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 |
|---|---|---|---|---|---|
17e930747991ec170fbdf7e6bf6f3401992ec553 | diff --git a/tracks/track.py b/tracks/track.py
index <HASH>..<HASH> 100755
--- a/tracks/track.py
+++ b/tracks/track.py
@@ -40,13 +40,14 @@ for i,(ff,sf,t) in enumerate(zip(ffs,sfs,tracktime)):
if i>5:
break;
print("reading {} and {}".format(ff,sf));
+ print(" reading sclrs and flds");
fd=read(ff,var=flabels,
gzip=True, remove_edges=True);
sd=read(sf,var=slabels,
gzip=True, remove_edges=True);
if i == 0:
s = np.lexsort((fd['z'],fd['y'],fd['x']));
- print(" reading sclrs and flds");
+ print(" recting sclrs and flds");
fd = flds.rect(fd,s);
sd = flds.rect(sd,s);
td=tracks[:i] | works, let's make it faster | noobermin_lspreader | train | py |
acb8fd8d74657cfac3b25c82e9c6028b93eb6c92 | diff --git a/foreman/api.py b/foreman/api.py
index <HASH>..<HASH> 100644
--- a/foreman/api.py
+++ b/foreman/api.py
@@ -55,7 +55,7 @@ class Api:
"""
def _log(self, *args, **kwargs):
ret = function(self, *args, **kwargs)
- if len(self.history)>self.maxHistory:
+ if len(self.history) > self.maxHistory:
self.history = self.history[1:self.maxHistory]
self.history.append({'errorMsg': self.errorMsg,
'payload': self.payload, | Correct PEP8 E<I>
missing whitespace around operator | davidblaisonneau-orange_foreman | train | py |
23f6b1bb8184d443bad42cbf9a215cfdac085fa1 | diff --git a/indra/reach/processor.py b/indra/reach/processor.py
index <HASH>..<HASH> 100644
--- a/indra/reach/processor.py
+++ b/indra/reach/processor.py
@@ -116,12 +116,20 @@ class ReachProcessor(object):
self.statements.append(Dephosphorylation(*args))
elif modification_type == 'ubiquitination':
self.statements.append(Ubiquitination(*args))
+ elif modification_type == 'deubiquitination':
+ self.statements.append(Deubiquitination(*args))
elif modification_type == 'acetylation':
self.statements.append(Acetylation(*args))
+ elif modification_type == 'deacetylation':
+ self.statements.append(Deacetylation(*args))
elif modification_type == 'hydroxylation':
self.statements.append(Hydroxylation(*args))
+ elif modification_type == 'dehydroxylation':
+ self.statements.append(Dehydroxylation(*args))
elif modification_type == 'sumoylation':
self.statements.append(Sumoylation(*args))
+ elif modification_type == 'desumoylation':
+ self.statements.append(Desumoylation(*args))
else:
logger.warning('Unhandled modification type: %s' %
modification_type) | Extract more modification types in REACH processor | sorgerlab_indra | train | py |
746fc462a551744f70864d61dd107d7964307e11 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,15 +1,12 @@
from setuptools import setup, find_packages
+with open('README.rst') as file:
+ long_description = file.read()
+
setup(name='ledger-autosync',
version="0.1",
description="Automatically sync your bank's data with ledger",
- long_description="""
-ledger-autosync is a program to pull down transactions from your
-bank and create `ledger <http://ledger-cli.org/>`_ transactions for
-them. It is designed to only create transactions that are not already
-present in your ledger files. This should make it comparable to some
-of the automated synchronization features available in products like
-GnuCash, Mint, etc.""",
+ long_description=long_description,
classifiers=[
"Development Status :: 4 - Alpha",
"Operating System :: OS Independent", | read long desc from README | egh_ledger-autosync | train | py |
33605f6cde3c3ca4cfb30b4c6e582b040815c33c | diff --git a/api/gui_test.go b/api/gui_test.go
index <HASH>..<HASH> 100644
--- a/api/gui_test.go
+++ b/api/gui_test.go
@@ -41,6 +41,7 @@ func (s *clientSuite) TestUploadGUIArchive(c *gc.C) {
).Close()
// Check that the API client POSTs the GUI archive to the correct endpoint.
- client.UploadGUIArchive(bytes.NewReader(archive), hash, size, vers)
+ err := client.UploadGUIArchive(bytes.NewReader(archive), hash, size, vers)
+ c.Assert(err, jc.ErrorIsNil)
c.Assert(called, jc.IsTrue)
} | Improve error handling in GUI archive api client test. | juju_juju | train | go |
f5217e1dc07b372b48ac73963acf0745a01674ad | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,10 @@
#!/usr/bin/env python
+"""
+Run the following to publish to PyPI:
+
+> python setup.py publish
+
+"""
import os
import sys
@@ -25,7 +31,7 @@ setup(name='pystache',
url='http://github.com/defunkt/pystache',
packages=['pystache'],
license='MIT',
- classifiers = (
+ classifiers = (
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python", | Added a module docstring to setup.py. | defunkt_pystache | train | py |
597d6e9d178bb4361cb9833838b3cd12af3c30e2 | diff --git a/lib/chewy/index/actions.rb b/lib/chewy/index/actions.rb
index <HASH>..<HASH> 100644
--- a/lib/chewy/index/actions.rb
+++ b/lib/chewy/index/actions.rb
@@ -177,7 +177,7 @@ module Chewy
if settings_hash[:settings] && settings_hash[:settings][:index]
index_settings = settings_hash[:settings][:index]
s[:number_of_replicas] = index_settings[:number_of_replicas] if index_settings.has_key?(:number_of_replicas)
- s[:refresh_interval] = index_settings[:refresh_interval] || '1s' if index_settings.has_key?(:refresh_interval)
+ s[:refresh_interval] = index_settings.fetch(:refresh_interval, '1s')
end
end | Fixed refresh_interval settings after import | toptal_chewy | train | rb |
7afffb3fda743d14086932cedc7cade835356ea9 | diff --git a/models/activityobject.js b/models/activityobject.js
index <HASH>..<HASH> 100644
--- a/models/activityobject.js
+++ b/models/activityobject.js
@@ -44,6 +44,10 @@ ActivityObject.schema = {
indices: ["id"]
};
+ActivityObject.pkey = function() {
+ return "url";
+};
+
ActivityObject.ensure = function(url, callback) {
ActivityObject.get(url, function(err, aobj) {
if (err && err.name == "NoSuchThingError") { | Make sure pkey is always URL | e14n_pump.io-client-app | train | js |
8a92ab4b2c0de50559b8906914b2eef63112d9f3 | diff --git a/tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php b/tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php
+++ b/tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php
@@ -66,12 +66,10 @@ abstract class BaseTest extends \PHPUnit_Framework_TestCase
public function tearDown()
{
if ($this->dm) {
- foreach ($this->dm->getDocumentDatabases() as $db) {
- foreach ($db->listCollections() as $collection) {
- $collection->drop();
- }
+ $collections = $this->dm->getConnection()->selectDatabase('doctrine_odm_tests')->listCollections();
+ foreach ($collections as $collection) {
+ $collection->remove(array());
}
- $this->dm->getConnection()->close();
}
} | Better teardown that doesn't segfault. | doctrine_mongodb-odm | train | php |
1ef61c260dd0d301ee7bc0210efe2db82be9dc6f | diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php
index <HASH>..<HASH> 100644
--- a/blocks/moodleblock.class.php
+++ b/blocks/moodleblock.class.php
@@ -418,8 +418,8 @@ class block_base {
* @todo finish documenting this function
*/
function applicable_formats() {
- // Default case: the block can be used in all course types
- return array('all' => true);
+ // Default case: the block can be used in all course types and not in quizzes
+ return array('all' => true, 'quiz' => false);
} | Pull all blocks out of quiz pages. We can see about allowing them later. | moodle_moodle | train | php |
476e6e64d22a1078cf7d35ce48c1aa7296f17981 | diff --git a/carelib.php b/carelib.php
index <HASH>..<HASH> 100644
--- a/carelib.php
+++ b/carelib.php
@@ -26,7 +26,9 @@ require_once trailingslashit( dirname( __FILE__ ) ) . 'inc/library.php';
* @return object CareLib
*/
function carelib() {
- return CareLib::instance( __FILE__ );
+ $plugin = CareLib::instance();
+ $plugin->set_paths( __FILE__ );
+ return $plugin;
}
/**
diff --git a/inc/library.php b/inc/library.php
index <HASH>..<HASH> 100644
--- a/inc/library.php
+++ b/inc/library.php
@@ -67,7 +67,7 @@ class CareLib {
* @access public
* @param string $file the absolute path to the library's root file.
*/
- public function setup_paths( $file ) {
+ public function set_paths( $file ) {
$this->file = $file;
$this->dir = trailingslashit( dirname( $file ) );
$this->uri = trailingslashit( $this->normalize_uri( dirname( $file ) ) );
@@ -84,11 +84,10 @@ class CareLib {
* @static
* @return CareLib
*/
- public static function instance( $file ) {
+ public static function instance() {
static $instance;
if ( null === $instance ) {
$instance = new self();
- $instance->setup_paths( $file );
}
return $instance;
} | Handle paths outside of the instance getter | cipherdevgroup_carelib | train | php,php |
98f6629e4ef6d5db84b2f44538c7691dc126f470 | diff --git a/owo/aiohttp2.py b/owo/aiohttp2.py
index <HASH>..<HASH> 100644
--- a/owo/aiohttp2.py
+++ b/owo/aiohttp2.py
@@ -6,7 +6,6 @@ from aiohttp.multipart import TOKEN
from aiohttp.hdrs import CONTENT_DISPOSITION
from urllib.parse import quote
-import asyncio
import aiohttp
diff --git a/owo/owo.py b/owo/owo.py
index <HASH>..<HASH> 100644
--- a/owo/owo.py
+++ b/owo/owo.py
@@ -1,7 +1,4 @@
import mimetypes
-import json
-import base64
-import io
import os.path
from functools import lru_cache | Made all code flake8
except for __init__ for obvious reasons | whats-this_owo.py | train | py,py |
4bd234b67937b6852a87cdca4236831439b94bd3 | diff --git a/pkg/apis/extensions/types.go b/pkg/apis/extensions/types.go
index <HASH>..<HASH> 100644
--- a/pkg/apis/extensions/types.go
+++ b/pkg/apis/extensions/types.go
@@ -182,7 +182,7 @@ type ThirdPartyResourceData struct {
api.ObjectMeta `json:"metadata,omitempty"`
// Data is the raw JSON data for this data.
- Data []byte `json:"name,omitempty"`
+ Data []byte `json:"data,omitempty"`
}
type Deployment struct {
diff --git a/pkg/apis/extensions/v1beta1/types.go b/pkg/apis/extensions/v1beta1/types.go
index <HASH>..<HASH> 100644
--- a/pkg/apis/extensions/v1beta1/types.go
+++ b/pkg/apis/extensions/v1beta1/types.go
@@ -172,7 +172,7 @@ type ThirdPartyResourceData struct {
v1.ObjectMeta `json:"metadata,omitempty"`
// Data is the raw JSON data for this data.
- Data []byte `json:"name,omitempty"`
+ Data []byte `json:"data,omitempty"`
}
// Deployment enables declarative updates for Pods and ReplicationControllers. | Correct a typo in the json/yaml tags for 3rd party objects. | kubernetes_kubernetes | train | go,go |
1e46f989dd57958521ec34715b177a497159e652 | diff --git a/demo/basic-reflection/example2.php b/demo/basic-reflection/example2.php
index <HASH>..<HASH> 100644
--- a/demo/basic-reflection/example2.php
+++ b/demo/basic-reflection/example2.php
@@ -1,4 +1,5 @@
<?php
+
// Load an autoloadable class
require_once __DIR__ . '/../../vendor/autoload.php';
@@ -8,4 +9,3 @@ use Roave\BetterReflection\Reflection\ReflectionClass;
$reflection = ReflectionClass::createFromName(ReflectionClass::class);
echo $reflection->getName() . "\n"; // ReflectionClass
echo ($reflection->isInternal() === true ? 'internal' : 'not internal') . "\n"; // not internal
- | [docs] example2.php - flip fallen space from the bottom | Roave_BetterReflection | train | php |
bbf35cdf7f30199757da6bde009d6ccd700e9ccb | diff --git a/src/models/Comment.php b/src/models/Comment.php
index <HASH>..<HASH> 100644
--- a/src/models/Comment.php
+++ b/src/models/Comment.php
@@ -57,6 +57,11 @@ class Comment extends \Eloquent {
{
$commentable = $this->commentable;
+ if ( ! is_object($commentable) || ! method_exists($commentable, 'getAttributes') )
+ {
+ return FALSE;
+ }
+
$attributes = $commentable->getAttributes();
if (method_exists($commentable, 'getCommentableTitle')) | added defensive coding to check getAttributes exists before calling it | FbF_Laravel-Comments | train | php |
2005e048f7342c011f4bc08899d5cb4d4a15357a | diff --git a/debugtools/middleware/xviewmiddleware.py b/debugtools/middleware/xviewmiddleware.py
index <HASH>..<HASH> 100644
--- a/debugtools/middleware/xviewmiddleware.py
+++ b/debugtools/middleware/xviewmiddleware.py
@@ -1,7 +1,14 @@
+import django
from debugtools.utils.xview import track_view_name, get_used_view_name, get_used_template
-class XViewMiddleware(object):
+if django.VERSION >= (1, 10):
+ from django.utils.deprecation import MiddlewareMixin
+else:
+ MiddlewareMixin = object
+
+
+class XViewMiddleware(MiddlewareMixin):
"""
Adds an X-View header to requests. | Add MiddlewareMixin for Django <I> middleware compatibility | edoburu_django-debugtools | train | py |
a37eb9243cb633a0f0e2b6c87fe0f05acd5956d4 | diff --git a/asammdf/mdf.py b/asammdf/mdf.py
index <HASH>..<HASH> 100644
--- a/asammdf/mdf.py
+++ b/asammdf/mdf.py
@@ -3001,6 +3001,13 @@ class MDF(object):
size = UINT64_u(stream.read(8))[0] - 24
texts[addr] = randomized_string(size)
+ for at in mdf.attachments:
+ for addr in (at.comment_addr, at.file_name_addr):
+ if addr and addr not in texts:
+ stream.seek(addr + 8)
+ size = UINT64_u(stream.read(8))[0] - 24
+ texts[addr] = randomized_string(size)
+
for idx, gp in enumerate(mdf.groups, 1):
addr = gp.data_group.comment_addr | add scrambling of attachments in mdf.scramble | danielhrisca_asammdf | train | py |
32a3c78bc904b9816169ff256f06dbbedbb551d2 | diff --git a/src/Billing/SubscriptionGateway.php b/src/Billing/SubscriptionGateway.php
index <HASH>..<HASH> 100644
--- a/src/Billing/SubscriptionGateway.php
+++ b/src/Billing/SubscriptionGateway.php
@@ -524,8 +524,10 @@ class SubscriptionGateway extends StripeGateway {
if ( ! array_get($stripeSubscriptions, $subscription->stripe_id) && ! $subscription->expired())
{
$subscription->update([
- 'active' => 0,
- 'ended_at' => Carbon::now(),
+ 'active' => 0,
+ 'ended_at' => Carbon::now(),
+ 'canceled_at' => null,
+ 'trial_ends_at' => null,
]);
}
} | tweak the syncWithStripe() method on the subscription gateway | cartalyst_stripe | train | php |
652efed86dfea1b411ce313766ae56ad8d8067ee | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ setup(name = 'python-safe',
author = 'Ole Nielsen, Tim Sutton, Ariel Núñez',
author_email = 'ole.moller.nielsen@gmail.com',
url = 'http://github.com/AIFDR/inasafe',
- long_description = read('README.rst'),
+ long_description = read('README'),
packages = ['safe',
'safe.common',
'safe.storage', | Chaged way to access README file | inasafe_inasafe | train | py |
b34911104b835856f28f07b9fc32a6edb553b296 | diff --git a/src/chisel/__init__.py b/src/chisel/__init__.py
index <HASH>..<HASH> 100644
--- a/src/chisel/__init__.py
+++ b/src/chisel/__init__.py
@@ -5,7 +5,7 @@
TODO
"""
-__version__ = '0.9.93'
+__version__ = '0.9.94'
from .action import \
Action, \ | chisel <I> | craigahobbs_chisel | train | py |
08c909900ad0f67be6e1a46d9f1f1165153e3030 | diff --git a/lib/json_constants_parser.js b/lib/json_constants_parser.js
index <HASH>..<HASH> 100755
--- a/lib/json_constants_parser.js
+++ b/lib/json_constants_parser.js
@@ -30,7 +30,9 @@ var LJM_JSON_FILE_LOCATION;
if (process.platform === 'win32') {
var modernPath = process.env.ALLUSERSPROFILE + '\\LabJack\\LJM\\ljm_constants.json';
var xpPath = process.env.ALLUSERSPROFILE + '\\Application Data\\LabJack\\LJM\\ljm_constants.json';
- if (path.existsSync(modernPath))
+ var filePath = fs.existsSync(modernPath);
+
+ if (filePath)
LJM_JSON_FILE_LOCATION = modernPath;
else
LJM_JSON_FILE_LOCATION = xpPath; | Fixed a depreciated function call for existsSync | chrisJohn404_LabJack-nodejs | train | js |
ff0577ee4c68a8d81c8a55cc37ad07415b428759 | diff --git a/p2p/net/connmgr/connmgr.go b/p2p/net/connmgr/connmgr.go
index <HASH>..<HASH> 100644
--- a/p2p/net/connmgr/connmgr.go
+++ b/p2p/net/connmgr/connmgr.go
@@ -141,12 +141,18 @@ func NewConnManager(low, hi int, opts ...Option) (*BasicConnMgr, error) {
}
// memoryEmergency is run when we run low on memory.
-// Close half of the connections, as quickly as possible.
+// Close connections until we right the low watermark.
// We don't pay attention to the silence period or the grace period.
// We try to not kill protected connections, but if that turns out to be necessary, not connection is safe!
func (cm *BasicConnMgr) memoryEmergency() {
- log.Info("Low on memory. Closing half of our connections.")
- target := int(atomic.LoadInt32(&cm.connCount) / 2)
+ connCount := int(atomic.LoadInt32(&cm.connCount))
+ target := connCount - cm.cfg.lowWater
+ if target < 0 {
+ log.Warnw("Low on memory, but we only have a few connections", "num", connCount, "low watermark", cm.cfg.lowWater)
+ return
+ } else {
+ log.Warnf("Low on memory. Closing %d connections.", target)
+ }
cm.trimMutex.Lock()
defer atomic.AddUint64(&cm.trimCount, 1) | always trim to the low watermark in a memory emergency | libp2p_go-libp2p | train | go |
742f11e42d212eaba23124d1e7c8cd031c32979d | diff --git a/tests/org.eclipse.xtext.common.types.tests/tests/org/eclipse/xtext/common/types/xtext/ui/ContentAssistTest.java b/tests/org.eclipse.xtext.common.types.tests/tests/org/eclipse/xtext/common/types/xtext/ui/ContentAssistTest.java
index <HASH>..<HASH> 100644
--- a/tests/org.eclipse.xtext.common.types.tests/tests/org/eclipse/xtext/common/types/xtext/ui/ContentAssistTest.java
+++ b/tests/org.eclipse.xtext.common.types.tests/tests/org/eclipse/xtext/common/types/xtext/ui/ContentAssistTest.java
@@ -25,7 +25,6 @@ import com.google.inject.Injector;
/**
* @author Sebastian Zarnekow - Initial contribution and API
*/
-@SuppressWarnings("restriction")
public class ContentAssistTest extends AbstractContentAssistProcessorTest {
@Override | [pde] added missing plugin.properties file to binary build | eclipse_xtext-extras | train | java |
fe9aab1055604e772be05a1cbbb36a207c177055 | diff --git a/transformers/tokenization_xlm_roberta.py b/transformers/tokenization_xlm_roberta.py
index <HASH>..<HASH> 100644
--- a/transformers/tokenization_xlm_roberta.py
+++ b/transformers/tokenization_xlm_roberta.py
@@ -30,8 +30,8 @@ VOCAB_FILES_NAMES = {'vocab_file': 'sentencepiece.bpe.model'}
PRETRAINED_VOCAB_FILES_MAP = {
'vocab_file':
{
- 'xlm-roberta-base': "https://schweter.eu/cloud/transformers/xlm-roberta-base-sentencepiece.bpe.model",
- 'xlm-roberta-large': "https://schweter.eu/cloud/transformers/xlm-roberta-large-sentencepiece.bpe.model",
+ 'xlm-roberta-base': "https://s3.amazonaws.com/models.huggingface.co/bert/xlm-roberta-base-sentencepiece.bpe.model",
+ 'xlm-roberta-large': "https://s3.amazonaws.com/models.huggingface.co/bert/xlm-roberta-large-sentencepiece.bpe.model",
}
} | tokenization: use S3 location for XLM-RoBERTa model | huggingface_pytorch-pretrained-BERT | train | py |
30d24416b2e171d1fec86b0f36cdfe316fd8dd57 | diff --git a/tika/__init__.py b/tika/__init__.py
index <HASH>..<HASH> 100644
--- a/tika/__init__.py
+++ b/tika/__init__.py
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "1.16"
+__version__ = "1.18"
try:
__import__('pkg_resources').declare_namespace(__name__)
diff --git a/tika/tika.py b/tika/tika.py
index <HASH>..<HASH> 100755
--- a/tika/tika.py
+++ b/tika/tika.py
@@ -152,7 +152,7 @@ log.addHandler(consoleHandler)
log.setLevel(logging.INFO)
Windows = True if platform.system() == "Windows" else False
-TikaVersion = os.getenv('TIKA_VERSION', '1.16')
+TikaVersion = os.getenv('TIKA_VERSION', '1.18')
TikaJarPath = os.getenv('TIKA_PATH', tempfile.gettempdir())
TikaFilesPath = tempfile.gettempdir()
TikaServerLogFilePath = log_path | Upgrade to <I>. This closes #<I>. | chrismattmann_tika-python | train | py,py |
189450da9088c28a82324adb1f1a22d1244f931b | diff --git a/src/plugins/AwsS3/index.js b/src/plugins/AwsS3/index.js
index <HASH>..<HASH> 100644
--- a/src/plugins/AwsS3/index.js
+++ b/src/plugins/AwsS3/index.js
@@ -60,12 +60,18 @@ module.exports = class AwsS3 extends Plugin {
value: 1
})
return params
+ }).catch((error) => {
+ this.core.emit('core:upload-error', file.id, error)
})
})
).then((responses) => {
const updatedFiles = {}
fileIDs.forEach((id, index) => {
const file = this.core.getFile(id)
+ if (file.error) {
+ return
+ }
+
const {
method = 'post',
url, | s3: Emit upload-error when generating upload parameters fails. | transloadit_uppy | train | js |
39dd83d692d0cb984af851b38e89b0cd8ea302b6 | diff --git a/store.go b/store.go
index <HASH>..<HASH> 100644
--- a/store.go
+++ b/store.go
@@ -222,10 +222,10 @@ func (s *FilesystemStore) save(session *Session) error {
if err != nil {
return err
}
+ defer fp.Close()
if _, err = fp.Write([]byte(encoded)); err != nil {
return err
}
- fp.Close()
return nil
} | ensure FilesystemStore closes the file even on error.
Fixes #<I> | gorilla_sessions | train | go |
63ccd4f77ef039e8398471486f966b079169a8f6 | diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -35,6 +35,20 @@ class Mock(object):
# pylint: enable=R0903
MOCK_MODULES = [
+ # third-party libs (for netapi modules)
+ 'flask',
+ 'flask.globals',
+ 'flask.views',
+ 'werkzeug',
+ 'werkzeug.exceptions',
+
+ # salt libs
+ 'salt',
+ 'salt.client',
+ 'salt.exceptions',
+ 'salt.log',
+ 'salt.runner',
+ 'salt.utils',
]
for mod_name in MOCK_MODULES: | Mocked several modules in order to build the docs | saltstack_salt | train | py |
00f4dc643c9a2624d0c358e4224490ae2fb12185 | diff --git a/provision/kubernetes/deploy.go b/provision/kubernetes/deploy.go
index <HASH>..<HASH> 100644
--- a/provision/kubernetes/deploy.go
+++ b/provision/kubernetes/deploy.go
@@ -166,7 +166,8 @@ func createBuildPod(params buildPodParams) error {
while id=$(docker ps -aq -f "label=io.kubernetes.container.name=%s" -f "label=io.kubernetes.pod.name=$(hostname)") && [ -z "${id}" ]; do
sleep 1;
done;
- docker wait "${id}" >/dev/null
+ exit_code=$(docker wait "${id}")
+ [ "${exit_code}" != "0" ] && exit "${exit_code}"
echo
echo '---- Building application image ----'
docker commit "${id}" "${img}" >/dev/null | provision/kubernetes: prevent image commit of a failed deploy | tsuru_tsuru | train | go |
34ce08500dd70a5528fc1696bbe4587359badf02 | diff --git a/lib/tangle/graph.rb b/lib/tangle/graph.rb
index <HASH>..<HASH> 100644
--- a/lib/tangle/graph.rb
+++ b/lib/tangle/graph.rb
@@ -59,11 +59,12 @@ module Tangle
#
# edges => Array
#
- def edges(&selector)
+ def edges(vertex: nil, &selector)
+ edges = vertex.nil? ? @edges : @edges_by_vertex[vertex]
if block_given?
- @edges.select(&selector)
+ edges.select(&selector)
else
- @edges.to_a
+ edges.to_a
end
end | Add vertex pre-selection to Graph#edges
Limit searched/returned edges to those that touch the given vertex, by using the `@edges_by_vertex` index. | notCalle_ruby-tangle | train | rb |
594c9176bdc42580f0c844bee4cf50767a32a5bf | diff --git a/lib/travis/task.rb b/lib/travis/task.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/task.rb
+++ b/lib/travis/task.rb
@@ -19,13 +19,17 @@ module Travis
class << self
def run(type, data, options = {})
- if false && Travis.env == 'staging'
- publisher('tasks').publish(:data => data, :options => options)
- else
+ if run_local?
const_get(type.to_s.camelize).new(data, options).run
+ else
+ publisher('tasks').publish(:data => data, :options => options)
end
end
+ def run_local?
+ Travis::Features.feature_inactive?(:travis_tasks)
+ end
+
def publisher(queue)
Travis::Amqp::Publisher.new(queue)
end | use a feature flip for travis-tasks | travis-ci_travis-core | train | rb |
f6831aeff6ce60f2d78d3ba7d6ed7a2a1c2f3eb4 | diff --git a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/common/services/DefaultTerminalConverters.java b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/common/services/DefaultTerminalConverters.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/common/services/DefaultTerminalConverters.java
+++ b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/common/services/DefaultTerminalConverters.java
@@ -13,10 +13,12 @@ import org.eclipse.xtext.conversion.impl.AbstractDeclarativeValueConverterServic
import org.eclipse.xtext.conversion.impl.AbstractIDValueConverter;
import com.google.inject.Inject;
+import com.google.inject.Singleton;
/**
* Default converters for Strings, Integers and IDs.
*/
+@Singleton
public class DefaultTerminalConverters extends AbstractDeclarativeValueConverterService {
@Inject | [xtext] value converters should be marked as singletons by default | eclipse_xtext-core | train | java |
dda740ecf0fbb1a513af8239b1386f2c4e98fbab | diff --git a/core/src/main/java/com/orientechnologies/common/console/OConsoleApplication.java b/core/src/main/java/com/orientechnologies/common/console/OConsoleApplication.java
index <HASH>..<HASH> 100755
--- a/core/src/main/java/com/orientechnologies/common/console/OConsoleApplication.java
+++ b/core/src/main/java/com/orientechnologies/common/console/OConsoleApplication.java
@@ -309,6 +309,7 @@ public class OConsoleApplication {
iCommand.toLowerCase().startsWith("drop database")||
iCommand.toLowerCase().startsWith("connect")){
commandWords = iCommand.split(" ");
+ commandWords = Arrays.stream(commandWords).filter(s->s.length()>0).toArray(String[]::new);
for (int i = 2; i < commandWords.length; i++){
boolean wrappedInQuotes = false;
if (commandWords[i].startsWith("'") && commandWords[i].endsWith("'")){
@@ -317,7 +318,7 @@ public class OConsoleApplication {
else if (commandWords[i].startsWith("\"") && commandWords[i].endsWith("\"")){
wrappedInQuotes = true;
}
-
+
if (wrappedInQuotes){
commandWords[i] = commandWords[i].substring(1, commandWords[i].length() - 1);
} | Fix multiple spaces in console CONNECT
Resolves: #<I> | orientechnologies_orientdb | train | java |
77d0a08c38d10e3ed509350fcfcc24cc2c296c62 | diff --git a/python/ray/autoscaler/_private/docker.py b/python/ray/autoscaler/_private/docker.py
index <HASH>..<HASH> 100644
--- a/python/ray/autoscaler/_private/docker.py
+++ b/python/ray/autoscaler/_private/docker.py
@@ -18,7 +18,7 @@ def _check_docker_file_mounts(file_mounts: Dict[str, str]) -> None:
if Path(local).is_file():
cli_logger.warning(
f"File Mount: ({remote}:{local}) refers to a file.\n To ensure"
- "this mount updates properly, please use a directory.")
+ " this mount updates properly, please use a directory.")
def validate_docker_config(config: Dict[str, Any]) -> None: | [docker] Fix missing space in docker.py warning (#<I>) | ray-project_ray | train | py |
1398d4e29a1c64a7c4a239f272d2a6d656fa0f41 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -93,7 +93,7 @@ function HttpProxyMiddleware(context, opts) {
// store uri before it gets rewritten for logging
var originalPath = req.url;
- var newProxyOptions = _.cloneDeep(proxyOptions);
+ var newProxyOptions = _.assign({}, proxyOptions);
// Apply in order:
// 1. option.router | fix(ntlm authentication) (#<I>) | chimurai_http-proxy-middleware | train | js |
495995cd08b2f45e27416a878051dd87a4263d80 | diff --git a/src/motor/Observable.js b/src/motor/Observable.js
index <HASH>..<HASH> 100644
--- a/src/motor/Observable.js
+++ b/src/motor/Observable.js
@@ -4,6 +4,10 @@ const instanceofSymbol = Symbol('instanceofSymbol')
const ObservableMixin = base => {
class Observable extends base {
+ constructor(options = {}) {
+ super(options)
+ }
+
on(eventName, callback) {
if (!this._eventMap)
this._eventMap = new Map
diff --git a/src/motor/TreeNode.js b/src/motor/TreeNode.js
index <HASH>..<HASH> 100644
--- a/src/motor/TreeNode.js
+++ b/src/motor/TreeNode.js
@@ -3,7 +3,7 @@ const instanceofSymbol = Symbol('instanceofSymbol')
const TreeNodeMixin = base => {
class TreeNode extends base {
- constructor(options) {
+ constructor(options = {}) {
super(options)
this._parent = null // default to no parent.
this._children = []; | All mixins should follow the constructor(options = {}) pattern. | trusktr_infamous | train | js,js |
0a8c427ae54537f277c6b91a788ad5398cc40d87 | diff --git a/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ImageDecoder.java b/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ImageDecoder.java
index <HASH>..<HASH> 100644
--- a/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ImageDecoder.java
+++ b/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ImageDecoder.java
@@ -115,7 +115,7 @@ public class ImageDecoder {
* @param encodedImage input image (encoded bytes plus meta data)
* @return a CloseableStaticBitmap
*/
- public synchronized CloseableStaticBitmap decodeStaticImage(
+ public CloseableStaticBitmap decodeStaticImage(
final EncodedImage encodedImage) {
CloseableReference<Bitmap> bitmapReference =
mBitmapFactoryWithPool.decodeFromEncodedImage(encodedImage);
@@ -134,7 +134,7 @@ public class ImageDecoder {
* @param qualityInfo quality info for the image
* @return a CloseableStaticBitmap
*/
- public synchronized CloseableStaticBitmap decodeJpeg(
+ public CloseableStaticBitmap decodeJpeg(
final EncodedImage encodedImage,
int length,
QualityInfo qualityInfo) { | Remove synchronization from ImageDecoder | facebook_fresco | train | java |
96dd072cd9dd7ec2ef32cf78268efd9c8ec9bdde | diff --git a/spec/cube_solver/cube_spec.rb b/spec/cube_solver/cube_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cube_solver/cube_spec.rb
+++ b/spec/cube_solver/cube_spec.rb
@@ -39,12 +39,12 @@ describe CubeSolver::Cube do
describe '#solved?' do
it 'returns true when cube is solved' do
- expect(subject.solved?).to be_true
+ expect(subject).to be_solved
end
it 'returns false when cube is not solved' do
subject.l
- expect(subject.solved?).to be_false
+ expect(subject).to_not be_solved
end
end | Use RSpec-isms for testing Cube#solved? | chrishunt_rubiks-cube | train | rb |
68d06d22fc591194ee59cff1ce85635c29b073a5 | diff --git a/src/Framework/Application/Application.php b/src/Framework/Application/Application.php
index <HASH>..<HASH> 100644
--- a/src/Framework/Application/Application.php
+++ b/src/Framework/Application/Application.php
@@ -153,10 +153,19 @@ class Application implements ApplicationInterface, LoggerAwareInterface
$status = 400;
break;
}
+ $this->logger->debug("Request to {url} does not include required header '{header}'. ", [
+ 'url' => $request->getUri()->getPath(),
+ 'method' => $ex->getMessage(),
+ ]);
return new Response($status, $headers);
} catch (NotFoundException $ex) {
return new Response(404);
} catch (MethodNotAllowedException $ex) {
+ $this->logger->debug("Request to {url} does not support '{method}'. Supported: {allowed}", [
+ 'url' => $request->getUri()->getPath(),
+ 'method' => $request->getMethod(),
+ 'allowed' => implode(', ', $ex->getAllowedMethods()),
+ ]);
return (new Response(405))
->withHeader('Allow', $ex->getAllowedMethods());
} catch (\BadMethodCallException $ex) { | Add debug logging for other exception types | phOnion_framework | train | php |
63a6e77b7982e6fde0c2f3b58cad87d720cea4af | diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -7,6 +7,11 @@ require 'active_support'
FIXTURES_DIR = File.join(Dir.pwd, 'test', 'fixtures')
+class Minitest::Test
+ FileUtils.rm_rf File.join(FIXTURES_DIR, 'output')
+ FileUtils.rm_rf File.join(FIXTURES_DIR, 'tmp')
+end
+
def read_output_file(dir, name)
File.read(File.join('output', dir, name, 'index.html')).gsub(/^\s*$/, '')
end | Clean up stale output before full run | gjtorikian_nanoc-conref-fs | train | rb |
5088e4f364e801ac5e4113d3b7c05e08e89cf6a1 | diff --git a/abstract.js b/abstract.js
index <HASH>..<HASH> 100644
--- a/abstract.js
+++ b/abstract.js
@@ -525,7 +525,8 @@ ee(Object.defineProperties(PersistenceDriver.prototype, assign({
type: 'size',
direct: true,
keyPath: keyPath,
- searchValue: searchValue
+ searchValue: searchValue,
+ filter: filter
};
return promise;
}, { primitive: true, length: 1 }), | Expose filter on index meta data | medikoo_dbjs-persistence | train | js |
e4ee7fc7d79d8f4297fefad0dbd16ea826b07d21 | diff --git a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php
index <HASH>..<HASH> 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php
@@ -58,6 +58,11 @@ class SearchEngineServiceProvider implements ServiceProviderInterface
return new SearchEngineLogger($app);
});
+ // Only used for Phrasea search engine
+ $app['phraseanet.SE.subscriber'] = $app->share(function ($app) {
+ return new PhraseaEngineSubscriber($app);
+ });
+
$app['elasticsearch.engine'] = $app->share(function ($app) {
return new ElasticSearchEngine(
$app, | Fix broken phrasea engine (introduced in #<I>) | alchemy-fr_Phraseanet | train | php |
3cde6e57e635d130ddb26189adb4323aeda6899d | diff --git a/test/TransactionServiceUTest.php b/test/TransactionServiceUTest.php
index <HASH>..<HASH> 100644
--- a/test/TransactionServiceUTest.php
+++ b/test/TransactionServiceUTest.php
@@ -164,7 +164,8 @@ class TransactionServiceUTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf($class, $service->pay($this->getTestPayPalTransaction()));
}
- public function testGetDataForUpi(){
+ public function testGetDataForUpi()
+ {
$data = new \stdClass();
$data->request_time_stamp = gmdate('YmdHis'); | put opening brace on the next line | wirecard_paymentSDK-php | train | php |
6ab614371a7d6b6d117fbe644986c6a29050353a | diff --git a/update.php b/update.php
index <HASH>..<HASH> 100644
--- a/update.php
+++ b/update.php
@@ -105,7 +105,7 @@
}
$code = sprintf($shell,
-' <h1>Update Symphony <em>Version '.kVERSION.'</em><em><a href="http://overture21.com/forum/comments.php?DiscussionID=754">change log</a></em></h1>
+' <h1>Update Symphony <em>Version '.kVERSION.'</em><em><a href="'.kCHANGELOG.'">change log</a></em></h1>
<h2>Update Complete</h2>
<p><strong>Post Installation Step: </strong>Since 2.0.2, the built-in image manipulation features have been replaced with the <a href="http://github.com/pointybeard/jit_image_manipulation/tree/master">JIT Image Manipulation</a> extension. Should you have uploaded (or cloned) this to your Extensions folder, be sure to <a href="'.URL.'/symphony/system/extensions/">enable it.</a></p> | removed the remaining static changelog URL reference | symphonycms_symphony-2 | train | php |
4b86353b9dc875eb61d432d14af6a1f3bfe59298 | diff --git a/lib/engineyard-serverside/version.rb b/lib/engineyard-serverside/version.rb
index <HASH>..<HASH> 100644
--- a/lib/engineyard-serverside/version.rb
+++ b/lib/engineyard-serverside/version.rb
@@ -1,5 +1,5 @@
module EY
module Serverside
- VERSION = '2.5.1.pre'
+ VERSION = '2.6.0.pre'
end
end | <I> version is next.
Minor bump for new features that are backwards compatible. | engineyard_engineyard-serverside | train | rb |
24f4d6dc56f38f98b0a0b980ff318e882d436947 | diff --git a/tpot/builtins/nn.py b/tpot/builtins/nn.py
index <HASH>..<HASH> 100644
--- a/tpot/builtins/nn.py
+++ b/tpot/builtins/nn.py
@@ -239,9 +239,9 @@ class _MLP(nn.Module):
self.hidden_size = round((input_size+num_classes)/2)
- self.fc1 = nn.Linear(input_size, hidden_size)
+ self.fc1 = nn.Linear(input_size, self.hidden_size)
self.relu = nn.ReLU()
- self.fc2 = nn.Linear(hidden_size, num_classes)
+ self.fc2 = nn.Linear(self.hidden_size, num_classes)
def forward(self, x):
hidden = self.fc1(x) | Make hidden size an instance attribute in _MLP | EpistasisLab_tpot | train | py |
13881f2002e8821555cab00307867a1c47957c8b | diff --git a/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java b/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java
index <HASH>..<HASH> 100644
--- a/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java
+++ b/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerDefinitionVisitor.java
@@ -1736,7 +1736,8 @@ public class TypeCheckerDefinitionVisitor extends AbstractTypeCheckVisitor
AExplicitFunctionDefinition def = AstFactory.newAExplicitFunctionDefinition(node.getMeasureName(), scope,
(List<ILexNameToken>) node.getTypeParams().clone(), mtype, cpll, node.getMeasure(), null, null, false, null);
- def.setClassDefinition(node.getClassDefinition());
+ def.setClassDefinition(node.getClassDefinition().clone());
+ def.setAccess(node.getAccess().clone());
question.assistantFactory.createPDefinitionAssistant().typeResolve(def, THIS, question);
def.apply(THIS, question); | Fix to make measure_f same access specifier as main function | overturetool_overture | train | java |
72470f0fe0ac71cd36e18d585404a90c6ce382bb | diff --git a/lib/scenario.js b/lib/scenario.js
index <HASH>..<HASH> 100644
--- a/lib/scenario.js
+++ b/lib/scenario.js
@@ -95,7 +95,6 @@ module.exports.test = (test) => {
*/
module.exports.injected = function (fn, suite, hookName) {
return function (done) {
-
const errHandler = (err) => {
recorder.session.start('teardown');
recorder.cleanAsyncErr();
@@ -111,7 +110,7 @@ module.exports.injected = function (fn, suite, hookName) {
if (!fn) throw new Error('fn is not defined');
- event.emit(event.hook.started, suite);
+ event.emit(event.hook.started, suite);
if (!recorder.isRunning()) {
recorder.start();
recorder.errHandler((err) => {
@@ -119,7 +118,7 @@ module.exports.injected = function (fn, suite, hookName) {
});
}
- this.test.body = fn.toString();
+ this.test.body = fn.toString();
if (isAsyncFunction(fn)) {
fn.apply(this, getInjectedArguments(fn)).then(() => { | refactor: fix eslint errors (#<I>) | Codeception_CodeceptJS | train | js |
627735b49e5e9a0fdcbade4b35df0aa8e21c0e05 | diff --git a/intranet/apps/eighth/models.py b/intranet/apps/eighth/models.py
index <HASH>..<HASH> 100644
--- a/intranet/apps/eighth/models.py
+++ b/intranet/apps/eighth/models.py
@@ -1080,7 +1080,7 @@ class EighthScheduledActivity(AbstractBaseEighthModel):
capacity = self.get_true_capacity()
return capacity != -1 and self.eighthsignup_set.count() > capacity
- def is_too_early_to_signup(self, now: datetime.datetime = None) -> bool:
+ def is_too_early_to_signup(self, now: Optional[datetime.datetime] = None) -> bool:
"""Returns whether it is too early to sign up for the activity
if it is a presign. | refactor(eighth): fix type annotation | tjcsl_ion | train | py |
483dc02e83258b1bce5905ada96ba74fb937970c | diff --git a/src/Connections/ConnectionInterface.php b/src/Connections/ConnectionInterface.php
index <HASH>..<HASH> 100644
--- a/src/Connections/ConnectionInterface.php
+++ b/src/Connections/ConnectionInterface.php
@@ -1,7 +1,6 @@
<?php
namespace Adldap\Connections;
-use Adldap\AdldapError;
/**
* The Connection interface used for making connections. Implementing
@@ -262,6 +261,8 @@ interface ConnectionInterface
* @param string $password
* @param bool $sasl
*
+ * @throws ConnectionException If connecting over TLS fails.
+ *
* @return bool
*/
public function bind($username, $password, $sasl = false);
diff --git a/src/Connections/Ldap.php b/src/Connections/Ldap.php
index <HASH>..<HASH> 100644
--- a/src/Connections/Ldap.php
+++ b/src/Connections/Ldap.php
@@ -276,8 +276,8 @@ class Ldap implements ConnectionInterface
*/
public function bind($username, $password, $sasl = false)
{
- if ($this->isUsingTLS()) {
- $this->startTLS();
+ if ($this->isUsingTLS() && $this->startTLS() === false) {
+ throw new ConnectionException("Unable to connect to LDAP server over TLS.");
}
if ($sasl) { | Throw connection exception if start TLS fails. | Adldap2_Adldap2 | train | php,php |
56ddbcba2dfd1f197e864eff379cc942cf064292 | diff --git a/maven-plugin/src/main/java/net/revelc/code/formatter/FormatterMojo.java b/maven-plugin/src/main/java/net/revelc/code/formatter/FormatterMojo.java
index <HASH>..<HASH> 100644
--- a/maven-plugin/src/main/java/net/revelc/code/formatter/FormatterMojo.java
+++ b/maven-plugin/src/main/java/net/revelc/code/formatter/FormatterMojo.java
@@ -443,7 +443,7 @@ public class FormatterMojo extends AbstractMojo implements ConfigurationSource {
return props;
}
- try (final BufferedInputStream stream = new BufferedInputStream(new FileInputStream(cacheFile))) {
+ try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(cacheFile))) {
props.load(stream);
} catch (IOException e) {
log.warn("Cannot load file hash cache properties file", e); | [ci] Remove redundant final in try with resources block | revelc_formatter-maven-plugin | train | java |
af2b2ec67bdbce8066364772b1875ec5297afeb8 | diff --git a/src/AlphaRPC/Common/Socket/Stream.php b/src/AlphaRPC/Common/Socket/Stream.php
index <HASH>..<HASH> 100644
--- a/src/AlphaRPC/Common/Socket/Stream.php
+++ b/src/AlphaRPC/Common/Socket/Stream.php
@@ -100,6 +100,10 @@ class Stream implements StreamInterface
}
/**
+ * Handles messages that are already in the buffer.
+ *
+ * When the timer expires, no more messages will be read, even
+ * when there are still more in the buffer.
*
* @param TimerInterface $timer
*
@@ -109,16 +113,22 @@ class Stream implements StreamInterface
public function handle(TimerInterface $timer = null)
{
$timer = $timer ?: new UnlimitedTimer();
- do {
+ while (true) {
try {
+ // Read from the buffer, but don't wait for new messages.
$this->read(new TimeoutTimer(0));
} catch (TimeoutException $ex) {
- // Timeout is not relevant here.
unset($ex);
+ // There is no message in the buffer. Return immediately.
return;
}
- } while (!$timer->isExpired());
+
+ if ($timer->isExpired()) {
+ // There is no more time to handle messages. Return immediately.
+ return;
+ }
+ }
}
/** | Improved comments on Stream::handle(). | alphacomm_alpharpc | train | php |
203c43ff4415f664c5ecc0cf2b0ade9ae9807c3a | diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py
index <HASH>..<HASH> 100755
--- a/codespell_lib/_codespell.py
+++ b/codespell_lib/_codespell.py
@@ -220,9 +220,8 @@ def parse_options(args):
action='append', metavar='FILE',
help='Custom dictionary file that contains spelling '
'corrections. If this flag is not specified or '
- 'equals "-" then default dictionary "%s" is used. '
- 'This option can be specified multiple times.' %
- default_dictionary)
+ 'equals "-" then the default dictionary is used. '
+ 'This option can be specified multiple times.')
parser.add_option('-I', '--ignore-words',
action='append', metavar='FILE',
help='File that contains words which will be ignored ' | Drop path in help output to make the build reproducible (#<I>)
Closes #<I> | codespell-project_codespell | train | py |
24507b0731c0077da252a8e7892b5b0419625a84 | diff --git a/src/Expression.php b/src/Expression.php
index <HASH>..<HASH> 100644
--- a/src/Expression.php
+++ b/src/Expression.php
@@ -28,9 +28,12 @@ class Expression implements \ArrayAccess, \IteratorAggregate
*
* $args['custom'] is used to store hash of custom template replacements.
*
+ * This property is made public to ease customization and make it accessible
+ * from Connection class for example.
+ *
* @var array
*/
- protected $args = ['custom' => []];
+ public $args = ['custom' => []];
/**
* As per PDO, _param() will convert value into :a, :b, :c .. :aa .. etc. | make args public (#<I>) | atk4_dsql | train | php |
c5545d151969b66f87cda3feee98d12b45638bed | diff --git a/src/DocBlock/Tags/Method.php b/src/DocBlock/Tags/Method.php
index <HASH>..<HASH> 100644
--- a/src/DocBlock/Tags/Method.php
+++ b/src/DocBlock/Tags/Method.php
@@ -218,6 +218,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
$argument['type'] = new Void_();
}
$keys = array_keys($argument);
+ sort($keys);
if ($keys !== [ 'name', 'type' ]) {
throw new \InvalidArgumentException(
'Arguments can only have the "name" and "type" fields, found: ' . var_export($keys, true) | Adds sort to order expected keys
Without this sort the order of argument name and type matter. But
we accually don't care about the order. Only name and type are allowed
but the order doesn't matter. | phpDocumentor_ReflectionDocBlock | train | php |
0aa3717d7d93a08dd3eb30512f817135456fa3db | diff --git a/torchvision/ops/boxes.py b/torchvision/ops/boxes.py
index <HASH>..<HASH> 100644
--- a/torchvision/ops/boxes.py
+++ b/torchvision/ops/boxes.py
@@ -66,8 +66,7 @@ def batched_nms(
_log_api_usage_once("torchvision.ops.batched_nms")
# Benchmarks that drove the following thresholds are at
# https://github.com/pytorch/vision/issues/1311#issuecomment-781329339
- # Ideally for GPU we'd use a higher threshold
- if boxes.numel() > 4_000 and not torchvision._is_tracing():
+ if boxes.numel() > (4000 if boxes.device.type == "cpu" else 20000) and not torchvision._is_tracing():
return _batched_nms_vanilla(boxes, scores, idxs, iou_threshold)
else:
return _batched_nms_coordinate_trick(boxes, scores, idxs, iou_threshold) | Change batched NMS threshold to choose for-loop version (#<I>)
According to the benchmark link <URL>.
This PR changes the threshold to be device dependent. | pytorch_vision | train | py |
6d7529c34f54ff51843c8ae46e079dc79299bb54 | diff --git a/commons-types/src/main/java/se/l4/commons/types/reflect/Annotated.java b/commons-types/src/main/java/se/l4/commons/types/reflect/Annotated.java
index <HASH>..<HASH> 100644
--- a/commons-types/src/main/java/se/l4/commons/types/reflect/Annotated.java
+++ b/commons-types/src/main/java/se/l4/commons/types/reflect/Annotated.java
@@ -24,7 +24,7 @@ public interface Annotated
/**
* Get if an annotation of the specific type is present.
*/
- default boolean hasAnnotation(@NonNull Class<?> annotationClass)
+ default boolean hasAnnotation(@NonNull Class<? extends Annotation> annotationClass)
{
for(Annotation a : getAnnotations())
{ | fix(types): hasAnnotation should only take in annotation types | LevelFourAB_commons | train | java |
702c7c41ade2e1d9aefdd15706c8c78146a1a567 | diff --git a/src/Amadeus/Client/SoapClient.php b/src/Amadeus/Client/SoapClient.php
index <HASH>..<HASH> 100644
--- a/src/Amadeus/Client/SoapClient.php
+++ b/src/Amadeus/Client/SoapClient.php
@@ -115,8 +115,8 @@ class SoapClient extends \SoapClient implements Log\LoggerAwareInterface
$newRequest = $request;
} else {
$newDom = new \DOMDocument('1.0', 'UTF-8');
- $newDom->loadXML($transform);
$newDom->preserveWhiteSpace = false;
+ $newDom->loadXML($transform);
$newRequest = $newDom->saveXML();
} | Another attempt at fixing failing unittest (newlines) | amabnl_amadeus-ws-client | train | php |
990173f8b1c0e36e9b6fdc4aeddb6f563d83658b | diff --git a/topydo/lib/ListFormat.py b/topydo/lib/ListFormat.py
index <HASH>..<HASH> 100644
--- a/topydo/lib/ListFormat.py
+++ b/topydo/lib/ListFormat.py
@@ -193,9 +193,9 @@ class ListFormatParser(object):
# relative completion date
'X': lambda t: 'x ' + humanize_date(t.completion_date()) if t.is_completed() else '',
- 'z': color_block,
+ 'z': lambda t: color_block if config().colors() else ' ',
- 'Z': lambda t: color_block(t, p_safe=False),
+ 'Z': lambda t: color_block(t, p_safe=False) if config().colors() else ' ',
}
self.format_list = self._preprocess_format() | Don't print colors codes when colors are turned off | bram85_topydo | train | py |
bf395348dc2d9e940ad16007cb3475ab063e1fd8 | diff --git a/src/photini/__init__.py b/src/photini/__init__.py
index <HASH>..<HASH> 100644
--- a/src/photini/__init__.py
+++ b/src/photini/__init__.py
@@ -1,5 +1,5 @@
from __future__ import unicode_literals
-__version__ = '14.12.0.dev172'
-_dev_no = '172'
-_commit = '66849e9'
+__version__ = '14.12.0.dev173'
+_dev_no = '173'
+_commit = 'b5464a1'
diff --git a/src/photini/editor.py b/src/photini/editor.py
index <HASH>..<HASH> 100755
--- a/src/photini/editor.py
+++ b/src/photini/editor.py
@@ -218,7 +218,7 @@ class MainWindow(QtGui.QMainWindow):
self.image_list.close_files(all_files)
def closeEvent(self, event):
- self.image_list.unsaved_files_dialog(with_cancel=False)
+ self.image_list.unsaved_files_dialog(all_files=True, with_cancel=False)
self.loggerwindow.shutdown()
QtGui.QMainWindow.closeEvent(self, event) | Bug fix: could quit with unsaved files
If the unsaved files weren't selected the "do you want to save?" dialog
wasn't happening. | jim-easterbrook_Photini | train | py,py |
56d09ecbee95e101317637243d35182f82c1110a | diff --git a/bika/lims/content/abstractroutineanalysis.py b/bika/lims/content/abstractroutineanalysis.py
index <HASH>..<HASH> 100644
--- a/bika/lims/content/abstractroutineanalysis.py
+++ b/bika/lims/content/abstractroutineanalysis.py
@@ -519,13 +519,3 @@ class AbstractRoutineAnalysis(AbstractAnalysis):
# Once we have the rules, the system has to execute its
# instructions if the result has the expected result.
doReflexRuleAction(self, action_row)
-
- @security.public
- def guard_to_be_preserved(self):
- """Returns if the Sample Partition to which this Analysis belongs needs
- to be prepreserved, so the Analysis. If the analysis has no Sample
- Partition assigned, returns False.
- Delegates to Sample Partitions's guard_to_be_preserved
- """
- part = self.getSamplePartition()
- return part and part.guard_to_be_preserved() | Remove guard_to_be_preserved from analysis (#<I>)
to_be_preserved state and transitions are no longer supported in
analysis_workflow | senaite_senaite.core | train | py |
6690fbd9a2ba00e40d7484425808c84d44233f0c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ setup(
long_description="""API's for cryptocurrency exchanges """,
license="BSD",
packages=['cryptoexchange', 'cryptoexchange/util'],
- install_requires = ["websocket-client"],
+ install_requires = ["websocket-client", "bitcoin-price-api"],
use_2to3 = True
) | add bitcoin-price-api as dependence | joequant_cryptoexchange | train | py |
d2137c1984cdfbd66259d3e117464a55251b0a42 | diff --git a/src/Resource/Customer.php b/src/Resource/Customer.php
index <HASH>..<HASH> 100644
--- a/src/Resource/Customer.php
+++ b/src/Resource/Customer.php
@@ -362,7 +362,7 @@ class Customer extends MoipResource
/**
* Set tax document from customer.
*
- * @param int $number Document number.
+ * @param string $number Document number.
* @param string $type Document type.
*
* @return $this | taxDocument.number is a string (because it can start with '0') | wirecardBrasil_moip-sdk-php | train | php |
04bef05b571e6dc8679b5beddb383038883f80b2 | diff --git a/mobly/controllers/android_device_lib/services/snippet_management_service.py b/mobly/controllers/android_device_lib/services/snippet_management_service.py
index <HASH>..<HASH> 100644
--- a/mobly/controllers/android_device_lib/services/snippet_management_service.py
+++ b/mobly/controllers/android_device_lib/services/snippet_management_service.py
@@ -18,10 +18,6 @@ from mobly.controllers.android_device_lib.services import base_service
MISSING_SNIPPET_CLIENT_MSG = 'No snippet client is registered with name "%s".'
-# This config is transient and we will remove it after completing the migration
-# from v1 to v2.
-_CLIENT_V2_CONFIG_KEY = 'use_mobly_snippet_client_v2'
-
class Error(errors.ServiceError):
"""Root error type for snippet management service.""" | Clean up legacy code (#<I>) | google_mobly | train | py |
41f0096badab95a86b6f121327ae3c78b76d5a86 | diff --git a/src/createApp.js b/src/createApp.js
index <HASH>..<HASH> 100644
--- a/src/createApp.js
+++ b/src/createApp.js
@@ -56,8 +56,7 @@ function createApp (views) {
var givenProps = this.state[key + '_props'];
var props = xtend({
key: key,
- app: this,
- viewClassName: this.state[key + '_class'] || 'view'
+ app: this
}, givenProps);
if (this.getViewProps) {
@@ -69,10 +68,10 @@ function createApp (views) {
getViewNotFound: function () {
return (
- <UI.View className="view">
+ <UI.View>
<UI.ViewContent>
<UI.Feedback
- iconKey="ion-alert-circled"
+ iconName="ion-alert-circled"
iconType="danger"
text={'Sorry, the view <strong>"' + this.state.currentView + '"</strong> is not available.'}
actionText="Okay, take me home"
@@ -101,7 +100,6 @@ function createApp (views) {
viewTransition: this.getCSSTransition(transition)
};
- newState[key + '_class'] = 'view';
newState[key + '_props'] = props || {};
xtend(newState, state); | createApp: 'view' classname is now defunct | touchstonejs_touchstonejs | train | js |
c84ab09a0e249151298d193018d45c58034faf86 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -231,6 +231,19 @@ function merge(source, target, filter) {
return target;
}
+function pedantic(value, period) {
+ period = period || '.';
+ value = /[a-zA-Z0-9]$/.test(value) ? value + period : value
+ // sane if it ends with some common punctuation.
+ var sane = /[!?:;\.]([\*`]+)?$/.test(value);
+ if(!sane) {
+ // close on markdown inline formatters
+ value = /[^\.][\)\]\*`]+$/.test(value) ? value + period : value;
+ }
+ return value;
+}
+
+
module.exports.repeat = repeat;
module.exports.pad = pad;
module.exports.camelcase = camelcase;
@@ -240,3 +253,4 @@ module.exports.wrap = wrap;
module.exports.ucfirst= ucfirst;
module.exports.ltrim = ltrim;
module.exports.rtrim = rtrim;
+module.exports.pedantic = pedantic; | Add pedantic function, requires testing. | cli-kit_cli-util | train | js |
95c89717f9a4f1199d26741cf910978aedf544d4 | diff --git a/lib/tty/prompt/reader.rb b/lib/tty/prompt/reader.rb
index <HASH>..<HASH> 100644
--- a/lib/tty/prompt/reader.rb
+++ b/lib/tty/prompt/reader.rb
@@ -345,7 +345,8 @@ module TTY
#
# @api public
def windows?
- ::File::ALT_SEPARATOR == "\\"
+ ::File::ALT_SEPARATOR == '\\' &&
+ !env['TERM'] =~ /cygwin/
end
end # Reader
end # Prompt | Change to treat cygwin as unix compatible reader and fix issue #<I> | piotrmurach_tty-prompt | train | rb |
988c8564d2dc08432e08bae53560258863cfad49 | diff --git a/pymatgen/io/vasp/sets.py b/pymatgen/io/vasp/sets.py
index <HASH>..<HASH> 100644
--- a/pymatgen/io/vasp/sets.py
+++ b/pymatgen/io/vasp/sets.py
@@ -267,7 +267,7 @@ class DictSet(VaspInputSet):
if self.vdw:
vdw_par = loadfn(os.path.join(MODULE_DIR, "vdW_parameters.yaml"))
if self.vdw.lower() in vdw_par.keys():
- self.user_incar_settings.update(vdw_par[self.vdw.lower()])
+ self._config_dict["INCAR"].update(vdw_par[self.vdw.lower()])
else:
raise KeyError("Invalid or unsupported van-der-Waals "
"functional. Supported functionals are " | Override config dict rather than user_incar_settings. | materialsproject_pymatgen | train | py |
2a4f77d2039e1f94b8e0c1f24fe3c0267c520064 | diff --git a/tests/integration/remove.php b/tests/integration/remove.php
index <HASH>..<HASH> 100644
--- a/tests/integration/remove.php
+++ b/tests/integration/remove.php
@@ -44,6 +44,9 @@ class removeTestCase extends WatchmanTestCase {
system("rm -rf $root ; mkdir -p $root/notme");
+ if (PHP_OS == 'Linux' && getenv('TRAVIS')) {
+ $this->assertSkipped('openvz and inotify unlinks == bad time');
+ }
$watches = $this->waitForWatchman(
array('watch-list'),
function ($list) use ($root) { | and one more to persuade travis-ci to be happier | facebook_watchman | train | php |
7cc30c513b7ca5d36f66cd8b7a15d84c3063089a | diff --git a/src/main/java/org/jamesframework/core/problems/objectives/AbstractObjective.java b/src/main/java/org/jamesframework/core/problems/objectives/AbstractObjective.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jamesframework/core/problems/objectives/AbstractObjective.java
+++ b/src/main/java/org/jamesframework/core/problems/objectives/AbstractObjective.java
@@ -29,21 +29,21 @@ public abstract class AbstractObjective<SolutionType extends Solution, DataType>
private boolean minimizing;
@Override
- public boolean isMinimizing() {
+ public final boolean isMinimizing() {
return minimizing;
}
/**
* Turn this objective into a minimizing objective.
*/
- public void setMinimizing(){
+ public final void setMinimizing(){
minimizing = true;
}
/**
* Turn this objective into a maximizing objective.
*/
- public void setMaximizing(){
+ public final void setMaximizing(){
minimizing = false;
} | added some final modifiers to AbstractObjective | hdbeukel_james-core | train | java |
4da0be87592ec5d5ddd4ce0cf4e87b0caf9bffcd | diff --git a/src/nupic/research/spatial_pooler.py b/src/nupic/research/spatial_pooler.py
index <HASH>..<HASH> 100644
--- a/src/nupic/research/spatial_pooler.py
+++ b/src/nupic/research/spatial_pooler.py
@@ -897,7 +897,7 @@ class SpatialPooler(object):
value is meaningless if global inhibition is enabled.
"""
if self._globalInhibition:
- self._inhibitionRadius = self._columnDimensions.max()
+ self._inhibitionRadius = int(self._columnDimensions.max())
return
avgConnectedSpan = numpy.average(
@@ -1663,7 +1663,7 @@ class SpatialPooler(object):
proto.potentialRadius = self._potentialRadius
proto.potentialPct = self._potentialPct
proto.inhibitionRadius = self._inhibitionRadius
- proto.globalInhibition = self._globalInhibition
+ proto.globalInhibition = self._globalInhibition == True
proto.numActiveColumnsPerInhArea = self._numActiveColumnsPerInhArea
proto.localAreaDensity = self._localAreaDensity
proto.stimulusThreshold = self._stimulusThreshold | Fix broken Spatial Pooler serialization | numenta_nupic | train | py |
862023a06c0bc52cedbc32eb1d55fc7813b785af | diff --git a/admin-tools-quartz/src/main/resources/static/admintool/quartz/js/quartz.js b/admin-tools-quartz/src/main/resources/static/admintool/quartz/js/quartz.js
index <HASH>..<HASH> 100644
--- a/admin-tools-quartz/src/main/resources/static/admintool/quartz/js/quartz.js
+++ b/admin-tools-quartz/src/main/resources/static/admintool/quartz/js/quartz.js
@@ -467,13 +467,20 @@ function save(type) {
triggerModel.originalTriggerGroup = idAr[3];
triggerModel.originalTriggerName = idAr[4];
}
+
var context = $('#webContext').attr('href');
+ var token = $("meta[name='_csrf']").attr("content");
+ var header = $("meta[name='_csrf_header']").attr("content");
+
$.ajax({
url: context + '/admintool/quartz/' + type,
data: JSON.stringify(triggerModel),
dataType: "text",
type: 'POST',
- contentType:'application/json; charset=UTF-8' ,
+ contentType:'application/json; charset=UTF-8',
+ beforeSend: function(xhr, settings) {
+ xhr.setRequestHeader(header, token);
+ },
error: function( xhr, status, errorThrown ) {
$('#admintoolError').modal();
if (console) { | Fix: #<I> - CSRF header added | andrehertwig_admintool | train | js |
a92dc703983662111f27b9e9f3bf78b49971087e | diff --git a/src/integrations/sproutimport/importers/fields/SuperTableImporter.php b/src/integrations/sproutimport/importers/fields/SuperTableImporter.php
index <HASH>..<HASH> 100644
--- a/src/integrations/sproutimport/importers/fields/SuperTableImporter.php
+++ b/src/integrations/sproutimport/importers/fields/SuperTableImporter.php
@@ -7,6 +7,10 @@ use barrelstrength\sproutbase\app\import\base\FieldImporter;
use barrelstrength\sproutimport\SproutImport;
use verbb\supertable\fields\SuperTableField;
+if (!class_exists(FieldImporter::class)) {
+ return;
+}
+
class SuperTableImporter extends FieldImporter
{
/** | Fix webhooks incompatibility | verbb_super-table | train | php |
e6cb5c75bca0772c9d5c27ac2083e2d6cb634148 | diff --git a/web/js/bkjs-ko.js b/web/js/bkjs-ko.js
index <HASH>..<HASH> 100644
--- a/web/js/bkjs-ko.js
+++ b/web/js/bkjs-ko.js
@@ -307,14 +307,14 @@ bkjs.koRestoreComponent = function(path, dflt)
bkjs.koBootpopup = function(options)
{
var _before = options.before;
- options.before = function(b) {
- if (typeof _before == "function") _before(b);
- ko.applyBindings(b.options.data || bkjs, b.modal.get(0));
+ options.before = function(self) {
+ if (typeof _before == "function") _before(self);
+ ko.applyBindings(self.options.data || bkjs, self.modal.get(0));
}
var _complete = options.complete;
- options.complete = function(event) {
- if (typeof _complete == "function") _complete.call(this, event);
- ko.cleanNode(this.modal.get(0));
+ options.complete = function(event, self) {
+ if (typeof _complete == "function") _complete.call(this, event, self);
+ ko.cleanNode(self.modal.get(0));
options.before = _before;
options.complete = _complete;
} | use passed popup in the koBootpopup properly | vseryakov_backendjs | train | js |
09edd54b32a6315df241358efba1de8c67a69594 | diff --git a/app/Packages/RealmAPI/Providers/RealmApiServiceProvider.php b/app/Packages/RealmAPI/Providers/RealmApiServiceProvider.php
index <HASH>..<HASH> 100644
--- a/app/Packages/RealmAPI/Providers/RealmApiServiceProvider.php
+++ b/app/Packages/RealmAPI/Providers/RealmApiServiceProvider.php
@@ -23,7 +23,7 @@ class RealmApiServiceProvider extends ServiceProvider {
$this->publishes([
// maybe also publish assets, langs, views?
- __DIR__.'/../Config/realm.php'
+ __DIR__.'/../Config/realm.php' => config_path('realm.php'),
]);
}
@@ -39,7 +39,7 @@ class RealmApiServiceProvider extends ServiceProvider {
public function register()
{
$this->app->bind(
- 'Vain\Packages\RealmAPI\RealmAPIFactory',
+ 'Vain\Packages\RealmAPI\EmulatorFactory',
'Vain\Packages\RealmAPI\Services\SoapService'
);
} | - fixed realm api service provider | vainproject_vain-cms | train | php |
5c40fd1799646a63c3ef1e76eb1f587f4402bc89 | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -55,7 +55,7 @@ repo_name = u"dtoolcore"
# built documents.
#
# The short X.Y version.
-version = u"3.7.0"
+version = u"3.8.0"
# The full version, including alpha/beta/rc tags.
release = version
diff --git a/dtoolcore/__init__.py b/dtoolcore/__init__.py
index <HASH>..<HASH> 100644
--- a/dtoolcore/__init__.py
+++ b/dtoolcore/__init__.py
@@ -11,7 +11,7 @@ from collections import defaultdict
import dtoolcore.utils
-__version__ = "3.7.0"
+__version__ = "3.8.0"
def _generate_storage_broker_lookup():
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
-version = "3.7.0"
+version = "3.8.0"
url = "https://github.com/jic-dtool/dtoolcore"
readme = open('README.rst').read() | Update the version number to <I> | jic-dtool_dtoolcore | train | py,py,py |
f1da9f883329e3974b29963f8824da54ef60ce72 | diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/component/interceptors/LogDiagnosticContextRecoveryInterceptor.java b/ejb3/src/main/java/org/jboss/as/ejb3/component/interceptors/LogDiagnosticContextRecoveryInterceptor.java
index <HASH>..<HASH> 100644
--- a/ejb3/src/main/java/org/jboss/as/ejb3/component/interceptors/LogDiagnosticContextRecoveryInterceptor.java
+++ b/ejb3/src/main/java/org/jboss/as/ejb3/component/interceptors/LogDiagnosticContextRecoveryInterceptor.java
@@ -64,8 +64,9 @@ public final class LogDiagnosticContextRecoveryInterceptor implements Intercepto
}
public Object processInvocation(final InterceptorContext context) throws Exception {
- if (MDC.getMap() != null) {
- for (String str : MDC.getMap().keySet()) {
+ final Map<String, Object> mdc = MDC.getMap();
+ if (mdc != null) {
+ for (String str : mdc.keySet()) {
MDC.remove(str);
}
} | [WFLY-<I>] improve perf on use of MDC.map | wildfly_wildfly | train | java |
ce4350bc63154b3b4abffa1ae3cdae2d4c84589b | diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Page/Page.php
+++ b/system/src/Grav/Common/Page/Page.php
@@ -1938,7 +1938,12 @@ class Page
} else {
$result = [];
foreach($value as $key => $val) {
- $result = $result + $this->evaluate([$key=>$val])->toArray();
+ if (is_int($key)) {
+ $result = $result + $this->evaluate($val)->toArray();
+ } else {
+ $result = $result + $this->evaluate([$key=>$val])->toArray();
+ }
+
}
return new Collection($result);
} | Fix to address #<I> - ability to have multiple collections in a regular list. | getgrav_grav | train | php |
51f6c4b918d4cf31183aca211689e79836443d7c | diff --git a/test/yargs-parser.js b/test/yargs-parser.js
index <HASH>..<HASH> 100644
--- a/test/yargs-parser.js
+++ b/test/yargs-parser.js
@@ -1117,6 +1117,13 @@ describe('yargs-parser', function () {
result.should.have.property('a').and.deep.equal([])
})
+ it('should not attempt to default array if an element has already been populated', function () {
+ var result = parser(['-a', 'foo', 'bar', '-b'], {
+ array: 'a'
+ })
+ result.should.have.property('a').and.deep.equal(['foo', 'bar'])
+ })
+
it('should default argument to empty array if no value given', function () {
var result = parser(['-b'], {
array: 'b' | Add test to ensure arrays are not unintentionally defaulting to [] | yargs_yargs-parser | train | js |
04007576b57a3888e05df983e495244c169fe6fa | diff --git a/spyder/plugins/findinfiles/widgets.py b/spyder/plugins/findinfiles/widgets.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/findinfiles/widgets.py
+++ b/spyder/plugins/findinfiles/widgets.py
@@ -598,14 +598,14 @@ class FindOptions(QWidget):
self.ok_button = create_toolbutton(self, text=_("Search"),
icon=ima.icon('find'),
triggered=lambda: self.find.emit(),
- tip=_("Start search"),
+ tip="",
text_beside_icon=True)
self.ok_button.clicked.connect(self.update_combos)
self.stop_button = create_toolbutton(self, text=_("Stop"),
icon=ima.icon('stop'),
triggered=lambda:
self.stop.emit(),
- tip=_("Stop search"),
+ tip="",
text_beside_icon=True)
for widget in [self.search_text, self.edit_regexp, self.case_button,
self.ok_button, self.stop_button, self.more_options]: | Find: Remove tooltips for the search and stop buttons | spyder-ide_spyder | train | py |
c3eb64980f9cfd907c30c25853a45124138ae88d | diff --git a/src/node/test/math/math_server.js b/src/node/test/math/math_server.js
index <HASH>..<HASH> 100644
--- a/src/node/test/math/math_server.js
+++ b/src/node/test/math/math_server.js
@@ -68,7 +68,7 @@ function mathDiv(call, cb) {
function mathFib(stream) {
// Here, call is a standard writable Node object Stream
var previous = 0, current = 1;
- for (var i = 0; i < stream.request.limit; i++) {
+ for (var i = 0; i < stream.request.getLimit(); i++) {
var response = new math.Num();
response.setNum(current);
stream.write(response); | node: fix math server minor bug | grpc_grpc | train | js |
3de1869914a02b6386e61cad50cd3ff22333cdbc | diff --git a/lib/docusign_rest/client.rb b/lib/docusign_rest/client.rb
index <HASH>..<HASH> 100644
--- a/lib/docusign_rest/client.rb
+++ b/lib/docusign_rest/client.rb
@@ -1781,7 +1781,7 @@ module DocusignRest
signHereTabs: get_tabs(tabs[:sign_here_tabs], options.merge!(sign_here_tab: true), index),
signerAttachmentTabs: nil,
ssnTabs: nil,
- textTabs: nil,
+ textTabs: get_tabs(tabs[:text_tabs], options, index),
titleTabs: nil,
zipTabs: nil
}.to_json | Allow text tabs to be passed when adding recipient tabs | jondkinney_docusign_rest | train | rb |
4fb6976e886aea29ee36113a9419e6e6131e20cc | diff --git a/app/controllers/govuk_publishing_components/application_controller.rb b/app/controllers/govuk_publishing_components/application_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/govuk_publishing_components/application_controller.rb
+++ b/app/controllers/govuk_publishing_components/application_controller.rb
@@ -14,7 +14,7 @@ module GovukPublishingComponents
private
def set_custom_slimmer_headers
- set_slimmer_headers(report_a_problem: 'false', remove_search: true)
+ set_slimmer_headers(remove_search: true)
end
def set_x_frame_options_header | Remove "report a problem" header
We can't use this because otherwise apps that are upgrading to the
latest version of slimmer
(<URL>) stop working because the
`report_a_problem ` header isn't allowed anymore. It would be better to
bump the slimmer version here too, but we can't do that yet because it
would require apps to upgrade before adding the new feedback component.
This will cause the "Is there anything wrong with this page" to show on
the component guide. It will disappear once we upgrade slimmer.
<URL> | alphagov_govuk_publishing_components | train | rb |
317f24076eeaf221b74d7ef1eb5a549c0c8b1169 | diff --git a/src/util/Util.js b/src/util/Util.js
index <HASH>..<HASH> 100644
--- a/src/util/Util.js
+++ b/src/util/Util.js
@@ -24,12 +24,11 @@ class Util {
static flatten(obj, ...props) {
if (!isObject(obj)) return obj;
- props = Object.assign(
- ...Object.keys(obj)
- .filter(k => !k.startsWith('_'))
- .map(k => ({ [k]: true })),
- ...props,
- );
+ const objProps = Object.keys(obj)
+ .filter(k => !k.startsWith('_'))
+ .map(k => ({ [k]: true }));
+
+ props = objProps.length ? Object.assign(...objProps, ...props) : Object.assign({}, ...props);
const out = {}; | fix(Util): support empty array for flatten (#<I>) | discordjs_discord.js | train | js |
eb5d6e66caf1e990bb422afd100a1d4f81370064 | diff --git a/flask_mail.py b/flask_mail.py
index <HASH>..<HASH> 100644
--- a/flask_mail.py
+++ b/flask_mail.py
@@ -292,7 +292,6 @@ class Message(object):
"""
assert self.recipients, "No recipients have been added"
- assert self.body or self.html, "No body or HTML has been set"
assert self.sender, "No sender address has been set"
if self.has_bad_headers():
diff --git a/tests.py b/tests.py
index <HASH>..<HASH> 100644
--- a/tests.py
+++ b/tests.py
@@ -101,17 +101,6 @@ class TestMessage(TestCase):
self.assertRaises(AssertionError, self.mail.send, msg)
- def test_send_without_body(self):
-
- msg = Message(subject="testing",
- recipients=["to@example.com"])
-
- self.assertRaises(AssertionError, self.mail.send, msg)
-
- msg.html = "<b>test</b>"
-
- self.mail.send(msg)
-
def test_normal_send(self):
"""
This will not actually send a message unless the mail server | Allow sending mails with no body. | nicolas-van_mailflash | train | py,py |
1b5f097f23059e9d5fc0681e6571d586038d6bd7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ PACKAGES = [
MOD_NAMES = [
'thinc.linalg',
- #'thinc.prng',
+ 'thinc.prng',
'thinc.structs',
'thinc.typedefs',
'thinc.linear.avgtron', | * Uncomment loading of PRNG | explosion_thinc | train | py |
ad275cb4adee492b51e66e10af13b5a2e9982e73 | diff --git a/lib/grade/grade_grade.php b/lib/grade/grade_grade.php
index <HASH>..<HASH> 100644
--- a/lib/grade/grade_grade.php
+++ b/lib/grade/grade_grade.php
@@ -794,10 +794,16 @@ class grade_grade extends grade_object {
// Get course-module
$cm = get_coursemodule_from_instance($this->grade_item->itemmodule,
$this->grade_item->iteminstance, $this->grade_item->courseid);
+ // If the course-module doesn't exist, display a warning...
if (!$cm) {
- debugging("Couldn't find course-module for module
- '{$this->grade_item->itemmodule}', instance '{$this->grade_item->iteminstance}',
- course '{$this->grade_item->courseid}'");
+ // ...unless the grade is being deleted in which case it's likely
+ // that the course-module was just deleted too, so that's okay.
+ if (!$deleted) {
+ debugging("Couldn't find course-module for module '" .
+ $this->grade_item->itemmodule . "', instance '" .
+ $this->grade_item->iteminstance . "', course '" .
+ $this->grade_item->courseid . "'");
+ }
return;
} | MDL-<I> Fix debugging message when deleting activity with grade completion | moodle_moodle | train | php |
d44b08e7ee67857d8a6e841d79c730370c51bfb5 | diff --git a/src/rituals/acts/releasing.py b/src/rituals/acts/releasing.py
index <HASH>..<HASH> 100644
--- a/src/rituals/acts/releasing.py
+++ b/src/rituals/acts/releasing.py
@@ -45,7 +45,16 @@ PKG_INFO_MULTIKEYS = ('Classifier',)
INSTALLER_BASH = """#!/usr/bin/env bash
set -e
-target="${1:?You need to provide a target location to install to}"
+if test -z "$1"; then
+ cat <<.
+usage: $0 <target-file>
+
+This script installs a self-contained Python application
+to the chosen target path (using eGenix PyRun and PEX).
+.
+ exit 1
+fi
+target="$1"
script=$(cd $(dirname "${BASH_SOURCE}") && pwd)/$(basename "${BASH_SOURCE}")
test -d $(dirname "$target")"/.pex" || mkdir $(dirname "$target")"/.pex" | :arrow_upper_right: proper usage for installer script | jhermann_rituals | train | py |
2a0f63d19bd6e666ad432ee459762489d6b6033a | diff --git a/py/selenium/webdriver/safari/webdriver.py b/py/selenium/webdriver/safari/webdriver.py
index <HASH>..<HASH> 100644
--- a/py/selenium/webdriver/safari/webdriver.py
+++ b/py/selenium/webdriver/safari/webdriver.py
@@ -22,6 +22,7 @@ except ImportError:
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
+from .service import Service
class WebDriver(RemoteWebDriver):
@@ -45,6 +46,7 @@ class WebDriver(RemoteWebDriver):
"""
self._reuse_service = reuse_service
+ self.service = Service(executable_path, port=port, quiet=quiet)
if not reuse_service:
self.service.start() | Fix Safari webdriver AttributeError for python client driver #<I> | SeleniumHQ_selenium | train | py |
9339fe50f20edbc7ec99c1b036245509955f1b9e | diff --git a/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js b/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js
index <HASH>..<HASH> 100644
--- a/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js
+++ b/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js
@@ -931,6 +931,7 @@ describe('plugin-meetings', () => {
it('should reject promise if user is in lobby ', async () => {
meeting.meetingState = 'ACTIVE';
meeting.locusInfo.parsedLocus = {self: {state: 'IDLE'}};
+ meeting.isUserUnadmitted = true;
try {
await meeting.addMedia(); | test(plugin-meetings): update unit test for wait in lobby | webex_spark-js-sdk | train | js |
3127b3f4a1597abdf65e8041dc2b321ca434fb19 | diff --git a/src/CSPBuilder.php b/src/CSPBuilder.php
index <HASH>..<HASH> 100644
--- a/src/CSPBuilder.php
+++ b/src/CSPBuilder.php
@@ -328,10 +328,12 @@ class CSPBuilder
/**
* Send the compiled CSP as a header()
*
+ * @param boolean $legacy Send legacy headers?
+ *
* @return boolean
* @throws \Exception
*/
- public function sendCSPHeader()
+ public function sendCSPHeader($legacy = true)
{
if (\headers_sent()) {
throw new \Exception('Headers already sent!');
@@ -343,8 +345,16 @@ class CSPBuilder
$which = $this->reportOnly
? 'Content-Security-Policy-Report-Only'
: 'Content-Security-Policy';
-
+
\header($which.': '.$this->compiled);
+ if ($legacy) {
+ // Add deprecated headers for compatibility with old clients
+ \header('X-'.$which.': '.$this->compiled);
+ $which = $this->reportOnly
+ ? 'X-Webkit-CSP-Report-Only'
+ : 'X-Webkit-CSP';
+ \header($which.': '.$this->compiled);
+ }
}
/** | Add legacy headers, closes #1 (thanks @timoh6) | paragonie_csp-builder | train | php |
4c9da9b810a3b84e9303ab0afe344a085889e23d | diff --git a/src/psd_tools/api/layers.py b/src/psd_tools/api/layers.py
index <HASH>..<HASH> 100644
--- a/src/psd_tools/api/layers.py
+++ b/src/psd_tools/api/layers.py
@@ -908,10 +908,10 @@ class ShapeLayer(Layer):
elif self.has_vector_mask():
bbox = self.vector_mask.bbox
self._bbox = (
- int(bbox[0] * self._psd.width),
- int(bbox[1] * self._psd.height),
- int(bbox[2] * self._psd.width),
- int(bbox[3] * self._psd.height),
+ round(bbox[0] * self._psd.width),
+ round(bbox[1] * self._psd.height),
+ round(bbox[2] * self._psd.width),
+ round(bbox[3] * self._psd.height),
)
else:
self._bbox = (0, 0, 0, 0) | Use round to shape bbox calculation | psd-tools_psd-tools | train | py |
99e86cc2f6341fa03d20c258ac05edd199a75f0b | diff --git a/ella/core/admin.py b/ella/core/admin.py
index <HASH>..<HASH> 100644
--- a/ella/core/admin.py
+++ b/ella/core/admin.py
@@ -1,4 +1,3 @@
-from app_data import multiform_factory
from app_data.admin import AppDataModelAdmin
from django.contrib import admin
from django.forms import models as modelforms
@@ -22,10 +21,6 @@ class RelatedInlineAdmin(admin.TabularInline):
extra = 3
# raw_id_fields = ('publishable_id',)
-CategoryMultiForm = multiform_factory(Category)
-CategoryMultiForm.add_form('ella', {'fields': ('paginate_by', 'propagate_listings')})
-
-
class CategoryAdmin(AppDataModelAdmin):
list_filter = ('site',)
list_display = ('draw_title', 'tree_path', '__unicode__')
@@ -37,7 +32,6 @@ class CategoryAdmin(AppDataModelAdmin):
'template', ('site', 'tree_parent'),
'ella.paginate_by',
'ella.propagate_listings')}),)
- multiform = CategoryMultiForm
class AuthorAdmin(admin.ModelAdmin): | no need for eplicit multiform any more | ella_ella | train | py |
cc9a769ca1e97237c0f5aee3ac331f00f742c795 | diff --git a/django_core/models.py b/django_core/models.py
index <HASH>..<HASH> 100644
--- a/django_core/models.py
+++ b/django_core/models.py
@@ -178,3 +178,8 @@ class AbstractBaseModel(models.Model):
if field.attname == field_name:
# This is the for_objs model class
return field.related.parent_model
+
+ @classmethod
+ def post_save(cls, *args, **kwargs):
+ """Adding a hook here so it's safe to call the super's post_save."""
+ pass | added post_save hook so it's save to call super post_save | InfoAgeTech_django-core | train | py |
3a016f252594cd4b316de6fc590a737eb59401d2 | diff --git a/src/main/java/com/hivemq/spi/services/AsyncMetricService.java b/src/main/java/com/hivemq/spi/services/AsyncMetricService.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/hivemq/spi/services/AsyncMetricService.java
+++ b/src/main/java/com/hivemq/spi/services/AsyncMetricService.java
@@ -25,7 +25,6 @@ public interface AsyncMetricService {
* @param <T> the metric type
* @return the metric (if available) or <code>null</code>
*/
- @Nullable
<T extends Metric> ListenableFuture<T> getHiveMQMetric(HiveMQMetric<T> metric);
/**
@@ -38,7 +37,6 @@ public interface AsyncMetricService {
* @param <T> the metric type
* @return the metric (if available) or <code>null</code>
*/
- @Nullable
<T extends Metric> ListenableFuture<Map<String, T>> getClusterMetric(HiveMQMetric<T> metric);
/** | removed nullable annotation from async metric service | hivemq_hivemq-spi | train | java |
00f067d42efdc65c2516b855b1c7226c4f92c7c3 | diff --git a/Security/SecurityConfiguration.php b/Security/SecurityConfiguration.php
index <HASH>..<HASH> 100644
--- a/Security/SecurityConfiguration.php
+++ b/Security/SecurityConfiguration.php
@@ -11,8 +11,6 @@
namespace Darvin\UserBundle\Security;
use Darvin\AdminBundle\Security\Configuration\AbstractSecurityConfiguration;
-use Darvin\AdminBundle\Security\Permissions\ObjectPermissions;
-use Darvin\ConfigBundle\Parameter\ParameterModel;
use Darvin\UserBundle\Entity\User;
/**
@@ -23,31 +21,18 @@ class SecurityConfiguration extends AbstractSecurityConfiguration
/**
* {@inheritdoc}
*/
- public function getModel()
+ public function getName()
{
- return array(
- new ParameterModel(
- 'permissions',
- ParameterModel::TYPE_ARRAY,
- array(
- 'user' => new ObjectPermissions(User::USER_CLASS),
- ),
- array(
- 'form' => array(
- 'options' => array(
- 'type' => 'darvin_admin_security_object_permissions',
- ),
- ),
- )
- ),
- );
+ return 'darvin_user_security';
}
/**
* {@inheritdoc}
*/
- public function getName()
+ protected function getSecurableObjectClasses()
{
- return 'darvin_user_security';
+ return array(
+ 'user' => User::USER_CLASS,
+ );
}
} | Simplify securable configurations. | DarvinStudio_DarvinUserBundle | train | php |
1ea97c7297b91510fa120f1051c1b7c2cd7b7302 | diff --git a/api/src/opentrons/hardware_control/api.py b/api/src/opentrons/hardware_control/api.py
index <HASH>..<HASH> 100644
--- a/api/src/opentrons/hardware_control/api.py
+++ b/api/src/opentrons/hardware_control/api.py
@@ -118,6 +118,9 @@ class API(HardwareAPILike):
except Exception:
mod_log.exception('Errored during door state event callback')
+ def _reset_last_mount(self):
+ self._last_moved_mount = None
+
@classmethod
async def build_hardware_controller(
cls, config: robot_configs.robot_config = None,
@@ -639,6 +642,7 @@ class API(HardwareAPILike):
# Gantry/frame (i.e. not pipette) action API
async def home_z(self, mount: top_types.Mount = None):
""" Home the two z-axes """
+ self._reset_last_mount()
if not mount:
axes = [Axis.Z, Axis.A]
else:
@@ -693,6 +697,7 @@ class API(HardwareAPILike):
home everything.
"""
await self._wait_for_is_running()
+ self._reset_last_mount()
# Initialize/update current_position
checked_axes = axes or [ax for ax in Axis]
gantry = [ax for ax in checked_axes if ax in Axis.gantry_axes()] | fix(api): Prevent extra pipette movement after homing (#<I>) | Opentrons_opentrons | train | py |
496960068a943880d895d76ae11521efa6280e26 | diff --git a/src/Environment.php b/src/Environment.php
index <HASH>..<HASH> 100644
--- a/src/Environment.php
+++ b/src/Environment.php
@@ -136,6 +136,9 @@ class Environment
);
$this->options = array_merge($default_options, $options);
+ if ($loader instanceof iEnvironmentAware) {
+ $loader->setEnvironment($this);
+ }
$this->loader = $loader;
$this->chainLoaderUsed = $loader instanceof ChainLoader; | Fix: Inject environment into template loader. | bugadani_Minty | train | php |
9313b665b0912df4add9d1117bb4d13a717d9464 | diff --git a/PyFunceble.py b/PyFunceble.py
index <HASH>..<HASH> 100755
--- a/PyFunceble.py
+++ b/PyFunceble.py
@@ -1804,6 +1804,7 @@ class Referer(object):
'ge',
'gr',
'mil',
+ 'mt',
'np',
'pa',
'tt',
@@ -2577,7 +2578,7 @@ if __name__ == '__main__':
'-v',
'--version',
action='version',
- version='%(prog)s 0.20.16-beta'
+ version='%(prog)s 0.20.17-beta'
)
ARGS = PARSER.parse_args() | Introduction of `mt` into the list of ignored extensions
cf: Whois lookup to <URL> | funilrys_PyFunceble | train | py |
8fed3cea46a9d12b38f68ce6c5f36b4bea729bd3 | diff --git a/lib/SDPInfo.js b/lib/SDPInfo.js
index <HASH>..<HASH> 100644
--- a/lib/SDPInfo.js
+++ b/lib/SDPInfo.js
@@ -1330,6 +1330,8 @@ SDPInfo.parse = function(string)
{
//Create track
track = new TrackInfo(media,trackId);
+ //Set the media id
+ track.setMediaId(mid);
//Set simulcast encodings (if any)
track.setEncodings(encodings);
//Append to stream | Always set mediaId even on plan B | medooze_semantic-sdp-js | train | js |
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.