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
|
---|---|---|---|---|---|
95ec53662a6bf47182f69faa372c6d86d3cab630
|
diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -3561,7 +3561,7 @@
var after = i ? computeSelAfterChange(doc, change) : lst(source);
makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));
- if (!i && doc.cm) doc.cm.scrollIntoView(change);
+ if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)});
var rebased = [];
// Propagate to the linked documents
|
Scroll correct positions into view after undo/redo
Issue #<I>
|
codemirror_CodeMirror
|
train
|
js
|
678a0716c48840cdfbb711dbcc27653cef443822
|
diff --git a/lib/ronin/ui/cli/commands/net/proxy.rb b/lib/ronin/ui/cli/commands/net/proxy.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/ui/cli/commands/net/proxy.rb
+++ b/lib/ronin/ui/cli/commands/net/proxy.rb
@@ -158,6 +158,11 @@ module Ronin
:usage => '/REGEXP/ [...]',
:description => 'Server reset rules'
+ examples [
+ "ronin net:proxy --port 8080 --server google.com:80",
+ "ronin net:proxy --port 53 --server 4.2.2.1 --udp --hexdump"
+ ]
+
#
# Sets up the proxy command.
#
|
Added example commands to the net:proxy command.
|
ronin-ruby_ronin
|
train
|
rb
|
15cdcf0a174867013087dddcc89f77352854690f
|
diff --git a/src/Element/TaskBarIcon.php b/src/Element/TaskBarIcon.php
index <HASH>..<HASH> 100644
--- a/src/Element/TaskBarIcon.php
+++ b/src/Element/TaskBarIcon.php
@@ -22,4 +22,18 @@ class TaskBarIcon implements ElementInterface
{
$this->element = new RawTaskBarIcon;
}
+
+ /**
+ * Add a child element
+ *
+ * @param ElementInterface $child
+ */
+ public function addChild(ElementInterface $child)
+ {
+ if ($child instanceof Menu) {
+ $this->element->setMenu($child);
+ }
+
+ $this->children[] = $child;
+ }
}
\ No newline at end of file
|
When adding a child element to TaskBarIcon, if its a menu, set this on our raw object
|
encorephp_wxwidgets
|
train
|
php
|
529feb274e9eb2cd16ecf5544e0c7ca9c300304e
|
diff --git a/src/server/pkg/deploy/cmds/cmds.go b/src/server/pkg/deploy/cmds/cmds.go
index <HASH>..<HASH> 100644
--- a/src/server/pkg/deploy/cmds/cmds.go
+++ b/src/server/pkg/deploy/cmds/cmds.go
@@ -21,7 +21,7 @@ import (
"go.pedge.io/pkg/cobra"
)
-var defaultDashImage = "pachyderm/dash:0.5.0"
+var defaultDashImage = "pachyderm/dash:0.5.1"
func maybeKcCreate(dryRun bool, manifest *bytes.Buffer, opts *assets.AssetOpts) error {
if dryRun {
|
Bump dash version to <I>
|
pachyderm_pachyderm
|
train
|
go
|
8f7b7b3ea5ab02fac299974588f7756c0af596d5
|
diff --git a/pymc/distributions.py b/pymc/distributions.py
index <HASH>..<HASH> 100755
--- a/pymc/distributions.py
+++ b/pymc/distributions.py
@@ -2799,11 +2799,12 @@ def _inject_dist(distname, kwargs={}, ns=locals()):
Reusable function to inject Stochastic subclasses into module
namespace
"""
- dist_logp, dist_random = name_to_funcs(dist, ns)
- classname = capitalize(dist)
- ns[classname]= stochastic_from_dist(dist, dist_logp,
+ dist_logp, dist_random = name_to_funcs(distname, ns)
+ classname = capitalize(distname)
+ ns[classname]= stochastic_from_dist(distname, dist_logp,
dist_random, **kwargs)
+
for dist in sc_continuous_distributions:
_inject_dist(dist)
@@ -2818,6 +2819,7 @@ for dist in mv_discrete_distributions:
_inject_dist('bernoulli', {'dtype' : np.bool})
+
def uninformative_like(x):
"""
uninformative_like(x)
|
Fixed bug in _inject_dist
|
pymc-devs_pymc
|
train
|
py
|
8229e787ef9e2e2562eb25a5401091af602968d1
|
diff --git a/perceval/_version.py b/perceval/_version.py
index <HASH>..<HASH> 100644
--- a/perceval/_version.py
+++ b/perceval/_version.py
@@ -1,2 +1,2 @@
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
-__version__ = "0.9.12"
+__version__ = "0.9.13"
|
Update version number to <I>
|
chaoss_grimoirelab-perceval
|
train
|
py
|
84f1cc3cbd4ac0b32523b73f1d4e55955e466a42
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ def list_files(d, root):
with open('README.rst') as fp:
description = fp.read()
setup(name='usagestats',
- version='0.1',
+ version='0.2',
py_modules=['usagestats'],
description="Anonymous usage statistics collecter",
install_requires=['requests'],
|
Changes version to '<I>'
|
remram44_usagestats
|
train
|
py
|
99ca90c9644e2835051d04c0577379ce0e318319
|
diff --git a/lib/Sabre/CalDAV/Backend/PDO.php b/lib/Sabre/CalDAV/Backend/PDO.php
index <HASH>..<HASH> 100644
--- a/lib/Sabre/CalDAV/Backend/PDO.php
+++ b/lib/Sabre/CalDAV/Backend/PDO.php
@@ -93,7 +93,7 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
// Making fields a comma-delimited list
$fields = implode(', ', $fields);
- $stmt = $this->pdo->prepare("SELECT " . $fields . " FROM `".$this->calendarTableName."` WHERE principaluri = ?");
+ $stmt = $this->pdo->prepare("SELECT " . $fields . " FROM `".$this->calendarTableName."` WHERE principaluri = ? ORDER BY calendarorder ASC");
$stmt->execute(array($principalUri));
$calendars = array();
|
list of calendars should be ordered by calendarorder
|
sabre-io_dav
|
train
|
php
|
1a531dc4f6aaec03ab23c579b71b0aed490b2c94
|
diff --git a/src/Phantoman.php b/src/Phantoman.php
index <HASH>..<HASH> 100644
--- a/src/Phantoman.php
+++ b/src/Phantoman.php
@@ -79,13 +79,13 @@ class Phantoman extends \Codeception\Platform\Extension
$command = $this->getCommand();
- $descriptorSpec = [
- ['pipe', 'r'],
- ['file', $this->getLogDir() . 'phantomjs.output.txt', 'w'],
- ['file', $this->getLogDir() . 'phantomjs.errors.txt', 'a']
- ];
+ $descriptorSpec = array(
+ array('pipe', 'r'),
+ array('file', $this->getLogDir() . 'phantomjs.output.txt', 'w'),
+ array('file', $this->getLogDir() . 'phantomjs.errors.txt', 'a')
+ );
- $this->resource = proc_open($command, $descriptorSpec, $this->pipes, null, null, ['bypass_shell' => true]);
+ $this->resource = proc_open($command, $descriptorSpec, $this->pipes, null, null, array('bypass_shell' => true));
if (!is_resource($this->resource) || !proc_get_status($this->resource)['running']) {
proc_close($this->resource);
|
Changed array notation from short to long
|
grantlucas_phantoman
|
train
|
php
|
1c1ba480f7b35df9b7e50fa1a60fed063929a9ee
|
diff --git a/tests/integration/setup/test_bdist.py b/tests/integration/setup/test_bdist.py
index <HASH>..<HASH> 100644
--- a/tests/integration/setup/test_bdist.py
+++ b/tests/integration/setup/test_bdist.py
@@ -3,26 +3,20 @@
tests.integration.setup.test_bdist
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
-
-# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
-# Import salt libs
import salt.utils.path
import salt.utils.platform
from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES
from tests.support.case import ModuleCase
-from tests.support.helpers import VirtualEnv, skip_if_not_root
-
-# Import Salt Testing libs
+from tests.support.helpers import VirtualEnv
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
-@skip_if_not_root
@skipIf(
salt.utils.path.which_bin(KNOWN_BINARY_NAMES) is None, "virtualenv not installed"
)
|
We do not need to be root to run this test
|
saltstack_salt
|
train
|
py
|
ab1d165bba1ea77c723295cfff3c11772c057218
|
diff --git a/spacy/cli/train.py b/spacy/cli/train.py
index <HASH>..<HASH> 100644
--- a/spacy/cli/train.py
+++ b/spacy/cli/train.py
@@ -102,9 +102,9 @@ def train(
if resume_components:
with nlp.select_pipes(enable=resume_components):
msg.info(f"Resuming training for: {resume_components}")
- nlp.resume_training()
+ nlp.resume_training(sgd=optimizer)
with nlp.select_pipes(disable=[*frozen_components, *resume_components]):
- nlp.begin_training(lambda: train_corpus(nlp))
+ nlp.begin_training(lambda: train_corpus(nlp), sgd=optimizer)
if tag_map:
# Replace tag map with provided mapping
|
Pass optimizer defined in config to resume/begin_training
Otherwise, this would create a default optimizer, which isn't what we want?
|
explosion_spaCy
|
train
|
py
|
61712dbd67e47597d5b7f988d1e64958a4a16e41
|
diff --git a/bitshares/storage.py b/bitshares/storage.py
index <HASH>..<HASH> 100644
--- a/bitshares/storage.py
+++ b/bitshares/storage.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
from graphenestorage import (
InRamConfigurationStore,
InRamEncryptedKeyStore,
@@ -10,8 +11,8 @@ from graphenestorage import (
url = "wss://node.bitshares.eu"
-InRamConfigurationStore.setdefault("node", url)
SqliteConfigurationStore.setdefault("node", url)
+SqliteConfigurationStore.setdefault("order-expiration", 356 * 24 * 60 * 60)
def get_default_config_store(*args, **kwargs):
|
Ensure we do have a default expiration time for new orders
|
bitshares_python-bitshares
|
train
|
py
|
67ecbba4ff24895389b347977be6342b544da8e7
|
diff --git a/libnetwork/drivers/bridge/bridge.go b/libnetwork/drivers/bridge/bridge.go
index <HASH>..<HASH> 100644
--- a/libnetwork/drivers/bridge/bridge.go
+++ b/libnetwork/drivers/bridge/bridge.go
@@ -313,11 +313,7 @@ func (n *bridgeNetwork) isolateNetwork(others []*bridgeNetwork, enable bool) err
}
// Install the rules to isolate this network against each of the other networks
- if err := setINC(thisConfig.BridgeName, enable); err != nil {
- return err
- }
-
- return nil
+ return setINC(thisConfig.BridgeName, enable)
}
func (d *driver) configure(option map[string]interface{}) error {
|
bridge: fix lint issue
|
moby_moby
|
train
|
go
|
a253f95437f3c40e06c72899e3f1e9f1e4582d7c
|
diff --git a/lib/mittsu/renderers/opengl/opengl_geometry_group.rb b/lib/mittsu/renderers/opengl/opengl_geometry_group.rb
index <HASH>..<HASH> 100644
--- a/lib/mittsu/renderers/opengl/opengl_geometry_group.rb
+++ b/lib/mittsu/renderers/opengl/opengl_geometry_group.rb
@@ -172,19 +172,5 @@ module Mittsu
def implementation(_)
self
end
-
- private
-
- def glCreateBuffer
- @_b ||= ' '*8
- glGenBuffers(1, @_b)
- @_b.unpack('L')[0]
- end
-
- def glCreateVertexArray
- @_b ||= ' '*8
- glGenVertexArrays(1, @_b)
- @_b.unpack('L')[0]
- end
end
end
|
patch: remove unnecessary private methods from geometry_group
|
jellymann_mittsu
|
train
|
rb
|
7db982e8ba5f0ac76089db33f270144b93648930
|
diff --git a/src/wappalyzer.js b/src/wappalyzer.js
index <HASH>..<HASH> 100644
--- a/src/wappalyzer.js
+++ b/src/wappalyzer.js
@@ -9,7 +9,7 @@ const Wappalyzer = {
.toLowerCase()
.replace(/[^a-z0-9-]/g, '-')
.replace(/--+/g, '-')
- .replace(/(?:^-|-$)/, '')
+ .replace(/(?:^-|-$)/g, '')
},
getTechnology(name) {
|
Fixed regex in slugify method.
|
AliasIO_Wappalyzer
|
train
|
js
|
810584243ad9c5365d9e5c270520db1ab50e4eda
|
diff --git a/lib/maruku/input/parse_doc.rb b/lib/maruku/input/parse_doc.rb
index <HASH>..<HASH> 100644
--- a/lib/maruku/input/parse_doc.rb
+++ b/lib/maruku/input/parse_doc.rb
@@ -18,10 +18,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#++
-
-require 'iconv'
-
-
module MaRuKu; module In; module Markdown; module BlockLevelParser
def parse_doc(s)
@@ -39,21 +35,23 @@ Summary: Encoding for the document.
If the `encoding` attribute is specified, then the content
will be converted from the specified encoding to UTF-8.
-
-Conversion happens using the `iconv` library.
=end
enc = self.attributes[:encoding]
self.attributes.delete :encoding
if enc && enc.downcase != 'utf-8'
- converted = Iconv.new('utf-8', enc).iconv(data)
-
-# puts "Data: #{data.inspect}: #{data}"
-# puts "Conv: #{converted.inspect}: #{converted}"
-
- data = converted
+
+ # Switch to ruby 1.9 String#encode
+ # with backward 1.8 compatibility
+ if data.respond_to?(:encode!)
+ data.encode!('UTF-8', enc)
+ else
+ require 'iconv'
+ data = Iconv.new('utf-8', enc).iconv(data)
+ end
+
end
-
+
@children = parse_text_as_markdown(data)
if true #markdown_extra?
|
Switch to ruby <I> String#encode with backward <I> compatibility (Iconv)
|
bhollis_maruku
|
train
|
rb
|
3b4e8b9b6c8ce84e2c14378e227a582d00fe8eb9
|
diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -9063,6 +9063,23 @@ const devices = [
},
},
{
+ fingerprint: [{modelID: 'RC-EM', manufacturerName: 'HEIMAN'}],
+ model: 'HS1RC-EM',
+ vendor: 'HEIMAN',
+ description: 'Smart remote controller',
+ supports: 'action',
+ fromZigbee: [fz.battery, fz.heiman_smart_controller_armmode, fz.command_emergency],
+ toZigbee: [],
+ exposes: [e.battery(), e.action(['emergency', 'disarm', 'arm_partial_zones', 'arm_all_zones'])],
+ meta: {configureKey: 1},
+ configure: async (device, coordinatorEndpoint) => {
+ const endpoint = device.getEndpoint(1);
+ await bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
+ await configureReporting.batteryPercentageRemaining(endpoint, {min: repInterval.MINUTES_5, max: repInterval.HOUR});
+ await endpoint.read('genPowerCfg', ['batteryPercentageRemaining']);
+ },
+ },
+ {
zigbeeModel: ['COSensor-EM', 'COSensor-N'],
model: 'HS1CA-E',
vendor: 'HEIMAN',
|
Add Heiman HS1RC-EM support (#<I>)
* Add Heiman HS1RC-EM support
* Trailing space removed
|
Koenkk_zigbee-shepherd-converters
|
train
|
js
|
fdd64b95f9cbdd9fecdb8d4b9f216e0af8b80145
|
diff --git a/test/src/Validator/MaxTest.php b/test/src/Validator/MaxTest.php
index <HASH>..<HASH> 100644
--- a/test/src/Validator/MaxTest.php
+++ b/test/src/Validator/MaxTest.php
@@ -54,7 +54,7 @@ class MaxTest extends \PHPUnit_Framework_TestCase {
}
/**
- * @covers Wellid\Validator\FloatingPoint::validate
+ * @covers Wellid\Validator\Max::validate
* @dataProvider dataProvider
* @param mixed $value
* @param boolean $expected
diff --git a/test/src/Validator/MinTest.php b/test/src/Validator/MinTest.php
index <HASH>..<HASH> 100644
--- a/test/src/Validator/MinTest.php
+++ b/test/src/Validator/MinTest.php
@@ -53,7 +53,7 @@ class MinTest extends \PHPUnit_Framework_TestCase {
}
/**
- * @covers Wellid\Validator\FloatingPoint::validate
+ * @covers Wellid\Validator\Min::validate
* @dataProvider dataProvider
* @param mixed $value
* @param boolean $expected
|
Fix PHPDocs in Tests
|
broeser_wellid
|
train
|
php,php
|
b35ad1e611268b648595949bd6b51dcb43dddb15
|
diff --git a/pyemma/coordinates/transform/transformer.py b/pyemma/coordinates/transform/transformer.py
index <HASH>..<HASH> 100644
--- a/pyemma/coordinates/transform/transformer.py
+++ b/pyemma/coordinates/transform/transformer.py
@@ -183,7 +183,7 @@ class Transformer(six.with_metaclass(ABCMeta, DataSource, Estimator, Loggable)):
if isinstance(X, np.ndarray):
X = DataInMemory(X, self.chunksize)
else:
- raise ValueError("no")
+ raise ValueError("no array given")
if 'stride' in kwargs:
self._param_with_stride = kwargs['stride']
@@ -309,4 +309,4 @@ class TransformerIterator(DataSourceIterator):
def next_chunk(self):
X = self._it.next_chunk()
- return self._data_source.transform(X)
+ return self._data_source._transform_array(X)
|
[transformer] fix deprecated call
|
markovmodel_PyEMMA
|
train
|
py
|
8d5bf11c706f2fe2bcc3af7fc5d337d20ca6add2
|
diff --git a/param/parameterized.py b/param/parameterized.py
index <HASH>..<HASH> 100644
--- a/param/parameterized.py
+++ b/param/parameterized.py
@@ -1392,6 +1392,8 @@ class Parameterized(object):
# a later-overridden parent class's parameter)
params_to_instantiate = {}
for class_ in classlist(type(self)):
+ if not issubclass(class_, Parameterized):
+ continue
for (k,v) in class_.__dict__.items():
# (avoid replacing name with the default of None)
if isinstance(v,Parameter) and v.instantiate and k!="name":
|
Skip processing non-parameterized classes in setup_param
Easy 5-<I>% speedup in creating Parameterized objects
|
pyviz_param
|
train
|
py
|
5560de72d51b868912d82691b6f7a28ba1ea5d8c
|
diff --git a/scripts/release.js b/scripts/release.js
index <HASH>..<HASH> 100644
--- a/scripts/release.js
+++ b/scripts/release.js
@@ -83,9 +83,12 @@ async function publishCanary(opts) {
if (!opts.dry) {
exec(`
- ${lernaBin} exec
- -- cd dist && npm pack --dry-run
+ ${lernaBin} exec --concurrency 1 --stream
+ -- cd dist
+ && npm pack --dry-run
+ && cat package.json
`)
+ console.log('\n')
const ready = await ask('Ready to publish?', true)
if (!ready) return
}
|
cli: show package.json before publish prompt
|
react-spring_react-spring
|
train
|
js
|
9ca1489a41eb973c84d728645609d4d0bd6e2840
|
diff --git a/drizzlepac/alignimages.py b/drizzlepac/alignimages.py
index <HASH>..<HASH> 100644
--- a/drizzlepac/alignimages.py
+++ b/drizzlepac/alignimages.py
@@ -1110,6 +1110,8 @@ if __name__ == '__main__':
output = convert_string_tf_to_boolean(ARGS.output)
# Get to it!
- return_value = perform_align(input_list,archive,clobber,debug,update_hdr_wcs,print_fit_parameters,print_git_info)
+ return_value = perform_align(input_list, archive=archive, clobber=clobber, debug=debug,
+ update_hdr_wcs=update_hdr_wcs, print_fit_parameters=print_fit_parameters,
+ print_git_info=print_git_info, output=output)
log.info(return_value)
|
drizzlepac/alignimages.py: fixed perform_align() subroutine call so all input arguments are included now. (#<I>)
|
spacetelescope_drizzlepac
|
train
|
py
|
52a650ed7bf593be46614737b3e6456cf09977a5
|
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -837,7 +837,8 @@ Run `rake gems:install` to install the missing gems.
# Enable threaded mode. Allows concurrent requests to controller actions and
# multiple database connections. Also disables automatic dependency loading
- # after boot
+ # after boot, and disables reloading code on every request, as these are
+ # fundamentally incompatible with thread safety.
def threadsafe!
self.preload_frameworks = true
self.cache_classes = true
|
Add some clarification of the side effects of threadsafe!
|
rails_rails
|
train
|
rb
|
f7313aa6d2e86015a0520ff599bec1fdcad605ce
|
diff --git a/src/NinjaMutex/Mutex.php b/src/NinjaMutex/Mutex.php
index <HASH>..<HASH> 100644
--- a/src/NinjaMutex/Mutex.php
+++ b/src/NinjaMutex/Mutex.php
@@ -94,7 +94,7 @@ class Mutex
*/
public function __destruct()
{
- if ($this->isAcquired()) {
+ while ($this->isAcquired()) {
$released = $this->releaseLock();
if (!$released) {
throw new UnrecoverableMutexException(sprintf(
|
Ups, don't push dev code
|
arvenil_ninja-mutex
|
train
|
php
|
2164143555d1b7c33658be02aa59580b4670e57b
|
diff --git a/algoliasearch/Client.go b/algoliasearch/Client.go
index <HASH>..<HASH> 100644
--- a/algoliasearch/Client.go
+++ b/algoliasearch/Client.go
@@ -111,6 +111,10 @@ func (c *Client) GenerateSecuredApiKey(apiKey string, public interface{}, userTo
return hex.EncodeToString(h.Sum(nil)), nil
}
+func (c *Client) EncodeParams(body interface{}) (string) {
+ return c.transport.EncodeParams(body)
+}
+
func (c *Client) MultipleQueries(queries []interface{}, optionals ...string) (interface{}, error) {
if len(optionals) > 2 {
return "", errors.New("Too many parametters")
|
Expose encode param for the generate secured api key
|
algolia_algoliasearch-client-go
|
train
|
go
|
f6552753135f34969544f354d4df831ad5ed4958
|
diff --git a/BoundingBox.js b/BoundingBox.js
index <HASH>..<HASH> 100644
--- a/BoundingBox.js
+++ b/BoundingBox.js
@@ -54,6 +54,13 @@ function BoundingBox (bounds) {
this.maxlon = bounds.lon
}
+ if (Array.isArray(bounds)) {
+ this.minlat = bounds[0]
+ this.maxlat = bounds[0]
+ this.minlon = bounds[1]
+ this.maxlon = bounds[1]
+ }
+
// e.g. L.latLng object
if (bounds.lng) {
this.minlon = bounds.lng
|
Accept [ lat, lon ] as input
|
plepe_boundingbox
|
train
|
js
|
8420bf82623e77f35d6b5533bf23874173901620
|
diff --git a/bcbio/variation/population.py b/bcbio/variation/population.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/population.py
+++ b/bcbio/variation/population.py
@@ -85,7 +85,7 @@ def _annotate_somatic(data):
paired = vcfutils.get_paired([data])
if paired:
r = dd.get_variation_resources(data)
- if os.path.exists(r.get("cosmic", "")):
+ if r.get("cosmic") and os.path.exists(r["cosmic"]):
return True
return False
|
vcfanno: safe check for cosmic VCF, allowing None
|
bcbio_bcbio-nextgen
|
train
|
py
|
edf935ca8ec50a2b1a35c454d1bffd60c994a1f0
|
diff --git a/connectionpool.go b/connectionpool.go
index <HASH>..<HASH> 100644
--- a/connectionpool.go
+++ b/connectionpool.go
@@ -291,7 +291,10 @@ func (c *SimplePool) HandleError(conn *Conn, err error, closed bool) {
return
}
c.removeConn(conn)
- if !c.quit {
+ c.mu.Lock()
+ poolClosed := c.quit
+ c.mu.Unlock()
+ if !poolClosed {
go c.fillPool() // top off pool.
}
}
|
lock mu when checking if the pool is closed
|
gocql_gocql
|
train
|
go
|
64ba71e18104cfebd3b4da9e2e79e8b9019a6ff7
|
diff --git a/lib/vigia/sail/example.rb b/lib/vigia/sail/example.rb
index <HASH>..<HASH> 100644
--- a/lib/vigia/sail/example.rb
+++ b/lib/vigia/sail/example.rb
@@ -22,9 +22,10 @@ module Vigia
instance = self
rspec.it instance do
skip if instance.skip?(self) || (respond_to?(:skip?) and send(:skip?))
- skip('__vigia__') if instance.disabled?(self) || (respond_to?(:disabled?) and send(:disabled?))
- instance_exec(&instance.expectation)
+ unless instance.disabled?(self) || (respond_to?(:disabled?) and send(:disabled?))
+ instance_exec(&instance.expectation)
+ end
end
end
|
dont run the expectation if it is disabled
|
nogates_vigia
|
train
|
rb
|
4daf0371465357036078caf123666697e6fa3622
|
diff --git a/lib/webrat/selenium/location_strategy_javascript/label.js b/lib/webrat/selenium/location_strategy_javascript/label.js
index <HASH>..<HASH> 100644
--- a/lib/webrat/selenium/location_strategy_javascript/label.js
+++ b/lib/webrat/selenium/location_strategy_javascript/label.js
@@ -1,8 +1,7 @@
var allLabels = inDocument.getElementsByTagName("label");
var candidateLabels = $A(allLabels).select(function(candidateLabel){
- var regExp = new RegExp('^' + locator + '\\b', 'i');
var labelText = getText(candidateLabel).strip();
- return (labelText.search(regExp) >= 0);
+ return labelText.toLowerCase() == locator.toLowerCase();
});
if (candidateLabels.length == 0) {
return null;
|
make label location strategy work with unescaped strings
|
brynary_webrat
|
train
|
js
|
1f2f8d7e23709386c8622d4f5037c6c6bcd1a5f5
|
diff --git a/juju/conn.go b/juju/conn.go
index <HASH>..<HASH> 100644
--- a/juju/conn.go
+++ b/juju/conn.go
@@ -13,7 +13,7 @@ var (
// Conn holds a connection to a juju.
type Conn struct {
// TODO extend to hold a *state.State.
- Environ environs.Environ
+ environ environs.Environ
}
// NewConn returns a Conn pointing at the environName environment, or the
@@ -33,10 +33,10 @@ func NewConn(environName string) (*Conn, error) {
// Bootstrap initializes the Conn's environment and makes it ready to deploy
// services.
func (c *Conn) Bootstrap() error {
- return c.Environ.Bootstrap()
+ return c.environ.Bootstrap()
}
// Destroy destroys the Conn's environment and all its instances.
func (c *Conn) Destroy() error {
- return c.Environ.Destroy(nil)
+ return c.environ.Destroy(nil)
}
|
juju: no need to export Conn.Environ
|
juju_juju
|
train
|
go
|
06cb1faa5b17055fa540465518aa3d8cee20ee5b
|
diff --git a/mem/meminfo.go b/mem/meminfo.go
index <HASH>..<HASH> 100644
--- a/mem/meminfo.go
+++ b/mem/meminfo.go
@@ -89,7 +89,6 @@ func (d *Info) String() string {
func GetInfo() (*Info, error) {
var l, i int
var name string
- var err error
var v byte
t := time.Now().UTC().UnixNano()
f, err := os.Open("/proc/meminfo")
@@ -100,13 +99,12 @@ func GetInfo() (*Info, error) {
buf := bufio.NewReader(f)
inf := &Info{Timestamp: t}
var pos int
- line := make([]byte, 0, 50)
val := make([]byte, 0, 32)
for {
if l == 16 {
break
}
- line, err = buf.ReadSlice('\n')
+ line, err := buf.ReadSlice('\n')
if err != nil {
if err == io.EOF {
break
|
elide unnecessary creation of line buffer in meminfo ticker
|
mohae_joefriday
|
train
|
go
|
7fc022c13fe107886d43109ac3c267a8bec89a57
|
diff --git a/src/MainGrid.js b/src/MainGrid.js
index <HASH>..<HASH> 100644
--- a/src/MainGrid.js
+++ b/src/MainGrid.js
@@ -330,7 +330,8 @@ MainGrid.prototype.computeCoordinates = function () {
x2: function(d) { return d.x; },
y2: _self.height,
'class': _self.prefix + 'donor-column',
- });
+ })
+ .style('pointer-events', 'none');
}
_self.cellHeight = _self.height / _self.genes.length;
@@ -349,7 +350,8 @@ MainGrid.prototype.computeCoordinates = function () {
if (_self.drawGridLines) {
_self.row.append('line')
- .attr('x2', _self.width);
+ .attr('x2', _self.width)
+ .style('pointer-events', 'none');
}
_self.row.append('text')
|
pointer-events for grid lines
|
oncojs_oncogrid
|
train
|
js
|
5d65fc8da0fa8e01c318113ed51d2007581fcaf6
|
diff --git a/smoketests/helpers.js b/smoketests/helpers.js
index <HASH>..<HASH> 100644
--- a/smoketests/helpers.js
+++ b/smoketests/helpers.js
@@ -98,7 +98,7 @@ const runTestStdout = ({ packageName, cliArgs, logMessage, isSubPackage } = {})
const timeout = setTimeout(() => {
console.log(" timeout: killing process");
proc.kill();
- }, 30000);
+ }, 60000);
let hasPassed = false;
|
test: increase timeout (#<I>)
|
webpack_webpack-cli
|
train
|
js
|
6c901ea0d5eeb6c85872423349985efe738af582
|
diff --git a/cluster/manager/pair.go b/cluster/manager/pair.go
index <HASH>..<HASH> 100644
--- a/cluster/manager/pair.go
+++ b/cluster/manager/pair.go
@@ -306,15 +306,15 @@ func (c *ClusterManager) GetPairToken(
)
updateCallbackFn := func(db *cluster.ClusterInfo) (bool, error) {
+ pairToken = db.PairToken
// Generate a token if we don't have one or a reset has been requested
- if db.PairToken == "" || reset {
+ if pairToken == "" || reset {
token, err := c.generatePairToken()
if err != nil {
returnError = errors.Wrap(err, "Failed to generate token")
return false, nil
- } else {
- pairToken = fmt.Sprintf("%s", token)
}
+ pairToken = fmt.Sprintf("%s", token)
db.PairToken = pairToken
return true, nil
}
|
set the pair token by default (#<I>)
|
libopenstorage_openstorage
|
train
|
go
|
556a0cb6d396f374e0f6c2a134e02350019dcaac
|
diff --git a/arff.py b/arff.py
index <HASH>..<HASH> 100644
--- a/arff.py
+++ b/arff.py
@@ -366,21 +366,16 @@ class BadLayout(ArffException):
if msg:
self.message = BadLayout.message + ' ' + msg.replace('%', '%%')
-class BadObject(ArffException):
- '''Error raised when the object representing the ARFF file has something
- wrong.'''
-
- def __str__(self):
- return 'Invalid object.'
class BadObject(ArffException):
- '''Error raised when the object representing the ARFF file has something
+ '''Error raised when the object representing the ARFF file has something
wrong.'''
- def __init__(self, msg=''):
+ def __init__(self, msg='Invalid object.'):
self.msg = msg
def __str__(self):
- return '%s'%self.msg
+ return '%s' % self.msg
+
# =============================================================================
# INTERNAL ====================================================================
|
Remove redundant class (#<I>)
|
renatopp_liac-arff
|
train
|
py
|
0c5e1c138d41ee96e5e52951536f428c35e93e23
|
diff --git a/src/api/index.js b/src/api/index.js
index <HASH>..<HASH> 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -114,6 +114,11 @@ export function update(links, id, value, name, config) {
export function submit(href) {
const data = state.get().drafts[href]
- requestResource({ data, href, method: 'post', resourceKey: 'current' })
- state.get().drafts.remove(href)
+ requestResource({
+ data,
+ href,
+ method: 'post',
+ resourceKey: 'current',
+ onDone: () => state.get().drafts.remove(href),
+ })
}
|
fix: Clear submit draft after successful request
|
cignium_hypermedia-client
|
train
|
js
|
dc65cd7a7a360b1d6a61cb05386b8e7f0c749e6b
|
diff --git a/src/processor/intents/invader-core/stronghold/stronghold.js b/src/processor/intents/invader-core/stronghold/stronghold.js
index <HASH>..<HASH> 100644
--- a/src/processor/intents/invader-core/stronghold/stronghold.js
+++ b/src/processor/intents/invader-core/stronghold/stronghold.js
@@ -77,6 +77,7 @@ const deployStronghold = function deployStronghold(context) {
nextDecayTime: decayTime
};
+ let createdStructureCounter = 1;
_.forEach(template.structures, i => {
const x = 0+core.x+i.dx, y = 0+core.y+i.dy;
const objectsToRemove =_.filter(roomObjects, o => !o.strongholdId && o.x == x && o.y == y);
@@ -113,6 +114,8 @@ const deployStronghold = function deployStronghold(context) {
}
bulk.insert(s);
+ roomObjects['deployedStructure'+createdStructureCounter] = s;
+ createdStructureCounter++;
});
}
};
|
fix(processor): stronghold deploying move fix
DEV-<I>
|
screeps_engine
|
train
|
js
|
a893274bb729b6f6c363f002cbb37aacbfc46b4d
|
diff --git a/ssbio/protein/structure/structprop.py b/ssbio/protein/structure/structprop.py
index <HASH>..<HASH> 100644
--- a/ssbio/protein/structure/structprop.py
+++ b/ssbio/protein/structure/structprop.py
@@ -89,7 +89,7 @@ class StructProp(Object):
@property
def structure_dir(self):
if not self._structure_dir:
- raise OSError('No sequence folder set')
+ raise OSError('No structure folder set')
return self._structure_dir
@structure_dir.setter
|
Fix typo in structure_dir
(cherry picked from commit e<I>e<I>f)
|
SBRG_ssbio
|
train
|
py
|
134d981047dcd0ffec7469d71b9c68d0d989ba55
|
diff --git a/src/Migrations/Version/Version20200905191956.php b/src/Migrations/Version/Version20200905191956.php
index <HASH>..<HASH> 100644
--- a/src/Migrations/Version/Version20200905191956.php
+++ b/src/Migrations/Version/Version20200905191956.php
@@ -35,4 +35,12 @@ final class Version20200905191956 extends AbstractMigration
$schema->dropTable('app_news');
}
+
+ /**
+ * @see https://github.com/doctrine/migrations/issues/1104
+ */
+ public function isTransactional(): bool
+ {
+ return false;
+ }
}
|
set to false in case there is no transaction
|
apioo_fusio-impl
|
train
|
php
|
4838eec6c39c5c985a5df2c49bc4e8c1e3bec7be
|
diff --git a/SoftLayer/managers/hardware.py b/SoftLayer/managers/hardware.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/managers/hardware.py
+++ b/SoftLayer/managers/hardware.py
@@ -604,12 +604,13 @@ def _get_port_speed_price_id(items, port_speed, no_public):
"""Choose a valid price id for port speed."""
for item in items:
+ if not utils.lookup(item,
+ 'itemCategory',
+ 'categoryCode') == 'port_speed':
+ continue
# Check for correct capacity and if the item matches private only
- if any([not utils.lookup(item,
- 'itemCategory',
- 'categoryCode') == 'port_speed',
- int(utils.lookup(item, 'capacity')) != port_speed,
+ if any([int(utils.lookup(item, 'capacity')) != port_speed,
_is_private_port_speed_item(item) != no_public]):
continue
|
Since not everything has a capacity, the check for a port speed needs to happen first
|
softlayer_softlayer-python
|
train
|
py
|
efb54784c8ac5378e70cebfd17dcdd36f6f50711
|
diff --git a/blockmanager.go b/blockmanager.go
index <HASH>..<HASH> 100644
--- a/blockmanager.go
+++ b/blockmanager.go
@@ -283,7 +283,7 @@ func (b *blockManager) handleBlockMsg(bmsg *blockMsg) {
// it as such. Otherwise, something really did go wrong, so log
// it as an actual error.
if _, ok := err.(btcchain.RuleError); ok {
- log.Warnf("[BMGR] Rejected block %v: %v", blockSha, err)
+ log.Infof("[BMGR] Rejected block %v: %v", blockSha, err)
} else {
log.Errorf("[BMGR] Failed to process block %v: %v", blockSha, err)
}
diff --git a/peer.go b/peer.go
index <HASH>..<HASH> 100644
--- a/peer.go
+++ b/peer.go
@@ -422,7 +422,7 @@ func (p *peer) handleTxMsg(msg *btcwire.MsgTx) {
// so log it as such. Otherwise, something really did go wrong,
// so log it as an actual error.
if _, ok := err.(TxRuleError); ok {
- log.Warnf("Rejected transaction %v: %v", hash, err)
+ log.Infof("Rejected transaction %v: %v", hash, err)
} else {
log.Errorf("Failed to process transaction %v: %v", hash, err)
}
|
Log rejected blocks and transactions as info.
Rather than logging these as warnings which implies something is wrong
that might require user action, log them as info.
|
btcsuite_btcd
|
train
|
go,go
|
56a44661b6101cef4449b22ec2adc97d622bc68c
|
diff --git a/core/src/main/java/org/bitcoinj/script/ScriptPattern.java b/core/src/main/java/org/bitcoinj/script/ScriptPattern.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/bitcoinj/script/ScriptPattern.java
+++ b/core/src/main/java/org/bitcoinj/script/ScriptPattern.java
@@ -205,7 +205,6 @@ public class ScriptPattern {
if (chunks.size() < 4) return false;
ScriptChunk chunk = chunks.get(chunks.size() - 1);
// Must end in OP_CHECKMULTISIG[VERIFY].
- if (!chunk.isOpCode()) return false;
if (!(chunk.equalsOpCode(OP_CHECKMULTISIG) || chunk.equalsOpCode(OP_CHECKMULTISIGVERIFY))) return false;
// Second to last chunk must be an OP_N opcode and there should be that many data chunks (keys).
int nOpCode = chunks.get(chunks.size() - 2).opcode;
|
ScriptPattern: Remove redundant opcode check in isSentToMultisig().
The following line has a check that is strictly stronger.
|
bitcoinj_bitcoinj
|
train
|
java
|
491538b61cce997ae5ffc537218397707a6a8b89
|
diff --git a/anchore/anchore_utils.py b/anchore/anchore_utils.py
index <HASH>..<HASH> 100644
--- a/anchore/anchore_utils.py
+++ b/anchore/anchore_utils.py
@@ -1278,7 +1278,7 @@ def get_distro_flavor(distro, version, likedistro=None):
'likeversion':version
}
- if distro in ['centos', 'rhel', 'fedora']:
+ if distro in ['centos', 'rhel', 'redhat', 'fedora']:
ret['flavor'] = "RHEL"
ret['likedistro'] = 'centos'
elif distro in ['debian', 'ubuntu']:
|
adding mapping between OSes that identify as redhat to the RHEL/centos flavor
|
anchore_anchore
|
train
|
py
|
16af1ca471aaa19f524d096024415648c3ca9c49
|
diff --git a/virtualbox/library_ext/guest.py b/virtualbox/library_ext/guest.py
index <HASH>..<HASH> 100644
--- a/virtualbox/library_ext/guest.py
+++ b/virtualbox/library_ext/guest.py
@@ -25,7 +25,7 @@ class IGuest(library.IGuest):
if timeout_ms != 0:
# There is probably a better way to to this?
if 'win' in self.os_type_id.lower():
- test_file = 'C:\\autoexec.bat'
+ test_file = 'C:\\Windows\\System32\\calc.exe'
else:
test_file = '/bin/sh'
while True:
|
Check for calc.exe instead of autoexec.bat when waiting for a windows guest to come online
|
sethmlarson_virtualbox-python
|
train
|
py
|
18906bce8b74497d9f3fe2d9661ea812d9e3b83f
|
diff --git a/pkg/client/s3/client.go b/pkg/client/s3/client.go
index <HASH>..<HASH> 100644
--- a/pkg/client/s3/client.go
+++ b/pkg/client/s3/client.go
@@ -141,7 +141,7 @@ func newReq(url string) *http.Request {
return req
}
-func parseListAllMyBuckets(r io.ReadCloser) ([]*client.Bucket, error) {
+func parseListAllMyBuckets(r io.Reader) ([]*client.Bucket, error) {
type allMyBuckets struct {
Buckets struct {
Bucket []*client.Bucket
|
Build fix erroneous change in previous commit
|
minio_mc
|
train
|
go
|
10179d5b36c1c0db94077cdd0565c00fdd231dce
|
diff --git a/lib/pg_search.rb b/lib/pg_search.rb
index <HASH>..<HASH> 100644
--- a/lib/pg_search.rb
+++ b/lib/pg_search.rb
@@ -21,7 +21,14 @@ module PgSearch
module ClassMethods
def pg_search_scope(name, options)
scope = PgSearch::Scope.new(name, self, options)
- define_singleton_method name, &scope.method(:build_relation)
+
+ method_proc = scope.method(:build_relation)
+
+ if respond_to?(:define_singleton_method)
+ define_singleton_method name, &method_proc
+ else
+ (class << self; self; end).send :define_method, name, &method_proc
+ end
end
def multisearchable(options = {})
|
Ruby <I> doesn't have define_singleton_method
|
Casecommons_pg_search
|
train
|
rb
|
7d720171567c6dec0271c7962bb6b4ad2da6d150
|
diff --git a/core/xml.js b/core/xml.js
index <HASH>..<HASH> 100644
--- a/core/xml.js
+++ b/core/xml.js
@@ -213,7 +213,13 @@ Blockly.Xml.blockToDom = function(block, opt_noId) {
}
var shadow = input.connection.getShadowDom();
if (shadow && (!childBlock || !childBlock.isShadow())) {
- container.appendChild(Blockly.Xml.cloneShadow_(shadow));
+ var shadowClone = Blockly.Xml.cloneShadow_(shadow);
+ // Remove the ID from the shadow dom clone if opt_noId
+ // is specified to true.
+ if (opt_noId && shadowClone.getAttribute('id')) {
+ shadowClone.removeAttribute('id');
+ }
+ container.appendChild(shadowClone);
}
if (childBlock) {
container.appendChild(Blockly.Xml.blockToDom(childBlock, opt_noId));
|
When opt_noId is specified to true, shadow ids should also be removed.
|
LLK_scratch-blocks
|
train
|
js
|
fce88def9f73e41a0620f7a6347d69af8e46f1e5
|
diff --git a/src/Filters/FiltersPartial.php b/src/Filters/FiltersPartial.php
index <HASH>..<HASH> 100644
--- a/src/Filters/FiltersPartial.php
+++ b/src/Filters/FiltersPartial.php
@@ -16,9 +16,9 @@ class FiltersPartial extends FiltersExact implements Filter
$sql = "LOWER({$wrappedProperty}) LIKE ?";
- if (is_array($value)) {
+ if (is_array($value) && count(array_filter($value))) {
return $query->where(function (Builder $query) use ($value, $sql) {
- foreach ($value as $partialValue) {
+ foreach (array_filter($value) as $partialValue) {
$partialValue = mb_strtolower($partialValue, 'UTF8');
$query->orWhereRaw($sql, ["%{$partialValue}%"]);
|
Eliminates empty value on partial match filter (#<I>)
Fixes issue where /api/resource?filter[status]=1,2,3, would return everything because of the trailing slash. A partial match on empty value does not make sense and should be avoided.
|
spatie_laravel-query-builder
|
train
|
php
|
35a03e899118bc30fd11c312f81c0339f81deeea
|
diff --git a/lib/racecar/config.rb b/lib/racecar/config.rb
index <HASH>..<HASH> 100644
--- a/lib/racecar/config.rb
+++ b/lib/racecar/config.rb
@@ -43,6 +43,9 @@ module Racecar
desc "How long to allow the Kafka brokers to wait before returning messages"
float :max_wait_time, default: 1
+ desc "The maximum size of message sets returned from a single fetch"
+ integer :max_bytes, default: 10485760
+
desc "A prefix used when generating consumer group names"
string :group_id_prefix
diff --git a/lib/racecar/runner.rb b/lib/racecar/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/racecar/runner.rb
+++ b/lib/racecar/runner.rb
@@ -67,7 +67,7 @@ module Racecar
begin
if processor.respond_to?(:process)
- consumer.each_message(max_wait_time: config.max_wait_time) do |message|
+ consumer.each_message(max_wait_time: config.max_wait_time, max_bytes: config.max_bytes) do |message|
payload = {
consumer_class: processor.class.to_s,
topic: message.topic,
@@ -81,7 +81,7 @@ module Racecar
end
end
elsif processor.respond_to?(:process_batch)
- consumer.each_batch(max_wait_time: config.max_wait_time) do |batch|
+ consumer.each_batch(max_wait_time: config.max_wait_time, max_bytes: config.max_bytes) do |batch|
payload = {
consumer_class: processor.class.to_s,
topic: batch.topic,
|
Allow configuring `max_bytes`
The max size of fetch responses. Used to avoid blowing out the memory of
consumers.
|
zendesk_racecar
|
train
|
rb,rb
|
7eb6c8cfefc5c800ed773dcb94bdbac52dfc1180
|
diff --git a/src/core/util/debug.js b/src/core/util/debug.js
index <HASH>..<HASH> 100644
--- a/src/core/util/debug.js
+++ b/src/core/util/debug.js
@@ -1,6 +1,7 @@
import config from '../config'
+import { noop } from 'shared/util'
-let warn
+let warn = noop
let formatComponentName
if (process.env.NODE_ENV !== 'production') {
|
expose warn as noop in production builds
|
IOriens_wxml-transpiler
|
train
|
js
|
fb812d1108300fa2e017e138f148e961db65deaf
|
diff --git a/aiohttp/__init__.py b/aiohttp/__init__.py
index <HASH>..<HASH> 100644
--- a/aiohttp/__init__.py
+++ b/aiohttp/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '2.3.0a3'
+__version__ = '2.3.0a4'
# This relies on each of the submodules having an __all__ variable.
|
Bump to <I>a4
|
aio-libs_aiohttp
|
train
|
py
|
a2f7f132f241936057b890907be6d69695e0bb0a
|
diff --git a/packages/graphiql/src/utility/commonKeys.js b/packages/graphiql/src/utility/commonKeys.js
index <HASH>..<HASH> 100644
--- a/packages/graphiql/src/utility/commonKeys.js
+++ b/packages/graphiql/src/utility/commonKeys.js
@@ -1,4 +1,8 @@
-const isMacOs = window.navigator.platform === 'MacIntel';
+let isMacOs = false
+
+if (typeof window === Object) {
+ isMacOs = window.navigator.platform === 'MacIntel';
+}
const commonKeys = {
// Persistent search box in Query Editor
|
fix:(graphiql) - for SSR, regression from extraKeys bugfix, fixes #<I>
- dont expect window to be present for extraKeys MacOs detection logic
- use existing graphiql convention for detecting the presence of window
|
graphql_graphiql
|
train
|
js
|
e03cc0ee2a1c373ae0059cecf4948eca41768de8
|
diff --git a/modules/mainRequest/mainRequest.js b/modules/mainRequest/mainRequest.js
index <HASH>..<HASH> 100644
--- a/modules/mainRequest/mainRequest.js
+++ b/modules/mainRequest/mainRequest.js
@@ -5,21 +5,22 @@ exports.version = '0.1';
exports.module = function (phantomas) {
var isMainRequest = true;
-
- phantomas.setMetric('statusCodesTrail', []); // @desc list of HTTP status codes that main request followed through (could contain a single element if the main request is a terminal one)
+ var statusCodes = [];
phantomas.on('recv', function (entry, res) {
if (isMainRequest) {
- captureStatusCode(res.status);
+ captureStatusCode(statusCodes, res.status);
}
});
phantomas.on('responseEnd', function (entry, res) {
isMainRequest = false;
- captureStatusCode(res.status);
+ captureStatusCode(statusCodes, res.status);
+
+ phantomas.setMetric('statusCodesTrail', statusCodes.join(','), true); // @desc comma-separated list of HTTP status codes that main request followed through (could contain a single element if the main request is a terminal one) [string]
});
- function captureStatusCode(code) {
- phantomas.getMetric('statusCodesTrail').push(code);
+ function captureStatusCode(codes, code) {
+ codes.push(code);
}
};
|
Capturing the metric only once as a comma-separated string
|
macbre_phantomas
|
train
|
js
|
3d1b22aabc684d8462d1935cc6ac48dde7c5f6be
|
diff --git a/src/test/java/io/github/bonigarcia/test/basic/EdgeJupiterTest.java b/src/test/java/io/github/bonigarcia/test/basic/EdgeJupiterTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/io/github/bonigarcia/test/basic/EdgeJupiterTest.java
+++ b/src/test/java/io/github/bonigarcia/test/basic/EdgeJupiterTest.java
@@ -26,7 +26,7 @@ import org.openqa.selenium.edge.EdgeDriver;
import io.github.bonigarcia.SeleniumExtension;
-@Disabled
+@Disabled("Edge is not available on Travis CI")
@ExtendWith(SeleniumExtension.class)
public class EdgeJupiterTest {
|
Include message to disabled tests (not available on Travis)
|
bonigarcia_selenium-jupiter
|
train
|
java
|
6c7c9f5cea30b6eed6d1bf33ee1322366fe4b328
|
diff --git a/holoviews/element/comparison.py b/holoviews/element/comparison.py
index <HASH>..<HASH> 100644
--- a/holoviews/element/comparison.py
+++ b/holoviews/element/comparison.py
@@ -154,6 +154,7 @@ class Comparison(ComparisonInterface):
cls.equality_type_funcs[Trisurface] = cls.compare_trisurface
cls.equality_type_funcs[Histogram] = cls.compare_histogram
cls.equality_type_funcs[Bars] = cls.compare_bars
+ cls.equality_type_funcs[Spikes] = cls.compare_spikes
# Tables
cls.equality_type_funcs[ItemTable] = cls.compare_itemtables
@@ -500,6 +501,10 @@ class Comparison(ComparisonInterface):
def compare_bars(cls, el1, el2, msg='Bars'):
cls.compare_columns(el1, el2, msg)
+ @classmethod
+ def compare_spikes(cls, el1, el2, msg='Spikes'):
+ cls.compare_columns(el1, el2, msg)
+
#=========#
# Rasters #
#=========#
|
Added Spikes Element comparison
|
pyviz_holoviews
|
train
|
py
|
a3403b335841fc43e29a42aff383299df16519d8
|
diff --git a/tasks/modernizr.js b/tasks/modernizr.js
index <HASH>..<HASH> 100644
--- a/tasks/modernizr.js
+++ b/tasks/modernizr.js
@@ -72,7 +72,7 @@ module.exports = function(grunt) {
grunt.registerTask("modernizr", "Build out a lean, mean Modernizr machine.", function () {
// Require a config object
- this.requiresConfig(this.name, this.name + ".devFile", this.name + ".outputFile");
+ this.requiresConfig(this.name);
// Config object
var config = grunt.config.get(this.name);
@@ -205,7 +205,21 @@ module.exports = function(grunt) {
var exclude = _defaults.excludeFiles.concat(config.excludeFiles);
// Exclude developer build
- exclude.push(config.devFile);
+ if (config.devFile !== "remote") {
+ if (!fs.existsSync(config.devFile)) {
+ grunt.fail.warn([
+ "Can't find your Modernizr development build at " + config.devFile,
+ "grunt-modernizr needs this path to avoid false positives",
+ "",
+ "Update your gruntfile via the modernizr.devFile config option",
+ "See %s#devfile-string for more details".replace("%s", _private.github),
+ "",
+ ""
+ ].join("\n ").replace(/\s$/, ""));
+ } else {
+ exclude.push(config.devFile);
+ }
+ }
// Also exclude generated file
exclude.push(config.outputFile);
|
Remove requirements for modernizr.devFile, modernizr.outputFile.
Instead, running the task without these settings will output a warning.
|
Modernizr_grunt-modernizr
|
train
|
js
|
65aeda758fac94ffab1fdf51e395d310330f84fd
|
diff --git a/src/runner_panel.js b/src/runner_panel.js
index <HASH>..<HASH> 100644
--- a/src/runner_panel.js
+++ b/src/runner_panel.js
@@ -354,7 +354,13 @@ define(function main(require, exports, module) {
};
}
var selected_run_configuration = $runner_panel.find('.nodejs-integration-tab-pane.active .run-configuration-dropdown-toggle');
- selected_run_configuration.find('.type').removeClass('node').removeClass('mocha').removeClass('npm').addClass(run_configuration.type);
+ selected_run_configuration.find('.type')
+ .removeClass('node')
+ .removeClass('mocha')
+ .removeClass('npm')
+ .removeClass('gulp')
+ .addClass(run_configuration.type);
+
selected_run_configuration.find('.name').html(run_configuration.name);
selected_run_configuration.attr('name', run_configuration.name);
selected_run_configuration.attr('type', run_configuration.type);
|
fixed gulp icon switch in runner selector
|
yacut_brackets-nodejs-integration
|
train
|
js
|
29c8a9a5c05332c4dfeec337f500ef4917ae9115
|
diff --git a/lib/BlockCypher/Builder/TXInputBuilder.php b/lib/BlockCypher/Builder/TXInputBuilder.php
index <HASH>..<HASH> 100644
--- a/lib/BlockCypher/Builder/TXInputBuilder.php
+++ b/lib/BlockCypher/Builder/TXInputBuilder.php
@@ -61,6 +61,7 @@ class TXInputBuilder
$txInput = new TXInput();
$txInput->setAddresses($this->addresses);
+ $txInput->setScriptType($this->scryptType);
return $txInput;
}
diff --git a/sample/transaction-api/CreateTxToSpendMultisignFundsWithBuilder.php b/sample/transaction-api/CreateTxToSpendMultisignFundsWithBuilder.php
index <HASH>..<HASH> 100644
--- a/sample/transaction-api/CreateTxToSpendMultisignFundsWithBuilder.php
+++ b/sample/transaction-api/CreateTxToSpendMultisignFundsWithBuilder.php
@@ -30,6 +30,9 @@ $tx = \BlockCypher\Builder\TXBuilder::aTX()
->addTXOutput($output)
->build();
+// For Sample Purposes Only.
+$request = clone $tx;
+
try {
$txSkeleton = $tx->create($apiContexts['BTC.test3']);
} catch (\Exception $ex) {
|
Fixed bug in TXInputBuilder and sample
|
blockcypher_php-client
|
train
|
php,php
|
e36e5edad01ddf74a25d49096f1ee6b8271d3cb9
|
diff --git a/src/main/java/org/jinstagram/model/Methods.java b/src/main/java/org/jinstagram/model/Methods.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jinstagram/model/Methods.java
+++ b/src/main/java/org/jinstagram/model/Methods.java
@@ -25,7 +25,7 @@ public final class Methods {
*
* Required scope : likes
*/
- public static final String LIKES_BY_MEDIA_ID = "/media/%s/likes/";
+ public static final String LIKES_BY_MEDIA_ID = "/media/%s/likes";
/**
* Get information about a location.
@@ -35,7 +35,7 @@ public final class Methods {
/**
* Get a list of recent media objects from a given location.
*/
- public static final String LOCATIONS_RECENT_MEDIA_BY_ID = "/locations/%s/media/recent/";
+ public static final String LOCATIONS_RECENT_MEDIA_BY_ID = "/locations/%s/media/recent";
/**
* Search for a location by geographic coordinate.
|
Remove trailing slash from URLs
Fails signature validation with trailing slash:
<URL>
|
sachin-handiekar_jInstagram
|
train
|
java
|
579e350842dca20e9296224d837dae451324d16a
|
diff --git a/holoviews/plotting/plotly/raster.py b/holoviews/plotting/plotly/raster.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/plotly/raster.py
+++ b/holoviews/plotting/plotly/raster.py
@@ -2,7 +2,7 @@ import numpy as np
import plotly.graph_objs as go
from ...core.options import SkipRendering
-from ...element import Image
+from ...element import Image, Raster
from .element import ColorbarPlot
@@ -27,6 +27,8 @@ class RasterPlot(ColorbarPlot):
else:
l, b, r, t = element.extents
array = element.dimension_values(2, flat=False)
+ if type(element) is Raster:
+ array=array.T[::-1,...]
ny, nx = array.shape
dx, dy = float(r-l)/nx, float(t-b)/ny
return (), dict(x0=l, y0=b, dx=dx, dy=dy, z=array)
|
Update plotly/raster.py to fix Raster for plotly (#<I>)
|
pyviz_holoviews
|
train
|
py
|
fec602b7c3f0896ba921c58b80ebb958efe0e4a1
|
diff --git a/object-filter/src/test/java/org/infinispan/objectfilter/impl/hql/ProtobufParsingTest.java b/object-filter/src/test/java/org/infinispan/objectfilter/impl/hql/ProtobufParsingTest.java
index <HASH>..<HASH> 100644
--- a/object-filter/src/test/java/org/infinispan/objectfilter/impl/hql/ProtobufParsingTest.java
+++ b/object-filter/src/test/java/org/infinispan/objectfilter/impl/hql/ProtobufParsingTest.java
@@ -6,7 +6,6 @@ import org.infinispan.protostream.ConfigurationBuilder;
import org.infinispan.protostream.ProtobufUtil;
import org.infinispan.protostream.SerializationContext;
import org.infinispan.protostream.descriptors.Descriptor;
-import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;
@@ -46,11 +45,9 @@ public class ProtobufParsingTest extends AbstractParsingTest {
assertEquals(0, result.getSortFields().size());
}
- @Ignore("protobuf does not have a Date type")
@Test
@Override
public void testInvalidDateLiteral() throws Exception {
- // keep this test here just as a reminder
- super.testInvalidDateLiteral();
+ // protobuf does not have a Date type, but keep this empty test here just as a reminder
}
}
|
Replace ignore tests with empty test to avoid false alarms
|
infinispan_infinispan
|
train
|
java
|
be9a43a28ea7c113e018ec6bcb033f2fb9977ccb
|
diff --git a/src/main/java/ratpack/zipkin/internal/ZipkinHttpClientImpl.java b/src/main/java/ratpack/zipkin/internal/ZipkinHttpClientImpl.java
index <HASH>..<HASH> 100644
--- a/src/main/java/ratpack/zipkin/internal/ZipkinHttpClientImpl.java
+++ b/src/main/java/ratpack/zipkin/internal/ZipkinHttpClientImpl.java
@@ -108,7 +108,7 @@ public class ZipkinHttpClientImpl implements HttpClient {
private Action<? super RequestSpec> tracedRequestAction(final Action<? super RequestSpec> action) {
return action.append(requestSpec -> {
MethodCapturingRequestSpec captor = new MethodCapturingRequestSpec(requestSpec);
- action.with(captor);
+ action.execute(captor);
HttpMethod capturedMethod = Optional.ofNullable(captor.getCapturedMethod()).orElse(HttpMethod.GET);
requestInterceptor
.handle(requestAdapterFactory.createAdaptor(requestSpec.method(capturedMethod), capturedMethod.getName()));
|
Invoke Action using "execute" instead of "with'.
Wasn't using the return value of "with".
|
hyleung_ratpack-zipkin
|
train
|
java
|
1de0d5864598a586b8f3cf2caefb3eb8e7db40a0
|
diff --git a/celery_progress/backend.py b/celery_progress/backend.py
index <HASH>..<HASH> 100644
--- a/celery_progress/backend.py
+++ b/celery_progress/backend.py
@@ -1,3 +1,4 @@
+import datetime
from abc import ABCMeta, abstractmethod
from decimal import Decimal
@@ -66,6 +67,20 @@ class Progress(object):
'progress': _get_completed_progress(),
'result': self.result.get(self.result.id) if success else str(self.result.info),
}
+ elif self.result.state == 'RETRY':
+ retry = self.result.info
+ when = str(retry.when) if isinstance(retry.when, datetime.datetime) else str(
+ datetime.datetime.now() + datetime.timedelta(seconds=retry.when))
+ return {
+ 'complete': True,
+ 'success': False,
+ 'progress': _get_completed_progress(),
+ 'result': {
+ 'when': when,
+ 'message': retry.message or str(retry.exc)
+ },
+ 'retry': True
+ }
elif self.result.state == PROGRESS_STATE:
return {
'complete': False,
|
Add RETRY state to get_info()
|
czue_celery-progress
|
train
|
py
|
6b7a2881dd351ac5711f8993384c5b01ae0305ac
|
diff --git a/lib/helper.js b/lib/helper.js
index <HASH>..<HASH> 100644
--- a/lib/helper.js
+++ b/lib/helper.js
@@ -57,6 +57,11 @@ function shallowClone(obj) {
;
if (obj === null || typeof obj !== 'object') return obj;
+ if (obj.constructor === Array)
+ output = [];
+ else
+ output = {};
+
for (key in obj) {
if (obj.hasOwnProperty(key)) {
output[key] = obj[key];
diff --git a/test/helper.simplifyNode.js b/test/helper.simplifyNode.js
index <HASH>..<HASH> 100644
--- a/test/helper.simplifyNode.js
+++ b/test/helper.simplifyNode.js
@@ -101,6 +101,20 @@ describe('helper.simplifyNode()', function() {
helper.simplifyNode([ 'test' ], false, true).should.deep.equal([ 'test' ]);
});
+ it('should simplify arrays as arrays', function() {
+ var input, output;
+
+ input = {
+ items: [ { id: 1 }, { id: 2 } ]
+ };
+
+ output = [
+ { id: 1 }, { id: 2 }
+ ];
+
+ helper.simplifyNode(input).should.deep.equal(output);
+ });
+
it('should not simplify when things get interesting', function() {
var input, output;
|
Do not convert arrays to objects on shallowClone
|
matthewmatician_xml-flow
|
train
|
js,js
|
298d4e116fd2dc3ff04f47c891305f31cadbb6dd
|
diff --git a/bench/deuces-long-message-bench.js b/bench/deuces-long-message-bench.js
index <HASH>..<HASH> 100644
--- a/bench/deuces-long-message-bench.js
+++ b/bench/deuces-long-message-bench.js
@@ -35,7 +35,7 @@ var count = function () {
log( '-> subscribers (clients):', tclients );
log( '-> publishers:', 1 );
log( '-> total reply messages for client subscriptions:', channels.length * tclients );
- assert.ok( reply_messages === channels.length * tclients, 'wrong number of messages replies form subscribe!' );
+ assert.ok( reply_messages === channels.length * tclients, 'wrong number of messages replies for subscribe!' );
log( '-> total messages published:', requests );
log( '-> total messages received from publisher:', requests * tclients );
log( '-> total msecs:', ttime );
|
msg correction in benchs
On branch master
modified: bench/deuces-long-message-bench.js
|
rootslab_deuces
|
train
|
js
|
72b7324ebda9f1feab02751ac04bb5bc6a780606
|
diff --git a/src/components/VStepper/VStepper.js b/src/components/VStepper/VStepper.js
index <HASH>..<HASH> 100644
--- a/src/components/VStepper/VStepper.js
+++ b/src/components/VStepper/VStepper.js
@@ -75,10 +75,9 @@ export default {
this.content = []
for (let index = 0; index < this.$children.length; index++) {
const child = this.$children[index]
- // TODO: use the component name instead of tag
- if (child.$options._componentTag === 'v-stepper-step') {
+ if (child.$options.name === 'v-stepper-step') {
this.steps.push(child)
- } else if (child.$options._componentTag === 'v-stepper-content') {
+ } else if (child.$options.name === 'v-stepper-content') {
child.isVertical = this.vertical
this.content.push(child)
}
|
fix(VStepper): Use name instead of tag name (#<I>)
|
vuetifyjs_vuetify
|
train
|
js
|
991c3eb911b997afa55201d1d3c71bc3d87c6d19
|
diff --git a/lib/rules/no-fallthrough.js b/lib/rules/no-fallthrough.js
index <HASH>..<HASH> 100644
--- a/lib/rules/no-fallthrough.js
+++ b/lib/rules/no-fallthrough.js
@@ -17,6 +17,7 @@ module.exports = function(context) {
var cases = node.cases,
consequent,
i,
+ len,
switchCase;
if (typeof cases !== "undefined") {
|
Globals are not good, declare len
|
eslint_eslint
|
train
|
js
|
038063c6f2e1b6577f8d674ad2df1420032c85f6
|
diff --git a/FbBotApp.php b/FbBotApp.php
index <HASH>..<HASH> 100755
--- a/FbBotApp.php
+++ b/FbBotApp.php
@@ -47,6 +47,10 @@ class FbBotApp
*/
protected $token = null;
+ /**
+ * @var null|string
+ */
+ protected $appsecret_proof = null;
/**
* Contains the last cURL error for the current session if encountered
@@ -59,15 +63,20 @@ class FbBotApp
* FbBotApp constructor.
* @param string $token
* @param string $version optional
+ * @param string $app_secret optional
*/
- public function __construct($token, $version = null)
+ public function __construct($token, $version = null, $app_secret=null)
{
$this->token = $token;
if (is_null($version)) {
- $version = $this->apiVersion
+ $version = $this->apiVersion;
}
-
+
+ if (!is_null($app_secret)) {
+ $this->appsecret_proof= hash_hmac('sha256', $this->token, $app_secret);
+ }
+
$this->apiUrl = $this->baseApiUrl . $version . "/";
}
@@ -518,6 +527,10 @@ class FbBotApp
{
$data['access_token'] = $this->token;
+ if (!is_null($this->appsecret_proof)){
+ $data['appsecret_proof'] = $this->appsecret_proof;
+ }
+
$headers = [
'Content-Type: application/json',
];
|
add appsecret_proof support, useful for post <I> api version
|
pimax_fb-messenger-php
|
train
|
php
|
7a95f8f8399579673d23c91c57fb637292324cfe
|
diff --git a/tests/reports/commands_tests.py b/tests/reports/commands_tests.py
index <HASH>..<HASH> 100644
--- a/tests/reports/commands_tests.py
+++ b/tests/reports/commands_tests.py
@@ -806,9 +806,9 @@ def test_report_schedule_working_timeout(create_report_slack_chart_working):
logs = db.session.query(ReportExecutionLog).all()
# Two logs, first is created by fixture
assert len(logs) == 2
- assert logs[1].error_message == ReportScheduleWorkingTimeoutError.message
- assert logs[1].state == ReportState.ERROR
-
+ assert ReportScheduleWorkingTimeoutError.message in [
+ log.error_message for log in logs
+ ]
assert create_report_slack_chart_working.last_state == ReportState.ERROR
|
fix: flaky test on reports (#<I>)
|
apache_incubator-superset
|
train
|
py
|
ec595d5f7e93e2a7bbb92ba3143308a6c4c9a626
|
diff --git a/src/main/java/com/github/jsonj/tools/JsonBuilder.java b/src/main/java/com/github/jsonj/tools/JsonBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/github/jsonj/tools/JsonBuilder.java
+++ b/src/main/java/com/github/jsonj/tools/JsonBuilder.java
@@ -27,7 +27,7 @@ import com.github.jsonj.JsonElement;
import com.github.jsonj.JsonObject;
import com.github.jsonj.JsonPrimitive;
import com.github.jsonj.JsonSet;
-import java.util.List;
+import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
@@ -526,8 +526,8 @@ public class JsonBuilder {
return ((JsonBuilder) o).get();
} else if(o instanceof Map) {
return new JsonObject((Map)o);
- } else if(o instanceof List) {
- return new JsonArray((List)o);
+ } else if(o instanceof Collection) {
+ return new JsonArray((Collection)o);
} else if(o instanceof JsonDataObject) {
return ((JsonDataObject) o).getJsonObject();
}
|
generalize fromObject to work on Collection instead of just List
|
jillesvangurp_jsonj
|
train
|
java
|
b1ec2b2442112ed6a70ad00c2e7fe3811b6d778f
|
diff --git a/src/main/java/io/evanwong/oss/hipchat/v2/HipChatClient.java b/src/main/java/io/evanwong/oss/hipchat/v2/HipChatClient.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/evanwong/oss/hipchat/v2/HipChatClient.java
+++ b/src/main/java/io/evanwong/oss/hipchat/v2/HipChatClient.java
@@ -123,6 +123,14 @@ public class HipChatClient {
return new AddRoomMemberRequestBuilder(userIdOrEmail, roomIdOrName, accessToken, httpClient, executorService);
}
+ public SetTopicRequestBuilder prepareSetTopicRequestBuilder(String roomIdOrName, String topic) {
+ return prepareSetTopicRequestBuilder(roomIdOrName, topic, defaultAccessToken);
+ }
+
+ public SetTopicRequestBuilder prepareSetTopicRequestBuilder(String roomIdOrName, String topic, String accessToken) {
+ return new SetTopicRequestBuilder(roomIdOrName, topic, accessToken, httpClient, executorService);
+ }
+
public void close() {
log.info("Shutting down...");
try {
|
Added client methods for set room topic.
|
evanwong_hipchat-java
|
train
|
java
|
4b4a8ecf556a47c2e8974fd5c9c366450f532035
|
diff --git a/src/main/java/org/jooq/lambda/SQL.java b/src/main/java/org/jooq/lambda/SQL.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jooq/lambda/SQL.java
+++ b/src/main/java/org/jooq/lambda/SQL.java
@@ -183,6 +183,9 @@ public final class SQL {
hasNext = rs().next();
}
+ if (!hasNext)
+ rs().close();
+
return hasNext;
}
catch (SQLException e) {
|
[#3] ResultSet resource leak
|
jOOQ_jOOL
|
train
|
java
|
3d6d4b482e25443f5a47eb93434ca3658400cb74
|
diff --git a/Form/Type/EWZRecaptchaType.php b/Form/Type/EWZRecaptchaType.php
index <HASH>..<HASH> 100644
--- a/Form/Type/EWZRecaptchaType.php
+++ b/Form/Type/EWZRecaptchaType.php
@@ -47,12 +47,12 @@ class EWZRecaptchaType extends AbstractType
protected $localeResolver;
/**
- * @param string $publicKey Recaptcha public key
- * @param bool $enabled Recaptache status
- * @param bool $ajax Ajax status
- * @param string $localeResolver
+ * @param string $publicKey Recaptcha public key
+ * @param bool $enabled Recaptache status
+ * @param bool $ajax Ajax status
+ * @param LocaleResolver $localeResolver
*/
- public function __construct($publicKey, $enabled, $ajax, $localeResolver)
+ public function __construct($publicKey, $enabled, $ajax, LocaleResolver $localeResolver)
{
$this->publicKey = $publicKey;
$this->enabled = $enabled;
|
use type hint for LocaleResolver and fixed PHPDoc
|
excelwebzone_EWZRecaptchaBundle
|
train
|
php
|
cb024577bf7ce3c98fb179565489d2305105dfcb
|
diff --git a/src/Palladium/Service/Search.php b/src/Palladium/Service/Search.php
index <HASH>..<HASH> 100644
--- a/src/Palladium/Service/Search.php
+++ b/src/Palladium/Service/Search.php
@@ -8,7 +8,6 @@ namespace Palladium\Service;
*/
use Palladium\Entity as Entity;
-use Palladium\Exception\UserNotFound;
use Palladium\Exception\IdentityNotFound;
use Palladium\Repository\Identity as Repository;
use Psr\Log\LoggerInterface;
@@ -60,13 +59,9 @@ class Search
/**
* Locates identity based on email address
*
- * @param string $identifier
- *
* @throws Palladium\Exception\IdentityNotFound if identity was not found
- *
- * @return Palladium\Entity\StandardIdentity
*/
- public function findStandardIdentityByIdentifier(string $identifier)
+ public function findStandardIdentityByIdentifier(string $identifier): Entity\StandardIdentity
{
$identity = new Entity\StandardIdentity;
$identity->setIdentifier($identifier);
@@ -87,7 +82,7 @@ class Search
}
- public function findNonceIdentityByIdentifier(string $identifier)
+ public function findNonceIdentityByIdentifier(string $identifier): Entity\NonceIdentity
{
$identity = new Entity\NonceIdentity;
$identity->setIdentifier($identifier);
|
Minor: cleaning up type-hints and aliases
|
teresko_palladium
|
train
|
php
|
ab90f63f43ad7779242c24bea9404dc1729a4f44
|
diff --git a/packages/swagger2openapi/index.js b/packages/swagger2openapi/index.js
index <HASH>..<HASH> 100644
--- a/packages/swagger2openapi/index.js
+++ b/packages/swagger2openapi/index.js
@@ -262,7 +262,7 @@ function processParameter(param,op,path,index,openapi,options) {
singularRequestBody = false;
result.content = {};
var contentType = 'application/x-www-form-urlencoded';
- if ((consumes.length) && (consumes[0] == 'multipart/form-data')) {
+ if ((consumes.length) && (consumes.indexOf('multipart/form-data')>0)) {
contentType = 'multipart/form-data';
}
|
Improve detection of multipart/form-data type
|
Mermade_oas-kit
|
train
|
js
|
dd4a17ef1ba6ad2d01299a09a6b8bd4837ee461c
|
diff --git a/highton/classes/person.py b/highton/classes/person.py
index <HASH>..<HASH> 100644
--- a/highton/classes/person.py
+++ b/highton/classes/person.py
@@ -37,7 +37,7 @@ class Person(Contact):
'title',
'background',
'linkedin-url',
- 'avatar-url',
+ 'avatar_url',
'company-id',
'company-name',
'visible-to',
|
Update person.py
Change in the API broke this. Had to change avatar-url to avatar_url.
|
seibert-media_Highton
|
train
|
py
|
ebc6d18e6436d1842d76fa0f78817785c9672b1d
|
diff --git a/future.go b/future.go
index <HASH>..<HASH> 100644
--- a/future.go
+++ b/future.go
@@ -458,7 +458,11 @@ func start(act interface{}, canCancel bool) *Future {
func Wrap(value interface{}) *Future {
fu := NewPromise()
- fu.Reslove(value)
+ if values, ok := value.([]interface{}); ok {
+ fu.Reslove(values...)
+ } else {
+ fu.Reslove(value)
+ }
return fu.Future
}
|
let wrap method can expand the slice arg
|
fanliao_go-promise
|
train
|
go
|
7a042adaa12b285fa0a0783f417f06465c6ed53a
|
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -1014,16 +1014,6 @@ EOT
by `puppet`, and should only be set if you're writing your own Puppet
executable.",
},
- :masterlog => {
- :default => "$logdir/puppetmaster.log",
- :type => :file,
- :owner => "service",
- :group => "service",
- :mode => 0660,
- :desc => "This file is literally never used, although Puppet may create it
- as an empty file. For more context, see the `puppetdlog` setting and
- puppet master's `--logdest` command line option."
- },
:masterhttplog => {
:default => "$logdir/masterhttp.log",
:type => :file,
|
(PUP-<I>) Remove masterlog option
Pull the `masterlog` configuration option as it is unused and causes confusion.
|
puppetlabs_puppet
|
train
|
rb
|
b76925dc98a86e885aac243e763a35aea846e593
|
diff --git a/rb/lib/selenium/webdriver/firefox/binary.rb b/rb/lib/selenium/webdriver/firefox/binary.rb
index <HASH>..<HASH> 100644
--- a/rb/lib/selenium/webdriver/firefox/binary.rb
+++ b/rb/lib/selenium/webdriver/firefox/binary.rb
@@ -170,6 +170,7 @@ module Selenium
def macosx_path
path = "/Applications/Firefox.app/Contents/MacOS/firefox-bin"
+ path = "~/Applications/Firefox.app/Contents/MacOS/firefox-bin" unless File.exist?(path)
path = Platform.find_binary("firefox-bin") unless File.exist?(path)
path
|
rb - osx to also look for firefox binary in homebrew cask default directory (issue #<I>)
|
SeleniumHQ_selenium
|
train
|
rb
|
3191c704a12a7afdc037f89da5a60590ebda59d7
|
diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php
+++ b/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php
@@ -78,7 +78,8 @@ class LocaleValidatorTest extends LocalizedTestCase
return array(
array('en'),
array('en_US'),
- array('my'),
+ array('pt'),
+ array('pt_PT'),
array('zh_Hans'),
);
}
|
[Validator] fixed tests, ICU <I> (Travis version) does not have the "my" locale
|
symfony_symfony
|
train
|
php
|
db51bd8f1bff39d62e63a8526713aeafe77a311d
|
diff --git a/view/frontend/requirejs-config.js b/view/frontend/requirejs-config.js
index <HASH>..<HASH> 100644
--- a/view/frontend/requirejs-config.js
+++ b/view/frontend/requirejs-config.js
@@ -5,6 +5,5 @@ var config = {
Klarna: 'https://x.klarnacdn.net/kp/lib/v1/api.js',
googlepayjs: 'https://pay.google.com/gp/p/js/pay.js'
}
- },
- urlArgs: "bust=" + (new Date()).getTime()
+ }
};
\ No newline at end of file
|
Removed the cache buster from requirejs
|
checkout_checkout-magento2-plugin
|
train
|
js
|
7d5cbf842465e2bacee229a44b9956348834099f
|
diff --git a/lib/cinch/plugin.rb b/lib/cinch/plugin.rb
index <HASH>..<HASH> 100644
--- a/lib/cinch/plugin.rb
+++ b/lib/cinch/plugin.rb
@@ -87,10 +87,16 @@ module Cinch
@__cinch_name = name
end
+ # @return [String]
+ # @api private
+ def __plugin_name
+ @__cinch_name || self.name.split("::").last.downcase
+ end
+
# @return [void]
# @api private
def __register_with_bot(bot, instance)
- plugin_name = @__cinch_name || self.name.split("::").last.downcase
+ plugin_name = __plugin_name
(@__cinch_listeners || []).each do |listener|
bot.debug "[plugin] #{plugin_name}: Registering listener for type `#{listener.event}`"
|
added helper method for getting plugin name
|
cinchrb_cinch
|
train
|
rb
|
5a2eeff932e162bdfef44ba742209efe9174e195
|
diff --git a/spyder/widgets/findreplace.py b/spyder/widgets/findreplace.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/findreplace.py
+++ b/spyder/widgets/findreplace.py
@@ -571,12 +571,20 @@ class FindReplace(QWidget):
replacement = re_pattern.sub(replace_text, selected_text)
if replacement != selected_text:
cursor = self.editor.textCursor()
+ start_pos = cursor.selectionStart()
cursor.beginEditBlock()
cursor.removeSelectedText()
if not self.re_button.isChecked():
replacement = re.sub(r'\\(?![nrtf])(.)', r'\1', replacement)
cursor.insertText(replacement)
+ # Restore selection
+ self.editor.set_cursor_position(start_pos)
+ newl_cnt = replacement.count(self.editor.get_line_separator())
+ sel_len = len(replacement) - newl_cnt
+ for c in range(sel_len):
+ self.editor.extend_selection_to_next('character', 'right')
cursor.endEditBlock()
+
if focus_replace_text:
self.replace_text.setFocus()
else:
|
Restored selection after replaced in selection
|
spyder-ide_spyder
|
train
|
py
|
da8c307977821dd92e1a0b5940c63c85c345d0b1
|
diff --git a/lib/validators/omnivore.js b/lib/validators/omnivore.js
index <HASH>..<HASH> 100644
--- a/lib/validators/omnivore.js
+++ b/lib/validators/omnivore.js
@@ -17,7 +17,7 @@ module.exports = function validateOmnivore(opts, callback) {
sniffer.quaff(opts.filepath, function(err, filetype) {
if (err) return callback(err);
- if (filetype === 'tif') limits = opts.limits || { max_filesize: 5 * 1024 * 1024 * 1024 };
+ if (filetype === 'tif') limits = opts.limits || { max_filesize: 4 * 1024 * 1024 * 1024 };
else limits = opts.limits || { max_filesize: 260 * 1024 * 1024 };
var q = queue();
|
set tifsize to 4GB
|
mapbox_mapbox-upload-validate
|
train
|
js
|
76ecde6a2c251827e852e1f8b08a01f698d45f46
|
diff --git a/packages/react-router/modules/Route.js b/packages/react-router/modules/Route.js
index <HASH>..<HASH> 100644
--- a/packages/react-router/modules/Route.js
+++ b/packages/react-router/modules/Route.js
@@ -25,7 +25,7 @@ class Route extends React.Component {
PropTypes.func,
PropTypes.node
]),
- location: PropTypes.location
+ location: PropTypes.object
}
static childContextTypes = {
diff --git a/packages/react-router/modules/__tests__/StaticRouter-test.js b/packages/react-router/modules/__tests__/StaticRouter-test.js
index <HASH>..<HASH> 100644
--- a/packages/react-router/modules/__tests__/StaticRouter-test.js
+++ b/packages/react-router/modules/__tests__/StaticRouter-test.js
@@ -172,7 +172,7 @@ describe('A <StaticRouter>', () => {
expect(() => {
ReactDOM.render((
<StaticRouter context={context}>
- <Prompt />
+ <Prompt message="this is only a test"/>
</StaticRouter>
), node)
}).toNotThrow()
|
Remove some warnings emitted during tests (#<I>)
|
ReactTraining_react-router
|
train
|
js,js
|
1240024f4798a8ec9fa782ca4ab14abcfe3701b8
|
diff --git a/src/commands/start-server.js b/src/commands/start-server.js
index <HASH>..<HASH> 100644
--- a/src/commands/start-server.js
+++ b/src/commands/start-server.js
@@ -86,11 +86,18 @@ function startPM2 (scriptPath, name) {
*/
process.on("SIGINT", () => {
logger.info(`Stopping pm2 instance: ${highlight(name)}…`);
- pm2.delete(name, () => {
+ try {
+ pm2.delete(name, () => {
+ pm2.disconnect(() => {
+ process.exit();
+ });
+ });
+ }
+ catch (e) {
pm2.disconnect(() => {
process.exit();
});
- });
+ }
});
}
|
Better handle issue when stopping pm2 before start
|
TrueCar_gluestick
|
train
|
js
|
c6bb82e8bca9033d597c0c54d89cba17e8737008
|
diff --git a/Tests/App/AppKernel.php b/Tests/App/AppKernel.php
index <HASH>..<HASH> 100644
--- a/Tests/App/AppKernel.php
+++ b/Tests/App/AppKernel.php
@@ -8,6 +8,19 @@ use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
+ /**
+ * @param string $environment
+ * @param bool $debug
+ *
+ * @see https://stackoverflow.com/questions/20743060/symfony2-and-date-default-timezone-get-it-is-not-safe-to-rely-on-the-system/20743237#20743237
+ */
+ public function __construct($environment, $debug)
+ {
+ date_default_timezone_set('UTC');
+
+ parent::__construct($environment, $debug);
+ }
+
public function registerBundles()
{
$bundles = [
|
Set timezone in “AppKernel” to avoid Behat warning on CircleCI
|
alexislefebvre_AsyncTweetsBundle
|
train
|
php
|
00658e8cf305f29cac33d993808d9bbd10093afb
|
diff --git a/mmcv/runner/iter_based_runner.py b/mmcv/runner/iter_based_runner.py
index <HASH>..<HASH> 100644
--- a/mmcv/runner/iter_based_runner.py
+++ b/mmcv/runner/iter_based_runner.py
@@ -212,7 +212,7 @@ class IterBasedRunner(BaseRunner):
if platform.system() != 'Windows':
mmcv.symlink(filename, dst_file)
else:
- shutil.copy(filename, dst_file)
+ shutil.copy(filepath, dst_file)
def register_training_hooks(self,
lr_config,
|
Fix copy source file path (#<I>)
|
open-mmlab_mmcv
|
train
|
py
|
fb05e7fd76158ae48fbecef36dcdd9a6bd13efef
|
diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -535,8 +535,8 @@ func (c *Client) Join(channels ...string) []string {
c.channelUserlistMutex.Lock()
c.channelUserlist[channel] = map[string]bool{}
c.channelUserlistMutex.Unlock()
- c.channelsMtx.Unlock()
}
+ c.channelsMtx.Unlock()
return remainder
}
|
Unlock channelsMtx once all channels updated
|
gempir_go-twitch-irc
|
train
|
go
|
dd376154d032642a42742d3b94c791ca81aea98c
|
diff --git a/test/functional/id-unique.js b/test/functional/id-unique.js
index <HASH>..<HASH> 100644
--- a/test/functional/id-unique.js
+++ b/test/functional/id-unique.js
@@ -1,17 +1,17 @@
module.exports = [
{
desc: 'should pass html with no duplicate ids',
- input: '<div id="div1"></div><div id="div2"></div>',
+ input: '<div id="div1"></div>text<div id="div2"></div>',
opts: { 'id-unique': true },
output: 0
}, {
desc: 'should fail html with a duplicate id',
- input: '<div id="div1"></div><div id="div1"></div>',
+ input: '<div id="div1"></div>text<div id="div1"></div>',
opts: { 'id-unique': true },
output: 1
}, {
desc: 'should pass any html when disabled',
- input: '<div id="div1"></div><div id="div1"></div>',
+ input: '<div id="div1"></div>text<div id="div1"></div>',
opts: { 'id-unique': false },
output: 0
}
|
Add testing for id-unique on non-tags
|
htmllint_htmllint
|
train
|
js
|
5d34d31739e812153d530bfc65eec63e9834660c
|
diff --git a/docs/storage/driver/oss/oss.go b/docs/storage/driver/oss/oss.go
index <HASH>..<HASH> 100644
--- a/docs/storage/driver/oss/oss.go
+++ b/docs/storage/driver/oss/oss.go
@@ -8,8 +8,7 @@
// time for directories (directories are an abstraction for key, value stores)
//
// Keep in mind that OSS guarantees only eventual consistency, so do not assume
-// that a successful write will mean immediate access to the data written (although
-// in most regions a new object put has guaranteed read after write). The only true
+// that a successful write will mean immediate access to the data written. The only true
// guarantee is that once you call Stat and receive a certain file size, that much of
// the file is already accessible.
package oss
|
Update the comments for consistence model
Change-Id: I<I>ee<I>f<I>fb<I>e<I>b<I>bd<I>e<I>e8
|
docker_distribution
|
train
|
go
|
58aef7d5ad6861a896ee307bdfc9ed3a144c645a
|
diff --git a/tests/contrib/hahelpers/test_ceph_utils.py b/tests/contrib/hahelpers/test_ceph_utils.py
index <HASH>..<HASH> 100644
--- a/tests/contrib/hahelpers/test_ceph_utils.py
+++ b/tests/contrib/hahelpers/test_ceph_utils.py
@@ -5,6 +5,7 @@ from tempfile import mkdtemp
from threading import Timer
from testtools import TestCase
+import nose.plugins.attrib
import charmhelpers.contrib.hahelpers.ceph as ceph_utils
import os
import time
@@ -80,6 +81,7 @@ class CephUtilsTests(TestCase):
self.log.assert_called_with('ceph: gave up waiting on block device %s' % device,
level='ERROR')
+ @nose.plugins.attrib.attr('slow')
def test_make_filesystem_timeout(self):
"""
make_filesystem() allows to specify how long it should wait for the
@@ -96,6 +98,7 @@ class CephUtilsTests(TestCase):
self.log.assert_called_with('ceph: gave up waiting on block device %s' % device,
level='ERROR')
+ @nose.plugins.attrib.attr('slow')
def test_device_is_formatted_if_it_appears(self):
"""
The specified device is formatted if it appears before the timeout
|
Added nose slow attribute to the slow tests
|
juju_charm-helpers
|
train
|
py
|
f6950633075ea336af68a5a08857dffd17ffbc96
|
diff --git a/lib/svtplay_dl/__init__.py b/lib/svtplay_dl/__init__.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/__init__.py
+++ b/lib/svtplay_dl/__init__.py
@@ -77,6 +77,8 @@ def get_media(url, options):
try:
stream.get(options)
except UIException as e:
+ if options.verbose:
+ raise e
log.error(e.message)
sys.exit(2)
|
Reraise UIExceptions when called with --verbose
|
spaam_svtplay-dl
|
train
|
py
|
4eebb54681963bc5fc410a7a941d48f5493d385a
|
diff --git a/src/components/timeslider/timeslider.js b/src/components/timeslider/timeslider.js
index <HASH>..<HASH> 100644
--- a/src/components/timeslider/timeslider.js
+++ b/src/components/timeslider/timeslider.js
@@ -529,7 +529,7 @@ const TimeSlider = Component.extend({
return function() {
if (_this.model.time.playing)
- _this.model.time.pause();
+ _this.model.time.set("playing", false, null, false);
_this._optionClasses();
_this.element.classed(class_dragging, true);
|
Replace time.pause with settings playing to false to prevent setting current time to url when we click on timeslider
|
vizabi_vizabi
|
train
|
js
|
a6393d0dcad29e1eee81243f4c62e620fa2b8388
|
diff --git a/views/category/partials/form-create.blade.php b/views/category/partials/form-create.blade.php
index <HASH>..<HASH> 100644
--- a/views/category/partials/form-create.blade.php
+++ b/views/category/partials/form-create.blade.php
@@ -19,7 +19,7 @@
<div class="form-group">
<label for="category-id">{{ trans_choice('forum::categories.category', 1) }}</label>
<select name="category_id" id="category-id" class="form-control">
- <option value="">({{ trans('forum::general.none') }})</option>
+ <option value="0">({{ trans('forum::general.none') }})</option>
@include ('forum::category.partials.options')
</select>
</div>
|
fixed: category not showing when created without parent
|
Riari_laravel-forum-frontend
|
train
|
php
|
e5a4fae467e9afe4077ced6dcda2642aec397ce6
|
diff --git a/src/Validate.php b/src/Validate.php
index <HASH>..<HASH> 100644
--- a/src/Validate.php
+++ b/src/Validate.php
@@ -22,6 +22,11 @@ class Validate
return $expiration >= time();
}
+ public function notBefore(int $notBefore): bool
+ {
+ return $notBefore <= time();
+ }
+
public function signature(string $signature, string $comparison): bool
{
return hash_equals($signature, $comparison);
diff --git a/tests/ValidateTest.php b/tests/ValidateTest.php
index <HASH>..<HASH> 100644
--- a/tests/ValidateTest.php
+++ b/tests/ValidateTest.php
@@ -136,4 +136,18 @@ class ValidateTest extends TestCase
$this->assertFalse($validate->secret('HELLOworldFOOBAR123'));
}
+
+ public function testValidateNotBefore()
+ {
+ $validate = new Validate();
+
+ $this->assertTrue($validate->notBefore(time() - 10));
+ }
+
+ public function testValidateNotFalse()
+ {
+ $validate = new Validate();
+
+ $this->assertFalse($validate->notBefore(time() + 10));
+ }
}
|
Added notBefore validation method and tests to Validate class.
|
RobDWaller_ReallySimpleJWT
|
train
|
php,php
|
1aa3e507aea57a7a47739f5e38709451c3d7f930
|
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/classical.py
+++ b/openquake/calculators/classical.py
@@ -302,7 +302,7 @@ class ClassicalCalculator(base.HazardCalculator):
avail = min(psutil.virtual_memory().available, config.memory.limit)
logging.info('Requiring %s for full ProbabilityMap of shape %s',
humansize(size), (G, N, L))
- maxsize = 20_000 * max(num_gs) * N * self.oqparam.imtls.size * 8
+ maxsize = 20_000 * max(num_gs) * self.oqparam.imtls.size * 8
logging.info('Requiring at max %s for gen_poes', humansize(maxsize))
if avail < bytes_per_grp:
raise MemoryError(
|
Fixed logging [ci skip]
|
gem_oq-engine
|
train
|
py
|
81762cd68ecc9496d42785296323f6337bb7e6a2
|
diff --git a/test/src/pops/test/testcase.php b/test/src/pops/test/testcase.php
index <HASH>..<HASH> 100644
--- a/test/src/pops/test/testcase.php
+++ b/test/src/pops/test/testcase.php
@@ -18,12 +18,12 @@ use Pops\ProxyClass;
class TestCase extends PHPUnit_Framework_TestCase
{
/**
- * @param Proxy|ProxyClass $proxy
+ * @param Proxy $proxy
* @param string $method
* @param array $arguments
* @param boolean $magic
*/
- protected function assertPopsProxyCall($proxy, $method, array $arguments = null, $magic = null)
+ protected function assertPopsProxyCall(Proxy $proxy, $method, array $arguments = null, $magic = null)
{
$actual = call_user_func_array(array($proxy, $method), $arguments);
|
tightened up test case with new interface
|
eloquent_pops
|
train
|
php
|
e4585adb55f99aa98368cddc8c744c1defa6131a
|
diff --git a/src/ca/eandb/jdcp/server/TemporaryJobServer.java b/src/ca/eandb/jdcp/server/TemporaryJobServer.java
index <HASH>..<HASH> 100644
--- a/src/ca/eandb/jdcp/server/TemporaryJobServer.java
+++ b/src/ca/eandb/jdcp/server/TemporaryJobServer.java
@@ -553,8 +553,10 @@ public final class TemporaryJobServer implements TaskService {
public void run() {
if (task != null) {
try {
- sched.job.submitTaskResults(task,
- results.deserialize(), monitor);
+ synchronized (sched.job) {
+ sched.job.submitTaskResults(task,
+ results.deserialize(), monitor);
+ }
if (sched.job.isComplete()) {
sched.finalizeJob();
|
Synchronized calls to submitTaskResults.
|
bwkimmel_jdcp
|
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.