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 |
|---|---|---|---|---|---|
47a408ab9ea92664de17f9a5d5802dee4b341258 | diff --git a/pysat/instruments/icon_mighti.py b/pysat/instruments/icon_mighti.py
index <HASH>..<HASH> 100644
--- a/pysat/instruments/icon_mighti.py
+++ b/pysat/instruments/icon_mighti.py
@@ -79,7 +79,9 @@ fname3b = ''.join(('ICON_L2-3_MIGHTI-B_Temperature_{year:04d}-{month:02d}',
supported_tags = {'a': {'los_wind': fname1a,
'temperature': fname3a},
'b': {'los-wind': fname1b,
- 'temperature': fname3b}}
+ 'temperature': fname3b},
+ 'green': {'vector_wind': fname2g},
+ 'red': {'vector_wind': fname2r}}
# use the CDAWeb methods list files routine
list_files = functools.partial(mm_gen.list_files, | BUG: complete supported_tags in mighti | rstoneback_pysat | train | py |
c8e2cf55517b7862e52e5f84181e723d2b5bf645 | diff --git a/resources/lang/zh-CN/cachet.php b/resources/lang/zh-CN/cachet.php
index <HASH>..<HASH> 100644
--- a/resources/lang/zh-CN/cachet.php
+++ b/resources/lang/zh-CN/cachet.php
@@ -75,10 +75,11 @@ return [
// Subscriber
'subscriber' => [
- 'subscribe' => '订阅最新的更新。',
- 'unsubscribe' => '使用这个链接取消订阅: :link',
- 'button' => '订阅',
- 'manage' => [
+ 'subscribe' => '订阅最新的更新。',
+ 'unsubscribe' => 'Unsubscribe',
+ 'button' => '订阅',
+ 'manage_subscription' => 'Manage subscription',
+ 'manage' => [
'no_subscriptions' => '您当前已订阅所有更新。',
'my_subscriptions' => '您当前已订阅下列更新',
'manage_at_link' => '在 :link 管理你的订阅', | New translations cachet.php (Chinese Simplified) | CachetHQ_Cachet | train | php |
59b5d29820ea4d313035a67660699038d3bd3acf | diff --git a/actions/MediaImport.php b/actions/MediaImport.php
index <HASH>..<HASH> 100755
--- a/actions/MediaImport.php
+++ b/actions/MediaImport.php
@@ -41,7 +41,6 @@ class MediaImport extends \tao_actions_Import {
/**
* overwrite the parent index to add the import handlers
*
- * @requiresRight id WRITE
* @see tao_actions_Import::index()
*/
public function index() | disable the write right to import a media | oat-sa_extension-tao-mediamanager | train | php |
6229a4d82304e8f0efeb4fb131d11521b6462aad | diff --git a/chef/lib/chef/knife/cookbook_site_install.rb b/chef/lib/chef/knife/cookbook_site_install.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/knife/cookbook_site_install.rb
+++ b/chef/lib/chef/knife/cookbook_site_install.rb
@@ -32,9 +32,9 @@ class Chef
banner "knife cookbook site install COOKBOOK [VERSION] (options)"
category "cookbook site"
- option :deps,
- :short => "-d",
- :long => "--dependencies",
+ option :no_deps,
+ :short => "-D",
+ :long => "--no-dependencies",
:boolean => true,
:description => "Grab dependencies automatically"
@@ -93,12 +93,12 @@ class Chef
end
- if config[:deps]
+ unless config[:no_deps]
md = Chef::Cookbook::Metadata.new
md.from_file(File.join(@install_path, @cookbook_name, "metadata.rb"))
md.dependencies.each do |cookbook, version_list|
# Doesn't do versions.. yet
- nv = Chef::Knife::CookbookSiteVendor.new
+ nv = self.class.new
nv.config = config
nv.name_args = [ cookbook ]
nv.run | make dependency fetching the default for cookbook site install | chef_chef | train | rb |
e830da0b6cb75f6842af8ccdf87165b4e49ee453 | diff --git a/examples/keystore.js b/examples/keystore.js
index <HASH>..<HASH> 100644
--- a/examples/keystore.js
+++ b/examples/keystore.js
@@ -41,7 +41,7 @@ var app = fortune({
, id = user.id || request.path.split('/').pop();
// require a password on user creation
- if(request.method == 'post') {
+ if(request.method.toLowerCase() == 'post') {
if(!!password) {
return hashPassword(user, password);
} else { | Update keystore example to proper request method
request.method usually returns the method in all caps because that is how it is usually sent. A header will look something like:
POST /users HTTP/<I>
Host: localhost:<I>
Content-Type: application/json
so request.method will equal "POST" | fortunejs_fortune | train | js |
12444fe474ae92302be24523be92dbdd101ab8d9 | diff --git a/test/backend-connection.test.js b/test/backend-connection.test.js
index <HASH>..<HASH> 100644
--- a/test/backend-connection.test.js
+++ b/test/backend-connection.test.js
@@ -7,11 +7,11 @@ var TypeOf = utils.TypeOf;
var InstanceOf = utils.InstanceOf;
var Connection = require('../lib/backend/connection').Connection;
-var MsgPackReceiver = require('../lib/backend/receiver').MsgPackReceiver;
+var FluentReceiver = require('../lib/backend/receiver').FluentReceiver;
function createBackend() {
var deferred = new Deferred();
- var backend = new MsgPackReceiver(utils.testSendPort);
+ var backend = new FluentReceiver(utils.testSendPort);
backend.received = [];
backend.on('receive', function(data) {
backend.received.push(data); | test: Use FluentReceiver isntead of MsgPackReceiver, because the backend is a fluentd. | droonga_express-droonga | train | js |
3497a4334583e0937be4d5619b9d3937f4a66aeb | diff --git a/lib/motion/project/cocoapods.rb b/lib/motion/project/cocoapods.rb
index <HASH>..<HASH> 100644
--- a/lib/motion/project/cocoapods.rb
+++ b/lib/motion/project/cocoapods.rb
@@ -174,13 +174,17 @@ module Motion::Project
end
end
+ HEADERS_ROOT = File.join(PODS_ROOT, 'Headers')
+
def copy_cocoapods_env_and_prefix_headers
headers = Dir.glob(["#{PODS_ROOT}/*.h", "#{PODS_ROOT}/*.pch"])
headers.each do |header|
src = File.basename(header)
dst = src.sub(/\.pch$/, '.h')
- unless File.exist?("#{PODS_ROOT}/Headers/____#{dst}")
- FileUtils.cp("#{PODS_ROOT}/#{src}", "#{PODS_ROOT}/Headers/____#{dst}")
+ dst_path = File.join(HEADERS_ROOT, "____#{dst}")
+ unless File.exist?(dst_path)
+ FileUtils.mkdir_p(HEADERS_ROOT)
+ FileUtils.cp(File.join(PODS_ROOT, src), dst_path)
end
end
end | Ensure the Pods/Headers dir exists before copying.
Fixes #<I>. | HipByte_motion-cocoapods | train | rb |
3b6ef2433e1fe157ad231ffd4076dd356b600144 | diff --git a/src/Agl/Core/Auth/Auth.php b/src/Agl/Core/Auth/Auth.php
index <HASH>..<HASH> 100644
--- a/src/Agl/Core/Auth/Auth.php
+++ b/src/Agl/Core/Auth/Auth.php
@@ -70,7 +70,7 @@ class Auth
$this->logout();
$this->_user = $pUser;
- if ($this->isLogged()) {
+ if ($this->_user->getId()) {
$this->_session->setUserId($this->_user->getId());
return true;
} | A user is not logged in when passing directly an Item to Auth. | agalbourdin_agl-core | train | php |
a3883abc73041546582d3a47ec268cd5c6d5945f | diff --git a/src/SectionField/Service/EntryNotFoundException.php b/src/SectionField/Service/EntryNotFoundException.php
index <HASH>..<HASH> 100644
--- a/src/SectionField/Service/EntryNotFoundException.php
+++ b/src/SectionField/Service/EntryNotFoundException.php
@@ -17,7 +17,7 @@ use Throwable;
class EntryNotFoundException extends \Exception
{
- public function __construct($message = '', $code = 0, Throwable $previous = null)
+ public function __construct($message = '', $code = 404, Throwable $previous = null)
{
$message = empty($message) ? 'Entry not found' : $message; | Entry not found throws <I> | dionsnoeijen_sexy-field-doctrine | train | php |
eabddd3c7cd81dffab45493d9d40c8baee1bd7be | diff --git a/core/src/main/java/fr/labri/gumtree/io/ActionsIoUtils.java b/core/src/main/java/fr/labri/gumtree/io/ActionsIoUtils.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/fr/labri/gumtree/io/ActionsIoUtils.java
+++ b/core/src/main/java/fr/labri/gumtree/io/ActionsIoUtils.java
@@ -84,7 +84,6 @@ public final class ActionsIoUtils {
Tree dst = mappings.getDst(src);
writeTreePos(w, true, src);
writeTreePos(w, false, dst);
- w.writeEmptyElement("before");
} else if (a instanceof Insert) {
Tree dst = a.getNode();
if (dst.isRoot()) writeInsertPos(w, true, new int[] {0, 0});
@@ -94,7 +93,6 @@ public final class ActionsIoUtils {
else writeInsertPos(w, true, dst.getParent().getChildren().get(idx -1).getLcPosEnd());
}
writeTreePos(w, false, dst);
- w.writeEmptyElement("after");
} else if (a instanceof Delete) {
Tree src = a.getNode();
writeTreePos(w, true, src); | fixed spurious before and after elements. | GumTreeDiff_gumtree | train | java |
91065f10ce848fdf9dd5c17ad5a824fec1e82e4e | diff --git a/rshell.py b/rshell.py
index <HASH>..<HASH> 100755
--- a/rshell.py
+++ b/rshell.py
@@ -153,7 +153,8 @@ def is_micropython_usb_device(port):
usb_id = port[2].lower()
else:
# Assume its a pyudev.device.Device
- if port['ID_BUS'] != 'usb' or port['SUBSYSTEM'] != 'tty':
+ if ('ID_BUS' not in port or port['ID_BUS'] != 'usb' or
+ 'SUBSYSTEM' not in port or port['SUBSYSTEM'] != 'tty'):
return False
usb_id = 'usb vid:pid={}:{}'.format(port['ID_VENDOR_ID'], port['ID_MODEL_ID'])
# We don't check the last digit of the PID since there are 3 possible | Fix problem where ID_BUS or SUBSYSTEM doesn't exist in the usb device | dhylands_rshell | train | py |
710b67470cb1b5f4f54c8d98501779400bc5a572 | diff --git a/src/main/GenomeTrack.js b/src/main/GenomeTrack.js
index <HASH>..<HASH> 100644
--- a/src/main/GenomeTrack.js
+++ b/src/main/GenomeTrack.js
@@ -117,7 +117,7 @@ var NonEmptyGenomeTrack = React.createClass({
},
getScale: function() {
var width = this.getDOMNode().offsetWidth;
- return utils.getTrackScale(this.props.range, this.state.width);
+ return utils.getTrackScale(this.props.range, width);
},
componentDidUpdate: function(prevProps: any, prevState: any) {
if (!shallowEquals(prevProps, this.props) || | pass the right width to the scale calculation | hammerlab_pileup.js | train | js |
250e70fecce489b3d0cc600b88678ebb34db4522 | diff --git a/src/main/java/com/blackducksoftware/integration/hub/dataservices/notification/items/PolicyViolationClearedContentItem.java b/src/main/java/com/blackducksoftware/integration/hub/dataservices/notification/items/PolicyViolationClearedContentItem.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/blackducksoftware/integration/hub/dataservices/notification/items/PolicyViolationClearedContentItem.java
+++ b/src/main/java/com/blackducksoftware/integration/hub/dataservices/notification/items/PolicyViolationClearedContentItem.java
@@ -16,4 +16,13 @@ public class PolicyViolationClearedContentItem extends PolicyViolationContentIte
super(createdAt, projectVersion, componentName, componentVersion, componentId, componentVersionId,
policyRuleList);
}
+
+ @Override
+ public String toString() {
+ return "PolicyViolationClearedContentItem [getPolicyRuleList()=" + getPolicyRuleList()
+ + ", getProjectVersion()=" + getProjectVersion() + ", getComponentName()=" + getComponentName()
+ + ", getComponentVersion()=" + getComponentVersion() + ", getComponentId()=" + getComponentId()
+ + ", getComponentVersionId()=" + getComponentVersionId() + ", getCreatedAt()=" + getCreatedAt() + "]";
+ }
+
} | IHCIC-<I>: Added missing toString() | blackducksoftware_blackduck-common | train | java |
468aed70e37fdcb45342c615b613b883e59607ec | diff --git a/crosscat/tests/test_log_likelihood.py b/crosscat/tests/test_log_likelihood.py
index <HASH>..<HASH> 100644
--- a/crosscat/tests/test_log_likelihood.py
+++ b/crosscat/tests/test_log_likelihood.py
@@ -124,8 +124,8 @@ def summary_plotter(results, dirname='./'):
pylab.plot(xlim, xlim)
return
def _plot_and_save(frame, variable_suffix, dirname='./'):
- x = frame['final_' + variable_suffix]
- y = frame['gen_' + variable_suffix]
+ x = frame['gen_' + variable_suffix]
+ y = frame['final_' + variable_suffix]
_scatter(x, y)
pylab.title(variable_suffix)
filename = variable_suffix | summary scatter: fix inverted sense of {in,}dependent variable | probcomp_crosscat | train | py |
7452729324b3638968e92a14ba1d44aa8f65cae9 | diff --git a/metpy/tests/test_units.py b/metpy/tests/test_units.py
index <HASH>..<HASH> 100644
--- a/metpy/tests/test_units.py
+++ b/metpy/tests/test_units.py
@@ -58,6 +58,7 @@ def test_axvline():
def test_atleast1d_without_units():
"""Test that atleast_1d wrapper can handle plain arrays."""
assert_array_equal(atleast_1d(1), np.array([1]))
+ assert_array_equal(atleast_1d([1, ], [2, ]), np.array([[1, ], [2, ]]))
def test_atleast2d_without_units():
@@ -65,6 +66,12 @@ def test_atleast2d_without_units():
assert_array_equal(atleast_2d(1), np.array([[1]]))
+def test_atleast2d_with_units():
+ """Test that atleast_2d wrapper can handle plain array with units."""
+ assert_array_equal(
+ atleast_2d(1 * units.degC), np.array([[1]]) * units.degC)
+
+
def test_units_diff():
"""Test our diff handles units properly."""
assert_array_equal(diff(np.arange(20, 22) * units.degC), | increase coverage of metpy.units | Unidata_MetPy | train | py |
408ca9d4871e074cc9dbca59ca6a09f1590dbbe8 | diff --git a/src/Template/Template.php b/src/Template/Template.php
index <HASH>..<HASH> 100644
--- a/src/Template/Template.php
+++ b/src/Template/Template.php
@@ -18,7 +18,7 @@ class Template
/**
* The name of the template.
- * @var string
+ * @var Name
*/
protected $name;
@@ -222,7 +222,7 @@ class Template
{
foreach (explode('|', $functions) as $function) {
if ($this->engine->doesFunctionExist($function)) {
- $var = call_user_func(array($this->template, $function), $var);
+ $var = call_user_func(array($this, $function), $var);
} elseif (is_callable($function)) {
$var = call_user_func($function, $var);
} else { | Fix bug with batch function in Template.
Update name property docblock in Template. | thephpleague_plates | train | php |
01b4231f172ce51a1ea3337445e0256013d04296 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -83,7 +83,8 @@ function isValidQueryCharacter(ch) {
}
const gen = [':', '/', '?', '#', '[', ']', '@'].map(code)
const sub = ['!', '$', '&', "'", '(', ')', '*', '+', ',', ';', '='].map(code)
- return concat(ALPHA, DIGIT, gen, sub, code('.')).indexOf(code(ch)) > -1
+ const pct = ['%', '-', '_', '~'].map(code)
+ return concat(ALPHA, DIGIT, gen, sub, pct, code('.')).indexOf(code(ch)) > -1
}
// fragment = *( pchar / "/" / "?" ) | fix(index.js): Add missing chars for parse
Adds missing characters (%, -, _ and ~) for isValidQueryCharacter | AraBlocks_did-uri | train | js |
083a3969259e3b790f3e5e32b2c946eab0df9e00 | diff --git a/tests/test_render.py b/tests/test_render.py
index <HASH>..<HASH> 100644
--- a/tests/test_render.py
+++ b/tests/test_render.py
@@ -30,7 +30,7 @@ class TestPageRenderers(unittest.TestCase):
# f.write(rendered_page)
- def test_full_oobe_flow(sefl):
+ def test_full_oobe_flow(self):
df = ge.read_csv("examples/data/Titanic.csv")
# df = ge.read_csv("examples/data/Meteorite_Landings.csv")
df.autoinspect(ge.dataset.autoinspect.pseudo_pandas_profiling)
@@ -42,8 +42,8 @@ class TestPageRenderers(unittest.TestCase):
rendered_page = R.render()
assert rendered_page != None
- with open('./test.html', 'w') as f:
- f.write(rendered_page)
+ # with open('./test.html', 'w') as f:
+ # f.write(rendered_page)
class TestSectionRenderers(unittest.TestCase): | Suppress file write to appease travis | great-expectations_great_expectations | train | py |
7e75bb135fb233dec1e780c92163e10215af3967 | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -378,6 +378,15 @@ test("Readability", function () {
equal (tinycolor.mostReadable("#f00", ["#d00", "#0d0"]).toHexString(), "#00dd00", "pick most readable color");
});
+test("Filters", function () {
+
+ equal (tinycolor("red").toFilter(), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffff0000,endColorstr=#ffff0000)");
+ equal (tinycolor("red").toFilter("blue"), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffff0000,endColorstr=#ff0000ff)");
+
+ equal(tinycolor("transparent").toFilter(), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#00000000)");
+ equal(tinycolor("transparent").toFilter("red"), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#ffff0000)");
+});
+
/* Too slow: 1677731 possibilities
asyncTest("Ajax load", function() { | add tests for issue #<I> (toFilter) | bgrins_TinyColor | train | js |
eaa1f9ba7b5043b157f0ce96f4c74fbed729af4e | diff --git a/lib/jUI.php b/lib/jUI.php
index <HASH>..<HASH> 100644
--- a/lib/jUI.php
+++ b/lib/jUI.php
@@ -16,12 +16,6 @@
See LICENSE or LICENSE_COM for more information
=====================================================ATK4=*/
class jUI extends jQuery {
- /*
- ATK4 system for javascript file management
- */
- public $dir=null;
- private $theme=false;
-
private $atk4_initialised=false;
function init(){ | jUI: unused variables
I guess these are some leftovers from old versions | atk4_atk4 | train | php |
598596c7f6481d09f57d351299145d52e9eee9db | diff --git a/command/agent/agent.go b/command/agent/agent.go
index <HASH>..<HASH> 100644
--- a/command/agent/agent.go
+++ b/command/agent/agent.go
@@ -314,9 +314,18 @@ func (a *Agent) clientConfig() (*clientconfig.Config, error) {
if conf == nil {
conf = clientconfig.DefaultConfig()
}
+
+ // If we are running a server, append both its bind and advertise address so
+ // we are able to at least talk to the local server even if that isn't
+ // configured explicitly. This handles both running server and client on one
+ // host and -dev mode.
+ conf.Servers = a.config.Client.Servers
if a.server != nil {
- conf.RPCHandler = a.server
+ conf.Servers = append(conf.Servers,
+ a.config.Addresses.RPC,
+ a.config.AdvertiseAddrs.RPC)
}
+
conf.LogOutput = a.logOutput
conf.LogLevel = a.config.LogLevel
conf.DevMode = a.config.DevMode
@@ -333,7 +342,6 @@ func (a *Agent) clientConfig() (*clientconfig.Config, error) {
if a.config.Client.AllocDir != "" {
conf.AllocDir = a.config.Client.AllocDir
}
- conf.Servers = a.config.Client.Servers
if a.config.Client.NetworkInterface != "" {
conf.NetworkInterface = a.config.Client.NetworkInterface
} | Do not bypass normal RPC codepath when running both client and server at once | hashicorp_nomad | train | go |
330cc7316dc0135f4e78356bc8129e69b5440f4d | diff --git a/application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php b/application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php
index <HASH>..<HASH> 100644
--- a/application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php
+++ b/application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php
@@ -331,8 +331,11 @@ class CIPHPUnitTestRequest
// Set CodeIgniter instance to TestCase
$this->testCase->setCI($CI);
- // Set default response code 200
- set_status_header(200);
+ if (!isset($CI->output->_status)) { // prevent overwriting, if already set in the $class::__construct()
+ // Set default response code 200
+ set_status_header(200);
+ }
+
// Run callable
if ($this->callables !== [])
{ | Don't overwrite the response set in __construct()
It would be set to `<I>`, no matter what.
If a satus was set in the constructor, it would get replaced with `<I>`. | kenjis_ci-phpunit-test | train | php |
2d34d2341e568c4c78619363014a1fe6e7785751 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -18,13 +18,16 @@
from setuptools import find_packages, setup
-with open('requirements.txt', 'rt') as reqs_file:
+with open('requirements.txt', 'rt', encoding="ascii") as reqs_file:
REQUIREMENTS = reqs_file.readlines()
+with open('README.rst', encoding="ascii") as readme_file:
+ readme_content = readme_file.read()
+
setup(
name='foremast',
description='Tools for creating infrastructure and Spinnaker Pipelines.',
- long_description=open('README.rst').read(),
+ long_description=readme_content,
long_description_content_type='text/x-rst',
author='Foremast',
author_email='ps-devops-tooling@example.com', | fix: file open linting issues in setup.py | foremast_foremast | train | py |
85f3417e6843a2bf1636140de93b1b52332259c8 | diff --git a/phoebe/atmospheres/create_atmospherefits.py b/phoebe/atmospheres/create_atmospherefits.py
index <HASH>..<HASH> 100644
--- a/phoebe/atmospheres/create_atmospherefits.py
+++ b/phoebe/atmospheres/create_atmospherefits.py
@@ -21,6 +21,7 @@ try: # Pyfits now integrated in astropy
except:
import astropy.io.fits as pyfits
import argparse
+import scipy.ndimage.filters
logger = logging.getLogger("ATM.GRID") | Smoothing before computing beaming factors to avoid numerical issues caused by metal lines | phoebe-project_phoebe2 | train | py |
ac849e3d4facb0833aa43cb73cecf7cd02f38c80 | diff --git a/ryu/services/protocols/bgp/base.py b/ryu/services/protocols/bgp/base.py
index <HASH>..<HASH> 100644
--- a/ryu/services/protocols/bgp/base.py
+++ b/ryu/services/protocols/bgp/base.py
@@ -285,7 +285,7 @@ class Activity(object):
"""Stops all threads spawn by this activity.
"""
for thread_name, thread in list(self._child_thread_map.items()):
- if name is not None and thread_name is name:
+ if name is None or thread_name == name:
LOG.debug('%s: Stopping child thread %s',
self.name, thread_name)
thread.kill() | Fix major bug in child thread cleanup logic
Without this fix, one cannot restart BGP Speaker instances | osrg_ryu | train | py |
542d2e3b06095ff90bba382bf0b05adc8e62f91a | diff --git a/tests/databases/api_tests.py b/tests/databases/api_tests.py
index <HASH>..<HASH> 100644
--- a/tests/databases/api_tests.py
+++ b/tests/databases/api_tests.py
@@ -358,7 +358,6 @@ class TestDatabaseApi(SupersetTestCase):
database_data = {"database_name": "test-database-updated"}
uri = f"api/v1/database/{test_database.id}"
rv = self.client.put(uri, json=database_data)
- print(rv.data.decode("utf-8"), database_data)
self.assertEqual(rv.status_code, 200)
# Cleanup
model = db.session.query(Database).get(test_database.id) | chore: clean up a debug line from #<I> (#<I>) | apache_incubator-superset | train | py |
bb6eee8b20b836aac4ee7c34d0bea641bc173922 | diff --git a/lib/config.js b/lib/config.js
index <HASH>..<HASH> 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -25,6 +25,8 @@ module.exports = function (options) {
}
}
+ config.hooks = require('./hooks')(config.plugins)
+
_.each(_.values(config.paths), _.ary(mkdirp.sync, 1))
var bindAddress = options.bindAddress || '127.0.0.1'
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -44,8 +44,6 @@ exports.init = function (env_config, callback) {
}
exports.configureServer = function (server, env_config, callback) {
- env_config.hooks = require('./hooks')(env_config.plugins)
-
server.connection({
port: env_config.app.port,
labels: ['web'] | refactor(hooks): move initialisation to config | hoodiehq_hoodie-server | train | js,js |
9249ed3dc44a30f7dc205b5c8d2683613f2e9b76 | diff --git a/moban/utils.py b/moban/utils.py
index <HASH>..<HASH> 100644
--- a/moban/utils.py
+++ b/moban/utils.py
@@ -72,7 +72,7 @@ def write_file_out(filename, content):
mkdir_p(dest_folder)
if PY2:
- if isinstance(filename, unicode):
+ if isinstance(filename, unicode) is False:
filename = unicode(filename)
dir_name = fs_path.dirname(filename)
the_file_name = fs_path.basename(filename) | :green_heart: fix file writing | moremoban_moban | train | py |
ba3a64b685661dd1a2ace758f12c82be661ca46b | diff --git a/sentry/helpers.py b/sentry/helpers.py
index <HASH>..<HASH> 100644
--- a/sentry/helpers.py
+++ b/sentry/helpers.py
@@ -76,7 +76,7 @@ def transform(value):
return str(value)
except:
return to_unicode(value)
- elif hasattr(value, '__sentry__'):
+ elif callable(getattr(value, '__sentry__', None)):
return value.__sentry__()
elif not isinstance(value, (int, bool)) and value is not None:
# XXX: we could do transform(repr(value)) here | Log helper bugfix: check that __sentry__ is callable first | elastic_apm-agent-python | train | py |
b60cb8a81f87658dc258a2b470cf10e4b609ad99 | diff --git a/examples/nautilus.py b/examples/nautilus.py
index <HASH>..<HASH> 100755
--- a/examples/nautilus.py
+++ b/examples/nautilus.py
@@ -8,8 +8,8 @@ import os
from babelfish import Language
from gi.repository import GObject, Gtk, Nautilus
-from subliminal import (VIDEO_EXTENSIONS, ProviderPool, __copyright__, __version__, check_video, provider_manager, region, save_subtitles, scan_video,
- scan_videos, compute_score)
+from subliminal import (VIDEO_EXTENSIONS, ProviderPool, __copyright__, __version__, check_video, compute_score,
+ provider_manager, region, save_subtitles, scan_video, scan_videos)
from subliminal.cli import Config, MutexLock, app_dir, cache_file, config_file
locale.bindtextdomain('subliminal', os.path.join(os.path.dirname(__file__), 'subliminal', 'locale')) | pep8 for nautilus | Diaoul_subliminal | train | py |
8dce1b477dd16f5b250ab6e7026213196a9ebb81 | diff --git a/doc/sphinxext/gen_rst.py b/doc/sphinxext/gen_rst.py
index <HASH>..<HASH> 100644
--- a/doc/sphinxext/gen_rst.py
+++ b/doc/sphinxext/gen_rst.py
@@ -61,7 +61,7 @@ HLIST_IMAGE_TEMPLATE = """
*
.. image:: images/%s
- :scale: 50
+ :scale: 47
"""
SINGLE_IMAGE = """ | MISC: make sure two figures hold on a line | sphinx-gallery_sphinx-gallery | train | py |
c510decc17a0785c8b02da39d682bbf6f044b2ab | diff --git a/src/python/dxpy/bindings/search.py b/src/python/dxpy/bindings/search.py
index <HASH>..<HASH> 100644
--- a/src/python/dxpy/bindings/search.py
+++ b/src/python/dxpy/bindings/search.py
@@ -426,10 +426,16 @@ def find_projects(name=None, level=None, describe=None, public=None, **kwargs):
resp = dxpy.api.systemFindProjects(query, **kwargs)
- for i in resp["results"]:
- yield i
- if "public" in resp:
+ if 'public' in resp:
+ found_projects = {}
+ for i in resp["results"]:
+ found_projects[i['id']] = True
+ yield i
for i in resp["public"]:
+ if i['id'] not in found_projects:
+ yield i
+ else:
+ for i in resp["results"]:
yield i
def find_apps(name=None, category=None, all_versions=None, published=None, | fixing bug where public projects that you explicitly have >= VIEW are reported twice | dnanexus_dx-toolkit | train | py |
735a583fb87991a740ba6400cfee8ef85ae4695a | diff --git a/logger.go b/logger.go
index <HASH>..<HASH> 100644
--- a/logger.go
+++ b/logger.go
@@ -497,13 +497,19 @@ func (l *Logger) Scan(r io.Reader) (cancel func()) {
// Clone returns a copy of this "l" Logger.
// This copy is returned as pointer as well.
func (l *Logger) Clone() *Logger {
+ // copy level output map.
+ levelOutput := make(map[Level]io.Writer, len(l.LevelOutput))
+ for k, v := range l.LevelOutput {
+ levelOutput[k] = v
+ }
+
return &Logger{
Prefix: l.Prefix,
Level: l.Level,
TimeFormat: l.TimeFormat,
NewLine: l.NewLine,
Printer: l.Printer,
- LevelOutput: l.LevelOutput,
+ LevelOutput: levelOutput,
handlers: l.handlers,
children: newLoggerMap(),
mu: sync.Mutex{}, | copy leveled outputs on Clone | kataras_golog | train | go |
1d3790e1517362b65288072ba1c4a63b929b11c6 | diff --git a/functional/client_test.go b/functional/client_test.go
index <HASH>..<HASH> 100644
--- a/functional/client_test.go
+++ b/functional/client_test.go
@@ -39,7 +39,14 @@ func TestKnownHostsVerification(t *testing.T) {
t.Errorf("Unable to SSH into fleet machine: \nstdout: %s\nstderr: %s\nerr: %v", stdout, stderr, err)
}
- // Recreation of the cluster simulates a change in the server's host key
+ // Gracefully poweroff the machine to allow fleet to purge its state.
+ cluster.PoweroffMember("1")
+
+ machines, err = cluster.WaitForNMachines(0)
+ if err != nil {
+ t.Fatal(err)
+ }
+
cluster.DestroyMember("1")
cluster.CreateMember("1", platform.MachineConfig{})
machines, err = cluster.WaitForNMachines(1) | functional: wait for machine to shut down | coreos_fleet | train | go |
8a084b284b7676e08e983a9228ea47172dae184f | diff --git a/src/Parser/Anime/EpisodesParser.php b/src/Parser/Anime/EpisodesParser.php
index <HASH>..<HASH> 100644
--- a/src/Parser/Anime/EpisodesParser.php
+++ b/src/Parser/Anime/EpisodesParser.php
@@ -57,8 +57,14 @@ class EpisodesParser implements ParserInterface
public function getEpisodesLastPage(): int
{
$episodesLastPage = $this->crawler
- ->filterXPath('//div[contains(@class, \'pagination\')]')
- ->children();
+ ->filterXPath('//div[contains(@class, \'pagination\')]');
+
+ if (!$episodesLastPage->count()) {
+ return 1;
+ }
+
+ $episodesLastPage = $episodesLastPage->children();
+
if ($episodesLastPage->getNode(1)->tagName === 'span') {
$episodesLastPage = $episodesLastPage | review AnimeEpisodes | jikan-me_jikan | train | php |
a63233c50b3dd8d4c2c3d92ec46e9219ed8340f2 | diff --git a/metric_tank/http.go b/metric_tank/http.go
index <HASH>..<HASH> 100644
--- a/metric_tank/http.go
+++ b/metric_tank/http.go
@@ -85,6 +85,11 @@ func Get(w http.ResponseWriter, req *http.Request, store Store, defCache *DefCac
http.Error(w, "missing target arg", http.StatusBadRequest)
return
}
+ if len(targets)*int(maxDataPoints) > 100*1000 {
+ http.Error(w, "too much data requested", http.StatusBadRequest)
+ return
+ }
+
now := time.Now()
fromUnix := uint32(now.Add(-time.Duration(24) * time.Hour).Unix())
toUnix := uint32(now.Add(time.Duration(1) * time.Second).Unix())
@@ -110,6 +115,10 @@ func Get(w http.ResponseWriter, req *http.Request, store Store, defCache *DefCac
http.Error(w, "to must be higher than from", http.StatusBadRequest)
return
}
+ if len(targets)*int(toUnix-fromUnix) > 2*365*24*3600 {
+ http.Error(w, "too much data requested", http.StatusBadRequest)
+ return
+ }
reqs := make([]Req, len(targets))
for i, target := range targets { | limit amount of points and timeframe you can query | grafana_metrictank | train | go |
68fb4afa09f7e68750450a6a34c8d28cdd87576b | diff --git a/src/Illuminate/Session/SessionServiceProvider.php b/src/Illuminate/Session/SessionServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Session/SessionServiceProvider.php
+++ b/src/Illuminate/Session/SessionServiceProvider.php
@@ -116,6 +116,11 @@ class SessionServiceProvider extends ServiceProvider {
*/
protected function registerCloseEvent()
{
+ if ($this->getDriver() == 'array') return;
+
+ // The cookie toucher is responsbile for updating the expire time on the cookie
+ // so that it is refreshed for each page load. Otherwise it is only set here
+ // once by PHP and never updated on each subsequent page load of the apps.
$this->registerCookieToucher();
$app = $this->app;
@@ -166,4 +171,14 @@ class SessionServiceProvider extends ServiceProvider {
return $config['lifetime'] == 0 ? 0 : time() + ($config['lifetime'] * 60);
}
+ /**
+ * Get the session driver name.
+ *
+ * @return string
+ */
+ protected function getDriver()
+ {
+ return $this->app['config']['session.driver'];
+ }
+
}
\ No newline at end of file | Do not set cookie when using array driver. | laravel_framework | train | php |
cc6e8deff1e6459036fee00d3bdb03ee3ccf46d2 | diff --git a/pptx/chart/series.py b/pptx/chart/series.py
index <HASH>..<HASH> 100644
--- a/pptx/chart/series.py
+++ b/pptx/chart/series.py
@@ -118,7 +118,7 @@ class BarSeries(_BaseCategorySeries):
"""
msg = (
'BarSeries.fill property is deprecated and will be removed in a '
- 'future release.'
+ 'future release Use .format.fill instead.'
)
warn(msg, UserWarning, stacklevel=2)
diff --git a/pptx/shapes/placeholder.py b/pptx/shapes/placeholder.py
index <HASH>..<HASH> 100644
--- a/pptx/shapes/placeholder.py
+++ b/pptx/shapes/placeholder.py
@@ -300,7 +300,7 @@ class ChartPlaceholder(_BaseSlidePlaceholder):
Return a newly created `p:graphicFrame` element having the specified
position and size and containing the chart identified by *rId*.
"""
- id_, name = self.id, self.name
+ id_, name = self.shape_id, self.name
return CT_GraphicalObjectFrame.new_chart_graphicFrame(
id_, name, rId, x, y, cx, cy
) | fix: a couple of lingering deprecation warnings | scanny_python-pptx | train | py,py |
39452d6b9c193e6f879ace0df902212ca9929e3f | diff --git a/opt/cs50/submit50/bin/submit50.py b/opt/cs50/submit50/bin/submit50.py
index <HASH>..<HASH> 100755
--- a/opt/cs50/submit50/bin/submit50.py
+++ b/opt/cs50/submit50/bin/submit50.py
@@ -186,6 +186,14 @@ def submit(problem):
config = {"course": course}
with open(CONFIG_PATH, "w") as f:
json.dump(config, f)
+
+ # course identifier specified at command line, cache it
+ else:
+ with open(CONFIG_PATH, "r") as f:
+ config = json.load(f)
+ config["course"] = course
+ with open(CONFIG_PATH, "w") as f:
+ json.dump(config, f)
# ensure problem exists
global EXCLUDE | Cache course identifier if provided at command line | cs50_submit50 | train | py |
e5b290ff836b6ba1f38b0fd3e89bb2ff76f271f3 | diff --git a/lib/moped/database.rb b/lib/moped/database.rb
index <HASH>..<HASH> 100644
--- a/lib/moped/database.rb
+++ b/lib/moped/database.rb
@@ -115,8 +115,10 @@ module Moped
# @since 1.0.0
def collection_names
Collection.new(self, "system.namespaces").
- find(name: { "$not" => /system|\$/ }).to_a.
- map{|collection| collection["name"].split(".", 2).last}
+ find(name: { "$not" => /system|\$/ }).
+ map do |doc|
+ doc["name"].sub(/^#{name}./, '')
+ end
end
end
end | Slight change in collection_names | mongoid_moped | train | rb |
83be4c51352c0c7262bc7b147bbc4fda8d80074d | diff --git a/lib/whenever/capistrano.rb b/lib/whenever/capistrano.rb
index <HASH>..<HASH> 100644
--- a/lib/whenever/capistrano.rb
+++ b/lib/whenever/capistrano.rb
@@ -1,3 +1,4 @@
+require 'capistrano/version'
if defined?(Capistrano::VERSION) && Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0')
load File.expand_path("../tasks/whenever.rake", __FILE__)
else | load capistrano/version so we can test it. | javan_whenever | train | rb |
6b3ace6a20c0d64607d1aa31714ae9dce4702c9d | diff --git a/lib/motion/project/cocoapods.rb b/lib/motion/project/cocoapods.rb
index <HASH>..<HASH> 100644
--- a/lib/motion/project/cocoapods.rb
+++ b/lib/motion/project/cocoapods.rb
@@ -88,7 +88,6 @@ module Motion::Project
@podfile.platform(platform, config.deployment_target)
@podfile.target(TARGET_NAME)
cp_config.podfile = @podfile
- cp_config.skip_repo_update = true
cp_config.installation_root = Pathname.new(File.expand_path(config.project_dir)) + 'vendor'
if cp_config.verbose = !!ENV['COCOAPODS_VERBOSE'] | remove `skip_repo_update' which was removed at CocoaPods <I>.beta<I>
<URL> | HipByte_motion-cocoapods | train | rb |
4deb6ec9ec7ac9da63bcbf8ec0e3519cfabce96e | diff --git a/client/info.go b/client/info.go
index <HASH>..<HASH> 100644
--- a/client/info.go
+++ b/client/info.go
@@ -4,6 +4,8 @@ import (
"fmt"
"strings"
+ "github.com/docker/go-units"
+
gflag "github.com/jessevdk/go-flags"
)
@@ -51,14 +53,6 @@ func (cli *HyperClient) HyperCmdInfo(args ...string) error {
}
func getMemSizeString(s int) string {
- var rtn float64
- if s < 1024*1024 {
- return fmt.Sprintf("%d KB", s)
- } else if s < 1024*1024*1024 {
- rtn = float64(s) / (1024.0 * 1024.0)
- return fmt.Sprintf("%.1f MB", rtn)
- } else {
- rtn = float64(s) / (1024.0 * 1024.0 * 1024.0)
- return fmt.Sprintf("%.1f GB", rtn)
- }
+ rtn := float64(s)
+ return units.HumanSize(rtn)
} | when dealing memory size, use go-units | hyperhq_hyperd | train | go |
ded776916e0f1f43f00786a60089ea876713e35f | diff --git a/src/geo/leaflet/leaflet-cartodb-vector-layer-group-view.js b/src/geo/leaflet/leaflet-cartodb-vector-layer-group-view.js
index <HASH>..<HASH> 100644
--- a/src/geo/leaflet/leaflet-cartodb-vector-layer-group-view.js
+++ b/src/geo/leaflet/leaflet-cartodb-vector-layer-group-view.js
@@ -30,9 +30,6 @@ var LeafletCartoDBVectorLayerGroupView = CartoDBd3Layer.extend({
layerModel.layers.bind('change:meta', function (child, meta) {
var index = layerModel.layers.indexOf(child);
this.options.styles[index] = meta.cartocss;
- if (this.options.styles.indexOf(undefined) === -1) {
- this.setUrl(this.model.get('urls').tiles[0]);
- }
}, this);
layerModel.layers.each(function (layer) {
@@ -66,6 +63,7 @@ var LeafletCartoDBVectorLayerGroupView = CartoDBd3Layer.extend({
_onTileJSONChanged: function () {
var tilejson = this.model.get('urls');
this.options.styles = this.model.layers.pluck('cartocss');
+ this.setUrl(this.model.get('urls').tiles[0]);
},
onAdd: function (map) { | sets styles in meta withougt setting url | CartoDB_carto.js | train | js |
475de32cd94045d12b243cd7d07e7c54ed211adb | diff --git a/ui/src/dashboards/graphics/graph.js b/ui/src/dashboards/graphics/graph.js
index <HASH>..<HASH> 100644
--- a/ui/src/dashboards/graphics/graph.js
+++ b/ui/src/dashboards/graphics/graph.js
@@ -503,6 +503,7 @@ export const GRAPH_TYPES = [
menuOption: 'Gauge',
graphic: GRAPH_SVGS.gauge,
},
+ // FEATURE FLAG for Table-Graph
// {
// type: 'table',
// menuOption: 'Table', | Add comment indicating location of feature flag | influxdata_influxdb | train | js |
337b3d323512e34c354ddbc61d1aee82a4d56ccb | diff --git a/lib/waterline/utils/query/help-find.js b/lib/waterline/utils/query/help-find.js
index <HASH>..<HASH> 100644
--- a/lib/waterline/utils/query/help-find.js
+++ b/lib/waterline/utils/query/help-find.js
@@ -66,6 +66,20 @@ module.exports = function helpFind(WLModel, s2q, omen, done) {
// Set up a few, common local vars for convenience / familiarity.
var orm = WLModel.waterline;
+ // Keep track of any populates which were explicitly set to `false`.
+ // (This is a special indicator that FS2Q adds when a particular subcriteria
+ // turns out to be a no-op. This is important so that we make sure to still
+ // explicitly attach the appropriate base value for the association-- for
+ // example an empty array `[]`. This avoids breaking any userland code which
+ // might be relying on the datatype, such as a `.length`, a `x[n]`, or a loop.)
+ var populatesExplicitlySetToFalse = [];
+ for (var assocAttrName in s2q.populates) {
+ var subcriteria = s2q.populates[assocAttrName];
+ if (subcriteria === false) {
+ populatesExplicitlySetToFalse.push(assocAttrName);
+ }
+ }//∞
+
// Build an initial stage three query (s3q) from the incoming stage 2 query (s2q).
var parentQuery = forgeStageThreeQuery({
stageTwoQuery: s2q, | Track associations explicitly set to false in help-find util | balderdashy_waterline | train | js |
e80fdc4d489fc9a5156a94f287dd238f3770d4e3 | diff --git a/goxpath/goxpath.go b/goxpath/goxpath.go
index <HASH>..<HASH> 100644
--- a/goxpath/goxpath.go
+++ b/goxpath/goxpath.go
@@ -14,6 +14,15 @@ func Exec(xp XPathExec, t tree.Node, ns map[string]string) ([]tree.Res, error) {
return parser.Exec(xp, t, ns)
}
+//MustExec is like Exec, but panics instead of returning an error.
+func MustExec(xp XPathExec, t tree.Node, ns map[string]string) []tree.Res {
+ res, err := parser.Exec(xp, t, ns)
+ if err != nil {
+ panic(err)
+ }
+ return res
+}
+
//MustParse is like Parse, but panics instead of returning an error.
func MustParse(xp string) XPathExec {
return parser.MustParse(xp) | Adding a MustExec method for convenience. | ChrisTrenkamp_goxpath | train | go |
b5c072c66c311589ea08c948b7d93fb9e8647755 | diff --git a/buildbot/test/test_vc.py b/buildbot/test/test_vc.py
index <HASH>..<HASH> 100644
--- a/buildbot/test/test_vc.py
+++ b/buildbot/test/test_vc.py
@@ -2598,7 +2598,7 @@ class MercurialInRepoHelper(MercurialHelper):
vc_try_checkout = deferredGenerator(vc_try_checkout)
def vc_try_finish(self, workdir):
-# rmdirRecursive(workdir)
+ rmdirRecursive(workdir)
pass | Remove accidentally left comment from cleanup step in MercurialInRepo test | buildbot_buildbot | train | py |
56b7abacf8649914e788e2ebf6309eb55f6a2938 | diff --git a/src/buildApp.js b/src/buildApp.js
index <HASH>..<HASH> 100644
--- a/src/buildApp.js
+++ b/src/buildApp.js
@@ -63,8 +63,8 @@ function buildApp(options, callback) {
(appPathArray, callback) => {
// somehow appPathArray is a 1 element array
- if (appPathArray.length !== 1) {
- console.warn('Warning: Packaged app path contains more than one element', appPathArray);
+ if (appPathArray.length > 1) {
+ console.warn('Warning: Packaged app path contains more than one element:', appPathArray);
}
const appPath = appPathArray[0];
callback(null, appPath); | Fix bug in console warning when not overwritting an existing executable | jiahaog_nativefier | train | js |
4e07ed78b5f66fdbd122b7ff6cb329d3bf57b377 | diff --git a/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js b/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js
index <HASH>..<HASH> 100644
--- a/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js
+++ b/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js
@@ -43,7 +43,7 @@
function commaDelimitedFieldToArray (value) {
- if(value === undefined || value === null || value === '')
+ if(!value)
return [];
return value.split(','); | refs #<I> fix sites manager was broken | matomo-org_matomo | train | js |
2c1c99dcf08cec8f600c85bc5ebcf65e4b762a93 | diff --git a/fleet.go b/fleet.go
index <HASH>..<HASH> 100644
--- a/fleet.go
+++ b/fleet.go
@@ -50,7 +50,7 @@ func main() {
cfgset.String("metadata", "", "List of key-value metadata to assign to the fleet machine")
cfgset.String("unit_prefix", "", "Prefix that should be used for all systemd units")
cfgset.String("agent_ttl", agent.DefaultTTL, "TTL in seconds of fleet machine state in etcd")
- cfgset.Bool("verify_units", true, "Verify unit file signatures using local SSH identities")
+ cfgset.Bool("verify_units", false, "Verify unit file signatures using local SSH identities")
cfgset.String("authorized_key_file", sign.DefaultAuthorizedKeyFile, "File that contains authorized keys to be used for signature verification")
globalconf.Register("", cfgset) | chore(fleet): set verify_units to be false as default
This should have consistent default value with `verify` and `sign`
in fleetctl. | coreos_fleet | train | go |
42cf3db8459474aa40811f826a5c1df0393b36b3 | diff --git a/spec/tree/assess/TreeAssessorSpec.js b/spec/tree/assess/TreeAssessorSpec.js
index <HASH>..<HASH> 100644
--- a/spec/tree/assess/TreeAssessorSpec.js
+++ b/spec/tree/assess/TreeAssessorSpec.js
@@ -226,6 +226,30 @@ describe( "TreeAssessor", () => {
expect( assessment ).toEqual( assessmentToGet );
} );
+
+ it( "return null if an assessment under the given name does not exist", () => {
+ const researcher = new TreeResearcher();
+ const research = new TestResearch();
+ researcher.addResearch( "test research", research );
+
+ const assessmentToGet = new TestAssessment( true, 4, "assessment to get", researcher );
+
+ const scoreAggregator = new TestAggregator();
+ const assessments = [
+ new TestAssessment( true, 8, "assessment not to get", researcher ),
+ assessmentToGet,
+ ];
+ const assessor = new TreeAssessor( {
+ researcher,
+ scoreAggregator,
+ i18n,
+ assessments,
+ } );
+
+ const assessment = assessor.getAssessment( "unknown assessment" );
+
+ expect( assessment ).toEqual( null );
+ } );
} );
describe( "setAssessments", () => { | Added test case for getting an undefined assessment. | Yoast_YoastSEO.js | train | js |
38239c7a3b9d381f32068b7572a346d45b6b3043 | diff --git a/src/config-wrapper.js b/src/config-wrapper.js
index <HASH>..<HASH> 100644
--- a/src/config-wrapper.js
+++ b/src/config-wrapper.js
@@ -78,9 +78,11 @@ function wrap(func, required, ...configs) {
transactionId,
} = context.invocation;
+ const authorization = getToken(request);
+
const options = {
headers: {
- authorization: getToken(request),
+ ...(authorization ? { authorization } : authorization),
},
}; | refactor(config): conditionally set authorization header | adobe_helix-shared | train | js |
4a101f48a311f3eeac72b0e00b1120b96fca6fc7 | diff --git a/openquake/hazardlib/calc/filters.py b/openquake/hazardlib/calc/filters.py
index <HASH>..<HASH> 100644
--- a/openquake/hazardlib/calc/filters.py
+++ b/openquake/hazardlib/calc/filters.py
@@ -209,7 +209,7 @@ class SourceFilter(object):
if sitecol is not None and len(sitecol) < len(sitecol.complete):
raise ValueError('%s is not complete!' % sitecol)
self.hdf5path = hdf5path
- if (hdf5path and
+ if hdf5path and (
config.distribution.oq_distribute in ('no', 'processpool') or
config.directory.shared_dir): # store the sitecol
with hdf5.File(hdf5path, 'w') as h5: | Small fix [skip CI] | gem_oq-engine | train | py |
cb4ecd21126dcd23a4fd0488c23dc7b4e8082514 | diff --git a/snmp/tests/test_e2e_snmp_listener.py b/snmp/tests/test_e2e_snmp_listener.py
index <HASH>..<HASH> 100644
--- a/snmp/tests/test_e2e_snmp_listener.py
+++ b/snmp/tests/test_e2e_snmp_listener.py
@@ -40,7 +40,9 @@ def test_e2e_snmp_listener(dd_agent_check, container_ip, autodiscovery_ready):
"""
snmp_device = _build_device_ip(container_ip)
subnet_prefix = ".".join(container_ip.split('.')[:3])
- aggregator = dd_agent_check({'init_config': {}, 'instances': []}, rate=True)
+ aggregator = dd_agent_check(
+ {'init_config': {}, 'instances': []}, rate=True, discovery_min_instances=5, discovery_timeout=10
+ )
# === network profile ===
common_tags = [ | Add discovery_min_instances to SNMP Listener test (#<I>) | DataDog_integrations-core | train | py |
a57c7c7d94996ccbc81cb2e94b023eb0fe901b8e | diff --git a/core-bundle/src/Resources/contao/modules/Module.php b/core-bundle/src/Resources/contao/modules/Module.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/modules/Module.php
+++ b/core-bundle/src/Resources/contao/modules/Module.php
@@ -283,6 +283,12 @@ abstract class Module extends \Frontend
if ($objNext !== null)
{
+ // Hide the link if the target page is invisible
+ if (!$objNext->published || ($objNext->start != '' && $objNext->start > time()) || ($objNext->stop != '' && $objNext->stop < time()))
+ {
+ continue(2);
+ }
+
$strForceLang = null;
$objNext->loadDetails(); | [Core] Hide forward pages if they point to unpublished target pages (see #<I>) | contao_contao | train | php |
c644eaa0fe15daf5810be717b82c6e459806b3c6 | diff --git a/ulid.go b/ulid.go
index <HASH>..<HASH> 100644
--- a/ulid.go
+++ b/ulid.go
@@ -78,14 +78,10 @@ var (
// ErrBigTime is returned when passing a timestamp bigger than MaxTime.
// Reading from the entropy source may also return an error.
func New(ms uint64, entropy io.Reader) (id ULID, err error) {
- if err = id.SetTime(ms); err != nil {
+ if err = id.SetTime(ms); err != nil || entropy == nil {
return id, err
}
- if entropy == nil {
- return id, nil
- }
-
switch e := entropy.(type) {
case *monotonic:
if len(e.prev) != 0 && e.ms == ms { | Merge if clauses in New | oklog_ulid | train | go |
63b6eb379ee930f9839748a7fc68d7b825779540 | diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -130,12 +130,6 @@ func changeMapToURLValues(data map[string]interface{}) url.Values {
switch val := v.(type) {
case string:
newUrlValues.Add(k, string(val))
- case []interface{}:
- for _, element := range val {
- if elementStr, ok := element.(string); ok {
- newUrlValues.Add(k, elementStr)
- }
- }
case []string:
for _, element := range val {
newUrlValues.Add(k, element) | Removed unnessary case for mapping url.Values | parnurzeal_gorequest | train | go |
f3bda05436c9ae4689e04d5b0db2c964a67da9b4 | diff --git a/tests/integration/test_real_browser.py b/tests/integration/test_real_browser.py
index <HASH>..<HASH> 100644
--- a/tests/integration/test_real_browser.py
+++ b/tests/integration/test_real_browser.py
@@ -178,7 +178,7 @@ class IntegrationServers:
self.servers = {}
-def run_integration_server():
+def _run_integration_server():
"""Runs integration server for interactive debugging."""
logging.basicConfig(level=logging.INFO)
@@ -209,4 +209,4 @@ if __name__ == "__main__":
# This module can be run in the following way:
# $ python -m tests.integration.test_real_browser
# from aiohttp_cors root directory.
- run_integration_server()
+ _run_integration_server() | make run_integration_server() private | aio-libs_aiohttp-cors | train | py |
e2e0854dff9b5486e0b10f0d4dc5b60bb30f36ab | diff --git a/lib/link.js b/lib/link.js
index <HASH>..<HASH> 100644
--- a/lib/link.js
+++ b/lib/link.js
@@ -23,7 +23,7 @@ function Link(session, handle, linkPolicy) {
this.remoteHandle = undefined;
this._onAttach = [];
- if (!!this.policy.reattach) {
+ if (this.policy && this.policy.reattach) {
this._timeouts = u.generateTimeouts(this.policy.reattach);
}
diff --git a/lib/session.js b/lib/session.js
index <HASH>..<HASH> 100644
--- a/lib/session.js
+++ b/lib/session.js
@@ -242,10 +242,10 @@ Session.prototype._removeLink = function(link) {
delete this._allocatedHandles[link.policy.options.handle];
if (link instanceof SenderLink) {
debug('Removing sender link ' + link.name);
- delete self._senderLinks[link.name];
+ delete this._senderLinks[link.name];
} else {
debug('Removing receiver link ' + link.name);
- delete self._receiverLinks[link.name];
+ delete this._receiverLinks[link.name];
}
}; | Better protection against missing policy in link for some unit-tests | noodlefrenzy_node-amqp10 | train | js,js |
4cb8ae6c8a8d69d906b330d3c70da084f28e8873 | diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java
index <HASH>..<HASH> 100644
--- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java
+++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2021 the original author or authors.
+ * Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,6 +50,12 @@ final class StandardGitHubRepository implements GitHubRepository {
requestBody.put("labels", labels);
}
requestBody.put("body", body);
+ try {
+ Thread.sleep(1000);
+ }
+ catch (InterruptedException ex) {
+ Thread.currentThread().interrupt();
+ }
ResponseEntity<Map> response = this.rest.postForEntity("issues", requestBody, Map.class);
return (Integer) response.getBody().get("number");
} | Try to avoid hitting secondary rate limit when opening issues
GitHub employs a secondary rate limit for actions that can trigger
notifications, such as opening a new issue. To avoid hitting this
limit, they recommend [1] waiting at least one second between each
request.
This commit attempts to comply with this guidance by adding a
one-second sleep prior to each POST request that opens an issue.
Closes gh-<I>
[1] <URL> | spring-projects_spring-boot | train | java |
89f896d698d09ca3f3b3d7d8a33d09aa4d17c24b | diff --git a/framework/views/alertDialog.js b/framework/views/alertDialog.js
index <HASH>..<HASH> 100644
--- a/framework/views/alertDialog.js
+++ b/framework/views/alertDialog.js
@@ -144,6 +144,8 @@ limitations under the License.
* Destroy alert dialog.
*/
destroy: function() {
+ this._mask.off();
+
this._element.remove();
this._mask.remove();
this._deviceBackButtonHandler.destroy();
diff --git a/framework/views/popover.js b/framework/views/popover.js
index <HASH>..<HASH> 100644
--- a/framework/views/popover.js
+++ b/framework/views/popover.js
@@ -276,6 +276,7 @@ limitations under the License.
destroy: function() {
this._scope.$destroy();
+ this._mask.off();
this._mask.remove();
this._popover.remove();
this._element.remove(); | Unbind event handlers to prevent memory leak. | OnsenUI_OnsenUI | train | js,js |
80facbd81bc61484f5fbea79e2c329334e67c414 | diff --git a/forms/EmailField.php b/forms/EmailField.php
index <HASH>..<HASH> 100644
--- a/forms/EmailField.php
+++ b/forms/EmailField.php
@@ -11,11 +11,12 @@ class EmailField extends TextField {
}
function getAttributes() {
- $attrs = array(
- 'type' => 'email',
+ return array_merge(
+ parent::getAttributes(),
+ array(
+ 'type' => 'email'
+ )
);
-
- return array_merge($attrs, $this->attributes);
}
/** | BUGFIX Ensure merging correctly | silverstripe_silverstripe-framework | train | php |
f7d1ce886c56d3562b1ce23156055351d827c063 | diff --git a/extending/optimize/optimize.php b/extending/optimize/optimize.php
index <HASH>..<HASH> 100644
--- a/extending/optimize/optimize.php
+++ b/extending/optimize/optimize.php
@@ -18,7 +18,7 @@
function rah_backup__optimize() {
@$tables = getThings('SHOW TABLES');
- foreach((array) $tables as $table) {
+ foreach($tables as $table) {
@safe_query('OPTIMIZE TABLE `'.$table.'`');
}
} | getThings should always return an array. | gocom_rah_backup | train | php |
c75eb594960dc6b9bfd4b3f038cb5f086819873e | diff --git a/lib/cucumber/cli/configuration.rb b/lib/cucumber/cli/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/cucumber/cli/configuration.rb
+++ b/lib/cucumber/cli/configuration.rb
@@ -136,7 +136,7 @@ module Cucumber
end
def tag_limits
- tag_expression.limits
+ tag_expression.limits.to_hash
end
def tag_expressions | Cast tag limits to Hash because jruby | cucumber_cucumber-ruby | train | rb |
845e2a902d65637e5d681d8b068929c6f0fd4a2b | diff --git a/ghostjs-core/src/ghostjs.js b/ghostjs-core/src/ghostjs.js
index <HASH>..<HASH> 100644
--- a/ghostjs-core/src/ghostjs.js
+++ b/ghostjs-core/src/ghostjs.js
@@ -92,6 +92,10 @@ class Ghost {
page.set('viewportSize', options.viewportSize)
}
+ page.onResourceTimeout = (url) => {
+ console.log('page timeout when trying to load ', url)
+ }
+
page.onPageCreated = (page) => {
var pageObj = {
page: page, | Log when pages timeout when loading. | KevinGrandon_ghostjs | train | js |
d97f4f0c1a15c58fa5dc7310afbcb63fc05afb0a | diff --git a/lib/modules/apostrophe-modal/public/js/modal.js b/lib/modules/apostrophe-modal/public/js/modal.js
index <HASH>..<HASH> 100644
--- a/lib/modules/apostrophe-modal/public/js/modal.js
+++ b/lib/modules/apostrophe-modal/public/js/modal.js
@@ -70,7 +70,7 @@ apos.define('apostrophe-modal', {
// Fewer event handlers all the time = better performance
apos.modalSupport.initialized = false;
- $(document).off('keyup.aposModal');
+ $(document).off('keydown.aposModal');
$(document).off('click.aposModal');
}; | forward-ported fix for "escape fires multiple events" bug | apostrophecms_apostrophe | train | js |
1abfe103fc3bd17dd87799f2eef92ad56259a598 | diff --git a/packages/posts/test/02_import-all.js b/packages/posts/test/02_import-all.js
index <HASH>..<HASH> 100644
--- a/packages/posts/test/02_import-all.js
+++ b/packages/posts/test/02_import-all.js
@@ -1 +1,5 @@
-import "../serverless/handler";
+import "../serverless/handler/getPhotos";
+import "../serverless/handler/getPosts";
+import "../serverless/handler/getWords";
+import "../serverless/handler/instagramAuthRedirect";
+import "../serverless/handler/instagramAuthReturn"; | ci(posts): `import` each serverless handler instead of just the `handlers/index`.
The `require`s are deferred which means they don't actually run and require all the code I want for the coverage calculations. | randytarampi_me | train | js |
8a1a75dd159b8e46828f3265a34b0014bab73a85 | diff --git a/stix2validator/errors.py b/stix2validator/errors.py
index <HASH>..<HASH> 100644
--- a/stix2validator/errors.py
+++ b/stix2validator/errors.py
@@ -212,6 +212,9 @@ def pretty_error(error, verbose=False):
if ('is_family' in error.instance and
not isinstance(error.instance['is_family'], bool)):
msg = "is_family: 'true' is not of type 'boolean'"
+ elif ('is_family' in error.instance and
+ 'name' not in error.instance):
+ msg = "'name' is required when 'is_family' is true"
else:
raise TypeError
except TypeError: | Improve an error message for malware
Specifically, when 'is_family' is true but 'name' is not present. | oasis-open_cti-stix-validator | train | py |
84fc33281734a92b803ba873d0ed534caf1333e9 | diff --git a/tests/unit/utils/test_ssdp.py b/tests/unit/utils/test_ssdp.py
index <HASH>..<HASH> 100644
--- a/tests/unit/utils/test_ssdp.py
+++ b/tests/unit/utils/test_ssdp.py
@@ -179,3 +179,20 @@ class SSDPFactoryTestCase(TestCase):
assert ssdp.time.sleep.call_args[0][0] > 0 and ssdp.time.sleep.call_args[0][0] < 0.5
assert factory.log.debug.called
assert 'Permission error' in factory.log.debug.mock_calls[0][1][0]
+
+ def test_datagram_received_bad_signature(self):
+ '''
+ Test datagram_received on bad signature
+
+ :return:
+ '''
+ factory = ssdp.SSDPFactory()
+ data = 'nonsense'
+ addr = '10.10.10.10', 'foo.suse.de'
+
+ with patch.object(factory, 'log', MagicMock()):
+ factory.datagram_received(data=data, addr=addr)
+ assert factory.log.debug.called
+ assert 'Received bad signature from' in factory.log.debug.call_args[0][0]
+ assert factory.log.debug.call_args[0][1] == addr[0]
+ assert factory.log.debug.call_args[0][2] == addr[1] | Add unit test on datagram_received when bad signature is happening | saltstack_salt | train | py |
cba0ccb96ff92e3abd683c897c1b02a5a664003b | diff --git a/code/model/entity/abstract.php b/code/model/entity/abstract.php
index <HASH>..<HASH> 100644
--- a/code/model/entity/abstract.php
+++ b/code/model/entity/abstract.php
@@ -464,6 +464,15 @@ abstract class KModelEntityAbstract extends KObjectArray implements KModelEntity
{
$data = parent::toArray();
+ foreach ($this->getComputedProperties() as $property)
+ {
+ if ($this->{$property} instanceof KModelEntityInterface) {
+ $data[$property] = array_values($this->{$property}->toArray());
+ } else {
+ $data[$property] = $this->{$property};
+ }
+ }
+
foreach(array_keys($data) as $key)
{
if (substr($key, 0, 1) === '_') { | Improve toArray() to also display all computed properties. This is an ideal behavior for displaying JSON to an JavaScript app written in for example in Ember.js / AngularJS etc. | timble_kodekit | train | php |
c7c3bda8b9114e95e1e27e194e4c42c4784fd659 | diff --git a/etcdserver/server.go b/etcdserver/server.go
index <HASH>..<HASH> 100644
--- a/etcdserver/server.go
+++ b/etcdserver/server.go
@@ -941,7 +941,10 @@ func (s *EtcdServer) sendMergedSnap(merged snap.Message) {
// If the follower still fails to catch up, it is probably just too slow
// to catch up. We cannot avoid the snapshot cycle anyway.
if ok {
- time.Sleep(releaseDelayAfterSnapshot)
+ select {
+ case <-time.After(releaseDelayAfterSnapshot):
+ case <-s.done:
+ }
}
atomic.AddInt64(&s.inflightSnapshots, -1)
case <-s.done: | etcdserver: respect done channel when sleeping for snapshot backoff | etcd-io_etcd | train | go |
5262fb193525a753b6ad88977d5a65a07fc1f4c6 | diff --git a/scripts/experiments/run_srl.py b/scripts/experiments/run_srl.py
index <HASH>..<HASH> 100755
--- a/scripts/experiments/run_srl.py
+++ b/scripts/experiments/run_srl.py
@@ -119,7 +119,7 @@ class SrlExpParamsRunner(ExpParamsRunner):
self.pos_unsup_test = parser_prefix + "/dmv_conll09-sp-dev_20_False/test-parses.txt"
# Semi-supervised parser output: PHEAD column.
self.brown_semi_train = parser_prefix + "/dmv_conll09-sp-brown-train_20_True/test-parses.txt"
- self.brown_semi_test = parser_prefix + "/dmv_conll09-sp-brown-dev_10_True/test-parses.txt"
+ self.brown_semi_test = parser_prefix + "/dmv_conll09-sp-brown-dev_20_True/test-parses.txt"
# Unsupervised parser output: PHEAD column.
self.brown_unsup_train = parser_prefix + "/dmv_conll09-sp-brown-train_20_False/test-parses.txt"
self.brown_unsup_test = parser_prefix + "/dmv_conll09-sp-brown-dev_20_False/test-parses.txt" | Change to run_srl; grabbing brown-dev_<I>_True now, as it should. | mgormley_pacaya | train | py |
5dd29fcd1856cb1b1cb5d4e2c8ab1ec092510f83 | diff --git a/pyhaproxy/render.py b/pyhaproxy/render.py
index <HASH>..<HASH> 100644
--- a/pyhaproxy/render.py
+++ b/pyhaproxy/render.py
@@ -165,8 +165,14 @@ backend %s
def __render_server(self, server):
server_line = ' server %s %s:%s %s\n'
+ attributes = []
+
+ #Strip out heading/trailing whitespace
+ for a in server.attributes:
+ attributes.append(a.strip())
+
return server_line % (
- server.name, server.host, server.port, ' '.join(server.attributes))
+ server.name, server.host, server.port, ' '.join(attributes))
def __render_acl(self, acl):
acl_line = ' acl %s %s\n' | Fix bug that would introduce whitespace to attributes with each new
render | imjoey_pyhaproxy | train | py |
cf8fc2a31479e0c56fd263e09b2890963ce73d57 | diff --git a/lib/routes/apiv1.js b/lib/routes/apiv1.js
index <HASH>..<HASH> 100644
--- a/lib/routes/apiv1.js
+++ b/lib/routes/apiv1.js
@@ -331,19 +331,21 @@ function getKeysTree(req, res, next) {
return callback(err);
}
keyData.attr.rel = type;
- var sizeCallback = function(err,count){
- if(err){
- return callback(err);
- }else{
- keyData.data+=" (" + count + ")";
- callback();
- }
- };
- if(type=='list'){
- req.redisConnection.llen(keyData.fullKey,sizeCallback);
- }else if(type == 'set'){
- req.redisConnection.scard(keyData.fullKey,sizeCallback);
- }else{
+ var sizeCallback = function (err, count) {
+ if (err) {
+ return callback(err);
+ } else {
+ keyData.data += " (" + count + ")";
+ callback();
+ }
+ };
+ if (type == 'list') {
+ req.redisConnection.llen(keyData.fullKey, sizeCallback);
+ } else if (type == 'set') {
+ req.redisConnection.scard(keyData.fullKey, sizeCallback);
+ } else if (type == 'zset') {
+ req.redisConnection.zcard(keyData.fullKey, sizeCallback);
+ } else {
callback();
}
}); | Show sorted set counts in redis tree | joeferner_redis-commander | train | js |
b0892c0b6934d795ac2080bfbc4ba8b8f4794914 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,16 +1,5 @@
(function() {
-
- const types = {
- 'animation':'animationend',
- 'MSAnimation':'MSAnimationEnd',
- 'WebkitAnimation':'webkitAnimationEnd',
- }
-
- const event = types[
- Object.keys(types).filter(x =>
- document.body.style.hasOwnProperty(x)
- )[0]
- ]
+ const event = 'animationend'
const Actuate = animations => $ => new Promise ((resolve, reject) => {
@@ -18,7 +7,8 @@
animations : animations.split(' ')
const done = _ => {
- $.classList.remove('animated', commands[0])
+ $.classList.remove('animated')
+ $.classList.remove(commands[0])
$.removeEventListener(event, done)
commands.shift()
commands.length ? animate() : resolve($)
@@ -26,7 +16,8 @@
const animate = _ => {
$.addEventListener(event, done)
- $.classList.add('animated', commands[0])
+ $.classList.add('animated')
+ $.classList.add(commands[0])
}
$.classList.contains('animated') ? | fixes compatibility issues with Firefox and IE<I> (#4) | lukejacksonn_Actuate | train | js |
91f30c70aa86d58488160ae66d3580b0d91366ed | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,6 @@ setup(
license='MIT',
packages=find_packages('src'),
package_dir={'': 'src'},
- package_data={'': ['VERSION']},
url='http://github.com/aeroxis/sultan',
classifiers=[
"Development Status :: 5 - Production/Stable", | Removed an unnecessary line in 'setup.py' | aeroxis_sultan | train | py |
daa7af06050d3a93f4319928f502239c3ff07f22 | diff --git a/src/models/room.js b/src/models/room.js
index <HASH>..<HASH> 100644
--- a/src/models/room.js
+++ b/src/models/room.js
@@ -1525,14 +1525,6 @@ function calculateRoomName(room, userId, ignoreRoomNameEvent) {
}
let alias = room.getCanonicalAlias();
-
- if (!alias) {
- const aliases = room.getAliases();
-
- if (aliases.length) {
- alias = aliases[0];
- }
- }
if (alias) {
return alias;
} | room name should only take canonical alias into account | matrix-org_matrix-js-sdk | train | js |
423ea059771b9264650f1c25c7dea657ee00f299 | diff --git a/test/instrument/FMSynth.js b/test/instrument/FMSynth.js
index <HASH>..<HASH> 100644
--- a/test/instrument/FMSynth.js
+++ b/test/instrument/FMSynth.js
@@ -1,18 +1,20 @@
define(["Tone/instrument/FMSynth", "helper/Basic",
- "helper/InstrumentTests", "helper/CompareToFile"],
-function(FMSynth, Basic, InstrumentTest, CompareToFile) {
+ "helper/InstrumentTests", "helper/CompareToFile", "helper/Supports"],
+function(FMSynth, Basic, InstrumentTest, CompareToFile, Supports) {
describe("FMSynth", function(){
Basic(FMSynth);
InstrumentTest(FMSynth, "C4");
- it("matches a file", function(){
- return CompareToFile(function(){
- const synth = new FMSynth().toMaster();
- synth.triggerAttackRelease("G4", 0.1, 0.05);
- }, "fmSynth.wav");
- });
+ if (Supports.CHROME_AUDIO_RENDERING){
+ it("matches a file", function(){
+ return CompareToFile(function(){
+ const synth = new FMSynth().toMaster();
+ synth.triggerAttackRelease("G4", 0.1, 0.05);
+ }, "fmSynth.wav");
+ });
+ }
context("API", function(){ | skipping FMSynth comparison when not on Chrome | Tonejs_Tone.js | train | js |
38fb3d67217b249c7dc25363b245fa1847eb41ee | diff --git a/tests/test_datatype.py b/tests/test_datatype.py
index <HASH>..<HASH> 100644
--- a/tests/test_datatype.py
+++ b/tests/test_datatype.py
@@ -29,4 +29,7 @@ class TestDatatype(TestCase):
dt = Datatype("region")
val = dt.allowed_values[u"Växjö kommun"]
self.assertTrue("wikidata" in val.dialects)
- self.assertEqual(val.dialects["wikidata"][0], u"Q500217")
+ self.assertEqual(u"Q500217", val.dialects["wikidata"].pop())
+
+ self.assertTrue("scb" in val.dialects)
+ self.assertEqual(u"0780 Växjö kommun", val.dialects["scb"].pop()) | make test pass by testing for correct value | jplusplus_statscraper | train | py |
50aa9c86fb9c0a73e36cd7c59dba661f6252dcc8 | diff --git a/subscriptions/search.js b/subscriptions/search.js
index <HASH>..<HASH> 100644
--- a/subscriptions/search.js
+++ b/subscriptions/search.js
@@ -10,7 +10,7 @@ import { searchIsReady$ } from '../streams/search';
import getTrackingData from '../selectors/search';
/**
- * Pages tracking subscriptions.
+ * Search tracking subscriptions.
* @param {Function} subscribe The subscribe function.
*/
export default function search(subscribe) { | CON-<I>: implemented feedback from review | shopgate_pwa | train | js |
d41f252c1ecfb514e08fac09fbc396ad53d635f8 | diff --git a/djangular/middleware.py b/djangular/middleware.py
index <HASH>..<HASH> 100644
--- a/djangular/middleware.py
+++ b/djangular/middleware.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import six
+from django import http
from django.core.handlers.wsgi import WSGIRequest
from django.core.urlresolvers import reverse
from django.utils.http import unquote
@@ -47,12 +48,6 @@ class DjangularUrlMiddleware(object):
request.environ['QUERY_STRING'] = query.urlencode()
else:
request.environ['QUERY_STRING'] = query.urlencode().encode('utf-8')
- # Reconstruct GET QueryList using WSGIRequest.GET function
- # ...
- # @cached_property
- # def GET(self):
- # raw_query_string = get_bytes_from_wsgi(self.environ, 'QUERY_STRING', '')
- # return http.QueryDict(raw_query_string, encoding=self._encoding)
- # ...
- # Since it's cached the actual function can be accessed as WSGIRequest.GET.func
- request.GET = WSGIRequest.GET.func(request)
+
+ # Reconstruct GET QueryList in the same way WSGIRequest.GET function works
+ request.GET = http.QueryDict(request.environ['QUERY_STRING']) | alternative request.GET building, previous version doesn't work in django <I> | jrief_django-angular | train | py |
6a9b49c78227bb4270a2b532cbbfe056a2f6e010 | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -97,9 +97,19 @@ In this example ``foo.conf`` in the ``dev`` environment will be used instead.
.. warning::
- When using a mode that includes a leading zero you must wrap the
- value in single quotes. If the value is not wrapped in quotes it
- will be read by YAML as an integer and evaluated as an octal.
+ When using a mode that includes a leading zero you must wrap the
+ value in single quotes. If the value is not wrapped in quotes it
+ will be read by YAML as an integer and evaluated as an octal.
+
+The ``names`` parameter, which is part of the state compiler, can be used to
+expand the contents of a single state declaration into multiple, single state
+declarations. Each item in the ``names`` list receives its own individual state
+``name`` and is converted into its own low-data structure. This is a convenient
+way to manage several files with similar attributes.
+
+There is more documentation about this feature in the
+:ref:`Names declaration<names-declaration>` section of the
+ :ref:`Highstate docs<states-highstate>`.
Special files can be managed via the ``mknod`` function. This function will
create and enforce the permissions on a special file. The function supports the | Add "names" option to file state docs: point users to highstate doc examples (#<I>)
* Add "names" option to file state docs: point users to highstate doc examples
Fixes #<I>
* Grammar fix | saltstack_salt | train | py |
f9473d8b64f41da477cf2b6f34145072faa22550 | diff --git a/splinter/driver/webdriver/__init__.py b/splinter/driver/webdriver/__init__.py
index <HASH>..<HASH> 100644
--- a/splinter/driver/webdriver/__init__.py
+++ b/splinter/driver/webdriver/__init__.py
@@ -131,9 +131,6 @@ class BaseWebDriver(DriverAPI):
def is_element_not_present_by_id(self, id):
return self.is_element_not_present(self.find_by_id, id)
-
- def switch_to_frame(self, id):
- self.driver.switch_to_frame(id)
@contextmanager
def get_iframe(self, id): | removed swtich_to_frame method, as it is deprecated. | cobrateam_splinter | train | py |
c1409d2f35785fbc276441f04d55ed2142c07047 | diff --git a/Nameless/Modules/Assets/Asset.php b/Nameless/Modules/Assets/Asset.php
index <HASH>..<HASH> 100644
--- a/Nameless/Modules/Assets/Asset.php
+++ b/Nameless/Modules/Assets/Asset.php
@@ -186,7 +186,7 @@ class Asset
$urls_old = array();
$urls_new = array();
- preg_match_all('#url\((.*)\)#im', $asset_text, $urls_old);
+ preg_match_all('#url\([\'"]?([^/\'"][^\'"]*)[\'"]?\)#im', $asset_text, $urls_old);
foreach ($urls_old[1] as $url)
{ | Bugfix: excluded absolute pathes from CSS pathreplacement | corpsee_nameless-source | train | php |
0c2c4536b23ba7a18cd6db962fc44dc8ab479a59 | diff --git a/lib/db_charmer/rails3/active_record/relation/connection_routing.rb b/lib/db_charmer/rails3/active_record/relation/connection_routing.rb
index <HASH>..<HASH> 100644
--- a/lib/db_charmer/rails3/active_record/relation/connection_routing.rb
+++ b/lib/db_charmer/rails3/active_record/relation/connection_routing.rb
@@ -59,12 +59,15 @@ module DbCharmer
end
# Connection switching (changes the default relation connection)
- def on_db(con)
- old_connection = db_charmer_connection
- self.db_charmer_connection = con
- clone
- ensure
- self.db_charmer_connection = old_connection
+ def on_db(con, &block)
+ if block_given?
+ @klass.on_db(con, &block)
+ else
+ clone.tap do |result|
+ result.db_charmer_connection = con
+ result.db_charmer_connection_is_forced = true
+ end
+ end
end
# Make sure we get the right connection here | Support block on_db calls on relations + allow forcing connections on relation | kovyrin_db-charmer | train | rb |
6c15b777011b49709177de6e62cbce4163a2ad1f | diff --git a/app/views/dashboard/components/edit.blade.php b/app/views/dashboard/components/edit.blade.php
index <HASH>..<HASH> 100644
--- a/app/views/dashboard/components/edit.blade.php
+++ b/app/views/dashboard/components/edit.blade.php
@@ -43,7 +43,7 @@
</div>
@if($groups->count() > 0)
<div class='form-group'>
- <label>Group</label>
+ <label>{{ trans('forms.components.group') }}</label>
<select name='component[group_id]' class='form-control'>
<option {{ $component->group_id === null ? "selected" : null }}></option>
@foreach($groups as $group) | Remove remaining plain English from edit.blade.php view | CachetHQ_Cachet | train | php |
4bc253d4aba439b1de7a0fa609a11e1622f66709 | diff --git a/smartcard/pcsc/PCSCCardConnection.py b/smartcard/pcsc/PCSCCardConnection.py
index <HASH>..<HASH> 100644
--- a/smartcard/pcsc/PCSCCardConnection.py
+++ b/smartcard/pcsc/PCSCCardConnection.py
@@ -68,6 +68,7 @@ class PCSCCardConnection( CardConnection ):
"""
CardConnection.__init__( self, reader )
self.hcard = None
+ self.dwActiveProtocol = SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1
hresult, self.hcontext = SCardEstablishContext( SCARD_SCOPE_USER )
if hresult!=0:
raise CardConnectionException( 'Failed to establish context : ' + SCardGetErrorMessage(hresult) )
@@ -124,6 +125,10 @@ class PCSCCardConnection( CardConnection ):
raise CardConnectionException( 'Failed to get status: ' + SCardGetErrorMessage(hresult) )
return atr
+ def getProtocol( self ):
+ """Return the protocol negociated during connect()."""
+ return self.dwActiveProtocol
+
def doTransmit( self, bytes, protocol=None ):
"""Transmit an apdu to the card and return response apdu. | implement getProtocol() to return the protocol negociated during connect() | LudovicRousseau_pyscard | train | py |
8b0fd96316cd5f828f3cde64dce0de28e3e1bd6b | diff --git a/examples/mvvmfx-fx-root-example/src/main/java/de/saxsys/jfx/mvvmfx/fx_root_example/LabeledTextFieldViewModel.java b/examples/mvvmfx-fx-root-example/src/main/java/de/saxsys/jfx/mvvmfx/fx_root_example/LabeledTextFieldViewModel.java
index <HASH>..<HASH> 100644
--- a/examples/mvvmfx-fx-root-example/src/main/java/de/saxsys/jfx/mvvmfx/fx_root_example/LabeledTextFieldViewModel.java
+++ b/examples/mvvmfx-fx-root-example/src/main/java/de/saxsys/jfx/mvvmfx/fx_root_example/LabeledTextFieldViewModel.java
@@ -23,7 +23,7 @@ public class LabeledTextFieldViewModel implements ViewModel {
@Override
public Boolean call() throws Exception {
final String text = inputText.get();
- return text != null && text.isEmpty();
+ return text == null || text.isEmpty();
}
}, inputText));
} | Fix wrong boolean binding in fx-root example | sialcasa_mvvmFX | train | java |
129d64c3d3f9ef011fba4d9415cc39ff8b1df60c | diff --git a/azurerm/data_source_redis_cache.go b/azurerm/data_source_redis_cache.go
index <HASH>..<HASH> 100644
--- a/azurerm/data_source_redis_cache.go
+++ b/azurerm/data_source_redis_cache.go
@@ -251,6 +251,8 @@ func dataSourceArmRedisCacheRead(d *schema.ResourceData, meta interface{}) error
if err = d.Set("patch_schedule", patchSchedule); err != nil {
return fmt.Errorf("Error setting `patch_schedule`: %+v", err)
}
+ } else {
+ d.Set("patch_schedule", []interface{}{})
}
keys, err := client.ListKeys(ctx, resourceGroup, name) | Set `patch_schedule` to empty list if no schedules present - allows
outputs to be used for this item without error, even when there are no schedules. | terraform-providers_terraform-provider-azurerm | train | go |
5b194a320efdf1738166c2e39eb5f8009b1eca11 | diff --git a/test/plugin-apply-test.js b/test/plugin-apply-test.js
index <HASH>..<HASH> 100644
--- a/test/plugin-apply-test.js
+++ b/test/plugin-apply-test.js
@@ -238,8 +238,9 @@ test.cb("emit inline asset", t => {
io.read(path.join(OUTPUT_PATH, "inline-asset.html")).then(output => {
io.read(sourceFile).then(source => {
- const sourceWithoutNewlines = source.replace(/\r?\n|\r/g, "");
- t.true(output.includes(sourceWithoutNewlines));
+ // HACK: Trim source as output differs between webpack versions
+ const trimmedSource = source.replace(/;\r?\n|\r/g, "");
+ t.true(output.includes(trimmedSource));
t.end();
});
}); | Trim source as output differs between webpack versions | jouni-kantola_templated-assets-webpack-plugin | train | js |
fef76d15c2c95d546e00a0c3fab14710e7e8d81e | diff --git a/lib/components/viewers/route-details.js b/lib/components/viewers/route-details.js
index <HASH>..<HASH> 100644
--- a/lib/components/viewers/route-details.js
+++ b/lib/components/viewers/route-details.js
@@ -182,6 +182,7 @@ class RouteDetails extends Component {
Object.entries(patterns)
.map((pattern) => {
return {
+ geometryLength: pattern[1].geometry?.length,
headsign: extractHeadsignFromPattern(pattern[1]),
id: pattern[0]
}
@@ -190,7 +191,14 @@ class RouteDetails extends Component {
// with a specific headsign is the accepted one. TODO: is this good behavior?
.reduce((prev, cur) => {
const amended = prev
- if (!prev.find(h => h.headsign === cur.headsign)) {
+ const alreadyExistingIndex = prev.findIndex(h => h.headsign === cur.headsign)
+ // If the item we're replacing has less geometry, replace it!
+ if (alreadyExistingIndex >= 0) {
+ // Only replace if new pattern has greater geometry
+ if (amended[alreadyExistingIndex].geometryLength < cur.geometryLength) {
+ amended[alreadyExistingIndex] = cur
+ }
+ } else {
amended.push(cur)
}
return amended | improvement(route-details): resolve duplicate headsigns based on geometry length | opentripplanner_otp-react-redux | train | js |
4665de1d00b6cdb8b5ef3823ca17799e6c4c67a7 | diff --git a/structr-core/src/main/java/org/structr/core/entity/SchemaNode.java b/structr-core/src/main/java/org/structr/core/entity/SchemaNode.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/core/entity/SchemaNode.java
+++ b/structr-core/src/main/java/org/structr/core/entity/SchemaNode.java
@@ -294,6 +294,13 @@ public class SchemaNode extends AbstractSchemaNode {
return;
}
+ // migrate RemoteDocument
+ if (_extendsClass.equals("org.structr.web.entity.RemoteDocument")) {
+
+ setProperty(extendsClass, "org.structr.feed.entity.RemoteDocument");
+ return;
+ }
+
// migrate Person
if (_extendsClass.equals("org.structr.core.entity.Person")) { | Enhancement: Adds migration code for RemoteDocument class. | structr_structr | train | java |
d525b3024eb17ebf090c0377c71c640a553ebae8 | diff --git a/lib/daemon/index.js b/lib/daemon/index.js
index <HASH>..<HASH> 100644
--- a/lib/daemon/index.js
+++ b/lib/daemon/index.js
@@ -8,7 +8,7 @@ function Daemon(conf) {
Daemon.prototype.initialize = function(conf) {
if (conf.verbose) log.setVerbose(conf.verbose);
log.debug('gearslothd', 'Config parsed:\n',
- util.inspect(conf, { depth: null }));
+ util.inspect(conf, { depth: 3 }));
if (conf.injector) this.add('./injector', conf);
if (conf.runner) this.add('./runner', conf); | Limit recursion depth to avoid huge object dumps | meetings_gearsloth | train | js |
1663f3808b41b7a22b2bc453f4751664df422d7c | diff --git a/src/DebugBar/Storage/FileStorage.php b/src/DebugBar/Storage/FileStorage.php
index <HASH>..<HASH> 100644
--- a/src/DebugBar/Storage/FileStorage.php
+++ b/src/DebugBar/Storage/FileStorage.php
@@ -77,7 +77,7 @@ class FileStorage implements StorageInterface
$data = $this->get($file['id']);
$meta = $data['__meta'];
unset($data);
- if (array_keys(array_intersect($meta, $filters)) == array_keys($filters)) {
+ if ($this->filter($meta, $filters)) {
$results[] = $meta;
}
if(count($results) >= ($max + $offset)){
@@ -87,6 +87,15 @@ class FileStorage implements StorageInterface
return array_slice($results, $offset, $max);
}
+
+ protected function filter($meta, $filters){
+ foreach($filters as $key => $value){
+ if(fnmatch ($value, $meta[$key]) === false){
+ return false;
+ }
+ }
+ return true;
+ }
/**
* {@inheritDoc} | Improve filtering
Make filter work with multiple keys and wildcard search, eg. user/* or ip <I>.* | maximebf_php-debugbar | train | php |
dc507b7b9a90def1fbae918c0dd8522b98c8c38e | diff --git a/oneapi/client.php b/oneapi/client.php
index <HASH>..<HASH> 100644
--- a/oneapi/client.php
+++ b/oneapi/client.php
@@ -72,6 +72,12 @@ class AbstractOneApiClient {
$this->throwException = true;
}
+ public function setAPIurl($baseUrl=NULL) {
+ $this->baseUrl = $baseUrl ? $baseUrl : self::$DEFAULT_BASE_URL;
+ if ($this->baseUrl[strlen($this->baseUrl) - 1] != '/')
+ $this->baseUrl .= '/';
+ }
+
public function login() {
$restPath = '/1/customerProfile/login'; | Added client->setAPIurl() method to library | infobip_oneapi-php | train | php |
5fde3044f792f263ccb9df712e0690cb22589d2b | diff --git a/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java b/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
+++ b/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015-2018 the original author or authors.
+ * Copyright 2015-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -225,7 +225,7 @@ public final class SecurityJackson2Modules {
JavaType result = delegate.typeFromId(context, id);
String className = result.getRawClass().getName();
if (isWhitelisted(className)) {
- return delegate.typeFromId(context, id);
+ return result;
}
boolean isExplicitMixin = config.findMixInClassFor(result.getRawClass()) != null;
if (isExplicitMixin) { | Resolve JavaType only once for whitelisted class | spring-projects_spring-security | train | java |
6f81bc090ed32eeb1dfb2ffba8e03569d466b7f1 | diff --git a/lib/fuzzystringmatch.rb b/lib/fuzzystringmatch.rb
index <HASH>..<HASH> 100644
--- a/lib/fuzzystringmatch.rb
+++ b/lib/fuzzystringmatch.rb
@@ -20,7 +20,11 @@ begin
if RUBY_PLATFORM == "java"
STDERR.puts "fuzzy-string-match Warning: native version is disabled on java platform. falled back to pure ruby version..."
else
- require 'fuzzystringmatch/inline'
+ begin
+ require 'fuzzystringmatch/inline'
+ rescue CompilationError
+ STDERR.puts "fuzzy-string-match Warning: fallback into pure version, because compile failed."
+ end
end
rescue LoadError
end
diff --git a/test/fallback_pure_spec.rb b/test/fallback_pure_spec.rb
index <HASH>..<HASH> 100644
--- a/test/fallback_pure_spec.rb
+++ b/test/fallback_pure_spec.rb
@@ -28,6 +28,8 @@ require 'inline'
describe Inline, "when c compile failed, fall back into pure " do
it "should" do
pending ("because JRuby always in pure mode.") if (RUBY_PLATFORM == "java")
- lambda { require 'fuzzystringmatch' }.should raise_error( CompilationError )
+ lambda { require 'fuzzystringmatch' }.should_not raise_error()
+
+ FuzzyStringMatch::JaroWinkler.create( :native ).pure?( ).should be_true
end
end | Commit in incomplete code.
Must make `ballback code`. | kiyoka_fuzzy-string-match | train | rb,rb |
1f7e98ae49ebae0a1e2fde9f315d92d4d2ad075d | diff --git a/Core/Search/Solr/Query/Content/CriterionVisitor/Tags.php b/Core/Search/Solr/Query/Content/CriterionVisitor/Tags.php
index <HASH>..<HASH> 100644
--- a/Core/Search/Solr/Query/Content/CriterionVisitor/Tags.php
+++ b/Core/Search/Solr/Query/Content/CriterionVisitor/Tags.php
@@ -18,7 +18,7 @@ abstract class Tags extends CriterionVisitor
/**
* For tag-queries which aren't field-specific.
- *
+ *
* @var \eZ\Publish\SPI\Persistence\Content\Type\Handler
*/
protected $contentTypeHandler;
@@ -78,7 +78,7 @@ abstract class Tags extends CriterionVisitor
continue;
}
- if ($fieldDefinition['field_type_identifier'] != 'eztags') {
+ if ($fieldDefinition['field_type_identifier'] != $this->fieldTypeIdentifier) {
continue;
} | Use already available field type identified in solr criterion visitors | netgen_TagsBundle | train | php |
0b7c64269fff25e02ac1091819b892f4f987e56c | diff --git a/modin/pandas/test/utils.py b/modin/pandas/test/utils.py
index <HASH>..<HASH> 100644
--- a/modin/pandas/test/utils.py
+++ b/modin/pandas/test/utils.py
@@ -11,6 +11,7 @@
# ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
+import re
import pytest
import numpy as np
import math
@@ -1101,10 +1102,17 @@ def check_file_leaks(func):
try:
fstart.remove(item)
except ValueError:
- # ignore files in /proc/, as they have nothing to do with
- # modin reading any data (and this is what we care about)
- if not item[0].startswith("/proc/"):
- leaks.append(item)
+ # Ignore files in /proc/, as they have nothing to do with
+ # modin reading any data (and this is what we care about).
+ if item[0].startswith("/proc/"):
+ continue
+ # Ignore files in /tmp/ray/session_*/logs (ray session logs)
+ # because Ray intends to keep these logs open even after
+ # work has been done.
+ if re.search(r"/tmp/ray/session_.*/logs", item[0]):
+ continue
+ leaks.append(item)
+
assert (
not leaks
), f"Unexpected open handles left for: {', '.join(item[0] for item in leaks)}" | FIX-#<I>: Ignore files from /private/tmp/ray/ when detecting file leaks (#<I>) | modin-project_modin | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.