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 |
|---|---|---|---|---|---|
cd81250ef84445be50b3986c1838d68dc223eff7 | diff --git a/cli.py b/cli.py
index <HASH>..<HASH> 100755
--- a/cli.py
+++ b/cli.py
@@ -153,6 +153,7 @@ def _generate_reload(generator, input, output):
print('watch:', path)
observer.schedule(event_handler, path, recursive=True)
for entry in input:
+ entry = entry.dirname().expand().abspath()
print('watch:', entry)
observer.schedule(event_handler, entry, recursive=True)
path = Path(__file__).parent / 'qface' | Fixed issue with watcher when a file name was passed as src | Pelagicore_qface | train | py |
cead584fdd31cfad9c3f4a051ce164db8e6353d6 | diff --git a/lib/taxonomite/entity.rb b/lib/taxonomite/entity.rb
index <HASH>..<HASH> 100644
--- a/lib/taxonomite/entity.rb
+++ b/lib/taxonomite/entity.rb
@@ -23,7 +23,7 @@ module Taxonomite
protected
# classes overload to create the appropriate taxonomy_node
# def create_taxonomy_node
- # Taxonomite::Taxon.new(name: self.name)
+ # Taxonomite::Node.new(name: self.name)
# end
private | fix comment (get rid of Taxon) | sgillesp_taxonomite | train | rb |
e403ac5bb59b0d43920ca1abf6f16e13f8fbc94e | diff --git a/core/broker/uplink.go b/core/broker/uplink.go
index <HASH>..<HASH> 100644
--- a/core/broker/uplink.go
+++ b/core/broker/uplink.go
@@ -158,6 +158,10 @@ func (b *broker) HandleUplink(uplink *pb.UplinkMessage) (err error) {
// Select best DownlinkOption
if len(downlinkOptions) > 0 {
downlinkMessage = &pb.DownlinkMessage{
+ DevEui: device.DevEui,
+ AppEui: device.AppEui,
+ AppId: device.AppId,
+ DevId: device.DevId,
DownlinkOption: selectBestDownlink(downlinkOptions),
}
} | Pass valid DownlinkMessage from Broker to NS | TheThingsNetwork_ttn | train | go |
390251517752eebf071a64a5dac63548d7376c77 | diff --git a/src/gitgraph.js b/src/gitgraph.js
index <HASH>..<HASH> 100644
--- a/src/gitgraph.js
+++ b/src/gitgraph.js
@@ -469,7 +469,7 @@
// Add height of detail div (normal vertical mode only)
if (commit.detail !== null) {
commit.detail.style.display = "block";
- this.parent.commitOffsetY -= commit.detail.clientHeight;
+ this.parent.commitOffsetY -= commit.detail.clientHeight - 40;
}
// Auto-render | Reduce margin bottom of detail (canvas) | nicoespeon_gitgraph.js | train | js |
285566790879b31d2fdd2a8c6f56825162eb71b9 | diff --git a/tests/test_publish_heroku.py b/tests/test_publish_heroku.py
index <HASH>..<HASH> 100644
--- a/tests/test_publish_heroku.py
+++ b/tests/test_publish_heroku.py
@@ -24,7 +24,7 @@ def test_publish_heroku_installs_plugin(mock_call, mock_check_output, mock_which
with runner.isolated_filesystem():
open("t.db", "w").write("data")
result = runner.invoke(cli.cli, ["publish", "heroku", "t.db"], input="y\n")
- assert -1 == result.exit_code
+ assert 0 != result.exit_code
mock_check_output.assert_has_calls(
[mock.call(["heroku", "plugins"]), mock.call(["heroku", "apps:list", "--json"])]
) | Fix for test failure with Click <I> | simonw_datasette | train | py |
f6c89e3c482528fdea762e5cdfff6169d65c8c20 | diff --git a/src/Application.php b/src/Application.php
index <HASH>..<HASH> 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -16,6 +16,7 @@ use Nyholm\Psr7\Factory\Psr17Factory;
use Nyholm\Psr7\Response as PsrResponse;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
+use Exception;
use RuntimeException;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest; | Fix missing import
Instead of getting expected error `'Unable to resolve PSR request. Please install symfony/psr-http-message-bridge and nyholm/psr7.'`, this error is shown instead: `Class 'Laravel\\Lumen\\Exception' not found in src/Application.php:<I>` | laravel_lumen-framework | train | php |
4027d084afb2ecab7b3a82e20c849dca0e698bad | diff --git a/src/mappers/har.js b/src/mappers/har.js
index <HASH>..<HASH> 100644
--- a/src/mappers/har.js
+++ b/src/mappers/har.js
@@ -190,6 +190,6 @@ function getOptionalDuration (start, end) {
return -1;
}
- return parseInt(end) - parseInt(start);
+ return end - start;
} | Remove unnecessary calls to parseInt. | springernature_boomcatch | train | js |
e36f075b0a7bbda964f2cab587e4bb43980e6870 | diff --git a/config/ember-try.js b/config/ember-try.js
index <HASH>..<HASH> 100644
--- a/config/ember-try.js
+++ b/config/ember-try.js
@@ -15,7 +15,7 @@ module.exports = function() {
name: 'ember-lts-2.12',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
- 'jquery-integration': true
+ 'jquery-integration': false
})
},
npm: {
@@ -29,12 +29,11 @@ module.exports = function() {
name: 'ember-lts-2.16',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
- 'jquery-integration': true
+ 'jquery-integration': false
})
},
npm: {
devDependencies: {
- '@ember/jquery': '^0.5.2',
'ember-source': '~2.16.0'
}
}
@@ -43,12 +42,11 @@ module.exports = function() {
name: 'ember-lts-2.18',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
- 'jquery-integration': true
+ 'jquery-integration': false
})
},
npm: {
devDependencies: {
- '@ember/jquery': '^0.5.2',
'ember-source': '~2.18.0'
}
} | also disable for the ember try sections | adopted-ember-addons_ember-pikaday | train | js |
0b7eff197c2de648e8dc6cb24cf3acf763290ae9 | diff --git a/src/Schema/Type/TypeReference.php b/src/Schema/Type/TypeReference.php
index <HASH>..<HASH> 100644
--- a/src/Schema/Type/TypeReference.php
+++ b/src/Schema/Type/TypeReference.php
@@ -80,8 +80,6 @@ class TypeReference
if (empty($path)) {
return false;
}
- // Remove the named type
- array_pop($path);
return in_array($nodeKind, $path);
} | BUGFIX: hasWrapper() unnecessarily popping the path | silverstripe_silverstripe-graphql | train | php |
b1271a0e6daa3d1d385a5c522f33b7dd31054076 | diff --git a/src/Traits/HasRole.php b/src/Traits/HasRole.php
index <HASH>..<HASH> 100644
--- a/src/Traits/HasRole.php
+++ b/src/Traits/HasRole.php
@@ -135,7 +135,9 @@ trait HasRole
}
/**
- * @param $query
+ * Query scope for user having the given roles.
+ *
+ * @param \Illuminate\Database\Eloquent\Builder $query
* @param array $roles
* @return mixed
*/
@@ -152,7 +154,7 @@ trait HasRole
/**
* Revokes the given role from the user using slug.
*
- * @param $slug
+ * @param string $slug
* @return bool
*/
public function revokeRoleBySlug($slug)
@@ -165,7 +167,7 @@ trait HasRole
/**
* Revokes the given role from the user.
*
- * @param $role
+ * @param mixed $role
* @return bool
*/
public function revokeRole($role = "") | Update doc blocks and bump <I> | yajra_laravel-acl | train | php |
f883b64dae5f32aad8e54525ce6912f3aad60474 | diff --git a/sitetree/admin.py b/sitetree/admin.py
index <HASH>..<HASH> 100644
--- a/sitetree/admin.py
+++ b/sitetree/admin.py
@@ -1,6 +1,9 @@
from django.conf import settings as django_settings
from django import VERSION as django_version
-from django.urls import get_urlconf, get_resolver
+try:
+ from django.urls import get_urlconf, get_resolver
+except ImportError:
+ from django.conf.urls import get_urlconf, get_resolver
from django.utils.translation import ugettext_lazy as _
from django.utils import six
from django.http import HttpResponseRedirect | added backward compatiblity
this adds compatibility with django prior to <I> | idlesign_django-sitetree | train | py |
5cbf3db264472c582d14613f743c400db6bbf988 | diff --git a/initializers/initRedis.js b/initializers/initRedis.js
index <HASH>..<HASH> 100644
--- a/initializers/initRedis.js
+++ b/initializers/initRedis.js
@@ -194,9 +194,8 @@ var initPingAndCheck = function(api, next){
// start timers
api.redis.ping(api, function(){
- api.redis.checkForDroppedPeers(api, function(){
- next();
- });
+ api.redis.lostPeerTimer = setTimeout(api.redis.checkForDroppedPeers, api.redis.lostPeerCheckTime, api);
+ next();
});
} | delay first peer check until tasks have been loaded | actionhero_actionhero | train | js |
2b0890821b8943959a563ec161df26d67cfc0629 | diff --git a/lib/db.js b/lib/db.js
index <HASH>..<HASH> 100644
--- a/lib/db.js
+++ b/lib/db.js
@@ -22,7 +22,7 @@ exports.index = function (collection) {
// Ensures there's a reasonable index for the poling dequeue
// Status is first b/c querying by status = queued should be very selective
- collection.ensureIndex({ status: 1, queue: 1, priority: 1, _id: 1, delay: 1 }, function (err) {
+ collection.ensureIndex({ status: 1, queue: 1, priority: -1, _id: 1, delay: 1 }, function (err) {
if (err) console.error(err);
});
}; | Switch sort direction of index in order to improve performance | scttnlsn_monq | train | js |
7ad6074e36296936f85b740c57587ace621f5eed | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,6 @@ setuptools.setup(
keywords="example boilerplate",
packages=setuptools.find_packages(exclude=["tests", "tests.*"]),
install_requires=[],
- test_suite="tests",
entry_points={
"console_scripts": [
"boilerplate_script = boilerplate.script:main"
diff --git a/tests/test_example.py b/tests/test_example.py
index <HASH>..<HASH> 100644
--- a/tests/test_example.py
+++ b/tests/test_example.py
@@ -1,7 +1,11 @@
-import unittest
+import pytest
-class TestExample(unittest.TestCase):
+class TestExample(object):
def test_example(self):
- self.assertTrue(True)
+ assert True, "This should not fail"
+
+ @pytest.mark.xfail
+ def test_failing(self):
+ assert False, "This will always fail"
diff --git a/tox.ini b/tox.ini
index <HASH>..<HASH> 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,7 +2,8 @@
envlist = py27,py3
[testenv]
deps = coverage
+ pytest
commands = coverage erase
- coverage run setup.py test
+ coverage run -m py.test
coverage report
coverage html | tests: switch to py.test | ateliedocodigo_eve-healthcheck | train | py,py,ini |
96fc8edb229aa09cf67f49dc12c7cb8c5b8c69ed | diff --git a/Test/FunctionalTestCase.php b/Test/FunctionalTestCase.php
index <HASH>..<HASH> 100755
--- a/Test/FunctionalTestCase.php
+++ b/Test/FunctionalTestCase.php
@@ -11,9 +11,11 @@ class FunctionalTestCase extends WebTestCase
$env = 'test';
$app = require __DIR__.'/../bootstrap.php';
- $app["swiftmailer.transport"] = new \Swift_Transport_NullTransport($app['swiftmailer.transport.eventdispatcher']);
- $app['mailer.logger'] = new MessageLogger();
- $app['mailer']->registerPlugin($app['mailer.logger']);
+ if (isset($app['swiftmailer.transport.eventdispatcher'])) {
+ $app["swiftmailer.transport"] = new \Swift_Transport_NullTransport($app['swiftmailer.transport.eventdispatcher']);
+ $app['mailer.logger'] = new MessageLogger();
+ $app['mailer']->registerPlugin($app['mailer.logger']);
+ }
$app['debug'] = true;
$app['exception_handler']->disable(); | fix tests when swiftmailer is not used | orthes_marvin | train | php |
9497693b64cd45963a9316464dd9f194b60cb556 | diff --git a/select2.js b/select2.js
index <HASH>..<HASH> 100755
--- a/select2.js
+++ b/select2.js
@@ -203,7 +203,7 @@
function measureTextWidth(e) {
if (!sizer){
- var style = e.currentStyle || window.getComputedStyle(e, null);
+ var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
sizer = $("<div></div>").css({
position: "absolute",
left: "-1000px", | style detection for search field sizer corrected | select2_select2 | train | js |
c17ea2380951c0a0104884a7b5d90470b0568568 | diff --git a/test/replication-test.js b/test/replication-test.js
index <HASH>..<HASH> 100644
--- a/test/replication-test.js
+++ b/test/replication-test.js
@@ -51,7 +51,7 @@ test('simple read from replicator (no ops)', function (t) {
i++
})
.on('end', function () {
- t.equal(i, 3434)
+ t.equal(i, 3130)
})
})
@@ -93,7 +93,7 @@ test('simple read from replicated index (no ops)', function (t) {
i++
})
.on('end', function () {
- t.equal(i, 3434)
+ t.equal(i, 3130)
})
})
@@ -138,7 +138,7 @@ test('validate gzip replication', function (t) {
i++
})
.on('end', function () {
- t.equal(i, 3434)
+ t.equal(i, 3130)
})
}) | test(replication): correct number of keys | fergiemcdowall_search-index-adder | train | js |
ea0c8d8e8c6dee5b207ead22fd20d6ba195eb7ea | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import find_packages
import os
-_version = '0.5.4'
+_version = '0.6'
_packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
_short_description = "pylint-django is a Pylint plugin to aid Pylint in recognising and understanding" \ | Moving development version back to <I> after merge from master | PyCQA_pylint-django | train | py |
787c86b4b358f2cbc17c937b3fa1a2e157119484 | diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -969,7 +969,7 @@ func (c *Client) do(r *Request) (resp *Response, err error) {
if r.Headers == nil {
header = make(http.Header)
} else {
- header = r.Headers.Clone()
+ header = r.Headers
}
contentLength := int64(len(r.body)) | avoid concurrent map iteration and map write(fix #<I>) | imroc_req | train | go |
8be5ffd017c56b4dd0750e374f098b04e4d0ac31 | diff --git a/mruby.go b/mruby.go
index <HASH>..<HASH> 100644
--- a/mruby.go
+++ b/mruby.go
@@ -90,5 +90,9 @@ func (m *Mrb) LoadString(code string) (*Value, error) {
// Close a Mrb, this must be called to properly free resources, and
// should only be called once.
func (m *Mrb) Close() {
+ // Delete all the methods from the state
+ delete(stateMethodTable, m.state)
+
+ // Close the state
C.mrb_close(m.state)
} | Clean up the method table on state close | mitchellh_go-mruby | train | go |
ddd0330263f3ba47260e80ef11ac293c1a8937b4 | diff --git a/sphinxcontrib/spelling/filters.py b/sphinxcontrib/spelling/filters.py
index <HASH>..<HASH> 100644
--- a/sphinxcontrib/spelling/filters.py
+++ b/sphinxcontrib/spelling/filters.py
@@ -7,7 +7,7 @@
# TODO - Words with multiple uppercase letters treated as classes and ignored
import builtins
-import imp
+import importlib
import subprocess
import sys
from xmlrpc import client as xmlrpc_client
@@ -189,13 +189,18 @@ class ImportableModuleFilter(Filter):
if word not in self.sought_modules:
self.sought_modules.add(word)
try:
- module_file, _, _ = imp.find_module(word)
- except ImportError:
- pass
+ mod = importlib.util.find_spec(word)
+ except Exception as err:
+ # This could be an ImportError, some more detailed
+ # error out of distutils, or something else triggered
+ # by failing to be able to import a parent package to
+ # use the metadata to search for a subpackage.
+ logger.debug(
+ 'find_spec({!r}) failed, invalid module name: {}'.format(
+ word, err))
else:
- if module_file is not None:
- module_file.close()
- self.found_modules.add(word)
+ if mod is not None:
+ self.found_modules.add(word)
return word in self.found_modules | filters: do not use imp in ImportableModuleFilter
The imp module is deprecated, so replace it with calls to importlib. | sphinx-contrib_spelling | train | py |
f1bf2f4a2b4c25f83d3fbeebad386c0e7518f593 | diff --git a/packages/avet-shared/src/httpclient.js b/packages/avet-shared/src/httpclient.js
index <HASH>..<HASH> 100644
--- a/packages/avet-shared/src/httpclient.js
+++ b/packages/avet-shared/src/httpclient.js
@@ -18,6 +18,8 @@ export function getHttpClient(ctx, options = {}) {
Object.keys(headers).forEach(key => {
axios.defaults.headers.common[key] = headers[key];
});
+ // 设置 ip
+ axios.defaults.headers.common['X-Forwarded-For'] = ctx.ip;
}
const baseURL = getBaseURL(ctx); | feat: httpclient setting ip headers | avetjs_avet | train | js |
854c43b86ed7a94c0f6ffa9f6a9e9092902efc09 | diff --git a/examples/slurm_at_maxwell/analysis/framework.py b/examples/slurm_at_maxwell/analysis/framework.py
index <HASH>..<HASH> 100644
--- a/examples/slurm_at_maxwell/analysis/framework.py
+++ b/examples/slurm_at_maxwell/analysis/framework.py
@@ -54,6 +54,12 @@ class SlurmWorkflow(law.slurm.SlurmWorkflow):
significant=False,
description="target queue partition; default: cms-uhh",
)
+ max_runtime = law.DurationParameter(
+ default=1.0,
+ unit="h",
+ significant=False,
+ description="the maximum job runtime; default unit is hours; default: 1h",
+ )
def slurm_output_directory(self):
# the directory where submission meta data should be stored
@@ -69,10 +75,11 @@ class SlurmWorkflow(law.slurm.SlurmWorkflow):
config.render_variables["analysis_path"] = os.getenv("ANALYSIS_PATH")
# useful defaults
- config.custom_content.append(("time", "00:10:00"))
+ job_time = law.util.human_duration(
+ seconds=law.util.parse_duration(self.max_runtime, input_unit="h") - 1,
+ colon_format=True,
+ )
+ config.custom_content.append(("time", job_time))
config.custom_content.append(("nodes", 1))
- # # copy the entire environment
- # config.custom_content.append(("export", "ALL"))
-
return config | Update slurm example. | riga_law | train | py |
15174863d7a57220405b7f41cdf4b19341cabc6a | diff --git a/contrib/externs/chrome_extensions.js b/contrib/externs/chrome_extensions.js
index <HASH>..<HASH> 100644
--- a/contrib/externs/chrome_extensions.js
+++ b/contrib/externs/chrome_extensions.js
@@ -317,6 +317,21 @@ chrome.app.window.AppWindow.prototype.getBounds = function() {};
chrome.app.window.AppWindow.prototype.setBounds = function(bounds) {};
+/**
+ * @return {boolean}
+ * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
+ */
+chrome.app.window.AppWindow.prototype.isAlwaysOnTop = function() {};
+
+
+/**
+ * @param {boolean} alwaysOnTop Set whether the window should stay above most
+ * other windows.
+ * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
+ */
+chrome.app.window.AppWindow.prototype.setAlwaysOnTop = function(alwaysOnTop) {};
+
+
/** @type {ChromeEvent} */
chrome.app.window.AppWindow.prototype.onBoundsChanged; | Add alwaysOnTop methods to Chrome app window extern definitions.
-------------
Created by MOE: <URL> | google_closure-compiler | train | js |
22d5309d2a10276448894552550b3cfa9158db27 | diff --git a/engine.go b/engine.go
index <HASH>..<HASH> 100644
--- a/engine.go
+++ b/engine.go
@@ -101,13 +101,18 @@ func (eng *Engine) Observe(name string, value interface{}, tags ...Tag) {
// Clock returns a new clock identified by name and tags.
func (eng *Engine) Clock(name string, tags ...Tag) *Clock {
+ return eng.ClockAt(name, time.Now(), tags...)
+}
+
+// ClockAt returns a new clock identified by name and tags with a specified
+// start time.
+func (eng *Engine) ClockAt(name string, start time.Time, tags ...Tag) *Clock {
cpy := make([]Tag, len(tags), len(tags)+1) // clock always appends a stamp.
copy(cpy, tags)
- now := time.Now()
return &Clock{
name: name,
- first: now,
- last: now,
+ first: start,
+ last: start,
tags: cpy,
eng: eng,
} | feat(engine): add ClockAt for creating a clock with a specific start time (#<I>) | segmentio_stats | train | go |
498d7f084dc1717cd34eacfb9fe5a26984623498 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -63,7 +63,7 @@ setup(
* Repository: https://github.com/datamade/dedupe
* Issues: https://github.com/datamade/dedupe/issues
* Mailing list: https://groups.google.com/forum/#!forum/open-source-deduplication
- * IRC channel, #dedupe on irc.freenode.net
+ * IRC channel, `#dedupe on irc.freenode.net <http://webchat.freenode.net/?channels=dedupe>`_
* Examples: https://github.com/datamade/dedupe-examples
"""
) | add link to webchat for irc channel in long description | dedupeio_dedupe | train | py |
13f241421009f93b91126c6cc09852193dd1f321 | diff --git a/pytorch2keras/operation_layers.py b/pytorch2keras/operation_layers.py
index <HASH>..<HASH> 100644
--- a/pytorch2keras/operation_layers.py
+++ b/pytorch2keras/operation_layers.py
@@ -139,9 +139,13 @@ def convert_clip(params, w_name, scope_name, inputs, layers, weights, names):
"""
print('Converting clip ...')
- def target_layer(x, vmin=params['min'], vmax=params['max']):
- import tensorflow as tf
- return tf.clip_by_value(x, vmin, vmax)
+ if params['min'] == 0:
+ print("using ReLU({0})".format(params['max']))
+ layer = keras.layers.ReLU(max_value=params['max'])
+ else:
+ def target_layer(x, vmin=params['min'], vmax=params['max']):
+ import tensorflow as tf
+ return tf.clip_by_value(x, vmin, vmax)
+ layer = keras.layers.Lambda(target_layer)
- lambda_layer = keras.layers.Lambda(target_layer)
- layers[scope_name] = lambda_layer(layers[inputs[0]])
+ layers[scope_name] = layer(layers[inputs[0]]) | Converting clip with a min value of 0 as a ReLU | nerox8664_pytorch2keras | train | py |
80c64fc77fbdb807d07be8f92b0a6ead4c445319 | diff --git a/user/edit.php b/user/edit.php
index <HASH>..<HASH> 100644
--- a/user/edit.php
+++ b/user/edit.php
@@ -19,7 +19,7 @@
require_login($course);
} else if (!isloggedin()) {
if (empty($SESSION->wantsurl)) {
- $SESSION->wantsurl = $CFG->httpswwwroot.'/edit/user.php';
+ $SESSION->wantsurl = $CFG->httpswwwroot.'/user/edit.php';
}
redirect($CFG->httpswwwroot.'/login/index.php');
} | MDL-<I> edit/user.php typo; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
87f5c484ab518c43cc9e22ab7feb1df6b6934dbd | diff --git a/datatable/dt.py b/datatable/dt.py
index <HASH>..<HASH> 100644
--- a/datatable/dt.py
+++ b/datatable/dt.py
@@ -175,18 +175,16 @@ class DataTable(object):
if names is None:
names = srcdt.names
self._fill_from_dt(srcdt.internal, names=names)
- elif is_type(src, PandasDataFrame_t):
- self._fill_from_pandas(src, names)
- elif is_type(src, PandasSeries_t):
- self._fill_from_pandas(src, names)
- elif is_type(src, NumpyArray_t):
- self._fill_from_numpy(src, names=names)
elif src is None:
self._fill_from_list([])
elif is_type(src, DataTable_t):
if names is None:
names = src.names
self._fill_from_dt(src.internal, names=names)
+ elif is_type(src, PandasDataFrame_t, PandasSeries_t):
+ self._fill_from_pandas(src, names)
+ elif is_type(src, NumpyArray_t):
+ self._fill_from_numpy(src, names=names)
else:
raise TTypeError("Cannot create DataTable from %r" % src) | Make import datatable faster (#<I>) | h2oai_datatable | train | py |
efef02f0a00122117a9f31a1f466b92efe9007e5 | diff --git a/anyconfig/backend/xml.py b/anyconfig/backend/xml.py
index <HASH>..<HASH> 100644
--- a/anyconfig/backend/xml.py
+++ b/anyconfig/backend/xml.py
@@ -386,7 +386,7 @@ def container_to_etree(obj, parent=None, **options):
_str = str if options.get("ac_parse_value") else anyconfig.utils.noop
if not anyconfig.mdicts.is_dict_like(obj):
- obj = _str(obj)
+ obj = False if obj is None else _str(obj)
if parent is not None and obj:
parent.text = obj # Parent is a leaf text node.
return # All attributes and text should be set already. | fix: correct processing of cases if is None (no text) in XML backend | ssato_python-anyconfig | train | py |
2a41b5332375378f6f25b03d06a59cf530849609 | diff --git a/src/naomi.js b/src/naomi.js
index <HASH>..<HASH> 100644
--- a/src/naomi.js
+++ b/src/naomi.js
@@ -37,11 +37,11 @@ exports.create = function (type, props) {
if (/postgres/i.test(type)) {
return new PostgresDatabase({
- host: props.host || process.env.MYSQL_HOST || 'localhost',
- port: props.port || parseInt(process.env.MYSQL_PORT, 10) || 5432,
- user: props.user || process.env.MYSQL_USER || 'root',
- password: props.password || process.env.MYSQL_PASSWORD || '',
- database: props.database || process.env.MYSQL_DATABASE || null,
+ host: props.host || process.env.POSTGRES_HOST || 'localhost',
+ port: props.port || parseInt(process.env.POSTGRES_PORT, 10) || 5432,
+ user: props.user || process.env.POSTGRES_USER || 'root',
+ password: props.password || process.env.POSTGRES_PASSWORD || '',
+ database: props.database || process.env.POSTGRES_DATABASE || null,
connectionLimit: props.connectionLimit || props.poolSize || 10, // connectionLimit used to be poolSize
poolIdleTimeout: 30000,
reapIntervalMillis: 1000 | This is what happens when you don't run the unit tests. Shaaaaaaa.... | jmike_naomi | train | js |
980ca5fd97d3fdede577aa3d26bca721441090ae | diff --git a/quilt/refresh.py b/quilt/refresh.py
index <HASH>..<HASH> 100644
--- a/quilt/refresh.py
+++ b/quilt/refresh.py
@@ -63,6 +63,11 @@ class Refresh(Command):
with TmpFile(prefix="pquilt-") as tmpfile:
f = tmpfile.open()
+
+ if patch_file.exists():
+ header = patch.get_header(self.quilt_patches)
+ tmpfile.write(header)
+
for file_name in files:
if file_name == ".timestamp":
continue | Don't omit header from current patch in refresh
Add the current header when trying to refreshing a patch. | bjoernricks_python-quilt | train | py |
d896a007a48b4bcd58e215a07f6bab0efde27521 | diff --git a/test/activerecord_test.rb b/test/activerecord_test.rb
index <HASH>..<HASH> 100644
--- a/test/activerecord_test.rb
+++ b/test/activerecord_test.rb
@@ -174,10 +174,11 @@ describe Enumerize::ActiveRecordSupport do
end
it 'sets value to enumerized field from db when record is reloaded' do
- user = InterestsRequiredUser.create!(interests: [:music])
- user.update(interests: [])
+ user = User.create!(interests: [:music])
+ User.find(user.id).update(interests: %i[music dancing])
+ user.interests.must_equal %w[music]
user.reload
- user.interests.must_equal ['music']
+ user.interests.must_equal %w[music dancing]
end
it 'validates inclusion when using write_attribute with string attribute' do | make AR reload support test more obvious | brainspec_enumerize | train | rb |
eb9f250725c171ff254529c4ddff6a2d41af314b | diff --git a/src/js/Node.js b/src/js/Node.js
index <HASH>..<HASH> 100644
--- a/src/js/Node.js
+++ b/src/js/Node.js
@@ -571,8 +571,10 @@ Node.prototype.clone = function() {
clone.field = this.field;
clone.fieldInnerText = this.fieldInnerText;
clone.fieldEditable = this.fieldEditable;
+ clone.previousField = this.previousField;
clone.value = this.value;
clone.valueInnerText = this.valueInnerText;
+ clone.previousValue = this.previousValue;
clone.expanded = this.expanded;
clone.visibleChilds = this.visibleChilds; | Fixed `clone` not copying `previousField` and `previousValue` | josdejong_jsoneditor | train | js |
f23665b22bf96eabdfbfc95f20348c9475e85ecd | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -222,7 +222,7 @@ function rebuild(psModule) {
if (!Array.isArray(res.result)) {
return res.resultType === 'success'
? resolve(psModule)
- : reject(res.result)
+ : reject(res)
}
Promise.map(res.result, (item, i) => {
@@ -232,7 +232,7 @@ function rebuild(psModule) {
.then(compileMessages => {
if (res.resultType === 'error') {
cache.errors = compileMessages
- reject(res.result)
+ reject(res)
} else {
cache.warnings = compileMessages
resolve(psModule) | Recompile on when psc-client-ide receives UnknownModule. | ethul_purs-loader | train | js |
b71225a503fcf2c8a69c2f2a5deab2f495f13af0 | diff --git a/src/Console/Application.php b/src/Console/Application.php
index <HASH>..<HASH> 100644
--- a/src/Console/Application.php
+++ b/src/Console/Application.php
@@ -31,10 +31,6 @@ class Application extends BaseApplication
*/
protected $directoryRoot;
/**
- * @var array
- */
- protected $errorMessages = [];
- /**
* @var \Composer\Autoload\ClassLoader
* The Drupal autoload file.
*/
@@ -249,12 +245,4 @@ class Application extends BaseApplication
$defaultHelperset->set($helper, is_int($alias) ? null : $alias);
}
}
-
- /**
- * @param array $errorMessages
- */
- public function addErrorMessages(array $errorMessages)
- {
- $this->errorMessages = $errorMessages;
- }
} | #<I> Remove messages feature from Application class | hechoendrupal_drupal-console | train | php |
d8910ce217514b6cadb803e0951859456bafa1e9 | diff --git a/lib/multi_exiftool/values.rb b/lib/multi_exiftool/values.rb
index <HASH>..<HASH> 100644
--- a/lib/multi_exiftool/values.rb
+++ b/lib/multi_exiftool/values.rb
@@ -1,5 +1,7 @@
# coding: utf-8
require 'date'
+require 'set'
+
module MultiExiftool
# Representing (tag, value) pairs of metadata.
@@ -7,9 +9,13 @@ module MultiExiftool
# method_missing.
class Values
+ attr_reader :tags
+
def initialize values
@values = {}
+ @tags = Set.new
values.map do |tag,val|
+ @tags << tag
val = val.kind_of?(Hash) ? Values.new(val) : val
@values[Values.unify_tag(tag)] = val
end
diff --git a/test/test_values.rb b/test/test_values.rb
index <HASH>..<HASH> 100644
--- a/test/test_values.rb
+++ b/test/test_values.rb
@@ -79,4 +79,14 @@ class TestValues < Test::Unit::TestCase
end
+ context 'tags' do
+
+ test 'tags preserves the original tag names' do
+ hash = {'FNumber' => 8, 'Author' => 'janfri', 'E-MailAddress' => 'janfri26@gmail.com'}
+ @values = MultiExiftool::Values.new(hash)
+ assert_equal hash.keys, @values.tags.to_a
+ end
+
+ end
+
end | New method Values#tags to get access to unmodified tag names. | janfri_multi_exiftool | train | rb,rb |
67bf96009942c86e90db24848ab17f3df43d6e4b | diff --git a/lib/algoliasearch-rails.rb b/lib/algoliasearch-rails.rb
index <HASH>..<HASH> 100644
--- a/lib/algoliasearch-rails.rb
+++ b/lib/algoliasearch-rails.rb
@@ -658,7 +658,7 @@ module AlgoliaSearch
algolia_object_id_of(hit)
end
results = json['hits'].map do |hit|
- o = results_by_id[hit['objectID']]
+ o = results_by_id[hit['objectID'].to_s]
if o
o.highlight_result = hit['_highlightResult']
o.snippet_result = hit['_snippetResult'] | Convert objectID to string when using as hash key | algolia_algoliasearch-rails | train | rb |
bcf9e3131f07f0ddba8a08bd2490a8d4b2f816ed | diff --git a/languagetool-language-modules/br/src/main/java/org/languagetool/tagging/br/BretonTagger.java b/languagetool-language-modules/br/src/main/java/org/languagetool/tagging/br/BretonTagger.java
index <HASH>..<HASH> 100644
--- a/languagetool-language-modules/br/src/main/java/org/languagetool/tagging/br/BretonTagger.java
+++ b/languagetool-language-modules/br/src/main/java/org/languagetool/tagging/br/BretonTagger.java
@@ -70,6 +70,14 @@ public class BretonTagger extends BaseTagger {
Matcher matcher;
for (String word : sentenceTokens) {
String probeWord = word;
+ if (probeWord.length() > 50) {
+ // avoid excessively long computation times for long (probably artificial) tokens:
+ List<AnalyzedToken> l = new ArrayList<>();
+ l.add(new AnalyzedToken(word, null, null));
+ tokenReadings.add(new AnalyzedTokenReadings(l, pos));
+ pos += word.length();
+ continue;
+ }
// This loop happens when we need to retry probing the dictionary
// which happens rarely when trying to remove suffixes -mañ, -se, etc. | [br] avoid excessively long computation times for long (probably artificial) tokens | languagetool-org_languagetool | train | java |
0a0e05093aa332541f71edb5785af9e300c314b7 | diff --git a/angr/vexer.py b/angr/vexer.py
index <HASH>..<HASH> 100644
--- a/angr/vexer.py
+++ b/angr/vexer.py
@@ -171,6 +171,8 @@ class VEXer:
:return:
'''
+ block.statements = [ x for x in block.statements if x.tag != 'Ist_NoOp' ]
+
funcname = "_post_process_%s" % self.arch.name
if hasattr(self, funcname):
block = getattr(self, funcname)(block) | Move de-nopping into vexer | angr_angr | train | py |
43807c63e6d4254bb7fbcf6a8ad6dc53ad8b3404 | diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb
index <HASH>..<HASH> 100644
--- a/lib/linguist/language.rb
+++ b/lib/linguist/language.rb
@@ -9,6 +9,7 @@ module Linguist
# Langages are defined in `lib/linguist/langages.yml`.
class Language
@languages = []
+ @index = {}
@name_index = {}
@alias_index = {}
@extension_index = {}
@@ -30,7 +31,7 @@ module Linguist
end
# Language name index
- @name_index[language.name] = language
+ @index[language.name] = @name_index[language.name] = language
language.aliases.each do |name|
# All Language aliases should be unique. Warn if there is a duplicate.
@@ -38,7 +39,7 @@ module Linguist
warn "Duplicate alias: #{name}"
end
- @alias_index[name] = language
+ @index[name] = @alias_index[name] = language
end
language.extensions.each do |extension|
@@ -134,6 +135,8 @@ module Linguist
#
# name - The String name of the Language
#
+ # TODO: Consider returning nil instead of Text
+ #
# Examples
#
# Language['Ruby']
@@ -142,9 +145,9 @@ module Linguist
# Language['ruby']
# # => #<Language name="Ruby">
#
- # Returns the Language or nil if none was found.
+ # Returns the Language or Text if none was found.
def self.[](name)
- find_by_name(name) || find_by_alias(name) || self['Text']
+ @index[name] || self['Text']
end
# Public: A List of popular languages | Create a separate index for lookup | github_linguist | train | rb |
8b33a95dd0fd7ccee82cc7677fc3e2f0d9d07227 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -22,5 +22,5 @@ setup(
py_modules=["SAM","utilities"],
- install_requires=['pandas','numpy','scikit-learn','matplotlib','scipy']
+ install_requires=['pandas','numpy','scikit-learn','matplotlib','scipy','anndata','scanpy']
) | added anndata and scanpy requirements | atarashansky_self-assembling-manifold | train | py |
01bb69ab4fa710bbb13ac3758ccc83b7fe750a7e | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -7,6 +7,8 @@ module.exports = {
'avoid-leaking-state-in-components': require('./rules/avoid-leaking-state-in-components'),
'avoid-leaking-state-in-ember-objects': require('./rules/avoid-leaking-state-in-ember-objects'),
'avoid-using-needs-in-controllers': require('./rules/avoid-using-needs-in-controllers'),
+ 'classic-decorator-hooks': require('./rules/classic-decorator-hooks'),
+ 'classic-decorator-no-classic-methods': require('./rules/classic-decorator-no-classic-methods'),
'closure-actions': require('./rules/closure-actions'),
'jquery-ember-run': require('./rules/jquery-ember-run'),
'local-modules': require('./rules/local-modules'), | fix: add missing rules `classic-decorator-hooks` and `classic-decorator-no-classic-methods` to index.js | ember-cli_eslint-plugin-ember | train | js |
1c70b34c29e04d68732621a19c612ac782f50f87 | diff --git a/src/cli/cli.js b/src/cli/cli.js
index <HASH>..<HASH> 100644
--- a/src/cli/cli.js
+++ b/src/cli/cli.js
@@ -110,7 +110,7 @@ class Cli extends mix(Configurable, Emitter) {
exec(){
_.forEach(requireAll(this._commandsDir), c => this.command(c.command, c.action, c.config || {}));
- return arguments.length ? this._execFromString.apply(Array.from(arguments)) : this._execFromArgv();
+ return arguments.length ? this._execFromString.apply(this, Array.from(arguments)) : this._execFromArgv();
}
theme(theme) { | Fix to failing exec() method | frctl_fractal | train | js |
2d1e9f3b7696a45ed8e48a624a33d662cb99e5cb | diff --git a/lib/yard/parser/ruby/legacy/ruby_lex.rb b/lib/yard/parser/ruby/legacy/ruby_lex.rb
index <HASH>..<HASH> 100644
--- a/lib/yard/parser/ruby/legacy/ruby_lex.rb
+++ b/lib/yard/parser/ruby/legacy/ruby_lex.rb
@@ -599,7 +599,7 @@ module YARD
end
@OP.def_rules(" ", "\t", "\f", "\r", "\13") do |chars, _io|
- @space_seen = TRUE
+ @space_seen = true
while (ch = getc) =~ /[ \t\f\r\13]/
chars << ch
end
@@ -642,9 +642,9 @@ module YARD
@colonblock_seen = false
case @lex_state
when EXPR_BEG, EXPR_FNAME, EXPR_DOT
- @continue = TRUE
+ @continue = true
else
- @continue = FALSE
+ @continue = false
@lex_state = EXPR_BEG
end
Token(TkNL).set_text("\n")
@@ -1166,8 +1166,8 @@ module YARD
end
type = TkINTEGER
- allow_point = TRUE
- allow_e = TRUE
+ allow_point = true
+ allow_e = true
while ch = getc
case ch
when /[0-9_]/ | Replace deprecated TRUE and FALSE constants with their equivalents. | lsegal_yard | train | rb |
4bfcd8db1091d76699adc3e933c722d20620d1c2 | diff --git a/addon/file.js b/addon/file.js
index <HASH>..<HASH> 100644
--- a/addon/file.js
+++ b/addon/file.js
@@ -74,11 +74,11 @@ function upload(file, url, opts, uploadFn) {
}
request.onprogress = function (evt) {
- if (evt.lengthComputable) {
- set(file, 'loaded', evt.loaded);
- set(file, 'size', evt.total);
- set(file, 'progress', (evt.loaded / evt.total) * 100);
- }
+ if (!evt.lengthComputable || evt.total === 0) return;
+
+ set(file, 'loaded', evt.loaded);
+ set(file, 'size', evt.total);
+ set(file, 'progress', (evt.loaded / evt.total) * 100);
};
request.ontimeout = function () { | Ignore progress events when the total file size is reported as 0 bytes (#<I>)
Have tested this manually using the docs site. Wasn't able to reproduce a NaN value.
### Before
Drop a file
Progresses from 0 => <I>%
Progress set back to 0% for a moment
Finishes
### After
Drop a file
Progresses from 0 => <I>%
Progress stays at <I>% for a moment
Finishes
Fixes #<I> | adopted-ember-addons_ember-file-upload | train | js |
088fcf39df6bf13cf84ce5b6593312a9c6c90e0f | diff --git a/maintain/release/cocoapods.py b/maintain/release/cocoapods.py
index <HASH>..<HASH> 100644
--- a/maintain/release/cocoapods.py
+++ b/maintain/release/cocoapods.py
@@ -39,7 +39,7 @@ class CocoaPodsReleaser(Releaser):
def bump(self, new_version):
with open(self.podspec) as fp:
spec = json.load(fp, object_pairs_hook=collections.OrderedDict)
- spec['version'] = new_version
+ spec['version'] = str(new_version)
with open(self.podspec, 'w') as fp:
json.dump(spec, fp, indent=2, separators=(',', ': '))
diff --git a/maintain/release/npm.py b/maintain/release/npm.py
index <HASH>..<HASH> 100644
--- a/maintain/release/npm.py
+++ b/maintain/release/npm.py
@@ -14,7 +14,7 @@ class NPMReleaser(Releaser):
def bump(self, new_version):
with open('package.json') as fp:
spec = json.load(fp, object_pairs_hook=collections.OrderedDict)
- spec['version'] = new_version
+ spec['version'] = str(new_version)
with open('package.json', 'w') as fp:
json.dump(spec, fp, indent=2, separators=(',', ': ')) | [release] Fix issue releasing CP and NPM | kylef_maintain | train | py,py |
3a153ab2f0b0e29ebb811aef62e2efc404aa28c4 | diff --git a/src/components/zoombuttonlist/zoombuttonlist.js b/src/components/zoombuttonlist/zoombuttonlist.js
index <HASH>..<HASH> 100644
--- a/src/components/zoombuttonlist/zoombuttonlist.js
+++ b/src/components/zoombuttonlist/zoombuttonlist.js
@@ -77,12 +77,6 @@ var ZoomButtonList = Component.extend({
}
this.model_binds = {};
-
- this._super(config, context);
-
- if(this.model.ui.cursorMode == undefined) {
- this.model.ui.set('cursorMode', null, false, false);
- }
Object.keys(this._available_buttons).forEach(function(buttonId) {
var button = _this._available_buttons[buttonId];
@@ -93,7 +87,8 @@ var ZoomButtonList = Component.extend({
}
});
-
+ this._super(config, context);
+
},
readyOnce: function() { | Fix zoomButtonList unresponsive button styling | vizabi_vizabi | train | js |
b874c392d320d57cee943abfd55975f652dc6d37 | diff --git a/h2o-py/h2o/job.py b/h2o-py/h2o/job.py
index <HASH>..<HASH> 100644
--- a/h2o-py/h2o/job.py
+++ b/h2o-py/h2o/job.py
@@ -79,11 +79,12 @@ class H2OJob(object):
symbols_remaining = width - last_display_amnt
if estimated_finish_time > last_display_time:
display_speed = symbols_remaining / (estimated_finish_time - last_display_time)
- next_display_time = last_display_time + 1 / max(display_speed, 1)
+ next_display_time = last_display_time + 1 / max(min(display_speed, 100), 1)
else:
display_speed = 0
next_display_time = next_poll_time + 1 # Force polling before displaying an update
- if next_poll_time <= next_display_time:
+ # Polling should always occur if it is past due -- takes precedence over displaying
+ if next_poll_time <= min(current_time, next_display_time):
if next_poll_time > current_time:
time.sleep(next_poll_time - current_time)
poll_interval = min(1, poll_interval + 0.2) | Prevent accidental dead-locking in job.py poll() | h2oai_h2o-3 | train | py |
1f2f87c47cae9a0f1f02025be6ee81b06ba6ed09 | diff --git a/chess/__init__.py b/chess/__init__.py
index <HASH>..<HASH> 100644
--- a/chess/__init__.py
+++ b/chess/__init__.py
@@ -1376,7 +1376,7 @@ class Board(BaseBoard):
Use :func:`~chess.Board.is_valid()` to detect invalid positions.
"""
- aliases = ["Standard", "Chess", "Classical", "Normal", "Illegal"]
+ aliases = ["Standard", "Chess", "Classical", "Normal", "Illegal", "From Position"]
uci_variant: ClassVar[Optional[str]] = "chess"
xboard_variant: ClassVar[Optional[str]] = "normal"
starting_fen = STARTING_FEN | Add From Position as alias for standard chess (fixes #<I>) | niklasf_python-chess | train | py |
263e8b9d2f36807db285027697b46d8bb598abfe | diff --git a/lib/monadic/maybe.rb b/lib/monadic/maybe.rb
index <HASH>..<HASH> 100644
--- a/lib/monadic/maybe.rb
+++ b/lib/monadic/maybe.rb
@@ -26,7 +26,7 @@ module Monadic
# @return [true, false] true if the underlying value is true
def truly?
- @value == true
+ !!@value == true
end
end | Use a double bang (double negation) to force @value to a boolean | pzol_monadic | train | rb |
c20f693a39bd080bd9f968fb68d438d6760339ec | diff --git a/build/webpack.dev.config.js b/build/webpack.dev.config.js
index <HASH>..<HASH> 100644
--- a/build/webpack.dev.config.js
+++ b/build/webpack.dev.config.js
@@ -62,7 +62,10 @@ module.exports = {
},
devServer: {
contentBase: resolve('../dev'),
- publicPath: '/dev/'
+ publicPath: '/dev/',
+ host: process.env.HOST || 'localhost',
+ port: process.env.PORT || '8080',
+ disableHostCheck: true
},
plugins: [
new ExtractTextPlugin({ | build(dev): Added ability to change port and host
Added the ability to specify a HOST or PORT through environment variables for the dev script | vuetifyjs_vuetify | train | js |
bdbc8ba6ae1e884d9d4c0b5a419196ed0bd5a8d1 | diff --git a/test/marker-index.test.js b/test/marker-index.test.js
index <HASH>..<HASH> 100644
--- a/test/marker-index.test.js
+++ b/test/marker-index.test.js
@@ -39,15 +39,19 @@ describe('MarkerIndex', () => {
if (MarkerIndex === NativeMarkerIndex) verifyHighestPossiblePaths()
}
- verifyRanges()
- testDump()
- testFindIntersecting()
- testFindContaining()
- testFindContainedIn()
- testFindStartingIn()
- testFindEndingIn()
- testFindStartingAt()
- testFindEndingAt()
+ const verifications = [
+ verifyRanges,
+ testDump,
+ testFindIntersecting,
+ testFindContaining,
+ testFindContainedIn,
+ testFindStartingIn,
+ testFindEndingIn,
+ testFindStartingAt,
+ testFindEndingAt,
+ ].sort((a, b) => random.intBetween(-1, 1))
+
+ verifications.forEach(verification => verification())
}
} | Perform test verifications in random order
This way, if any read-only method writes an invalid value to the cache, the
test will catch the error. | atom_superstring | train | js |
9dd625c18d419d292fbb261b3ffe0dd7da861232 | diff --git a/test/extended/util/test.go b/test/extended/util/test.go
index <HASH>..<HASH> 100644
--- a/test/extended/util/test.go
+++ b/test/extended/util/test.go
@@ -534,6 +534,8 @@ var (
// SDN-587: OVN-Kubernetes doesn't support hairpin services
`\[sig-network\] Services should allow pods to hairpin back to themselves through services`,
`\[sig-network\] Networking Granular Checks: Services should function for endpoint-Service`,
+ // https://github.com/ovn-org/ovn-kubernetes/issues/928
+ `\[sig-network\] Services should be rejected when no endpoints exist`,
},
"[Suite:openshift/scalability]": {},
// tests that replace the old test-cmd script | test/extended: skip "Services should be rejected when no endpoints exist" for OVNKubernetes
Not expected to work yet. Only recently was re-enabled for SDN too, so clearly
it's not a huge issue that the test fails (at least for now). | openshift_origin | train | go |
e79aba10d4c6c4eadd7dcc672a3d0d15e62b9969 | diff --git a/integration/images/volume-ownership/tools/get_owner_windows.go b/integration/images/volume-ownership/tools/get_owner_windows.go
index <HASH>..<HASH> 100644
--- a/integration/images/volume-ownership/tools/get_owner_windows.go
+++ b/integration/images/volume-ownership/tools/get_owner_windows.go
@@ -26,7 +26,7 @@ import (
func main() {
if len(os.Args) != 2 {
- fmt.Printf("Usage: %s file_or_directory\n", os.Args[0])
+ fmt.Println("Usage: get_owner_windows.exe file_or_directory")
os.Exit(1)
} | integration/images/volume-ownership: strip path information from usage output
POSIX guidelines describes; <URL> | containerd_containerd | train | go |
7810d888c1c40b9af7ac7f94b5798d9d54d9a446 | diff --git a/lib/stripe/util.rb b/lib/stripe/util.rb
index <HASH>..<HASH> 100644
--- a/lib/stripe/util.rb
+++ b/lib/stripe/util.rb
@@ -17,23 +17,26 @@ module Stripe
def self.object_classes
@object_classes ||= {
+ # data structures
+ 'list' => ListObject,
+
+ # business objects
+ 'application_fee' => ApplicationFee,
'balance' => Balance,
'balance_transaction' => BalanceTransaction,
+ 'card' => Card,
'charge' => Charge,
+ 'coupon' => Coupon,
'customer' => Customer,
+ 'event' => Event,
+ 'fee_refund' => ApplicationFeeRefund,
'invoiceitem' => InvoiceItem,
'invoice' => Invoice,
'plan' => Plan,
- 'coupon' => Coupon,
- 'event' => Event,
- 'transfer' => Transfer,
'recipient' => Recipient,
- 'card' => Card,
- 'subscription' => Subscription,
- 'list' => ListObject,
'refund' => Refund,
- 'application_fee' => ApplicationFee,
- 'fee_refund' => ApplicationFeeRefund
+ 'subscription' => Subscription,
+ 'transfer' => Transfer
}
end | formatting. alphabetize key-values by keys and add comments. | stripe_stripe-ruby | train | rb |
40e7a1d18c9feba215cb094a5292932900dd301e | diff --git a/state/presence/presence_test.go b/state/presence/presence_test.go
index <HASH>..<HASH> 100644
--- a/state/presence/presence_test.go
+++ b/state/presence/presence_test.go
@@ -692,4 +692,4 @@ func (s *PresenceSuite) TestRobustness(c *gc.C) {
}
}
c.Check(atomic.LoadUint32(&observed), gc.Equals, uint32(numKeys))
-}
\ No newline at end of file
+} | Driveby `go vet` fix - no EOL at end of file | juju_juju | train | go |
a8765a741c43aae4ff7d3edac681c30288081069 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ setup(name="karabo_bridge",
long_description=read("README.rst"),
license="BSD-3-Clause",
install_requires=[
- 'msgpack>=0.5.4',
+ 'msgpack==0.5.4',
'msgpack-numpy',
'numpy',
'pyzmq>=17.0.0', | new msgpack version breaks test for now... | European-XFEL_karabo-bridge-py | train | py |
2fe23c0fa6c89cd5fed6ef00ed85891647fe2633 | diff --git a/examples/vueds/styleguide/vueds-theme.js b/examples/vueds/styleguide/vueds-theme.js
index <HASH>..<HASH> 100644
--- a/examples/vueds/styleguide/vueds-theme.js
+++ b/examples/vueds/styleguide/vueds-theme.js
@@ -40,7 +40,8 @@ module.exports = {
'& & a': {
fontSize: '13px';
fontWeight: 'normal',
- color: '#258aef'
+ color: '#258aef',
+ cursor: 'pointer'
}
}
}, | docs: cusor: pointer | vue-styleguidist_vue-styleguidist | train | js |
bb222027937069de51c4ef0cc7aa60cae83fba72 | diff --git a/dingo/core/__init__.py b/dingo/core/__init__.py
index <HASH>..<HASH> 100644
--- a/dingo/core/__init__.py
+++ b/dingo/core/__init__.py
@@ -134,7 +134,7 @@ class NetworkDingo:
orm_GridDistrict.geom, srid)).\
label('poly_geom'),
func.ST_AsText(func.ST_Transform(
- orm_EgoDeuSubstation.geom, srid)).\
+ orm_EgoDeuSubstation.point, srid)).\
label('subs_geom')).\
join(orm_EgoDeuSubstation, orm_GridDistrict.subst_id==
orm_EgoDeuSubstation.id).\ | modify column for substation import
Column 'geom' was renamed to 'point'. See here for context: <URL> | openego_ding0 | train | py |
1c265d0536cc6a931a4eb3375977ed82378153b2 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -29,7 +29,7 @@ return array(
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
- 'version' => '15.5.1',
+ 'version' => '15.5.2',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoTests' => '>=6.4.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -1589,6 +1589,6 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->setVersion('14.1.5');
}
- $this->skip('14.1.5', '15.5.1');
+ $this->skip('14.1.5', '15.5.2');
}
} | Bump to version <I> | oat-sa_extension-tao-testqti | train | php,php |
52370b6cf8336bdb8d9aa0b1e83765c56336a7eb | diff --git a/simpleai/search/models.py b/simpleai/search/models.py
index <HASH>..<HASH> 100644
--- a/simpleai/search/models.py
+++ b/simpleai/search/models.py
@@ -79,16 +79,16 @@ class SearchProblem(object):
def state_representation(self, state):
"""
Returns a string representation of a state.
- By default it returns repr(state).
+ By default it returns str(state).
"""
- return repr(state)
+ return str(state)
def action_representation(self, action):
"""
Returns a string representation of an action.
- By default it returns repr(action).
+ By default it returns str(action).
"""
- return repr(action)
+ return str(action)
class SearchNode(object): | The default representations for actions and states use str instead of repr | simpleai-team_simpleai | train | py |
d29dfd731f9f386603fd863d7f291ccc89baf2f2 | diff --git a/lib/rubocop/cop/variable_force.rb b/lib/rubocop/cop/variable_force.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/cop/variable_force.rb
+++ b/lib/rubocop/cop/variable_force.rb
@@ -284,11 +284,7 @@ module RuboCop
def process_scope(node)
if TWISTED_SCOPE_TYPES.include?(node.type)
# See the comment at the end of file for this behavior.
- twisted_nodes = [node.children[0]]
- twisted_nodes << node.children[1] if node.class_type?
- twisted_nodes.compact!
-
- twisted_nodes.each do |twisted_node|
+ twisted_nodes(node).each do |twisted_node|
process_node(twisted_node)
scanned_nodes << twisted_node
end
@@ -298,6 +294,12 @@ module RuboCop
skip_children!
end
+ def twisted_nodes(node)
+ twisted_nodes = [node.children[0]]
+ twisted_nodes << node.children[1] if node.class_type?
+ twisted_nodes.compact
+ end
+
def process_send(node)
_receiver, method_name, args = *node
return unless method_name == :binding | Reduce ABC size of VariableForce | rubocop-hq_rubocop | train | rb |
441109d87bec86bf2f8d275c4d58ac2ddcbc491a | diff --git a/pytypes/type_util.py b/pytypes/type_util.py
index <HASH>..<HASH> 100644
--- a/pytypes/type_util.py
+++ b/pytypes/type_util.py
@@ -777,7 +777,7 @@ def _funcsigtypes(func0, slf, func_class = None, globs = None, prop_getter = Fal
for t in argNames)], retTp if not retTp is None else type(None))
if infer_defaults:
resType = _handle_defaults(resType, argSpecs, unspecIndices)
- if not pytypes.annotations_override_typestring and not (tpStr is None or tpStr[0] is None):
+ if not pytypes.annotations_override_typestring and not (tpStr is None or tpStr[0] is None or tpStr[0] == 'ignore'):
if pytypes.strict_annotation_collision_check:
raise TypeError('%s.%s has multiple type declarations.'
% (func.__module__, func.__name__)) | Do not complain about type mismatch for "type: ignore".
Before ignore was seen as a type itself. | Stewori_pytypes | train | py |
ff9d0e416c56bfddad6a2cde12594587b26baa0e | diff --git a/js/bybit.js b/js/bybit.js
index <HASH>..<HASH> 100644
--- a/js/bybit.js
+++ b/js/bybit.js
@@ -2035,7 +2035,7 @@ module.exports = class bybit extends Exchange {
if (limit !== undefined) {
request['limit'] = limit;
}
- const response = await this.openapiGetWalletWithdrawList (this.extend (request, params));
+ const response = await this.v2PrivateGetWalletWithdrawList (this.extend (request, params));
//
// {
// "ret_code": 0,
@@ -2158,7 +2158,7 @@ module.exports = class bybit extends Exchange {
if (limit !== undefined) {
request['limit'] = limit;
}
- const response = await this.openapiGetWalletFundRecords (this.extend (request, params));
+ const response = await this.v2PrivateGetWalletFundRecords (this.extend (request, params));
//
// {
// "ret_code": 0, | bybit fetchWithdrawals, fetchLedger v2 | ccxt_ccxt | train | js |
9be195cdf06cf38da5b00456e03ad41cce091016 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -3,10 +3,8 @@ var path = require('path');
function routesResolver(filePath) {
var ngModule = require(filePath).default || require(filePath);
- if (ngModule.routes && ngModule.routes.length) {
- return ngModule.routes;
- }
- return [];
+ var routes = ngModule.routes || require(filePath).routes || [];
+ return routes;
}
function resolveNgRoute(srcPath, config, defaultFile, resolver) { | refactor: check for routes in both default and export | AngularClass_resolve-angular-routes | train | js |
3ee8fbaf45fd9f73d93449d061cd525d216e3c0e | diff --git a/lib/rubocop/cop/util.rb b/lib/rubocop/cop/util.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/cop/util.rb
+++ b/lib/rubocop/cop/util.rb
@@ -157,8 +157,7 @@ module RuboCop
end
def begins_its_line?(range)
- source_before_range = range.source_buffer.source[0...range.begin_pos]
- source_before_range.rpartition("\n").last.strip.empty?
+ (range.source_line =~ /\S/) == range.column
end
def within_node?(inner, outer) | Much faster implementation of Util#begins_its_line? | rubocop-hq_rubocop | train | rb |
5dc64caaf2bf5a524e28cb0639b16cccaf5d321f | diff --git a/mtools/test/test_mlogfilter.py b/mtools/test/test_mlogfilter.py
index <HASH>..<HASH> 100644
--- a/mtools/test/test_mlogfilter.py
+++ b/mtools/test/test_mlogfilter.py
@@ -175,5 +175,13 @@ class TestMLogFilter(object):
(ll.datetime >= event2 - padding and ll.datetime <= event2 + padding)
)
+ @raises(SystemExit)
+ def test_no_logfile(self):
+ """ mlogfilter: test that not providing at least 1 log file throws clean error. """
+
+ self.tool.run('--from Jan 1')
+
+
+
# output = sys.stdout.getvalue().strip()
\ No newline at end of file | added test to error out cleanly when no log file is provided for mlogfilter. | rueckstiess_mtools | train | py |
f9f8bc9b6768e1d25336455ac83b6908d8169867 | diff --git a/agent/core/src/main/java/org/jolokia/http/AgentServlet.java b/agent/core/src/main/java/org/jolokia/http/AgentServlet.java
index <HASH>..<HASH> 100644
--- a/agent/core/src/main/java/org/jolokia/http/AgentServlet.java
+++ b/agent/core/src/main/java/org/jolokia/http/AgentServlet.java
@@ -350,9 +350,9 @@ public class AgentServlet extends HttpServlet {
long now = System.currentTimeMillis();
pResp.setDateHeader("Date",now);
// 1h in the past since it seems, that some servlet set the date header on their
- // own so that it cannot be guaranteed that these heades are really equals.
- // It happend on Tomcat that Date: was finally set *before* Expires: in the final
- // answers some times which seems to be an implementation percularity from Tomcat
+ // own so that it cannot be guaranteed that these headers are really equals.
+ // It happened on Tomcat that Date: was finally set *before* Expires: in the final
+ // answers some times which seems to be an implementation peculiarity from Tomcat
pResp.setDateHeader("Expires",now - 3600000);
} | Cleared up JavaDoc a bit. | rhuss_jolokia | train | java |
0b94916696b3abfa3cd81246ca974b25ce4a2f15 | diff --git a/js/reportico.js b/js/reportico.js
index <HASH>..<HASH> 100755
--- a/js/reportico.js
+++ b/js/reportico.js
@@ -334,6 +334,8 @@ reportico_jquery(document).on('click', '.swAdminButton, .swAdminButton2, .swMenu
params += "&reportico_ajax_called=1";
csvpdfoutput = false;
+
+ if ( reportico_jquery(this).prop("name") != "submit_design_mode" )
reportico_jquery(reportico_container).find("input:radio").each(function() {
d = 0;
nm = reportico_jquery(this).prop("value"); | After running PDF, running design mode executed report in new window
instead of entering design mode | reportico-web_reportico | train | js |
2e710be8560c6f5722fd721f68b49add95996088 | diff --git a/lib/simpletestlib.php b/lib/simpletestlib.php
index <HASH>..<HASH> 100644
--- a/lib/simpletestlib.php
+++ b/lib/simpletestlib.php
@@ -37,7 +37,8 @@ function recurseFolders($path, $callback, $fileregexp = '/.*/', $exclude = false
foreach ($files as $file) {
$filepath = $path .'/'. $file;
- if ($file == '.' || $file == '..') {
+ if (strpos($file, '.') === 0) {
+ /// Don't check hidden files.
continue;
} else if (is_dir($filepath)) {
if (!in_array($filepath, $ignorefolders)) { | Unit tests: in recurseFolders, skip files/folders whose names begnis with '.'/ | moodle_moodle | train | php |
112aed074d6f2ac63f96dea76f1e40fed9bae7bd | diff --git a/state/backups/create.go b/state/backups/create.go
index <HASH>..<HASH> 100644
--- a/state/backups/create.go
+++ b/state/backups/create.go
@@ -316,6 +316,18 @@ func (b *builder) buildAll() error {
return nil
}
+// result returns a "create" result relative to the current state of the
+// builder. create() uses this method to get the final backup result
+// from the builder it used.
+//
+// Note that create() calls builder.cleanUp() after it calls
+// builder.result(). cleanUp() causes the builder's workspace directory
+// to be deleted. This means that while the file in the result is still
+// open, it no longer corresponds to any filename on the filesystem.
+// We do this to avoid leaving any temporary files around. The
+// consequence is that we cannot simply return the temp filename, we
+// must leave the file open, and the caller is responsible for closing
+// the file (hence io.ReadCloser).
func (b *builder) result() (*createResult, error) {
// Open the file in read-only mode.
file, err := os.Open(b.archive.Filename) | Clarify why create() returns an open file instead of a filename. | juju_juju | train | go |
dd35224dca2213879b2ac5f0ea04e001bde1f42c | diff --git a/leaflet.rotatedMarker.js b/leaflet.rotatedMarker.js
index <HASH>..<HASH> 100644
--- a/leaflet.rotatedMarker.js
+++ b/leaflet.rotatedMarker.js
@@ -27,7 +27,7 @@
if(oldIE) {
// for IE 9, use the 2D rotation
- this._icon.style[L.DomUtil.TRANSFORM] = ' rotate(' + this.options.rotationAngle + 'deg)';
+ this._icon.style[L.DomUtil.TRANSFORM] = 'rotate(' + this.options.rotationAngle + 'deg)';
} else {
// for modern browsers, prefer the 3D accelerated version
this._icon.style[L.DomUtil.TRANSFORM] += ' rotateZ(' + this.options.rotationAngle + 'deg)'; | Remove unnecessary space for 2D rotation styles
In case of the old IE browser we are using ``=`` instead of ``+=`` operator so this blank space is unnecessary | bbecquet_Leaflet.RotatedMarker | train | js |
d8b13338b2e80bbb5e30ec65e4aafde7c4c30c6a | diff --git a/tests/test-logger-interface-compliant.php b/tests/test-logger-interface-compliant.php
index <HASH>..<HASH> 100644
--- a/tests/test-logger-interface-compliant.php
+++ b/tests/test-logger-interface-compliant.php
@@ -15,6 +15,7 @@ use IronBound\DB\Query\Simple_Query;
use IronBound\DBLogger\Logger;
use IronBound\DBLogger\Table;
use Psr\Log\LoggerInterface;
+use Psr\Log\Test\DummyTest;
use Psr\Log\Test\LoggerInterfaceTest;
/**
@@ -122,7 +123,7 @@ class Test_Logger_Interface_Compliant extends LoggerInterfaceTest {
'string' => 'Foo',
'int' => 0,
'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
+ 'nested' => array('with object' => new DummyTest()),
'object' => new \DateTime,
//'resource' => fopen('php://memory', 'r'),
); | Fix fatal error due to class not existing. | iron-bound-designs_IronBound-DB-Logger | train | php |
03b07655c8b263dc28990b39cff7c49a214f4e73 | diff --git a/lib/Proem/Api/IO/Response/Http/Standard.php b/lib/Proem/Api/IO/Response/Http/Standard.php
index <HASH>..<HASH> 100644
--- a/lib/Proem/Api/IO/Response/Http/Standard.php
+++ b/lib/Proem/Api/IO/Response/Http/Standard.php
@@ -43,7 +43,7 @@ class Standard implements Template
*
* @var string
*/
- protected $httpVersion = '1.1';
+ protected $httpVersion = '1.0';
/**
* Store the HTTP Status code
@@ -289,8 +289,6 @@ class Standard implements Template
foreach ($this->headers->all() as $index => $value) {
header(sprintf('%s: %s', $index, $value));
}
-
- flush();
}
/** | Fix protocol version and remove explicit flush. | proem-components_signal | train | php |
422317fda2951c254a95d8f56f5f3ed2b34d6b9d | diff --git a/lib/devtools/index.js b/lib/devtools/index.js
index <HASH>..<HASH> 100644
--- a/lib/devtools/index.js
+++ b/lib/devtools/index.js
@@ -667,20 +667,22 @@ var scratchpadCommandSpec = {
description: { key: 'scratchpad_desc' },
params: [
{
+ name: 'script',
+ type: 'string',
+ description: { key: 'scratchpad_script_desc' },
+ defaultValue: null
+ },
+ {
group: 'Options',
params: [
+ /*
{
name: 'file',
type: 'file',
description: { key: 'scratchpad_file_desc' },
defaultValue: null
},
- {
- name: 'script',
- type: 'string',
- description: { key: 'scratchpad_script_desc' },
- defaultValue: null
- },
+ */
{
name: 'chrome',
type: 'boolean', | Bug <I> (scratchpad, part): Avoid bug with only grouped params
(see also bug <I>) | joewalker_gcli | train | js |
95008f81c62031558d94eaf71141cc49cf2489b1 | diff --git a/lib/dmllib.php b/lib/dmllib.php
index <HASH>..<HASH> 100644
--- a/lib/dmllib.php
+++ b/lib/dmllib.php
@@ -1207,6 +1207,10 @@ function sql_paging_limit($page, $recordsperpage) {
/**
* Returns the proper SQL to do LIKE in a case-insensitive way
*
+ * Note the LIKE are case sensitive for Oracle. Oracle 10g is required to use
+ * the caseinsensitive search using regexp_like() or NLS_COMP=LINGUISTIC :-(
+ * See http://docs.moodle.org/en/XMLDB_Problems#Case-insensitive_searches
+ *
* @uses $CFG
* @return string
*/
@@ -1214,10 +1218,10 @@ function sql_ilike() {
global $CFG;
switch ($CFG->dbtype) {
- case 'mysql':
- return 'LIKE';
- default:
+ case 'postgres7':
return 'ILIKE';
+ default:
+ return 'LIKE';
}
} | sql_ilike() -- added notes on Oracle support or lack thereof | moodle_moodle | train | php |
333bdb8622fc5e3ed489d9faaa657595f22fb814 | diff --git a/ca/django_ca/extensions.py b/ca/django_ca/extensions.py
index <HASH>..<HASH> 100644
--- a/ca/django_ca/extensions.py
+++ b/ca/django_ca/extensions.py
@@ -2108,6 +2108,14 @@ class SubjectKeyIdentifier(KeyIdExtension):
def extension_type(self):
return x509.SubjectKeyIdentifier(digest=self.value)
+ def from_other(self, value):
+ if isinstance(value, x509.SubjectKeyIdentifier):
+ self.critical = self.default_critical
+ self.value = value.digest
+ self._test_value()
+ else:
+ super(AuthorityKeyIdentifier, self).from_other(value)
+
def from_extension(self, ext):
self.value = ext.value.digest | add abilty to create extensions from x<I>.SKI | mathiasertl_django-ca | train | py |
626bf6a861fffeb2e30d7295f0241b98a0777907 | diff --git a/packages/ui/vue/app-client.js b/packages/ui/vue/app-client.js
index <HASH>..<HASH> 100644
--- a/packages/ui/vue/app-client.js
+++ b/packages/ui/vue/app-client.js
@@ -44,11 +44,8 @@ router.onReady(() => {
// async components are resolved.
router.beforeResolve(async (to, from, next) => {
if (to.matched.some(record => !store.state.$user.scp.includes(record.meta.scope) && !store.state.$user.scp.includes('write_root'))) {
- console.log("scope didnt match")
next(false)
} else {
- console.log("scope did match")
-
const matched = router.getMatchedComponents(to)
// Register dyanmic store modules on route change (not direct load!) | fix(ui): removed debug logs | cubic-js_cubic | train | js |
6f87995ab6d2b5890be763b9338a80144b9707f3 | diff --git a/src/Support/ArrayHelpers.php b/src/Support/ArrayHelpers.php
index <HASH>..<HASH> 100644
--- a/src/Support/ArrayHelpers.php
+++ b/src/Support/ArrayHelpers.php
@@ -5,8 +5,7 @@ declare(strict_types=1);
namespace Roave\ApiCompare\Support;
use Assert\Assert;
-use function array_flip;
-use function array_key_exists;
+use function in_array;
final class ArrayHelpers
{
@@ -22,6 +21,6 @@ final class ArrayHelpers
{
Assert::that($arrayOfStrings)->all()->string();
- return array_key_exists($value, array_flip($arrayOfStrings));
+ return in_array($value, $arrayOfStrings);
}
} | Using non-strict `in_array()` checks to avoid copying data around without any need for that | Roave_BackwardCompatibilityCheck | train | php |
b7e82ad2fd03b23b53ab94de66c5b3c30863724a | diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go b/staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/delete/delete.go
@@ -84,7 +84,7 @@ var (
kubectl delete -k dir
# Delete resources from all files that end with '.json' - i.e. expand wildcard characters in file names
- kubectl apply -f '*.json'
+ kubectl delete -f '*.json'
# Delete a pod based on the type and name in the JSON passed into stdin
cat pod.json | kubectl delete -f - | Typo in kubectl delete --help <I> | kubernetes_kubernetes | train | go |
2fc691d3a5981c71388e0aca3d758773f1b2cb63 | diff --git a/pages/app/presenters/refinery/pages/section_presenter.rb b/pages/app/presenters/refinery/pages/section_presenter.rb
index <HASH>..<HASH> 100644
--- a/pages/app/presenters/refinery/pages/section_presenter.rb
+++ b/pages/app/presenters/refinery/pages/section_presenter.rb
@@ -91,13 +91,16 @@ module Refinery
@attributes = attributes
end
- #see https://github.com/flavorjones/loofah/blob/master/lib/loofah/html5/scrub.rb#L21
- def scrub_attributes(node)
- node.attribute_nodes.each do |attr_node|
- next if attr_node.node_name =~ /\Adata-[\w-]+\z/
+ def allowed_node?(node)
+ tags.include?(node.name)
+ end
- super
- end
+ def skip_node?(node)
+ node.text?
+ end
+
+ def scrub_attribute?(name)
+ attributes.exclude?(name) && name !~ /\Adata-[\w-]+\z/
end
end | Refactor CustomScrubber to fix support of data-attr (#<I>) | refinery_refinerycms | train | rb |
a162abb0fbd5e397433c1fe3c52fc22313b7f70b | diff --git a/colormath/__init__.py b/colormath/__init__.py
index <HASH>..<HASH> 100644
--- a/colormath/__init__.py
+++ b/colormath/__init__.py
@@ -1 +1 @@
-VERSION = '1.0.3'
\ No newline at end of file
+VERSION = '1.0.4'
\ No newline at end of file | Version bump to <I> for next eventual release. | gtaylor_python-colormath | train | py |
c10a8c89b91b60c6846223a5775401a18914dc91 | diff --git a/packages/upload-core/src/upload.js b/packages/upload-core/src/upload.js
index <HASH>..<HASH> 100644
--- a/packages/upload-core/src/upload.js
+++ b/packages/upload-core/src/upload.js
@@ -1,5 +1,6 @@
import tus from 'tus-js-client';
import resolveUrl from '@availity/resolve-url';
+import * as Tiff from 'tiff';
// https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript/8831937#8831937
const hashCode = str => { | feat(POCL-<I>): added missing import. | Availity_sdk-js | train | js |
18d46418ed1117ef851bc8313d95d01ca3a8f3db | diff --git a/src/bundleWriter.js b/src/bundleWriter.js
index <HASH>..<HASH> 100644
--- a/src/bundleWriter.js
+++ b/src/bundleWriter.js
@@ -13,6 +13,8 @@ function bundleWriter() {
if (bundle.content && dest) {
pending.push(writeBundle(logger, bundle, streamFactory(dest)));
}
+
+ return bundle;
});
return Promise.all(pending).then(function() { return context;});
diff --git a/src/context.js b/src/context.js
index <HASH>..<HASH> 100644
--- a/src/context.js
+++ b/src/context.js
@@ -84,7 +84,7 @@ Context.prototype.setShard = function(name, shard, dest) {
if (shard) {
shards[name] = new Bundle(name, shard);
- shards[name].dest = dest || name;
+ shards[name].dest = shard.dest || dest || name;
}
else {
delete shards[name]; | fixed issue with shard dest not getting properly setup | MiguelCastillo_bit-bundler | train | js,js |
9a97f6929af78c0bfffeca2f96a9c47f7fa1e943 | diff --git a/plugins/no-caching/index.js b/plugins/no-caching/index.js
index <HASH>..<HASH> 100644
--- a/plugins/no-caching/index.js
+++ b/plugins/no-caching/index.js
@@ -12,6 +12,7 @@ function getBodyParts(config) {
// Tweak client cache-related headers so ensure no
// caching, then let the request be dispatched normally
delete req.headers['if-modified-since'];
+ delete req.headers['if-none-match'];
req.headers['cache-control'] = 'no-cache';
next(req, res); | Delete the if-none-match header in the no-caching plugin | robohydra_robohydra | train | js |
8b38cbe4fe852828e2a52c0f2134d5865a84ecbc | diff --git a/spec/punchblock/component/prompt_spec.rb b/spec/punchblock/component/prompt_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/punchblock/component/prompt_spec.rb
+++ b/spec/punchblock/component/prompt_spec.rb
@@ -69,7 +69,6 @@ module Punchblock
let(:command) { Input.new :grammar => '[5 DIGITS]' }
before do
- pending
command.component_id = 'abc123'
command.target_call_id = '123abc'
command.client = mock_client
@@ -78,7 +77,7 @@ module Punchblock
describe '#stop_action' do
subject { command.stop_action }
- its(:to_xml) { should be == '<stop xmlns="urn:xmpp:rayo:1"/>' }
+ its(:to_xml) { should be == '<stop xmlns="urn:xmpp:rayo:ext:1"/>' }
its(:component_id) { should be == 'abc123' }
its(:target_call_id) { should be == '123abc' }
end | [CS] Some Prompt model specs were pending for no reason | adhearsion_punchblock | train | rb |
942339d8d93bcdc369d36bcbc1b54e18db137f21 | diff --git a/game.js b/game.js
index <HASH>..<HASH> 100644
--- a/game.js
+++ b/game.js
@@ -982,7 +982,7 @@ var __slice = Array.prototype.slice;
var root;
root = typeof exports !== "undefined" && exports !== null ? exports : this;
return root.Core = function(I) {
- var self;
+ var Module, moduleName, self, _i, _len, _ref;
if (I == null) I = {};
Object.reverseMerge(I, {
includedModules: []
@@ -1155,6 +1155,12 @@ var __slice = Array.prototype.slice;
return self[name].apply(self, args);
}
};
+ _ref = I.includedModules;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ moduleName = _ref[_i];
+ Module = moduleName.constantize();
+ self.extend(Module(I, self));
+ }
return self;
};
})(); | loading initial modules, should withstand serialization and deserialization | PixieEngine_Cornerstone | train | js |
b765043c99e13b64587d3ec5388d0aceada70123 | diff --git a/examples/movies/model/all.php b/examples/movies/model/all.php
index <HASH>..<HASH> 100644
--- a/examples/movies/model/all.php
+++ b/examples/movies/model/all.php
@@ -99,7 +99,7 @@ foreach ($movie->getTranslations()->filterLanguage('en') as $translation) {
echo "Trailers<br/>";
-foreach ($movie->getTrailers() as $trailer) {
+foreach ($movie->getVideos() as $trailer) {
printf(" - %s<br/>", $trailer->getUrl());
} | Method getTrailers() doesn't exist | php-tmdb_api | train | php |
623d9c75ae7b195c1668fe5fc9b18da14c4bdb97 | diff --git a/lib/puppet/network/format_handler.rb b/lib/puppet/network/format_handler.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/network/format_handler.rb
+++ b/lib/puppet/network/format_handler.rb
@@ -121,20 +121,28 @@ module Puppet::Network::FormatHandler
result = put_preferred_format_first(result)
- Puppet.debug "#{indirection.name} supports formats: #{result.sort.join(' ')}; using #{result.first}"
+ Puppet.debug "#{friendly_name} supports formats: #{result.map{ |f| f.to_s }.sort.join(' ')}; using #{result.first}"
result
end
private
+ def friendly_name
+ if self.respond_to? :indirection
+ indirection.name
+ else
+ self
+ end
+ end
+
def put_preferred_format_first(list)
preferred_format = Puppet.settings[:preferred_serialization_format].to_sym
if list.include?(preferred_format)
list.delete(preferred_format)
list.unshift(preferred_format)
else
- Puppet.warning "Value of 'preferred_serialization_format' (#{preferred_format}) is invalid for #{indirection.name}, using default (#{list.first})"
+ Puppet.warning "Value of 'preferred_serialization_format' (#{preferred_format}) is invalid for #{friendly_name}, using default (#{list.first})"
end
list
end | Fixing <I>: Failing specs in format_handler
Clean up warning messages so that they don't fail when run inside the
test class. | puppetlabs_puppet | train | rb |
927d7a07d2c36c034532aa8c371df38b00ac6fd5 | diff --git a/cmd/kube-proxy/app/conntrack.go b/cmd/kube-proxy/app/conntrack.go
index <HASH>..<HASH> 100644
--- a/cmd/kube-proxy/app/conntrack.go
+++ b/cmd/kube-proxy/app/conntrack.go
@@ -34,7 +34,7 @@ type Conntracker interface {
type realConntracker struct{}
-var readOnlySysFSError = errors.New("ReadOnlySysFS")
+var readOnlySysFSError = errors.New("readOnlySysFS")
func (realConntracker) SetMax(max int) error {
glog.Infof("Setting nf_conntrack_max to %d", max) | In error, the first letter should be lowcase | kubernetes_kubernetes | train | go |
654290ea7807ab1c3b3e655a50a79dbc67cebedd | diff --git a/test/test_autopep8.py b/test/test_autopep8.py
index <HASH>..<HASH> 100644
--- a/test/test_autopep8.py
+++ b/test/test_autopep8.py
@@ -1437,6 +1437,7 @@ a.has_key(
self._inner_setup(line)
self.assertEqual(self.result, fixed)
+ @unittest.skipIf(sys.version_info[0] < 3, 'needs to be fixed on Python 2')
def test_w601_with_non_ascii(self):
line = """
# -*- coding: utf-8 -*- | Skip test_w<I>_with_non_ascii() for now
It is failing on Python 2. | hhatto_autopep8 | train | py |
c60a8db5a4d4cff375d9920fcf34e36bc6e4250f | diff --git a/lib/utils.rb b/lib/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/utils.rb
+++ b/lib/utils.rb
@@ -12,18 +12,30 @@ module Geos
end
def create_point(cs)
+ if cs.length != 1
+ raise RuntimeError.new("IllegalArgumentException: Point coordinate list must contain a single element")
+ end
+
cast_geometry_ptr(FFIGeos.GEOSGeom_createPoint_r(Geos.current_handle, cs.ptr)).tap {
cs.ptr.autorelease = false
}
end
def create_line_string(cs)
+ if cs.length <= 1 && cs.length != 0
+ raise RuntimeError.new("IllegalArgumentException: point array must contain 0 or >1 elements")
+ end
+
cast_geometry_ptr(FFIGeos.GEOSGeom_createLineString_r(Geos.current_handle, cs.ptr)).tap {
cs.ptr.autorelease = false
}
end
def create_linear_ring(cs)
+ if cs.length <= 1 && cs.length != 0
+ raise RuntimeError.new("IllegalArgumentException: point array must contain 0 or >1 elements")
+ end
+
cast_geometry_ptr(FFIGeos.GEOSGeom_createLinearRing_r(Geos.current_handle, cs.ptr)).tap {
cs.ptr.autorelease = false
} | Check dimension bounds on create methods. | dark-panda_ffi-geos | train | rb |
3e95625c26d757fdccf6ef66a4567d8dc7faad77 | diff --git a/jquery.floatThead.js b/jquery.floatThead.js
index <HASH>..<HASH> 100644
--- a/jquery.floatThead.js
+++ b/jquery.floatThead.js
@@ -641,6 +641,9 @@
$table.unbind('reflow');
reflowEvent = windowResizeEvent = containerScrollEvent = windowScrollEvent = function() {};
$scrollContainer.unbind('scroll.floatTHead');
+ if (wrappedContainer) {
+ $scrollContainer.unwrap();
+ }
$floatContainer.remove();
$table.data('floatThead-attached', false);
floatTheadCreated--; | Fixed DOM leakage in destroy. | mkoryak_floatThead | train | js |
0ece78335f0d5c8f52ac9c45bc7ed11d136eca70 | diff --git a/lib/project.api.js b/lib/project.api.js
index <HASH>..<HASH> 100644
--- a/lib/project.api.js
+++ b/lib/project.api.js
@@ -60,6 +60,8 @@ class Project {
let localJsonPath = path.join(directory, 'aquifer.local.json');
+
+
// Default directory to Aquifer.projectDir.
this.directory = directory = directory || Aquifer.projectDir;
@@ -91,10 +93,6 @@ class Project {
// If this project has no defined core version, default to 7.
this.config.core = this.config.core || this.drupalVersion;
-
- // Backward compatibility for make and build paths
- this.config.build.makeFile = this.config.build.makeFile;
- this.config.build.directory = this.config.build.directory;
this.setDrupalVersion(this.config.core);
// Define absolute paths to assets. | Remove backward compatibility vars. | aquifer_aquifer | train | js |
a05addc11545583ab9a24d54e1c3156ea7282cc7 | diff --git a/src/Environment.php b/src/Environment.php
index <HASH>..<HASH> 100644
--- a/src/Environment.php
+++ b/src/Environment.php
@@ -82,14 +82,19 @@ class Environment
// Temp, cache directories
define('TMP_DIR', TESTER_DIR . '/tmp');
- define('TEMP_DIR', TMP_DIR . '/tests/' . getmypid());
+ define('TEMP_DIR', TMP_DIR . '/tests/' . lcg_value());
define('CACHE_DIR', TMP_DIR . '/cache');
ini_set('session.save_path', TEMP_DIR);
// Create folders
- self::mkdir(dirname(TEMP_DIR));
+ self::mkdir(TEMP_DIR);
self::mkdir(CACHE_DIR);
self::purge(TEMP_DIR);
+
+ register_shutdown_function(function () {
+ self::purge(TMP_DIR);
+ @rmdir(TMP_DIR);
+ });
}
/** | Environment: use lcg_value instead of PID, cleanup TEMP folders | ninjify_nunjuck | train | php |
67b31c717eb671a4a09645dc9e406a35db812c76 | diff --git a/FtpLibrary.py b/FtpLibrary.py
index <HASH>..<HASH> 100644
--- a/FtpLibrary.py
+++ b/FtpLibrary.py
@@ -152,6 +152,7 @@ To run library remotely execute: python FtpLibrary.py <ipaddress> <portnumber>
else:
newFtp = None
outputMsg = ""
+ connected = False
try:
timeout = int(timeout)
port = int(port)
@@ -161,10 +162,13 @@ To run library remotely execute: python FtpLibrary.py <ipaddress> <portnumber>
else:
newFtp = ftplib.FTP()
outputMsg += newFtp.connect(host, port, timeout)
+ connected = True
outputMsg += newFtp.login(user, password)
except socket.error as se:
raise FtpLibraryError('Socket error exception occured.')
except ftplib.all_errors as e:
+ if connected == True:
+ newFtp.quit()
raise FtpLibraryError(str(e))
except Exception as e:
raise FtpLibraryError(str(e)) | - fixed closing the connection if login fails (otherwise connection is
left open) | kowalpy_Robot-Framework-FTP-Library | train | py |
dcade01d3cb4dafaca658f2d305003eec3d91117 | diff --git a/lib/extract.js b/lib/extract.js
index <HASH>..<HASH> 100644
--- a/lib/extract.js
+++ b/lib/extract.js
@@ -26,12 +26,20 @@ function extract(html, model, options = {}) {
const parserOptions = Object.assign({}, HTMLPARSER2_OPTIONS, options.htmlparser2)
const handlerOptions = Object.assign({}, DOMHANDLER_OPTIONS, options.domhandler)
+ let deserializedModel
+
+ try {
+ deserializedModel = JSON.parse(JSON.stringify(model))
+ } catch (error) {
+ throw new ModelError(`The model cannot be serialized; ${error.message}`)
+ }
+
const handler = new DomHandler(handlerOptions)
const parser = new Parser(handler, parserOptions)
parser.end(html)
- return getItem(handler.dom, model)
+ return getItem(handler.dom, deserializedModel)
}
/** | Ensure the model is JSON-serializable | eeshi_node-scrapy | train | js |
677f31e4d7b187d490d1756c867f3a54e14671aa | diff --git a/pyqg/model.py b/pyqg/model.py
index <HASH>..<HASH> 100644
--- a/pyqg/model.py
+++ b/pyqg/model.py
@@ -363,7 +363,7 @@ class Model(PseudoSpectralKernel):
#print 't=%16d, tc=%10d: cfl=%5.6f, ke=%9.9f' % (
# self.t, self.tc, cfl, ke)
self.logger.info(' Step: %i, Time: %e, KE: %e, CFL: %f'
- %(self.tc,self.t,self.ke,self.cfl))
+ , self.tc,self.t,self.ke,self.cfl )
assert self.cfl<1., self.logger.error('CFL condition violated') | Small change to avoid incurring in cost of string interpolation (as per landscape tip) | pyqg_pyqg | train | py |
2b228abe783cab73b86a80101d7dca6acc3058d9 | diff --git a/app/models/neighborly/balanced/order_proxy.rb b/app/models/neighborly/balanced/order_proxy.rb
index <HASH>..<HASH> 100644
--- a/app/models/neighborly/balanced/order_proxy.rb
+++ b/app/models/neighborly/balanced/order_proxy.rb
@@ -38,14 +38,14 @@ module Neighborly::Balanced
project_url = Rails.application.routes.url_helpers.project_url(project)
subject.meta = {
- project: project.name,
- goal: project.goal,
- campaign_type: project.campaign_type.humanize,
- user: project.user.name,
- category: project.category.name_en,
- url: project_url,
- expires_at: I18n.l(project.expires_at.utc),
- id: project.id,
+ 'Project' => project.name,
+ 'Goal' => project.goal,
+ 'Campaign Type' => project.campaign_type.humanize,
+ 'User' => project.user.name,
+ 'Category' => project.category.name_en,
+ 'URL' => project_url,
+ 'Expires At' => I18n.l(project.expires_at),
+ 'ID' => project.id,
}
subject.save | Humanize keys of meta information sent to Balanced | FromUte_dune-balanced | train | rb |
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.