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 |
|---|---|---|---|---|---|
1be3afe6ecd1b4d06341470c4798428663708189 | diff --git a/transit/writer.py b/transit/writer.py
index <HASH>..<HASH> 100644
--- a/transit/writer.py
+++ b/transit/writer.py
@@ -68,7 +68,10 @@ class Marshaler(object):
return self.emit_string(ESC, "_", None, True, cache) if as_map_key else self.emit_object(None)
def emit_string(self, prefix, tag, string, as_map_key, cache):
- return self.emit_object(cache.encode(str(prefix) + tag + escape(string), as_map_key), as_map_key)
+ encoded = cache.encode(str(prefix)+tag+escape(string), as_map_key)
+ if "cache_enabled" in self.opts and cache.is_cacheable(encoded, as_map_key):
+ return self.emit_object(cache.value_to_key(encoded), as_map_key)
+ return self.emit_object(encoded, as_map_key)
def emit_boolean(self, b, as_map_key, cache):
return self.emit_string(ESC, "?", b, True, cache) if as_map_key else self.emit_object(b) | Optimization: Ruby's cache short-circuit approach when in emit_object | cognitect_transit-python | train | py |
5fe626948a562eaa48517ef46ff6134916243abb | diff --git a/light.go b/light.go
index <HASH>..<HASH> 100644
--- a/light.go
+++ b/light.go
@@ -12,6 +12,7 @@ import (
"fmt"
"time"
"errors"
+ "log"
)
// Light struct defines attributes of a light.
@@ -204,6 +205,28 @@ func (light *Light) SetBrightness(percent int) error {
}
}
+
+// Light.Brighten will increase LightStruct.Bri by a given percent (integer)
+func (light *Light) Brighten(percent int) error {
+ if percent > 0 && percent <= 100 {
+ originalBri := light.State.Bri
+ increaseBri := float32(originalBri)*float32((float32(percent)/100.0))
+ newBri := uint8(originalBri+int(increaseBri))
+ if newBri > 254 { // LightState.Bri must be between 1 and 254 inclusive
+ newBri = 254
+ log.Println("Light.Brighten state set over 100%, setting brightness to 100%. ")
+ }
+ lightState := LightState{On: true, Bri: newBri}
+ err := light.SetState(lightState)
+ if err != nil {
+ return err
+ }
+ return nil
+ } else {
+ return errors.New("Light.Brighten percentage is not between 1 and 100. ")
+ }
+}
+
// Light.SetState modifyies light attributes. See `LightState` struct for attributes.
// Brightness must be between 1 and 254 (inclusive)
// Hue must be between 0 and 65535 (inclusive) | Implemented Light.Brighten to complement Light.Dim | Collinux_gohue | train | go |
e482846f6e6d7f837b65c007ec1e798ad60b0524 | diff --git a/Connectors/ConnectionFactory.php b/Connectors/ConnectionFactory.php
index <HASH>..<HASH> 100755
--- a/Connectors/ConnectionFactory.php
+++ b/Connectors/ConnectionFactory.php
@@ -126,8 +126,8 @@ class ConnectionFactory
try {
return $this->createConnector($config)->connect($config);
} catch (PDOException $e) {
- if (count($hosts) - 1 === $key) {
- $this->container->make(ExceptionHandler::class)->report($e);
+ if (count($hosts) - 1 === $key) {
+ $this->container->make(ExceptionHandler::class)->report($e);
}
}
} | Applied fixes from StyleCI (#<I>) | illuminate_database | train | php |
c2e7a681059b70ff5800fe8f1ff9b73b4bdba72f | diff --git a/discord/client.py b/discord/client.py
index <HASH>..<HASH> 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -1085,7 +1085,7 @@ class Client:
if check is None:
check = lambda m: True
- iterator = LogsFromIterator(self, channel, limit, before, after)
+ iterator = LogsFromIterator.create(self, channel, limit, before=before, after=after)
ret = []
count = 0 | Fix purge_from to use LogsFromIterator.create (#<I>) | Rapptz_discord.py | train | py |
354e9f730e9ffaa123aa4adc92fc122db401e80b | diff --git a/src/components/victory-area/victory-area.js b/src/components/victory-area/victory-area.js
index <HASH>..<HASH> 100644
--- a/src/components/victory-area/victory-area.js
+++ b/src/components/victory-area/victory-area.js
@@ -34,7 +34,7 @@ class VictoryArea extends React.Component {
static defaultProps = {
dataComponent: <Area/>,
- labelComponent: <VictoryLabel/>,
+ labelComponent: <VictoryLabel renderInPortal/>,
scale: "linear",
samples: 50,
standalone: true,
diff --git a/src/components/victory-line/victory-line.js b/src/components/victory-line/victory-line.js
index <HASH>..<HASH> 100644
--- a/src/components/victory-line/victory-line.js
+++ b/src/components/victory-line/victory-line.js
@@ -42,7 +42,7 @@ class VictoryLine extends React.Component {
standalone: true,
sortKey: "x",
dataComponent: <Curve/>,
- labelComponent: <VictoryLabel/>,
+ labelComponent: <VictoryLabel renderInPortal/>,
containerComponent: <VictoryContainer/>,
groupComponent: <VictoryClipContainer/>,
theme: VictoryTheme.grayscale | add renderInPortal prop to VictoryLabel in clipped data types | FormidableLabs_victory | train | js,js |
c2139b5c39be7e3669cb5821046888cd88418ce6 | diff --git a/src/org/opencms/file/types/CmsResourceTypeImage.java b/src/org/opencms/file/types/CmsResourceTypeImage.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/file/types/CmsResourceTypeImage.java
+++ b/src/org/opencms/file/types/CmsResourceTypeImage.java
@@ -632,7 +632,7 @@ public class CmsResourceTypeImage extends A_CmsResourceType {
: CmsProperty.toObjectMap(properties);
propsMap.put(
CmsPropertyDefinition.PROPERTY_IMAGE_SIZE,
- new CmsProperty(CmsPropertyDefinition.PROPERTY_IMAGE_SIZE, propValue, null));
+ new CmsProperty(CmsPropertyDefinition.PROPERTY_IMAGE_SIZE, null, propValue));
newProps = new ArrayList<>(propsMap.values());
} | Changed automatic SVG size property to be written as a shared property. | alkacon_opencms-core | train | java |
b757a29ff4d8dd6a66e3ad77e2e46b9b377be9f0 | diff --git a/lib/puppetdb_query/version.rb b/lib/puppetdb_query/version.rb
index <HASH>..<HASH> 100644
--- a/lib/puppetdb_query/version.rb
+++ b/lib/puppetdb_query/version.rb
@@ -1,3 +1,3 @@
module PuppetDBQuery
- VERSION = "0.0.36".freeze
+ VERSION = "0.0.37".freeze
end | m<I>'s version bumper | m-31_puppetdb_query | train | rb |
51c2b22e9fbec4bf5dc2f29a4b7323a5d95afbd3 | diff --git a/core/server/services/members/config.js b/core/server/services/members/config.js
index <HASH>..<HASH> 100644
--- a/core/server/services/members/config.js
+++ b/core/server/services/members/config.js
@@ -51,7 +51,8 @@ function getStripePaymentConfig() {
return null;
}
- stripePaymentProcessor.config.plans.push(COMPLIMENTARY_PLAN);
+ // NOTE: "Complimentary" plan has to be first in the queue so it is created even if regular plans are not configured
+ stripePaymentProcessor.config.plans.unshift(COMPLIMENTARY_PLAN);
const webhookHandlerUrl = new URL('/members/webhooks/stripe', siteUrl); | 🐛 Fixed order for "Complimentary" plan creation
no issue
- When new Ghost instance is initialized "Complimentary" plan doesn't have to wait for the rest of plans to be configured.
- Without configured plans the admin would still be able to assign "Complimentary" plan to members or import same kind of members.
- There is no error handling at the moment when plan initialization fails, that's why it was very confusing when all of the sudden it wasn't possible to create a member record | TryGhost_Ghost | train | js |
8f29d0903f17a822f56edb1dc073e7d76b1f9075 | diff --git a/src/Service/RequestService.php b/src/Service/RequestService.php
index <HASH>..<HASH> 100644
--- a/src/Service/RequestService.php
+++ b/src/Service/RequestService.php
@@ -10,7 +10,7 @@ use Psr\Http\Message\RequestInterface;
use React\Promise\CancellablePromiseInterface;
use function React\Promise\resolve;
-final class RequestService
+class RequestService
{
/**
* @var ClientInterface | Marked RequestService as not final so it can be mocked | php-api-clients_transport | train | php |
35b2bf5f7847573c78606d34f1119ffb7bb95007 | diff --git a/project/library/CM/Response/Page.php b/project/library/CM/Response/Page.php
index <HASH>..<HASH> 100644
--- a/project/library/CM/Response/Page.php
+++ b/project/library/CM/Response/Page.php
@@ -14,7 +14,6 @@ class CM_Response_Page extends CM_Response_Abstract {
$page->prepare($this);
$html = $this->getRender()->render($page);
} catch (CM_Exception $e) {
- throw $e;
if (!array_key_exists(get_class($e), $this->_getConfig()->catch)) {
throw $e;
} | t<I>: revert | cargomedia_cm | train | php |
5abd05c4793e2f49dcb6f8014f8dd307c6101d81 | diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MetricsAutoConfiguration.java
index <HASH>..<HASH> 100644
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MetricsAutoConfiguration.java
+++ b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MetricsAutoConfiguration.java
@@ -95,7 +95,7 @@ public class MetricsAutoConfiguration {
@Bean
@ConditionalOnClass(name = "com.netflix.hystrix.strategy.HystrixPlugins")
- @ConditionalOnProperty(value = "management.metrics.export.hystrix.enabled", matchIfMissing = true)
+ @ConditionalOnProperty(value = "management.metrics.binders.hystrix.enabled", matchIfMissing = true)
public HystrixMetricsBinder hystrixMetricsBinder() {
return new HystrixMetricsBinder();
} | Fixed typo in hystrix binding conditional | micrometer-metrics_micrometer | train | java |
5c366be02163ebc33f155b83d1d98e7d7d60ce7a | diff --git a/lib/isodoc/convert.rb b/lib/isodoc/convert.rb
index <HASH>..<HASH> 100644
--- a/lib/isodoc/convert.rb
+++ b/lib/isodoc/convert.rb
@@ -127,6 +127,7 @@ module IsoDoc
stylesheet.gsub!(/(\s|\{)mso-[^:]+:[^;]+;/m, "\\1") if stripwordcss
SassC.load_paths << File.join(Gem.loaded_specs['isodoc'].full_gem_path,
"lib", "isodoc")
+ SassC.load_paths << File.dirname(filename)
engine = SassC::Engine.new(fontheader + stylesheet, syntax: :scss)
outname = File.basename(filename, ".*") + ".css"
File.open(outname, "w:UTF-8") { |f| f.write(engine.render) } | feat: Allow flavor SCSS to importing sibling SCSS
#<I> | metanorma_isodoc | train | rb |
d63fec939190b16e7bea6f8d1de17c6e0a5cc114 | diff --git a/src/GitHub_Updater/Base.php b/src/GitHub_Updater/Base.php
index <HASH>..<HASH> 100644
--- a/src/GitHub_Updater/Base.php
+++ b/src/GitHub_Updater/Base.php
@@ -74,7 +74,7 @@ class Base {
* Loads options to private static variable.
*/
public function __construct() {
- self::$options = get_site_option( 'github_updater' );
+ self::$options = get_site_option( 'github_updater', array());
$this->add_headers();
} | Set $options default as array to avoid PHP warning. | afragen_github-updater | train | php |
92f09c2d20eb688d7c0d4d2e9f5c16e5aa91a0bc | diff --git a/src/configupdater/configupdater.py b/src/configupdater/configupdater.py
index <HASH>..<HASH> 100644
--- a/src/configupdater/configupdater.py
+++ b/src/configupdater/configupdater.py
@@ -1,4 +1,4 @@
-"""Configuration file parser.
+"""Configuration file updater.
A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
@@ -709,7 +709,9 @@ class ConfigUpdater(object):
Return list of successfully read files.
"""
- if isinstance(filenames, (str, os.PathLike)):
+ # os.Pathlike objects requires Python >=3.6
+ # if isinstance(filenames, (str, os.PathLike)):
+ if isinstance(filenames, str):
filenames = [filenames]
read_ok = []
for filename in filenames:
@@ -718,8 +720,9 @@ class ConfigUpdater(object):
self._read(fp, filename)
except OSError:
continue
- if isinstance(filename, os.PathLike):
- filename = os.fspath(filename)
+ # os.Pathlike objects requires Python >=3.6
+ # if isinstance(filename, os.PathLike):
+ # filename = os.fspath(filename)
read_ok.append(filename)
return read_ok | Remove PathLike for Py <I> support | pyscaffold_configupdater | train | py |
61a098491127963d2c9a143b0a18c6a85d5d284c | diff --git a/src/dygraph.js b/src/dygraph.js
index <HASH>..<HASH> 100644
--- a/src/dygraph.js
+++ b/src/dygraph.js
@@ -84,16 +84,6 @@ var Dygraph = function(div, data, opts, opt_fourth_param) {
Dygraph.NAME = "Dygraph";
Dygraph.VERSION = "1.1.0";
-Dygraph.__repr__ = function() {
- return "[" + Dygraph.NAME + " " + Dygraph.VERSION + "]";
-};
-
-/**
- * Returns information about the Dygraph class.
- */
-Dygraph.toString = function() {
- return Dygraph.__repr__();
-};
// Various default values
Dygraph.DEFAULT_ROLL_PERIOD = 1; | Drop class-level toString()
I've never seen this on any other JS class. The instance toString()
method is more standard. | danvk_dygraphs | train | js |
76039a7b39838be52599f42e7e271e9ceabcf862 | diff --git a/lib/hipbot/message.rb b/lib/hipbot/message.rb
index <HASH>..<HASH> 100644
--- a/lib/hipbot/message.rb
+++ b/lib/hipbot/message.rb
@@ -5,6 +5,7 @@ module Hipbot
def initialize *args
super
Hipbot.logger.info("MESSAGE from #{sender} in #{room}")
+ self.raw_body = raw_body.force_encoding('UTF-8')
self.body = strip_recipient(raw_body)
self.recipients = raw_body.scan(/@(\p{Word}++)/).flatten.compact.uniq
end | force utf-8 encoding on messages | pewniak747_hipbot | train | rb |
e03a31b3a8a61b3ee13b9de530f7801d5f2e2e3b | diff --git a/symphony/content/content.systemauthors.php b/symphony/content/content.systemauthors.php
index <HASH>..<HASH> 100644
--- a/symphony/content/content.systemauthors.php
+++ b/symphony/content/content.systemauthors.php
@@ -539,11 +539,17 @@ class contentSystemAuthors extends AdministrationPage
* @param array $fields
* The POST fields
* This parameter is available @since Symphony 2.7.0
+ * @param array $errors
+ * The error array used to validate the Author.
+ * Extension should register their own errors elsewhere and used the value
+ * to modify the UI accordingly.
+ * This parameter is available @since Symphony 2.7.0
*/
Symphony::ExtensionManager()->notifyMembers('AddElementstoAuthorForm', '/system/authors/', array(
'form' => &$this->Form,
'author' => $author,
'fields' => $_POST['fields'],
+ 'errors' => $this->_errors,
));
} | Add `errors` to AddElementstoAuthorForm
This way, extension developers can update the UI based on their error
set in other delegates.
Picked from <I>c<I> | symphonycms_symphony-2 | train | php |
dddaeb4bc8048dbb4a661f52b942057f3d389aeb | diff --git a/crispy/gui/widgets/plotwidget.py b/crispy/gui/widgets/plotwidget.py
index <HASH>..<HASH> 100644
--- a/crispy/gui/widgets/plotwidget.py
+++ b/crispy/gui/widgets/plotwidget.py
@@ -27,12 +27,13 @@ from __future__ import absolute_import, division, unicode_literals
__authors__ = ['Marius Retegan']
__license__ = 'MIT'
-__date__ = '18/06/2018'
+__date__ = '10/07/2018'
+import sys
from collections import OrderedDict as odict
from PyQt5.QtWidgets import QMenu, QToolBar
-from PyQt5.QtCore import Qt
+from PyQt5.QtCore import Qt, QSize
from silx.gui.plot import PlotWidget
from silx.gui.plot import actions, backends, tools
@@ -149,7 +150,13 @@ class MainPlotWidget(BasePlotWidget):
_profileWindow.setWindowTitle(str())
self._profileToolBar = ProfileToolBar(
parent=self, plot=self, profileWindow=_profileWindow)
+ self.removeToolBar(self._outputToolBar)
self.addToolBar(self._profileToolBar)
+ self.addToolBar(self._outputToolBar)
+ self._outputToolBar.show()
+
+ if sys.platform == 'darwin':
+ self.setIconSize(QSize(24, 24))
# Create QAction for the context menu once for all.
self._zoomBackAction = actions.control.ZoomBackAction( | Reduce the size of the icons on macOS | mretegan_crispy | train | py |
ae9ae7a800368272d7b58c098b595a404a82b007 | diff --git a/dagger2support/src/main/java/mortar/dagger2support/DaggerService.java b/dagger2support/src/main/java/mortar/dagger2support/DaggerService.java
index <HASH>..<HASH> 100644
--- a/dagger2support/src/main/java/mortar/dagger2support/DaggerService.java
+++ b/dagger2support/src/main/java/mortar/dagger2support/DaggerService.java
@@ -30,7 +30,7 @@ public class DaggerService {
Class<?> generatedClass = Class.forName(generatedName);
Object builder = generatedClass.getMethod("builder").invoke(null);
- for (Method method : builder.getClass().getMethods()) {
+ for (Method method : builder.getClass().getDeclaredMethods()) {
Class<?>[] params = method.getParameterTypes();
if (params.length == 1) {
Class<?> dependencyClass = params[0]; | Avoid unnecessary method traversing for DaggerService
Traverse through declared methods only to avoid clashes with java base methods like equals, etc.
Now I suffer crash on providing module as dependency (equals has Object param which is assignableFrom *everything*) | square_mortar | train | java |
d677b4efc7e4de4c5797e724ae73f8ce83d9a32c | diff --git a/jobs/src/main/java/de/otto/edison/jobs/repository/JobRepositoryCleanup.java b/jobs/src/main/java/de/otto/edison/jobs/repository/JobRepositoryCleanup.java
index <HASH>..<HASH> 100644
--- a/jobs/src/main/java/de/otto/edison/jobs/repository/JobRepositoryCleanup.java
+++ b/jobs/src/main/java/de/otto/edison/jobs/repository/JobRepositoryCleanup.java
@@ -1,5 +1,7 @@
package de.otto.edison.jobs.repository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.metrics.CounterService;
import org.springframework.scheduling.annotation.Scheduled;
@@ -16,6 +18,8 @@ import java.util.List;
*/
public class JobRepositoryCleanup {
+ private static final Logger LOG = LoggerFactory.getLogger(JobRepositoryCleanup.class);
+
public static final long ONE_MINUTE = 60 * 1000L;
@Autowired
@@ -32,6 +36,7 @@ public class JobRepositoryCleanup {
strategy.doCleanUp(repository);
}
} catch (final RuntimeException e) {
+ LOG.error(e.getMessage(), e);
counterService.increment("counter.jobs.cleanup.errors");
}
} | Added logging of exceptions during cleanup of job repositories | otto-de_edison-microservice | train | java |
72ce7c52df2bb0cd1e1644d8bb543a7bd3177e9b | diff --git a/zounds/__init__.py b/zounds/__init__.py
index <HASH>..<HASH> 100644
--- a/zounds/__init__.py
+++ b/zounds/__init__.py
@@ -38,11 +38,10 @@ from learn import \
KMeans, Learned, MeanStdNormalization, UnitNorm, Log, Multiply, \
PreprocessingPipeline, Slicer, ReservoirSampler, simple_settings, \
SklearnModel, WithComponents, InstanceScaling, Reshape, ShuffledSamples, \
- PyTorchNetwork, PyTorchGan, PyTorchAutoEncoder, GanTrainer, \
- WassersteinGanTrainer, SupervisedTrainer, TripletEmbeddingTrainer, \
- Weighted, MuLawCompressed, SimHash, AbsoluteValue, Binarize, Sharpen, \
- learning_pipeline, object_store_pipeline_settings, \
- infinite_streaming_learning_pipeline
+ PyTorchNetwork, PyTorchGan, PyTorchAutoEncoder,WassersteinGanTrainer, \
+ SupervisedTrainer, TripletEmbeddingTrainer, Weighted, MuLawCompressed, \
+ SimHash, AbsoluteValue, Binarize, Sharpen, learning_pipeline, \
+ object_store_pipeline_settings, infinite_streaming_learning_pipeline
from ui import \
ZoundsApp, ZoundsSearch, TrainingMonitorApp, SupervisedTrainingMonitorApp, \ | Remove top-level learn module imports | JohnVinyard_zounds | train | py |
b6a12caa1a6d20e599b5a3d1a8cd4d8defd39f49 | diff --git a/closure/goog/style/bidi.js b/closure/goog/style/bidi.js
index <HASH>..<HASH> 100644
--- a/closure/goog/style/bidi.js
+++ b/closure/goog/style/bidi.js
@@ -108,9 +108,11 @@ goog.style.bidi.getOffsetStart = function(element) {
// the border width from the actual distance. So we need to add it back.
var borderWidths = goog.style.getBorderBox(bestParent);
offsetLeftForReal += borderWidths.left;
- } else if (goog.userAgent.isDocumentModeOrHigher(8)) {
- // When calculating an element's offsetLeft, IE8-Standards Mode erroneously
- // adds the border width to the actual distance. So we need to subtract it.
+ } else if (goog.userAgent.isDocumentModeOrHigher(8) &&
+ !goog.userAgent.isDocumentModeOrHigher(9)) {
+ // When calculating an element's offsetLeft, IE8/9-Standards Mode
+ // erroneously adds the border width to the actual distance. So we need to
+ // subtract it.
var borderWidths = goog.style.getBorderBox(bestParent);
offsetLeftForReal -= borderWidths.left;
} | Fix style/bidi_test.testGetOffsetStart by substracting the border witdh only for IE8 and IE9 as it seems fixed in IE<I>+.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
ad590feaa88f245b206daefe5743811de2ee2102 | diff --git a/spacy/tests/doc/test_doc_api.py b/spacy/tests/doc/test_doc_api.py
index <HASH>..<HASH> 100644
--- a/spacy/tests/doc/test_doc_api.py
+++ b/spacy/tests/doc/test_doc_api.py
@@ -219,7 +219,6 @@ def test_doc_api_has_vector(en_tokenizer, text_file, text, vectors):
def test_parse_tree(EN):
text = 'I like New York in Autumn.'
- EN = English(parser=False)
doc = EN(text, tag=True)
doc.from_array([HEAD], numpy.asarray([[1, 0, 1, -2, -3, -1, -5]], dtype='int32').T)
# full method parse_tree(text) is a trivial composition | Fix test, which imported English incorrectly | explosion_spaCy | train | py |
2869633d6c73f4b3c9df7f945052036a5bd4477c | diff --git a/syntax/parser.go b/syntax/parser.go
index <HASH>..<HASH> 100644
--- a/syntax/parser.go
+++ b/syntax/parser.go
@@ -632,7 +632,7 @@ func (p *Parser) stmtList(stops ...string) (sl StmtList) {
// fi
// TODO(mvdan): look into deduplicating this with similar logic
// in caseItems.
- for i := len(p.accComs)-1; i >= 0; i-- {
+ for i := len(p.accComs) - 1; i >= 0; i-- {
c := p.accComs[i]
if c.Pos().Col() != p.pos.Col() {
break
@@ -1954,7 +1954,7 @@ func (p *Parser) caseItems(stop string) (items []*CaseItem) {
p.got(_Newl)
split := len(p.accComs)
if p.tok == _LitWord && p.val != stop {
- for i := len(p.accComs)-1; i >= 0; i-- {
+ for i := len(p.accComs) - 1; i >= 0; i-- {
c := p.accComs[i]
if c.Pos().Col() != p.pos.Col() {
break | syntax: apply Go <I>'s gofmt
Very minor change. Still, do it separately. | mvdan_sh | train | go |
c5b3a7893d47731ff254d3d2e2ecb836df5693ce | diff --git a/src/schema.js b/src/schema.js
index <HASH>..<HASH> 100644
--- a/src/schema.js
+++ b/src/schema.js
@@ -47,7 +47,9 @@ export const schema = new Schema({
code: true,
defining: true,
attrs: {params: {default: ""}},
- parseDOM: [{tag: "pre", preserveWhitespace: true, getAttrs: node => ({params: node.getAttribute("data-params")})}],
+ parseDOM: [{tag: "pre", preserveWhitespace: true, getAttrs: node => (
+ {params: node.getAttribute("data-params") || ""}
+ )}],
toDOM(node) { return ["pre", node.attrs.params ? {"data-params": node.attrs.params} : {}, ["code", 0]] }
}, | Make sure code_block.attrs.params is the empty string, not null, when missing | ProseMirror_prosemirror-markdown | train | js |
245873dad191258be06e1f0a0f90ed48dba7bbf8 | diff --git a/test/adapters/patron_test.rb b/test/adapters/patron_test.rb
index <HASH>..<HASH> 100644
--- a/test/adapters/patron_test.rb
+++ b/test/adapters/patron_test.rb
@@ -14,7 +14,7 @@ module Adapters
# no support for SSL peer verification
undef :test_GET_ssl_fails_with_bad_cert if ssl_mode?
- end unless jruby?
+ end unless RUBY_VERSION < '1.9' or jruby?
end
end | Skip Patron tests if Ruby version less than <I> | lostisland_faraday | train | rb |
585640a0908538fb17a4bd6964566180707d2847 | diff --git a/hazelcast/src/test/java/com/hazelcast/internal/server/FirewallingServer.java b/hazelcast/src/test/java/com/hazelcast/internal/server/FirewallingServer.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/test/java/com/hazelcast/internal/server/FirewallingServer.java
+++ b/hazelcast/src/test/java/com/hazelcast/internal/server/FirewallingServer.java
@@ -80,7 +80,6 @@ public class FirewallingServer
return delegate.getConnections();
}
-
@Override
public void addConnectionListener(ConnectionListener listener) {
delegate.addConnectionListener(listener);
@@ -271,6 +270,10 @@ public class FirewallingServer
return delegate.getConnections();
}
+ @Override
+ public int connectionCount() {
+ return delegate.connectionCount();
+ }
@Override
public ServerConnection get(@Nonnull Address address, int streamId) {
@@ -298,6 +301,12 @@ public class FirewallingServer
}
@Override
+ public boolean blockOnConnect(Address address,
+ long timeoutMillis, int streamId) throws InterruptedException {
+ return delegate.blockOnConnect(address, timeoutMillis, streamId);
+ }
+
+ @Override
public boolean register(
Address remoteAddress,
Address targetAddress, | Implement missing delegate methods (#<I>) | hazelcast_hazelcast | train | java |
aad30ac7094839999bc2add960c639b865097c68 | diff --git a/adapters/couch_adapter.js b/adapters/couch_adapter.js
index <HASH>..<HASH> 100644
--- a/adapters/couch_adapter.js
+++ b/adapters/couch_adapter.js
@@ -15,7 +15,24 @@ var CouchAdapter = function(config) {
});
return queryProperties.join(":").replace(/\//g, '.');
}
+
+
+ // flush
+ // --------------
+ // Flush the database
+ self.flush = function(callback) {
+ var databaseName = _.last(config.url.split('/'));
+ console.log(databaseName);
+ db.request("DELETE", "/"+databaseName, function (err) {
+ err ? callback(err)
+ : db.request("PUT", "/"+databaseName, function(err) {
+ err ? callback(err) : callback();
+ });
+ });
+ };
+
+
// writeGraph
// --------------
@@ -101,7 +118,7 @@ var CouchAdapter = function(config) {
err ? callback('Error during saving the view') : callback();
});
} else {
- throw '_design/queries not found.';
+ throw('_design/queries not found.');
}
});
}
@@ -184,6 +201,8 @@ var CouchAdapter = function(config) {
query(qry, function(err, nodes) {
types = {};
+ if (err) return callback(err);
+
_.each(nodes, function(node) {
// Attach node to the result graph
result[node._id] = node; | Implemented CouchAdapter#flush. | substance_data | train | js |
da8937e56f0e84c45356204a0034c8d006a8a9cb | diff --git a/src/Kodeine/Acl/Traits/HasPermission.php b/src/Kodeine/Acl/Traits/HasPermission.php
index <HASH>..<HASH> 100644
--- a/src/Kodeine/Acl/Traits/HasPermission.php
+++ b/src/Kodeine/Acl/Traits/HasPermission.php
@@ -45,23 +45,24 @@ trait HasPermission
}
/**
- * Check if user has the given permission.
+ * Check if User has the given permission.
*
* @param string $permission
+ * @param string $operator
* @return bool
*/
- public function can($permission)
+ public function can($permission, $operator = null)
{
// user permissions including
// all of user role permissions
$merge = $this->getPermissions();
- // get first role and use can method
- // $merge already has all user role
- // permissions.
- $role = $this->roles->first();
+ // lets call our base can() method
+ // from role class. $merge already
+ // has user & role permissions
+ $model = config('acl.role', 'Kodeine\Acl\Models\Eloquent\Role');
- return ! is_null($role) && $role->can($permission, null, $merge);
+ return (new $model)->can($permission, $operator, $merge);
}
/** | fixed can() method in HasPermission Trait | kodeine_laravel-acl | train | php |
8cc57f6c2cc8cac7ce2a722f178480d904da3933 | diff --git a/spec/truncate_html/html_truncator_spec.rb b/spec/truncate_html/html_truncator_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/truncate_html/html_truncator_spec.rb
+++ b/spec/truncate_html/html_truncator_spec.rb
@@ -1,3 +1,4 @@
+# Encoding: UTF-8
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
describe TruncateHtml::HtmlTruncator do
@@ -67,8 +68,18 @@ describe TruncateHtml::HtmlTruncator do
end
end
+ context 'when the characters are multibyte' do
+ before(:each) do
+ @html = '<p>Look at our multibyte characters ā ž <a href="awesomeful.net">this</a> link for randomness ā ž</p>'
+ end
+
+ it 'leaves the multibyte characters after truncation' do
+ truncate(@html, :length => @html.length).should == '<p>Look at our multibyte characters ā ž <a href="awesomeful.net">this</a> link for randomness ā ž</p>'
+ end
+ end
+
#unusual, but just covering my ass
- context 'when the HTML tags are multiline' do
+ context 'when the HTML tags are multiline' do
before(:each) do
@html = <<-END_HTML
<div id="foo" | Added spec that fails on <I> before the change by smix and passes afterwards thus proving multibyte support added. | hgmnz_truncate_html | train | rb |
44cf3a280dd32aa85ad16740763714cff5793967 | diff --git a/lib/puppet/ssl/certificate_factory.rb b/lib/puppet/ssl/certificate_factory.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/ssl/certificate_factory.rb
+++ b/lib/puppet/ssl/certificate_factory.rb
@@ -138,7 +138,7 @@ module Puppet::SSL::CertificateFactory
def self.build_server_extensions
{
"keyUsage" => [%w{digitalSignature keyEncipherment}, true],
- "extendedKeyUsage" => [%w{serverAuth clientAuth emailProtection}, true],
+ "extendedKeyUsage" => [%w{serverAuth clientAuth}, true],
"basicConstraints" => ["CA:FALSE", true],
}
end
@@ -156,6 +156,7 @@ module Puppet::SSL::CertificateFactory
def self.build_client_extensions
{
"keyUsage" => [%w{nonRepudiation digitalSignature keyEncipherment}, true],
+ # We don't seem to use this, but that seems much more reasonable here...
"extendedKeyUsage" => [%w{clientAuth emailProtection}, true],
"basicConstraints" => ["CA:FALSE", true],
"nsCertType" => "client,email", | (#<I>) Don't enable `emailProtection` for server keys.
Previously, Puppet enabled the `emailProtection` bit in the extended key usage
field. This is unnecessary, and while probably not harmful we are taking the
view that what is not required should not be allowed, so ... removed. | puppetlabs_puppet | train | rb |
62ee13ed8882c29e153878a497e3755d804a161e | diff --git a/visidata/menu.py b/visidata/menu.py
index <HASH>..<HASH> 100644
--- a/visidata/menu.py
+++ b/visidata/menu.py
@@ -557,6 +557,7 @@ def drawSubmenu(vd, scr, sheet, y, x, menus, level, disp_menu_boxchars=''):
BUTTON1_PRESSED=lambda y,x,key,p=sheet.activeMenuItems[:level]+[j]: sheet.pressMenu(*p),
BUTTON2_PRESSED=vd.nop,
BUTTON3_PRESSED=vd.nop,
+ BUTTON1_CLICKED=lambda y,x,key,p=sheet.activeMenuItems[:level]+[j]: sheet.pressMenu(*p),
BUTTON1_RELEASED=vd.nop,
BUTTON2_RELEASED=vd.nop,
BUTTON3_RELEASED=vd.nop)
@@ -629,6 +630,7 @@ def drawMenu(vd, scr, sheet):
BUTTON1_PRESSED=lambda y,x,key,i=i,sheet=sheet: sheet.pressMenu(i),
BUTTON2_PRESSED=vd.nop,
BUTTON3_PRESSED=vd.nop,
+ BUTTON1_CLICKED=lambda y,x,key,i=i,sheet=sheet: sheet.pressMenu(i),
BUTTON1_RELEASED=vd.nop,
BUTTON2_RELEASED=vd.nop,
BUTTON3_RELEASED=vd.nop) | [menu-] add BUTTON1_CLICKED same as BUTTON1_PRESSED | saulpw_visidata | train | py |
1087541ac99feeb5487fbd681e87c7ca1e738d73 | diff --git a/hydra_base/db/__init__.py b/hydra_base/db/__init__.py
index <HASH>..<HASH> 100644
--- a/hydra_base/db/__init__.py
+++ b/hydra_base/db/__init__.py
@@ -88,12 +88,14 @@ def connect(db_url=None):
if db_url is None:
db_url = config.get('mysqld', 'url')
+
+ db_url = "{}?charset=utf8&use_unicode=1".format(db_url)
log.info("Connecting to database: %s", db_url)
db_url = create_mysql_db(db_url)
global engine
- engine = create_engine(db_url)
+ engine = create_engine(db_url, encoding='utf-8')
maker = sessionmaker(bind=engine, autoflush=False, autocommit=False,
extension=ZopeTransactionExtension()) | added the utf8 encoding | hydraplatform_hydra-base | train | py |
2081d07be5e22b7b483a66e32102fdb8698d0c78 | diff --git a/src/processor/intents/spawns/recycle-creep.js b/src/processor/intents/spawns/recycle-creep.js
index <HASH>..<HASH> 100644
--- a/src/processor/intents/spawns/recycle-creep.js
+++ b/src/processor/intents/spawns/recycle-creep.js
@@ -19,5 +19,5 @@ module.exports = function(object, intent, scope) {
return;
}
- require('../creeps/_die')(target, 1.0, scope);
+ require('../creeps/_die')(target, C.CREEP_RECYCLE_RATE, scope);
};
\ No newline at end of file | refact(runtime): change creep recycle ratio from <I>% to <I>% | screeps_engine | train | js |
5c33517149ab173fe93b1f50a9cb61d7ff98902c | diff --git a/app/models/standard_tags.rb b/app/models/standard_tags.rb
index <HASH>..<HASH> 100644
--- a/app/models/standard_tags.rb
+++ b/app/models/standard_tags.rb
@@ -41,7 +41,7 @@ module StandardTags
}
tag 'children' do |tag|
tag.locals.children = tag.locals.page.children
- tag.expand unless tag.locals.page.children.blank?
+ tag.expand
end
desc %{
diff --git a/spec/models/standard_tags_spec.rb b/spec/models/standard_tags_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/models/standard_tags_spec.rb
+++ b/spec/models/standard_tags_spec.rb
@@ -37,11 +37,6 @@ describe "Standard Tags" do
page(:home).should render('<r:unless_parent>true</r:unless_parent>').as('true')
end
- it '<r:children> should render the contained block if the current page has child pages' do
- page(:home).should render('<r:children>true</r:children>').as('true')
- page(:childless).should render('<r:children>false</r:children>').as('')
- end
-
it '<r:if_children> should render the contained block if the current page has child pages' do
page(:home).should render('<r:if_children>true</r:if_children>').as('true')
page(:childless).should render('<r:if_children>true</r:if_children>').as('') | r:children change broke r:children:count | radiant_radiant | train | rb,rb |
8d0f8018baacaa5dc94996a4a285867d682623c8 | diff --git a/salt/payload.py b/salt/payload.py
index <HASH>..<HASH> 100644
--- a/salt/payload.py
+++ b/salt/payload.py
@@ -14,7 +14,6 @@ import datetime
# Import salt libs
import salt.log
-import salt.crypt
import salt.transport.frame
from salt.exceptions import SaltReqTimeoutError
from salt.utils import immutabletypes | removing salt.crypt from payload.py which is not used and causing salt-key to break. | saltstack_salt | train | py |
c6d56af2cba8d8b59c1049bec970f4b1cbf26c9d | diff --git a/js/app.js b/js/app.js
index <HASH>..<HASH> 100644
--- a/js/app.js
+++ b/js/app.js
@@ -466,7 +466,7 @@ App.prototype.runAnalyzer = function() {
this.seoAssessorPresenter.setKeyword( this.paper.getKeyword() );
this.seoAssessorPresenter.render();
- this.callbacks.saveScores( this.seoAssessor.calculateOverallScore(), this.assessorPresenter );
+ this.callbacks.saveScores( this.seoAssessor.calculateOverallScore(), this.seoAssessorPresenter );
if ( isUndefined( this.contentAssessorPresenter ) ){
this.contentAssessorPresenter.renderIndividualRatings(); | Fixes variable for savescores | Yoast_YoastSEO.js | train | js |
8260aaeefab099dc4cc57516a8a400f393d3b803 | diff --git a/src/TermBuilder.php b/src/TermBuilder.php
index <HASH>..<HASH> 100644
--- a/src/TermBuilder.php
+++ b/src/TermBuilder.php
@@ -9,10 +9,11 @@ class TermBuilder {
$terms = collect(preg_split('/[\s,]+/', $search));
if($wildcards === true){
- foreach ($terms as $key => $term) {
- $terms[$key] = $term. '*';
- }
+ $terms->transform(function($term){
+ return $term. '*';
+ });
}
+
return $terms;
} | fixed with transform instead of foreach | swisnl_laravel-fulltext | train | php |
001a14319ded4a5e621027eb5383ff4e84bebd21 | diff --git a/lib/server.js b/lib/server.js
index <HASH>..<HASH> 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -18,6 +18,8 @@ var processChannel = require('strong-control-channel/process');
var runner = require('./run');
var setupPushReceiver = require('./receive').setupPushReceiver;
var util = require('util');
+var versionPm = require('../package.json').version;
+var versionApi = require('strong-mesh-models/package.json').version;
// Extend base without modifying it.
function extend(base, extra) {
@@ -270,8 +272,10 @@ Server.prototype.start = function start(cb) {
if (err) return callback(err);
var address = this.address();
- console.log('%s: StrongLoop PM listening on port `%s`',
+ console.log('%s: StrongLoop PM v%s (API v%s) listening on port `%s`',
self._originalCommand,
+ versionPm,
+ versionApi,
address.port);
// The HTTP server. This is used when stopping PM and to get the address | server: report pm and API version at startup | strongloop_strong-pm | train | js |
92c7930ab533ee0b4e3059f69b47296ada1e4af7 | diff --git a/digitalocean/Image.py b/digitalocean/Image.py
index <HASH>..<HASH> 100644
--- a/digitalocean/Image.py
+++ b/digitalocean/Image.py
@@ -2,20 +2,15 @@ import requests
from .baseapi import BaseAPI
class Image(BaseAPI):
- id = None
- name = None
- distribution = None
- slug = None
- public = None
- regions = []
- created_at = None
-
def __init__(self, *args, **kwargs):
- super(Image, self).__init__()
-
- #Setting the attribute values
- for attr in kwargs.keys():
- setattr(self,attr,kwargs[attr])
+ self.id = None
+ self.name = None
+ self.distribution = None
+ self.slug = None
+ self.public = None
+ self.regions = []
+ self.created_at = None
+ super(Image, self).__init__(*args, **kwargs)
def destroy(self):
""" | Image now has the new attribute declaration inside __init__ | koalalorenzo_python-digitalocean | train | py |
838057aa91315c0e106e9a6c464013b01ccae74f | diff --git a/pysat/tests/test_instruments.py b/pysat/tests/test_instruments.py
index <HASH>..<HASH> 100644
--- a/pysat/tests/test_instruments.py
+++ b/pysat/tests/test_instruments.py
@@ -4,8 +4,7 @@ import pysat
from pysat.tests.instrument_test_class import generate_instrument_list
from pysat.tests.instrument_test_class import InstTestClass
-instruments = generate_instrument_list(pysat.instruments.__all__,
- package='pysat.instruments')
+instruments = generate_instrument_list(package=pysat.instruments)
method_list = [func for func in dir(InstTestClass)
if callable(getattr(InstTestClass, func))]
@@ -32,7 +31,7 @@ class TestInstruments(InstTestClass):
def setup(self):
"""Runs before every method to create a clean testing setup."""
- self.package = 'pysat.instruments'
+ self.package = pysat.instruments
def teardown(self):
"""Runs after every method to clean up previous testing.""" | BUG: update package in test_instruments | rstoneback_pysat | train | py |
22dfa6ae1b431cb8e8afe72ce7d60360bf766337 | diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go
+++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go
@@ -32,6 +32,9 @@ const InvalidManagedFieldsAfterMutatingAdmissionWarningFormat = ".metadata.manag
// NewManagedFieldsValidatingAdmissionController validates the managedFields after calling
// the provided admission and resets them to their original state if they got changed to an invalid value
func NewManagedFieldsValidatingAdmissionController(wrap admission.Interface) admission.Interface {
+ if wrap == nil {
+ return nil
+ }
return &managedFieldsValidatingAdmissionController{wrap: wrap}
} | prevent fieldManager admission from wrapping nil | kubernetes_kubernetes | train | go |
fae9b71a920f205c9e1766dee451f731d36b5d0d | diff --git a/displayer.go b/displayer.go
index <HASH>..<HASH> 100644
--- a/displayer.go
+++ b/displayer.go
@@ -102,15 +102,21 @@ func (d *Displayer) Output() string {
if outputStr, ok := d.RawOutput.(string); ok {
return outputStr
}
- var b []byte
+ var out string
var err error
if d.prettify {
+ var b []byte
b, err = json.MarshalIndent(output, "", " ")
+ if err == nil {
+ out = string(b) + "\n"
+ }
} else {
+ var b []byte
b, err = json.Marshal(output)
+ out = string(b)
}
if err != nil {
return fmt.Sprintf("%v", output)
}
- return string(b)
+ return out
} | Add newline after output when prettyfying. | rightscale_rsc | train | go |
22aded113a76c446597e13a16cb1cbdab82836ee | diff --git a/src/hu/webhejj/commons/trie/TrieNode.java b/src/hu/webhejj/commons/trie/TrieNode.java
index <HASH>..<HASH> 100644
--- a/src/hu/webhejj/commons/trie/TrieNode.java
+++ b/src/hu/webhejj/commons/trie/TrieNode.java
@@ -20,16 +20,16 @@ public class TrieNode<T> {
private int tail;
private char[] keys;
private TrieNode<T>[] children;
-
+ private T value;
+
@SuppressWarnings("unchecked")
public TrieNode(int size, T value) {
keys = new char[size];
children = new TrieNode[size];
tail = 0;
+ this.value = value;
}
- private T value;
-
public T getValue() {
return value;
}
@@ -37,6 +37,13 @@ public class TrieNode<T> {
this.value = value;
}
+ public char[] getKeys() {
+ return keys;
+ }
+ public int getSize() {
+ return tail;
+ }
+
@SuppressWarnings("unchecked")
public TrieNode<T> addChild(char key) { | Fix TrieNode: actually store a node value; added getters for node keys
and size. | gnagy_webhejj-commons | train | java |
7eca8f6abe72dc7e6f081cc2d9b268b8527a58b6 | diff --git a/test/store.js b/test/store.js
index <HASH>..<HASH> 100644
--- a/test/store.js
+++ b/test/store.js
@@ -48,12 +48,12 @@ if (typeof(window)==='object') {
t.isFunction(store(["key","key2"],function(key,val){
//获取多个key的数据处理,return 并保存;
if(key&&key == 'key') return "keytest";
- console.log("key:",key)
return "逐个更改数据"
}),'store([Arary],function)测试');
t.deepEqual(store.get("key"),"keytest",'测试store(Array,function)存储key是否成功!');
t.deepEqual(store.get("key2"),"逐个更改数据",'测试store(Array,function)存储key2是否成功!');
t.deepEqual(store.set('ad',234).get('ad'),234,'链式调用测试');
+ t.deepEqual(store.search('key'),{"key":"keytest","key1":{"a":1},"key2":"逐个更改数据"},'搜索方法测试');
}); | Add "search" method to test cases. | jaywcjlove_store.js | train | js |
5e4430d62523790f2e42fa30b2735b7b76db5038 | diff --git a/modules/custom/openy_upgrade_tool/src/Form/OpenyUpgradeLogSettingsForm.php b/modules/custom/openy_upgrade_tool/src/Form/OpenyUpgradeLogSettingsForm.php
index <HASH>..<HASH> 100644
--- a/modules/custom/openy_upgrade_tool/src/Form/OpenyUpgradeLogSettingsForm.php
+++ b/modules/custom/openy_upgrade_tool/src/Form/OpenyUpgradeLogSettingsForm.php
@@ -35,6 +35,7 @@ class OpenyUpgradeLogSettingsForm extends FormBase {
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('openy_upgrade_tool.settings');
+ // TODO: Remove this in Open Y 3.0 release.
$form['force_mode'] = [
'#type' => 'checkbox',
'#title' => $this->t('Force mode'), | [OPENY-<I>] Add reminder for next release | ymcatwincities_openy | train | php |
1c228f97363732924c54192641ee9dcf5faadf4b | diff --git a/safe/impact_functions/inundation/flood_population_evacuation.py b/safe/impact_functions/inundation/flood_population_evacuation.py
index <HASH>..<HASH> 100644
--- a/safe/impact_functions/inundation/flood_population_evacuation.py
+++ b/safe/impact_functions/inundation/flood_population_evacuation.py
@@ -152,8 +152,10 @@ class FloodEvacuationFunction(FunctionProvider):
table_body = [question,
TableRow([(tr('People in %.1f m of water') %
thresholds[-1]),
- '%s' % format_int(evacuated)],
+ '%s*' % format_int(evacuated)],
header=True),
+ TableRow(tr('* Number is rounded to the nearest 1000'),
+ header=False),
TableRow(tr('Map shows population density needing '
'evacuation')),
TableRow([tr('Needs per week'), tr('Total')], | Add notes in the result window for rounding number in FloodEvacuationFunction #<I>. | inasafe_inasafe | train | py |
7f4502a5ea69cd5c8fce14b780d3b1d916588b26 | diff --git a/classes/Routing/UrlGenerator.php b/classes/Routing/UrlGenerator.php
index <HASH>..<HASH> 100644
--- a/classes/Routing/UrlGenerator.php
+++ b/classes/Routing/UrlGenerator.php
@@ -90,9 +90,16 @@ class UrlGenerator
public function getRouteUrl($name, array $params = array(), $relative = false)
{
$route = $this->router->getRoute($name);
- $query = array_filter($params, 'is_string', ARRAY_FILTER_USE_KEY);
- $params = array_filter($params, 'is_int', ARRAY_FILTER_USE_KEY);
- $path = $this->getRoutePath($route, $params);
+ $routeParams = [];
+ $query = [];
+ foreach ($params as $key => $value) {
+ if (is_int($key)) {
+ $routeParams[] = $value;
+ } else {
+ $query[$key] = $value;
+ }
+ }
+ $path = $this->getRoutePath($route, $routeParams);
if ($query) {
$path .= '?'.http_build_query($query); | ARRAY_FILTER_USE_KEY is php <I> only :( | autarky_framework | train | php |
cf725097a9739c01c9b220fe729fb53b2847f24d | diff --git a/src/__init__.py b/src/__init__.py
index <HASH>..<HASH> 100644
--- a/src/__init__.py
+++ b/src/__init__.py
@@ -446,7 +446,7 @@ class _ModuleProxy():
line = _ModuleProxy(line)
line.__call__ = line.line
-with open(_os.path.join(__path__, 'version.txt'), 'r') as _f:
+with open(_os.path.join(__path__[0], 'version.txt'), 'r') as _f:
# exclude the git commit number (PEP 396)
__version__ = _f.read().rsplit('.', 1)[0] | should be __path__[0] | libtcod_python-tcod | train | py |
442607e4c9afd2f19e8d541ff0823f44dead1e8e | diff --git a/aws/resource_aws_elastic_beanstalk_environment.go b/aws/resource_aws_elastic_beanstalk_environment.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_elastic_beanstalk_environment.go
+++ b/aws/resource_aws_elastic_beanstalk_environment.go
@@ -618,13 +618,13 @@ func resourceAwsElasticBeanstalkEnvironmentRead(d *schema.ResourceData, meta int
return err
}
- rawTags, err := keyvaluetags.ElasticbeanstalkListTags(conn, arn)
+ tags, err := keyvaluetags.ElasticbeanstalkListTags(conn, arn)
if err != nil {
return fmt.Errorf("error listing tags for Elastic Beanstalk environment (%s): %w", arn, err)
}
- tags := rawTags.IgnoreElasticbeanstalk().IgnoreConfig(ignoreTagsConfig)
+ tags = tags.IgnoreElasticbeanstalk().IgnoreConfig(ignoreTagsConfig)
//lintignore:AWSR002
if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { | r/elastic_bs_env: Consistent vars | terraform-providers_terraform-provider-aws | train | go |
fe78d3f354f255e74938833b411a869ce4e4e42b | diff --git a/src/FieldHandlers/ListFieldHandler.php b/src/FieldHandlers/ListFieldHandler.php
index <HASH>..<HASH> 100644
--- a/src/FieldHandlers/ListFieldHandler.php
+++ b/src/FieldHandlers/ListFieldHandler.php
@@ -158,6 +158,7 @@ class ListFieldHandler extends BaseFieldHandler
protected function _getCsvData($path)
{
$result = [];
+ $count = count($this->_fieldParams);
if (file_exists($path)) {
if (false !== ($handle = fopen($path, 'r'))) {
$row = 0;
@@ -167,6 +168,13 @@ class ListFieldHandler extends BaseFieldHandler
$row++;
continue;
}
+ /*
+ Skip if row is incomplete
+ */
+ if ($count !== count($data)) {
+ continue;
+ }
+
$result[] = $data;
}
fclose($handle); | skip incomplete rows from csv lists (task #<I>) | QoboLtd_cakephp-csv-migrations | train | php |
3c3a02da469ea88496a7a91fcece9a38ac88afaf | diff --git a/app/index.js b/app/index.js
index <HASH>..<HASH> 100644
--- a/app/index.js
+++ b/app/index.js
@@ -10,14 +10,15 @@ var options = {};
module.exports = yeoman.generators.Base.extend({
initializing: function () {
+ this.pkg = require('../package.json');
+ this.distros = require('./distros');
+
if (!this.options.skipWelcome) {
this.log(yosay(
- 'Welcome to ' + chalk.red('Gadget') + ', the gnarly generator for Grunt Drupal Tasks!'
+ 'Welcome to ' + chalk.red('Gadget ') + this.pkg.version + ', the gnarly generator for Grunt Drupal Tasks!'
));
}
- this.pkg = require('../package.json');
- this.distros = require('./distros');
},
prompting: function () { | Adding version of project to beginning yosay message for insight. | phase2_generator-gadget | train | js |
5e11a3062dac1ea383bdc713fa927a8d756bd50a | diff --git a/Source/com/drew/metadata/exif/GpsDirectory.java b/Source/com/drew/metadata/exif/GpsDirectory.java
index <HASH>..<HASH> 100644
--- a/Source/com/drew/metadata/exif/GpsDirectory.java
+++ b/Source/com/drew/metadata/exif/GpsDirectory.java
@@ -143,7 +143,7 @@ public class GpsDirectory extends ExifDirectoryBase
_tagNameMap.put(TAG_AREA_INFORMATION, "GPS Area Information");
_tagNameMap.put(TAG_DATE_STAMP, "GPS Date Stamp");
_tagNameMap.put(TAG_DIFFERENTIAL, "GPS Differential");
- _tagNameMap.put(TAG_H_POSITIONING_ERROR, "GPS H Positioning Error");
+ _tagNameMap.put(TAG_H_POSITIONING_ERROR, "GPS Horizontal Positioning Error");
}
public GpsDirectory() | Consistent tag name between Java and .NET libraries
Favouring the more descriptive form. | drewnoakes_metadata-extractor | train | java |
2dd4648e2ba5af25e4959f1f6b4acbb74bda80b7 | diff --git a/src/projCode/Somerc.php b/src/projCode/Somerc.php
index <HASH>..<HASH> 100644
--- a/src/projCode/Somerc.php
+++ b/src/projCode/Somerc.php
@@ -65,7 +65,7 @@ class Somerc
$S = -$this->alpha * ($Sa1 + $Sa2) + $this->K;
// spheric latitude
- $b = 2.0 * (atan( exp( $S ) ) - proj4phpCommon::PI / 4.0);
+ $b = 2.0 * (atan( exp( $S ) ) - Common::PI / 4.0);
// spheric longitude
$I = $this->alpha * ($p->x - $this->lambda0); | Somerc: replace proj4phpCommon by Common | proj4php_proj4php | train | php |
8688b8f554cba6d7b8941913e02208aab0b78ed7 | diff --git a/lib/amee/v3/item_value_definition_list.rb b/lib/amee/v3/item_value_definition_list.rb
index <HASH>..<HASH> 100644
--- a/lib/amee/v3/item_value_definition_list.rb
+++ b/lib/amee/v3/item_value_definition_list.rb
@@ -3,9 +3,9 @@ module AMEE
class ItemValueDefinitionList < AMEE::Collection
- def initialize_with_v3(connection,uid,options={})
+ def initialize_with_v3(connection,uid,options={}, &block)
@use_v3_connection = true
- initialize_without_v3(connection, uid, options)
+ initialize_without_v3(connection, uid, options, &block)
end
alias_method_chain :initialize, :v3 | Pass block filter through to base class in IVDList class. COM-<I> | OpenAMEE_amee-ruby | train | rb |
3fb482135ce98251ee1dfaf36ace3b6bbf464041 | diff --git a/aiidalab_widgets_base/utils/__init__.py b/aiidalab_widgets_base/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/aiidalab_widgets_base/utils/__init__.py
+++ b/aiidalab_widgets_base/utils/__init__.py
@@ -2,6 +2,7 @@
from functools import wraps
import more_itertools as mit
+import numpy as np
from ase.io import read
@@ -115,3 +116,20 @@ def yield_for_change(widget, attribute):
return inner
return f
+
+
+class PinholeCamera:
+ def __init__(self, matrix):
+ self.matrix = np.reshape(matrix, (4, 4)).transpose()
+
+ def screen_to_vector(self, move_vector):
+ """Converts vector from the screen coordinates to the normalized vector in 3D."""
+ move_vector[0] = -move_vector[0] # the x axis seem to be reverted in nglview.
+ res = np.append(np.array(move_vector), [0])
+ res = self.inverse_matrix.dot(res)
+ res /= np.linalg.norm(res)
+ return res[0:3]
+
+ @property
+ def inverse_matrix(self):
+ return np.linalg.inv(self.matrix) | Add a class to handle Pinhole camera. (#<I>)
This allows to easily handle transformations between 3D "real" space
and the "screen" space. | aiidalab_aiidalab-widgets-base | train | py |
d569bf0ee09e6a177e6b56c1157b891d9556f94f | diff --git a/lib/active_admin/views/pages/show.rb b/lib/active_admin/views/pages/show.rb
index <HASH>..<HASH> 100644
--- a/lib/active_admin/views/pages/show.rb
+++ b/lib/active_admin/views/pages/show.rb
@@ -43,8 +43,8 @@ module ActiveAdmin
end
module DefaultMainContent
- def default_main_content
- attributes_table *default_attribute_table_rows
+ def default_main_content(&block)
+ attributes_table(*default_attribute_table_rows, &block)
end
def default_attribute_table_rows | Easier extending default show page
I would like to add few fields to show page, but keep the defaults.
Passing block to `default_main_content` would make it use defaults + block. | activeadmin_activeadmin | train | rb |
3580c52ebbe91dbcae91c25e43ac87af0284c534 | diff --git a/app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.rb b/app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.rb
index <HASH>..<HASH> 100644
--- a/app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.rb
+++ b/app_generators/ahn/templates/components/disabled/restful_rpc/restful_rpc.rb
@@ -60,7 +60,7 @@ RESTFUL_API_HANDLER = lambda do |env|
# TODO: set the content-type and other HTTP headers
response_object = rpc_object.send(path, *json)
- [200, {"Content-Type" => "application/json"}, response_object.to_json]
+ [200, {"Content-Type" => "application/json"}, Array(response_object.to_json)]
end | Fix a bug in restful_rpc where JSON is not automatically wrapped in an Array | adhearsion_adhearsion | train | rb |
62e82c0964d79a0107e9563eb65c4c09f26df836 | diff --git a/src/geo/ui/legends/legends-view.js b/src/geo/ui/legends/legends-view.js
index <HASH>..<HASH> 100644
--- a/src/geo/ui/legends/legends-view.js
+++ b/src/geo/ui/legends/legends-view.js
@@ -48,6 +48,9 @@ var LegendsView = Backbone.View.extend({
this.$shadowBottom = $('<div>').addClass('CDB-Legends-canvasShadow CDB-Legends-canvasShadow--bottom');
this.$el.append(this.$shadowTop);
this.$el.append(this.$shadowBottom);
+ _.defer(function () {
+ this._showOrHideShadows();
+ }.bind(this));
},
_bindScroll: function () {
@@ -62,6 +65,10 @@ var LegendsView = Backbone.View.extend({
},
_onScroll: function () {
+ this._showOrHideShadows();
+ },
+
+ _showOrHideShadows: function () {
var $el = $(this._container());
var currentPos = $el.scrollTop();
var max = $el.get(0).scrollHeight; | Show shadows initially if there's some scroll | CartoDB_carto.js | train | js |
0af1cffb6b324f11a31fb799788cf603c749ee1c | diff --git a/PluginBase/src/org/bimserver/bimbots/BimBotContext.java b/PluginBase/src/org/bimserver/bimbots/BimBotContext.java
index <HASH>..<HASH> 100644
--- a/PluginBase/src/org/bimserver/bimbots/BimBotContext.java
+++ b/PluginBase/src/org/bimserver/bimbots/BimBotContext.java
@@ -3,4 +3,5 @@ package org.bimserver.bimbots;
public interface BimBotContext {
void updateProgress(String label, int percentage);
+ String getCurrentUser();
} | Added a method to get the current user(name), e.a. email address | opensourceBIM_BIMserver | train | java |
b949748467127139f08ecf5fb4db9d6fa7e9be03 | diff --git a/zipline/pipeline/factors/factor.py b/zipline/pipeline/factors/factor.py
index <HASH>..<HASH> 100644
--- a/zipline/pipeline/factors/factor.py
+++ b/zipline/pipeline/factors/factor.py
@@ -500,7 +500,7 @@ class CustomFactor(RequiredWindowLengthMixin, CustomTermMixin, Factor):
highest_highs = nanmax(axis=0)
lowest_lows = nanmin(axis=0)
- out[:] = highest_highs = lowest_lows
+ out[:] = highest_highs - lowest_lows
# Doesn't require passing inputs or window_length because they're
# pre-declared as defaults | BUG/DOC: Subtraction is what I meant there... | quantopian_zipline | train | py |
3e892bf6880d2b03d4b38020f56062be90595caf | diff --git a/lib/mini_term/ansi/output.rb b/lib/mini_term/ansi/output.rb
index <HASH>..<HASH> 100644
--- a/lib/mini_term/ansi/output.rb
+++ b/lib/mini_term/ansi/output.rb
@@ -13,6 +13,7 @@ module MiniTerm
def beep
STDERR.write(BELL)
STDERR.flush
+ self
end
end
diff --git a/lib/mini_term/windows/link.rb b/lib/mini_term/windows/link.rb
index <HASH>..<HASH> 100644
--- a/lib/mini_term/windows/link.rb
+++ b/lib/mini_term/windows/link.rb
@@ -46,6 +46,6 @@ module MiniTerm
# MiniTerm needs to make some noise.
beep_proc = Win32API.new("user32", "MessageBeep", ['L'], '0')
- define_singleton_method(:beep) { beep_proc.call(0) }
+ define_singleton_method(:beep) { beep_proc.call(0); self }
end
diff --git a/test/mini_term_test.rb b/test/mini_term_test.rb
index <HASH>..<HASH> 100644
--- a/test/mini_term_test.rb
+++ b/test/mini_term_test.rb
@@ -55,7 +55,7 @@ class MiniTermTest < Minitest::Test
end
def test_making_noise
- assert(MiniTerm.beep)
+ assert_equal(MiniTerm, MiniTerm.beep)
end
def test_the_mapper | Output routines should now return self. | PeterCamilleri_mini_term | train | rb,rb,rb |
7144c8baf025c01922702b7abf106f6b7957dfdb | diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -175,7 +175,9 @@ class Chef
if config[:attribute_from_cli]
Chef::Log.debug("Using node attribute '#{config[:attribute_from_cli]}' from the command line as the ssh target")
host = extract_nested_value(item, config[:attribute_from_cli])
- elsif item[:cloud] && item[:cloud][:public_hostname]
+ elsif item[:cloud] &&
+ item[:cloud][:public_hostname] &&
+ !item[:cloud][:public_hostname].empty?
Chef::Log.debug("Using node attribute 'cloud[:public_hostname]' automatically as the ssh target")
host = item[:cloud][:public_hostname]
else | Check to make sure that item[:cloud][:public_hostname] is not empty before using it as the ssh target | chef_chef | train | rb |
7cef9748ff87d99c2117a45214e31bb45a17062e | diff --git a/mod/workshop/version.php b/mod/workshop/version.php
index <HASH>..<HASH> 100644
--- a/mod/workshop/version.php
+++ b/mod/workshop/version.php
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2018120301; // The current module version (YYYYMMDDXX)
+$plugin->version = 2019030700; // The current module version (YYYYMMDDXX)
$plugin->requires = 2018112800; // Requires this Moodle version.
$plugin->component = 'mod_workshop'; | MDL-<I> mod_workshop: fix version bump | moodle_moodle | train | php |
9e2055982066901ef6842475aab97db11da5424a | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -6,7 +6,11 @@
callback - once all deferences are finished call this function
*/
-exports.Understudy = function() {
+
+module.exports = Understudy;
+module.exports.Understudy = Understudy;
+
+function Understudy() {
this.perform = perform;
this.after = registrar('_after_interceptors');
this.before = registrar('_before_interceptors'); | [api] allow understudy to be required directly | bmeck_understudy | train | js |
6378aab439f38ce335e325b2e4414254cff09901 | diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/View/View.php
+++ b/lib/Cake/View/View.php
@@ -862,12 +862,16 @@ class View extends Object {
$this->_current = $viewFile;
$initialBlocks = count($this->Blocks->unclosed());
- $this->getEventManager()->dispatch(new CakeEvent('View.beforeRenderFile', $this, array($viewFile)));
+ $eventManager = $this->getEventManager();
+ $beforeEvent = new CakeEvent('View.beforeRenderFile', $this, array($viewFile));
+
+ $eventManager->dispatch($beforeEvent);
$content = $this->_evaluate($viewFile, $data);
+
$afterEvent = new CakeEvent('View.afterRenderFile', $this, array($viewFile, $content));
//TODO: For BC puporses, set extra info in the event object. Remove when appropriate
$afterEvent->modParams = 1;
- $this->getEventManager()->dispatch($afterEvent);
+ $eventManager->dispatch($afterEvent);
$content = $afterEvent->data[1];
if (isset($this->_parents[$viewFile])) { | Call a few fewer methods. | cakephp_cakephp | train | php |
c225feefc8ccddddc5f815073ea034efc6e3c2bb | diff --git a/classes/PodsRESTFields.php b/classes/PodsRESTFields.php
index <HASH>..<HASH> 100644
--- a/classes/PodsRESTFields.php
+++ b/classes/PodsRESTFields.php
@@ -195,7 +195,10 @@ class PodsRESTFields {
return false;
}
- return filter_var( $field->get_arg( $mode, false ), FILTER_VALIDATE_BOOLEAN );
+ // Field arguments are prefixed with `rest`;
+ $mode_arg = 'rest_' . $mode;
+
+ return filter_var( $field->get_arg( $mode_arg, false ), FILTER_VALIDATE_BOOLEAN );
}
} | Field arguments are prefixed with `rest` | pods-framework_pods | train | php |
a098d96c94df99d8136f2959b8c7abab0c4c6529 | diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Test/Case/Utility/ValidationTest.php
+++ b/lib/Cake/Test/Case/Utility/ValidationTest.php
@@ -1766,7 +1766,6 @@ class ValidationTest extends CakeTestCase {
$this->assertTrue(Validation::email('abc.efg@cakephp.org', true));
$this->assertFalse(Validation::email('abc.efg@caphpkeinvalid.com', true));
- $this->assertFalse(Validation::email('abc@example.abcd', true));
}
/** | Remove flaky test that was of questionable value. | cakephp_cakephp | train | php |
23ae97e54b727cbb4680dbb66156b4eb5519e657 | diff --git a/src/shapes/Shape.js b/src/shapes/Shape.js
index <HASH>..<HASH> 100644
--- a/src/shapes/Shape.js
+++ b/src/shapes/Shape.js
@@ -18,8 +18,7 @@
* }
*/
export class Shape {
- static name = 'Shape';
-
+ _name = 'Shape';
_text = '';
_width = 15;
_height = 5;
@@ -54,6 +53,15 @@ export class Shape {
}
/**
+ * Get name of the shape.
+ *
+ * @returns {String}
+ */
+ getName() {
+ return this._name;
+ }
+
+ /**
* Get text content from this shape.
*
* @returns {String}
@@ -194,7 +202,7 @@ export class Shape {
*/
toObject() {
return {
- name: Shape.name,
+ name: this.getName(),
options: {
text: this.getText(),
width: this.getWidth(),
@@ -235,7 +243,6 @@ export class Shape {
*/
static fromObject(obj) {
if (!obj.name || !obj.options) throw new Error('It looks like it is not an Object representation of the Shape');
- if (obj.name !== Shape.name) throw new Error('You are trying to create Shape from Object representation of another Shape');
return new this(obj.options);
} | fix(shape): Fixes issue with static property that is not supported | ghaiklor_kittik | train | js |
5ce86f9afccc98ef59146dd129a91b46c893040a | diff --git a/java-monitoring/samples/snippets/src/test/java/com/example/AlertIT.java b/java-monitoring/samples/snippets/src/test/java/com/example/AlertIT.java
index <HASH>..<HASH> 100644
--- a/java-monitoring/samples/snippets/src/test/java/com/example/AlertIT.java
+++ b/java-monitoring/samples/snippets/src/test/java/com/example/AlertIT.java
@@ -95,9 +95,9 @@ public class AlertIT {
@Test
public void testDisableEnablePolicies() throws IOException {
- AlertSample.main(new String[] {"disable", "-d", "display_name='test-policy'"});
- assertTrue(bout.toString().contains("disabled"));
AlertSample.main(new String[] {"enable", "-d", "display_name='test-policy'"});
assertTrue(bout.toString().contains("enabled"));
+ AlertSample.main(new String[] {"disable", "-d", "display_name='test-policy'"});
+ assertTrue(bout.toString().contains("disabled"));
}
} | samples: Fix flaky tests (#<I>)
* Fixed flaky tests
* reverted back | googleapis_google-cloud-java | train | java |
f1f5fd3a1cf93cc464f3794b6b510bb696ae9026 | diff --git a/src/Propel/Generator/Builder/Om/QueryBuilder.php b/src/Propel/Generator/Builder/Om/QueryBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Propel/Generator/Builder/Om/QueryBuilder.php
+++ b/src/Propel/Generator/Builder/Om/QueryBuilder.php
@@ -974,11 +974,10 @@ abstract class ".$this->getUnqualifiedClassName()." extends " . $parentClass . "
* Example usage:
* <code>
* \$query->filterBy$colPhpName('fooValue'); // WHERE $colName = 'fooValue'
- * \$query->filterBy$colPhpName('%fooValue%'); // WHERE $colName LIKE '%fooValue%'
+ * \$query->filterBy$colPhpName('%fooValue%', Criteria::LIKE); // WHERE $colName LIKE '%fooValue%'
* </code>
*
- * @param string \$$variableName The value to use as filter.
- * Accepts wildcards (* and % trigger a LIKE)";
+ * @param string \$$variableName The value to use as filter.";
} elseif ($col->isBooleanType()) {
$script .= "
* Example usage: | Updated PHPDoc for filterByX (#<I>) | propelorm_Propel2 | train | php |
348967d17a59d869b647bc5e4350b35b7b892861 | diff --git a/tests/databases/pgsql/PgSQLQBTest.php b/tests/databases/pgsql/PgSQLQBTest.php
index <HASH>..<HASH> 100644
--- a/tests/databases/pgsql/PgSQLQBTest.php
+++ b/tests/databases/pgsql/PgSQLQBTest.php
@@ -19,6 +19,12 @@ class PgSQLQBTest extends QBTest {
public function setUp()
{
+ // If the database isn't installed, skip the tests
+ if ( ! class_exists("PgSQL"))
+ {
+ $this->markTestSkipped();
+ }
+
// Attempt to connect, if there is a test config file
if (is_file(QBASE_DIR . "test_config.json"))
{ | Skip QB tests for Postgres if the class isn't loaded | aviat4ion_Query | train | php |
8eb17b0ee0d64b79c892e3ef71241484db1d3aed | diff --git a/payu/experiment.py b/payu/experiment.py
index <HASH>..<HASH> 100644
--- a/payu/experiment.py
+++ b/payu/experiment.py
@@ -639,12 +639,16 @@ class Experiment(object):
# NOTE: This is PBS-specific
job_id = get_job_id(short=False)
+ if job_id == '':
+ job_id = self.run_id[:6]
+
for fname in self.output_fnames:
src = os.path.join(self.control_path, fname)
stem, suffix = os.path.splitext(fname)
- dest = ".".join((stem, job_id, suffix))
+ dest = os.path.join(error_log_dir,
+ ".".join((stem, job_id)) + suffix)
print(src, dest) | Forgot to prepend error path to logs when run crashes. (#<I>)
Now use git commit hash to uniquely identify logs if PBS id not
available, e.g. using payu-run. | payu-org_payu | train | py |
d187d924d675d8830d374a280cf2dada68114c18 | diff --git a/lib/handlebars_assets/version.rb b/lib/handlebars_assets/version.rb
index <HASH>..<HASH> 100644
--- a/lib/handlebars_assets/version.rb
+++ b/lib/handlebars_assets/version.rb
@@ -1,3 +1,3 @@
module HandlebarsAssets
- VERSION = "0.23.5"
+ VERSION = "0.23.6"
end | Bump handlebars_assets to <I> | leshill_handlebars_assets | train | rb |
470cad95a10d289dde51bdc6800ab4432db7591d | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -25,6 +25,15 @@ Vodo.prototype.config = {
name: 'vodo',
uniqueId: 'imdb_id',
tabName: 'Vodo',
+ filters: {
+ sorters: {
+ popularity: 'Popularity',
+ updated: 'Updated',
+ year: 'Year',
+ alphabet: 'Alphabetical',
+ rating: 'Rating'
+ }
+ },
args: {
urlList: Provider.ArgType.ARRAY
}, | add filters to adapt for butter provider <I> | butterproviders_butter-provider-vodo | train | js |
ded186de2a894a24c14bf3e999ec8ca12ffd36d4 | diff --git a/mods/parsoid.js b/mods/parsoid.js
index <HASH>..<HASH> 100644
--- a/mods/parsoid.js
+++ b/mods/parsoid.js
@@ -744,7 +744,9 @@ PSP.makeTransform = function(from, to) {
var innerRes = res.body[to];
innerRes.status = 200;
// Handle body_only flag.
- // bodyOnly is deprecated and will be removed at some point
+ // bodyOnly is deprecated and will be removed at some point.
+ // XXX: Remove bodyOnly support after end of November 2015 (see
+ // https://phabricator.wikimedia.org/T114185).
if (to === 'html' && (req.body.body_only || req.body.bodyOnly)) {
// Log remaining bodyOnly uses / users
if (req.body.bodyOnly) { | Add more explicit comment about bodyOnly support removal | wikimedia_restbase | train | js |
e75a8559cc605f301c87750bf4c85820d8f21345 | diff --git a/lib/textbringer/window.rb b/lib/textbringer/window.rb
index <HASH>..<HASH> 100644
--- a/lib/textbringer/window.rb
+++ b/lib/textbringer/window.rb
@@ -171,10 +171,6 @@ module Textbringer
@@started = true
yield
ensure
- @@windows.each do |win|
- win.delete
- end
- @@windows.clear
Curses.echo
Curses.noraw
Curses.nl | Don't delete windows to avoid errors on exit. | shugo_textbringer | train | rb |
3b589c57627785d7f7623a8f0c0274dd4abe20a6 | diff --git a/finglish/f2p.py b/finglish/f2p.py
index <HASH>..<HASH> 100755
--- a/finglish/f2p.py
+++ b/finglish/f2p.py
@@ -41,7 +41,7 @@ def f2p_word_internal(word):
converter = middle
conversions = converter.get(letter)
if conversions == None:
- conversions = letter
+ return [(''.join(word), 1.0)]
else:
conversions = ['' if i == 'nothing' else i for i in conversions]
persian.append(conversions) | Return the original word if one of the letters is invalid. | elektito_finglish | train | py |
0603a4415053cd2d76b26f09dc618db91a9fed3c | diff --git a/quantrisk/tears.py b/quantrisk/tears.py
index <HASH>..<HASH> 100644
--- a/quantrisk/tears.py
+++ b/quantrisk/tears.py
@@ -214,7 +214,7 @@ def create_bayesian_tear_sheet(df_rets, bmark, live_start_date, plot_train_len=5
def create_full_tear_sheet(df_rets, df_pos=None, df_txn=None,
gross_lev=None, fetcher_urls='',
- algo_create_date=None,
+ algo_create_date=None, bayesian=False,
backtest_days_pct=0.5, cone_std=1.0):
benchmark_rets = utils.get_symbol_rets('SPY')
@@ -229,3 +229,6 @@ def create_full_tear_sheet(df_rets, df_pos=None, df_txn=None,
if df_txn is not None:
create_txn_tear_sheet(df_rets, df_pos, df_txn)
+
+ if bayesian:
+ create_bayesian_tear_sheet(df_rets, benchmark_rets, live_start_date=algo_create_date) | ENH Add option for Bayesian tear sheet to full tear sheet. | quantopian_pyfolio | train | py |
c291acd96e9a7dffc5bbf19973fa09be590d3b06 | diff --git a/api/lock.go b/api/lock.go
index <HASH>..<HASH> 100644
--- a/api/lock.go
+++ b/api/lock.go
@@ -70,6 +70,9 @@ func (c *Client) LockKey(key string) (*Lock, error) {
// to acquire and release the mutex. The key used must have
// write permissions.
func (c *Client) LockOpts(opts *LockOptions) (*Lock, error) {
+ if opts.Key == "" {
+ return nil, fmt.Errorf("missing key")
+ }
if opts.SessionName == "" {
opts.SessionName = DefaultLockSessionName
}
@@ -264,17 +267,16 @@ func (l *Lock) renewSession(id string, doneCh chan struct{}) {
// monitorLock is a long running routine to monitor a lock ownership
// It closes the stopCh if we lose our leadership.
func (l *Lock) monitorLock(session string, stopCh chan struct{}) {
+ defer close(stopCh)
kv := l.c.KV()
opts := &QueryOptions{RequireConsistent: true}
WAIT:
pair, meta, err := kv.Get(l.opts.Key, opts)
if err != nil {
- close(stopCh)
return
}
if pair != nil && pair.Session == session {
opts.WaitIndex = meta.LastIndex
goto WAIT
}
- close(stopCh)
} | api: Minor cleanups in lock | hashicorp_consul | train | go |
1e7368e782a74bc757cf05096b2176c096d85505 | diff --git a/lib/dmllib.php b/lib/dmllib.php
index <HASH>..<HASH> 100644
--- a/lib/dmllib.php
+++ b/lib/dmllib.php
@@ -962,6 +962,15 @@ function set_field($table, $newfield, $newvalue, $field1, $value1, $field2='', $
$select = where_clause($field1, $value1, $field2, $value2, $field3, $value3);
+ // Oracle DIRTY HACK -
+ if ($CFG->dbtype == 'oci8po') {
+ $dataobject = new StdClass;
+ $dataobject->{$newfield} = $newvalue;
+ oracle_dirty_hack($table, $dataobject); // Convert object to the correct "empty" values for Oracle DB
+ $newvalue = $dataobject->{$newfield};
+ }
+ /// End DIRTY HACK
+
return $db->Execute('UPDATE '. $CFG->prefix . $table .' SET '. $newfield .' = \''. $newvalue .'\' '. $select);
} | dmlib: set_field() now has the Oracle DIRTY HACK too! | moodle_moodle | train | php |
bb0e3766072e60c7a274353e5379ee0f1f2f0718 | diff --git a/common/hook_manager.py b/common/hook_manager.py
index <HASH>..<HASH> 100644
--- a/common/hook_manager.py
+++ b/common/hook_manager.py
@@ -28,9 +28,10 @@ class HookManager(object):
def _exception_free_callback(self, callback, *args, **kwargs):
""" A wrapper that remove all exceptions raised from hooks """
try:
- callback(*args, **kwargs)
+ return callback(*args, **kwargs)
except Exception as e:
print "An exception occured while calling a hook! " + str(e)
+ return None
def add_hook(self, name, callback):
""" Add a new hook that can be called with the call_hook function """
@@ -40,4 +41,4 @@ class HookManager(object):
def call_hook(self, name, **kwargs):
""" Call all hooks registered with this name. Returns a list of the returns values of the hooks (in the order the hooks were added)"""
- return [x(**kwargs) for x in self.hooks.get(name, [])]
+ return [y for y in [x(**kwargs) for x in self.hooks.get(name, [])] if y is not None] | Modify a bit how Hook Manager handles the hooks | UCL-INGI_INGInious | train | py |
3923256db04d825af5abf475a26f24e3ae045bdc | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -60,7 +60,7 @@ function getFileContents(file) {
//
// Clean SVGs
//
-gulp.task('clean-svg', function (cb) {
+gulp.task('clean', function (cb) {
gulp.src([options.dist + '**/*.svg'])
.pipe(clean());
cb();
@@ -70,7 +70,7 @@ gulp.task('clean-svg', function (cb) {
//
// Minify SVGs
//
-gulp.task('svgmin', function (cb) {
+gulp.task('min', function (cb) {
gulp.src([options.src + '**/*.svg'])
.pipe(svgmin({
plugins: [
@@ -85,7 +85,7 @@ gulp.task('svgmin', function (cb) {
//
// Compile Readme
//
-gulp.task('compile-docs', function (cb) {
+gulp.task('docs', function (cb) {
// Copy generated svg files to be used staticly
// in docs for previewing overlays
@@ -143,5 +143,5 @@ gulp.task('compile-docs', function (cb) {
// Default Task
//
gulp.task('default', function (cb) {
- sequence('clean-svg', 'svgmin', 'compile-docs')(cb);
+ sequence('clean', 'min', 'docs')(cb);
}); | [TASK] Rename gulp tasks to clean, min and docs | TYPO3_TYPO3.Icons | train | js |
4f7004adeff3fe17d7c2ca214cb82f0b6f946ac8 | diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js
index <HASH>..<HASH> 100644
--- a/src/tabs/tabs.js
+++ b/src/tabs/tabs.js
@@ -152,15 +152,6 @@
}
}
- /**
- * Downgrade the component.
- *
- * @private
- */
- MaterialTabs.prototype.mdlDowngrade_ = function() {
- // No special downgrading code needed for now.
- };
-
// The component registers itself. It can assume componentHandler is available
// in the global scope.
componentHandler.register({ | Reverting #<I> after discussing approach. | material-components_material-components-web | train | js |
a4d4a7a72976262b7a36b0c1b989174502e9c779 | diff --git a/provider/openstack/image.go b/provider/openstack/image.go
index <HASH>..<HASH> 100644
--- a/provider/openstack/image.go
+++ b/provider/openstack/image.go
@@ -4,6 +4,9 @@
package openstack
import (
+ "crypto/tls"
+ "net/http"
+
"launchpad.net/juju-core/environs/imagemetadata"
"launchpad.net/juju-core/environs/instances"
"launchpad.net/juju-core/environs/simplestreams"
@@ -40,6 +43,13 @@ func findInstanceSpec(e *environ, ic *instances.InstanceConstraint) (*instances.
if err != nil {
return nil, err
}
+ if !e.Config().SSLHostnameVerification() {
+ insecureConfig := &tls.Config{InsecureSkipVerify: true}
+ insecureTransport := &http.Transport{TLSClientConfig: insecureConfig}
+ insecureClient := &http.Client{Transport: insecureTransport}
+ oldHTTPClient := simplestreams.SetHttpClient(insecureClient)
+ defer simplestreams.SetHttpClient(oldHTTPClient)
+ }
// TODO (wallyworld): use an env parameter (default true) to mandate use of only signed image metadata.
matchingImages, err := imagemetadata.Fetch(baseURLs, simplestreams.DefaultIndexPath, imageConstraint, false)
if err != nil { | Quick hack appears to work.
Before we ask imagestreams to check our private buckets,
override the httpClient that simplestreams is going to
use.
This isn't perfect, but it works ok for what we need. | juju_juju | train | go |
3f2074096b277603ca462e8ad4789b0a12b8bbf5 | diff --git a/app/controllers/days_controller.rb b/app/controllers/days_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/days_controller.rb
+++ b/app/controllers/days_controller.rb
@@ -6,8 +6,8 @@ class DaysController < AuthorizedController
# AJAX methods
def calculate_cash
- bills = params[:cash_register].select { |a| a[0].to_f > 5 }
- mint = params[:cash_register].select { |a| a[0].to_f <= 5 }
+ bills = params[:cash_register].select { |key, value| key.to_f > 5 }
+ mint = params[:cash_register].select { |key, value| key.to_f <= 5 }
@cash = bills.map { |a| a[0].to_f * a[1].to_f }.sum
@cash += mint.map { |a| a[1].to_f }.sum | Treat params[:cash_register] as hash, not array in days/calculate_cash. | huerlisi_bookyt_salary | train | rb |
866ffd6a89c27f0835ae5c384fbfade26f1aaee6 | diff --git a/Swat/SwatCheckbox.php b/Swat/SwatCheckbox.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatCheckbox.php
+++ b/Swat/SwatCheckbox.php
@@ -76,6 +76,9 @@ class SwatCheckbox extends SwatInputControl implements SwatState
if ($this->value)
$input_tag->checked = 'checked';
+ if (!$this->isSensitive())
+ $input_tag->disabled = 'disabled';
+
$input_tag->display();
} | When a checkbox is set as insensitive by Swat, display the input tag with disabled='disabled'.
svn commit r<I> | silverorange_swat | train | php |
377ba9f5755394bef524831198668d16ed50e174 | diff --git a/DependencyInjection/EzCoreExtraExtension.php b/DependencyInjection/EzCoreExtraExtension.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/EzCoreExtraExtension.php
+++ b/DependencyInjection/EzCoreExtraExtension.php
@@ -14,7 +14,6 @@ namespace Lolautruche\EzCoreExtraBundle\DependencyInjection;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
use InvalidArgumentException;
-use Lolautruche\EzCoreExtraBundle\Templating\Twig\DebugTemplate;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
@@ -70,7 +69,7 @@ class EzCoreExtraExtension extends Extension implements PrependExtensionInterfac
{
// Override Twig base class when in debug
if ($container->getParameter('kernel.debug')) {
- $container->prependExtensionConfig('twig', ['base_template_class' => DebugTemplate::class]);
+ $container->prependExtensionConfig('twig', ['base_template_class' => 'Lolautruche\EzCoreExtraBundle\Templating\Twig\DebugTemplate']);
}
}
} | Compatibility with php <<I>
Changed call to debug template twig class | lolautruche_EzCoreExtraBundle | train | php |
a21d306694075dca29f800096744dcfdc0114de8 | diff --git a/src/Traits/HasTranslations.php b/src/Traits/HasTranslations.php
index <HASH>..<HASH> 100644
--- a/src/Traits/HasTranslations.php
+++ b/src/Traits/HasTranslations.php
@@ -55,4 +55,18 @@ trait HasTranslations
return $value;
}
+
+ /**
+ * Convert the model's attributes to an array.
+ *
+ * @return array
+ */
+ public function attributesToArray()
+ {
+ $values = array_map(function ($attribute) {
+ return $this->getTranslation($attribute, config('app.locale')) ?: null;
+ }, $keys = $this->getTranslatableAttributes());
+
+ return array_replace(parent::attributesToArray(), array_combine($keys, $values));
+ }
} | Return only first translation of translatable attributes | rinvex_laravel-support | train | php |
be5f2412ffe353df9b754b3e7774cc828cd5fa0a | diff --git a/lib/big_index/resource.rb b/lib/big_index/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/big_index/resource.rb
+++ b/lib/big_index/resource.rb
@@ -377,7 +377,9 @@ module BigIndex
end
def self.find_by_#{finder_name}(user_query, options={})
- find_all_by_#{finder_name}(user_query, options.merge({:limit => 1})).first
+ record = find_all_by_#{finder_name}(user_query, options.merge({:limit => 1})).first
+ raise BigRecord::RecordNotFound, "Couldn't find \#{self.name} with #{finder_name}='\#{user_query}'" unless record
+ record
end
end_eval
end | Bigindex update
* Dynamic attribute finder updated again. | openplaces_bigindex | train | rb |
afce6317ea027bb7dac40fe36f71304184ad1397 | diff --git a/code/libraries/koowa/libraries/event/listener/listener.php b/code/libraries/koowa/libraries/event/listener/listener.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/libraries/event/listener/listener.php
+++ b/code/libraries/koowa/libraries/event/listener/listener.php
@@ -61,7 +61,7 @@ class KEventListener extends KObject implements KEventListenerInterface
$config->append(array(
'dispatcher' => 'koowa:event.dispatcher',
'auto_connect' => true,
- 'priority' => KCommand::PRIORITY_NORMAL
+ 'priority' => KEvent::PRIORITY_NORMAL
));
parent::_initialize($config); | re #<I> : Use KEvent priorities. | joomlatools_joomlatools-framework | train | php |
1c1169bf4d56edef3fa05d8fd7e0a7ad24e5127e | diff --git a/core-bundle/src/Resources/contao/library/Contao/Database/Installer.php b/core-bundle/src/Resources/contao/library/Contao/Database/Installer.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/library/Contao/Database/Installer.php
+++ b/core-bundle/src/Resources/contao/library/Contao/Database/Installer.php
@@ -95,8 +95,10 @@ class Installer extends \Controller
}
return '
- <table id="sql_table" style="margin-top:9px">'.$return.'
- </table>' . "\n";
+<div id="sql_wrapper">
+ <table id="sql_table">'.$return.'
+ </table>
+</div>';
} | [Core] Wrap the SQL statements in the install tool in a scrollable div (see #<I>) | contao_contao | train | php |
b9421f7c8d09365acc525c0c282c56801263e97f | diff --git a/salt/master.py b/salt/master.py
index <HASH>..<HASH> 100644
--- a/salt/master.py
+++ b/salt/master.py
@@ -18,8 +18,12 @@ import multiprocessing
import sys
# Import third party libs
-import zmq
-from M2Crypto import RSA
+try:
+ import zmq
+ from M2Crypto import RSA
+except ImportError:
+ # Don't fail on RAET when utils may import
+ pass
# Import salt libs
import salt.crypt | Allow raet libs to safely import salt.master | saltstack_salt | train | py |
ceded7193726727daafef3ea0677c92fdc01f94b | diff --git a/packages/heroku-apps/commands/config/set.js b/packages/heroku-apps/commands/config/set.js
index <HASH>..<HASH> 100644
--- a/packages/heroku-apps/commands/config/set.js
+++ b/packages/heroku-apps/commands/config/set.js
@@ -5,13 +5,22 @@ let co = require('co');
let extend = require('util')._extend;
let _ = require('lodash');
+function split(str, delim) {
+ var components = str.split(delim);
+ var result = [components.shift()];
+ if(components.length) {
+ result.push(components.join(delim));
+ }
+ return result;
+}
+
function* run (context, heroku) {
let vars = _.reduce(context.args, function (vars, v) {
if (v.indexOf('=') === -1) {
cli.error(`${cli.color.cyan(v)} is invalid. Must be in the format ${cli.color.cyan('FOO=bar')}.`);
process.exit(1);
}
- v = v.split('=');
+ v = split(v, '=');
vars[v[0]] = v[1];
return vars;
}, {}); | fix splitting of config vars with = in them | heroku_cli | train | js |
b4b843035426ac4dad670ee5528bc210fc81c213 | diff --git a/src/module.js b/src/module.js
index <HASH>..<HASH> 100644
--- a/src/module.js
+++ b/src/module.js
@@ -248,9 +248,15 @@ angular.module('stormpath', [
away from the login page and send the user to the
post login state.
*/
- if($user.currentUser && $user.currentUser.href){
+ if($user.currentUser!==false){
e.preventDefault();
- $state.go(config.defaultPostLoginState);
+ $user.get().finally(function(){
+ if($user.currentUser && $user.currentUser.href){
+ $state.go(config.defaultPostLoginState);
+ } else {
+ $state.go(toState.name,toParams);
+ }
+ });
}
}
}); | Fix: redirect away from login if already logged in | stormpath_stormpath-sdk-angularjs | train | js |
9bf31f5faaf9066de67c3a7350e2e12ef7483649 | diff --git a/container/__init__.py b/container/__init__.py
index <HASH>..<HASH> 100644
--- a/container/__init__.py
+++ b/container/__init__.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-__version__ = '0.9.3rc2'
+__version__ = '0.9.3rc3'
import os
import sys | chored version to reflect recent PRs merged to develop | ansible_ansible-container | train | py |
c171859ee70e21bccda6ba71ca40ceeb09c9c7c7 | diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index <HASH>..<HASH> 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -328,16 +328,19 @@ import java.util.List;
defaultValue = "false",
name = "Dry Run",
type = PropertyType.BOOLEAN,
- global = false, project = false),
+ global = false, project = false,
+ category = CoreProperties.CATEGORY_GENERAL),
@Property(
key = CoreProperties.DRY_RUN_INCLUDE_PLUGINS,
name = "Plugins accepted for dry run",
- global = true, project = false),
+ global = true, project = false,
+ category = CoreProperties.CATEGORY_GENERAL),
@Property(
key = CoreProperties.DRY_RUN_EXCLUDE_PLUGINS,
name = "Plugins excluded for dry run",
global = true, project = false,
- defaultValue = "devcockpit,pdfreport,report,scmactivity,views"),
+ defaultValue = "devcockpit,pdfreport,report,scmactivity,views",
+ category = CoreProperties.CATEGORY_GENERAL),
@Property(
key = "sonar.dryRun.export.path",
defaultValue = "dryRun.json", | SONAR-<I> move settings to the category 'general' | SonarSource_sonarqube | train | java |
cc38fe6200899c707dca6aaab1a27cb3b0308681 | diff --git a/src/ace/BackgroundTokenizer.js b/src/ace/BackgroundTokenizer.js
index <HASH>..<HASH> 100644
--- a/src/ace/BackgroundTokenizer.js
+++ b/src/ace/BackgroundTokenizer.js
@@ -97,8 +97,14 @@ var BackgroundTokenizer = function(tokenizer) {
if (row > 0 && this.lines[row - 1]) {
state = this.lines[row - 1].state;
}
+
+ // TODO find a proper way to cache every line
var tokens = this.tokenizer.getLineTokens(this.textLines[row] || "", state || "start");
- this.lines[row] = tokens;
+ if (state) {
+ this.lines[row] = tokens;
+ } else {
+ return tokens;
+ }
}
return this.lines[row];
}; | we cannot cache the tokenized state all the time :( | joewalker_gcli | train | js |
70b00cbbe4294d5216bab779571e79f96abd58fa | diff --git a/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/RemoteHmmerScan.java b/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/RemoteHmmerScan.java
index <HASH>..<HASH> 100644
--- a/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/RemoteHmmerScan.java
+++ b/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/RemoteHmmerScan.java
@@ -112,7 +112,7 @@ public class RemoteHmmerScan implements HmmerScan {
HttpURLConnection connection2 = (HttpURLConnection) respUrl.openConnection();
connection2.setRequestMethod("GET");
connection2.setRequestProperty("Accept", "application/json");
-
+ connection2.setConnectTimeout(60000); // 1 minute
//Get the response
BufferedReader in = new BufferedReader( | setting timeout when talking to Hmmer server | biojava_biojava | train | java |
a7227cdedd82981ce51cf961c6ff16813d84fa25 | diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestEdgeDriver.java b/java/client/test/org/openqa/selenium/testing/drivers/TestEdgeDriver.java
index <HASH>..<HASH> 100644
--- a/java/client/test/org/openqa/selenium/testing/drivers/TestEdgeDriver.java
+++ b/java/client/test/org/openqa/selenium/testing/drivers/TestEdgeDriver.java
@@ -66,10 +66,9 @@ public class TestEdgeDriver extends RemoteWebDriver implements WebStorage, Locat
try {
if (service == null) {
Path logFile = Files.createTempFile("edgedriver", ".log");
- boolean isLegacy = System.getProperty("webdriver.edge.edgehtml") == null ||
- Boolean.getBoolean("webdriver.edge.edgehtml") ||
- capabilities.getCapability(EdgeOptions.USE_CHROMIUM) == null ||
- Boolean.parseBoolean(capabilities.getCapability(EdgeOptions.USE_CHROMIUM).toString());
+
+ // We only want to use the legacy version if we're told to.
+ boolean isLegacy = Boolean.getBoolean("webdriver.edge.edgehtml");
EdgeDriverService.Builder<?, ?> builder =
StreamSupport.stream(ServiceLoader.load(DriverService.Builder.class).spliterator(), false) | [testing] Only check one flag to see if we want legacy edge driver | SeleniumHQ_selenium | train | java |
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.