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
|
---|---|---|---|---|---|
228460d004175ebd539bba641d27773eb955bc40 | diff --git a/pyinfra/operations/server.py b/pyinfra/operations/server.py
index <HASH>..<HASH> 100644
--- a/pyinfra/operations/server.py
+++ b/pyinfra/operations/server.py
@@ -521,6 +521,7 @@ def crontab(
name_comment = '# pyinfra-name={0}'.format(cron_name)
existing_crontab = crontab.get(command)
+ existing_crontab_command = command
existing_crontab_match = command
if not existing_crontab and cron_name: # find the crontab by name if provided
@@ -528,6 +529,7 @@ def crontab(
if name_comment in details['comments']:
existing_crontab = details
existing_crontab_match = cmd
+ existing_crontab_command = cmd
exists = existing_crontab is not None
@@ -576,6 +578,7 @@ def crontab(
month != existing_crontab.get('month'),
day_of_week != existing_crontab.get('day_of_week'),
day_of_month != existing_crontab.get('day_of_month'),
+ existing_crontab_command != command,
)):
edit_commands.append(sed_replace(
temp_filename, existing_crontab_match, new_crontab_line, | Fix check for named crontab command changes in `server.crontab` operation. | Fizzadar_pyinfra | train | py |
0b31bbd60a231cf72b5af5a604ee0eea80a3655e | diff --git a/src/Query/LaravelBulkQuery.php b/src/Query/LaravelBulkQuery.php
index <HASH>..<HASH> 100644
--- a/src/Query/LaravelBulkQuery.php
+++ b/src/Query/LaravelBulkQuery.php
@@ -19,9 +19,13 @@ use POData\UriProcessor\ResourcePathProcessor\SegmentParser\KeyDescriptor;
class LaravelBulkQuery
{
+ /** @var AuthInterface */
protected $auth;
+ /** @var MetadataProvider */
protected $metadataProvider;
+ /** @var LaravelQuery */
protected $query;
+ /** @var MetadataControllerContainer */
protected $controllerContainer;
public function __construct(LaravelQuery &$query, AuthInterface $auth = null)
@@ -225,7 +229,7 @@ class LaravelBulkQuery
/**
* @param ResourceSet $sourceResourceSet
- * @param $verbName
+ * @param string $verbName
* @return array|null
* @throws InvalidOperationException
* @throws \ReflectionException
@@ -242,6 +246,9 @@ class LaravelBulkQuery
return $this->getControllerContainer()->getMapping($modelName, $verbName);
}
+ /**
+ * @return LaravelQuery
+ */
public function getQuery()
{
return $this->query; | Flesh out annotations on LaravelBulkQuery | Algo-Web_POData-Laravel | train | php |
e529cd1be1846044b8562e6f09d995633edc6ac8 | diff --git a/definitions/npm/bluebird_v3.x.x/flow_v0.70.x-/bluebird_v3.x.x.js b/definitions/npm/bluebird_v3.x.x/flow_v0.70.x-/bluebird_v3.x.x.js
index <HASH>..<HASH> 100644
--- a/definitions/npm/bluebird_v3.x.x/flow_v0.70.x-/bluebird_v3.x.x.js
+++ b/definitions/npm/bluebird_v3.x.x/flow_v0.70.x-/bluebird_v3.x.x.js
@@ -51,6 +51,12 @@ declare type $Promisable<T> = Promise<T> | T;
declare class Bluebird$Disposable<R> {}
declare class Bluebird$Promise<+R> extends Promise<R> {
+ static RangeError: Class<Bluebird$RangeError>;
+ static CancellationErrors: Class<Bluebird$CancellationErrors>;
+ static TimeoutError: Class<Bluebird$TimeoutError>;
+ static RejectionError: Class<Bluebird$RejectionError>;
+ static OperationalError: Class<Bluebird$OperationalError>;
+
static Defer: Class<Bluebird$Defer>;
static PromiseInspection: Class<Bluebird$PromiseInspection<*>>; | Expose static class definitions for Bluebird Errors (#<I>)
* Expose static class definitions for Errors
* Fix copy paste syntax typo | flow-typed_flow-typed | train | js |
f618bbba806214b2f6c895212c88243bb28d222d | diff --git a/projects/tests/src/test/java/org/jboss/forge/addon/projects/impl/ProjectFactoryImplTest.java b/projects/tests/src/test/java/org/jboss/forge/addon/projects/impl/ProjectFactoryImplTest.java
index <HASH>..<HASH> 100644
--- a/projects/tests/src/test/java/org/jboss/forge/addon/projects/impl/ProjectFactoryImplTest.java
+++ b/projects/tests/src/test/java/org/jboss/forge/addon/projects/impl/ProjectFactoryImplTest.java
@@ -25,6 +25,7 @@ import org.jboss.forge.furnace.spi.ListenerRegistration;
import org.jboss.forge.furnace.util.Predicate;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -62,6 +63,7 @@ public class ProjectFactoryImplTest
}
@Test
+ @Ignore("WELD-1487 - Weld fails to create beans for anonymous types")
public void testCreateProject() throws Exception
{
final AtomicBoolean projectSet = new AtomicBoolean(false); | Ignore failing weld behavior for now. | forge_core | train | java |
a9190f6320ee03a330c0dd392c8112f220217bf0 | diff --git a/jsonfield/subclassing.py b/jsonfield/subclassing.py
index <HASH>..<HASH> 100644
--- a/jsonfield/subclassing.py
+++ b/jsonfield/subclassing.py
@@ -32,7 +32,7 @@ class Creator(object):
def __get__(self, obj, type=None):
if obj is None:
- raise AttributeError('Can only be accessed via an instance.')
+ return self
return obj.__dict__[self.field.name]
def __set__(self, obj, value): | Django <I> compatibility, prevents AttributeError
The code was copied from this old file in Django:
<URL> | dmkoch_django-jsonfield | train | py |
6f03004b5f7c5a1fb81bdcbc1585ae83df37a1dc | diff --git a/cloud_utils/list_instances.py b/cloud_utils/list_instances.py
index <HASH>..<HASH> 100644
--- a/cloud_utils/list_instances.py
+++ b/cloud_utils/list_instances.py
@@ -361,7 +361,7 @@ def get_cloud_from_zone(zone):
def main():
parser = ArgumentParser()
- parser.add_argument('name', nargs='+', help='name to search')
+ parser.add_argument('name', nargs='*', help='name to search')
parser.add_argument('--by-id', action='store_true', default=False, help='Search instance by id')
parser.add_argument('-w', '--width', required=False, type=int, default=0, help='printed table width')
parser.add_argument('-l', '--align', required=False, type=str, default='c', choices=ALIGN_OPTIONS,
@@ -381,6 +381,10 @@ def main():
parser.add_argument('--clouds', nargs='*', default=SUPPORTED_CLOUDS, help='clouds to search default: {}'.format(SUPPORTED_CLOUDS))
args = parser.parse_args()
+ if not args.name:
+ name = sys.argv.pop(-1)
+ args = parser.parse_args()
+ args.name = [name]
args.clouds = [cloud.lower() for cloud in args.clouds]
if args.gevent: | Fix name handling when fields/projects is being used | google_python-cloud-utils | train | py |
10e8470eea2280a3cc7ab3a083864134b593b381 | diff --git a/spec/Suite/Set.spec.php b/spec/Suite/Set.spec.php
index <HASH>..<HASH> 100644
--- a/spec/Suite/Set.spec.php
+++ b/spec/Suite/Set.spec.php
@@ -39,6 +39,17 @@ describe("Set", function() {
});
+ it("keeps keys for associative arrays", function() {
+
+ $a = [];
+ $b = [2 => 'test2'];
+ $result = Set::merge($a, $b);
+ expect($result)->toBe([
+ 2 => "test2"
+ ]);
+
+ });
+
it("throws an exception with not enough parameters", function() {
$closure = function() {
diff --git a/src/Set.php b/src/Set.php
index <HASH>..<HASH> 100644
--- a/src/Set.php
+++ b/src/Set.php
@@ -52,7 +52,7 @@ class Set
foreach ($source as $key => $value) {
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {
$merged[$key] = static::merge($merged[$key], $value);
- } elseif (is_int($key)) {
+ } elseif (is_int($key) && array_key_exists(0, $source)) {
$merged[] = $value;
} else {
$merged[$key] = $value; | Keeps keys for associative arrays. | crysalead_set | train | php,php |
bb4997ff5ef2f75a426bcf6fe8740d8b8fbfe87a | diff --git a/src/js/tabris.js b/src/js/tabris.js
index <HASH>..<HASH> 100644
--- a/src/js/tabris.js
+++ b/src/js/tabris.js
@@ -96,7 +96,7 @@
WidgetProxy.prototype = {
get: function( method ) {
- return Tabris._nativeBridge.set( this.id, method );
+ return Tabris._nativeBridge.get( this.id, method );
},
set: function( arg1, arg2 ) { | "get" on objects will now call "get" on the native bridge. A typo caused it to call "set" which crashed the client. | eclipsesource_tabris-js | train | js |
56be6c7ba209f9ba81edc69e5a2bd55f35c586f0 | diff --git a/salt/modules/win_network.py b/salt/modules/win_network.py
index <HASH>..<HASH> 100644
--- a/salt/modules/win_network.py
+++ b/salt/modules/win_network.py
@@ -4,15 +4,9 @@ Module for gathering and managing network information
import datetime
import hashlib
-
-# Import Python libs
import re
import socket
-# Import 3rd party libraries
-import salt.ext.six as six # pylint: disable=W0611
-
-# Import Salt libs
import salt.utils.network
import salt.utils.platform
import salt.utils.validate.net
@@ -41,7 +35,7 @@ except ImportError:
try:
- import wmi # pylint: disable=W0611
+ import wmi # pylint: disable=import-error
except ImportError:
HAS_DEPENDENCIES = False | Drop Py2 and six on salt/modules/win_network.py | saltstack_salt | train | py |
986f5d272289c8421bbd3ce2682c79f287240918 | diff --git a/pgpy/pgp.py b/pgpy/pgp.py
index <HASH>..<HASH> 100644
--- a/pgpy/pgp.py
+++ b/pgpy/pgp.py
@@ -393,7 +393,10 @@ class PGPSignature(Armorable, ParentRef, PGPObject):
_data = bytearray()
if isinstance(subject, six.string_types):
- subject = subject.encode('charmap')
+ try:
+ subject = subject.encode('utf-8')
+ except UnicodeEncodeError:
+ subject = subject.encode('charmap')
"""
All signatures are formed by producing a hash over the signature | try utf-8 first; fall back to charmap if that fails | SecurityInnovation_PGPy | train | py |
ee969ae2a416cfe2ca194f5dbae362536ce2c7f3 | diff --git a/quart/exceptions.py b/quart/exceptions.py
index <HASH>..<HASH> 100644
--- a/quart/exceptions.py
+++ b/quart/exceptions.py
@@ -1,5 +1,5 @@
from http import HTTPStatus
-from typing import Iterable, Optional
+from typing import Iterable, NoReturn, Optional
from .wrappers import Response
@@ -118,7 +118,11 @@ if not please click the link
return headers
-def abort(status_code: int, description: Optional[str] = None, name: Optional[str] = None) -> None:
+def abort(
+ status_code: int,
+ description: Optional[str] = None,
+ name: Optional[str] = None,
+) -> NoReturn:
error_class = all_http_exceptions.get(status_code)
if error_class is None:
raise HTTPException(status_code, description or 'Unknown', name or 'Unknown') | quart: use NoReturn for abort method
As it currently returns None, mypy think functions that expect a return
value never return. This method only raises Exceptions, so it the ideal
use case for NoReturn which mypy can use to realise it doesn't have to
worry about branches that call this. | pgjones_quart | train | py |
91dcd813d4e261b342911f49a30d995a1a72c1a2 | diff --git a/ansible_vault/api.py b/ansible_vault/api.py
index <HASH>..<HASH> 100644
--- a/ansible_vault/api.py
+++ b/ansible_vault/api.py
@@ -18,6 +18,7 @@ from __future__ import absolute_import
import ansible
import yaml
+import six
try:
from ansible.parsing.vault import VaultLib
except ImportError:
@@ -56,6 +57,8 @@ class Vault(object):
default_flow_style=False,
allow_unicode=True)
encrypted = self.vault.encrypt(yaml_text)
+ if six.PY3: # Handle Python3 Bytestring
+ encrypted = encrypted.decode('utf-8')
if stream:
stream.write(encrypted)
else: | Update api.py
Decode the bytestring to work with python 3 and not require the user to specify binary on file open | tomoh1r_ansible-vault | train | py |
bf89be77b9a5917b233227e61d4812d7d2ac5567 | diff --git a/src/transformers/data/processors/utils.py b/src/transformers/data/processors/utils.py
index <HASH>..<HASH> 100644
--- a/src/transformers/data/processors/utils.py
+++ b/src/transformers/data/processors/utils.py
@@ -253,7 +253,7 @@ class SingleSentenceClassificationProcessor(DataProcessor):
features = []
for (ex_index, (input_ids, example)) in enumerate(zip(all_input_ids, self.examples)):
if ex_index % 10000 == 0:
- logger.info("Writing example %d", ex_index)
+ logger.info("Writing example %d/%d" % (ex_index, len(examples)))
# The mask has 1 for real tokens and 0 for padding tokens. Only real
# tokens are attended to.
attention_mask = [1 if mask_padding_with_zero else 0] * len(input_ids) | Improve logging message in the single sentence classification processor | huggingface_pytorch-pretrained-BERT | train | py |
31ab59b4e3391d4af746c23e15990828088ef958 | diff --git a/server/admin/member.js b/server/admin/member.js
index <HASH>..<HASH> 100644
--- a/server/admin/member.js
+++ b/server/admin/member.js
@@ -20,6 +20,7 @@
'use strict';
var errors = require('../../lib/errors.js');
+var Member = require('../../lib/membership/member.js');
var sendJoin = require('../../lib/gossip/join-sender.js').joinCluster;
var TypedError = require('error/typed');
@@ -38,7 +39,8 @@ function createJoinHandler(ringpop) {
}
// Handle rejoin for member that left.
- if (ringpop.membership.localMember.status === 'leave') {
+ var localStatus = ringpop.membership.localMember.status;
+ if (localStatus === Member.Status.leave) {
// Assert local member is alive.
ringpop.membership.makeAlive(ringpop.whoami(), Date.now()); | Address Ben's feedback; codify leave | esatterwhite_skyring | train | js |
096031fc68936b3a5274a18b77b293daf4a5a432 | diff --git a/drone/client.go b/drone/client.go
index <HASH>..<HASH> 100644
--- a/drone/client.go
+++ b/drone/client.go
@@ -276,9 +276,9 @@ func (c *client) BuildList(owner, name string, opts ListOptions) ([]*Build, erro
}
// BuildCreate creates a new build by branch or commit.
-func (c *client) BuildCreate(owner, name, commit, branch string) (*Build, error) {
+func (c *client) BuildCreate(owner, name, commit, branch string, params map[string]string) (*Build, error) {
out := new(Build)
- val := url.Values{}
+ val := mapValues(params)
if commit != "" {
val.Set("commit", commit)
} | Add in params for BuildCreate | drone_drone-go | train | go |
39908443b8608f4ddb752cd79bb27228ec0bce60 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ HERE = os.path.dirname(__file__)
setup(
name=NAME,
- version='0.0.3',
+ version='0.0.4',
packages=find_packages(),
package_data={'': ['*.txt', '*.rst']},
author='Peter Hudec', | Increased release version to <I>. | authomatic_liveandletdie | train | py |
8c69fd766ae2e98d8128f9a40c164ac2209a5312 | diff --git a/assets/js/components/Navigation/Section.js b/assets/js/components/Navigation/Section.js
index <HASH>..<HASH> 100644
--- a/assets/js/components/Navigation/Section.js
+++ b/assets/js/components/Navigation/Section.js
@@ -10,7 +10,7 @@ class Section {
this.box = new Box(
mainController,
this.element.querySelector('.box'),
- this.element.dataset['initial-state']
+ this.element.dataset.initialState
)
} | Use correct accessor
Solves x-briowser issue with maintaining menu state outside WebKit browsers | nails_module-admin | train | js |
aff70482263e974d764c29f1290c18342ce3e888 | diff --git a/SoftLayer/CLI/image/import.py b/SoftLayer/CLI/image/import.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/CLI/image/import.py
+++ b/SoftLayer/CLI/image/import.py
@@ -60,7 +60,7 @@ def cli(env, name, note, os_code, uri, ibm_api_key, root_key_crn, wrapped_dek,
os_code=os_code,
uri=uri,
ibm_api_key=ibm_api_key,
- crkCrn=root_key_crn,
+ root_key_crn=root_key_crn,
wrapped_dek=wrapped_dek,
cloud_init=cloud_init,
byol=byol,
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ else:
setup(
name='SoftLayer',
- version='5.7.2',
+ version='5.7.1',
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author='SoftLayer Technologies, Inc.', | Merge remote-tracking branch 'origin/master' | softlayer_softlayer-python | train | py,py |
df302b3ee99cdcd12c87357bbd4675b6d0da5768 | diff --git a/src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java b/src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
index <HASH>..<HASH> 100644
--- a/src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
+++ b/src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
@@ -3359,6 +3359,7 @@ public class CDKAtomTypeMatcherTest extends AbstractCDKAtomTypeTest {
/**
* @cdk.bug 3190151
*/
+ @Test
public void testP() throws Exception {
IAtom atomP = new NNAtom("P");
IAtomContainer mol = new Molecule();
@@ -3371,6 +3372,7 @@ public class CDKAtomTypeMatcherTest extends AbstractCDKAtomTypeTest {
/**
* @cdk.bug 3190151
*/
+ @Test
public void testPine() throws Exception {
IAtom atomP = new NNAtom(Elements.PHOSPHORUS);
IAtomType atomTypeP = new NNAtomType(Elements.PHOSPHORUS); | Added missing @Test annotation (idiot) | cdk_cdk | train | java |
1ee03eb732fcedc2414d46a21675c45235c4d642 | diff --git a/category_encoders/wrapper.py b/category_encoders/wrapper.py
index <HASH>..<HASH> 100644
--- a/category_encoders/wrapper.py
+++ b/category_encoders/wrapper.py
@@ -4,6 +4,7 @@ from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.model_selection import StratifiedKFold
import category_encoders as encoders
import pandas as pd
+import numpy as np
class MultiClassWrapper(BaseEstimator, TransformerMixin): | Added Numpy import for NestedCVWrapper | scikit-learn-contrib_categorical-encoding | train | py |
90e2158dd740c291632dc3fd32ad506fac3c7ef1 | diff --git a/src/Spy/Timeline/Driver/QueryBuilder/QueryBuilder.php b/src/Spy/Timeline/Driver/QueryBuilder/QueryBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Spy/Timeline/Driver/QueryBuilder/QueryBuilder.php
+++ b/src/Spy/Timeline/Driver/QueryBuilder/QueryBuilder.php
@@ -284,7 +284,7 @@ class QueryBuilder
$this->groupByAction($data['group_by_action']);
}
- if (isset($data['subject'])) {
+ if (isset($data['subject']) && !empty($data['subject'])) {
$subjects = $data['subject'];
if (!$actionManager) { | If there is no hash, no requests. | stephpy_timeline | train | php |
037e80a6b43e8811a91f8f8835404183f62d4935 | diff --git a/lib/osc-ruby/osc_types.rb b/lib/osc-ruby/osc_types.rb
index <HASH>..<HASH> 100644
--- a/lib/osc-ruby/osc_types.rb
+++ b/lib/osc-ruby/osc_types.rb
@@ -1,6 +1,6 @@
require File.join( File.dirname( __FILE__ ), "osc_argument" )
- module OSC
+module OSC
class OSCInt32 < OSCArgument
def tag() 'i' end
def encode() [@val].pack('N') end | removing warnings "mismatched indentations" | aberant_osc-ruby | train | rb |
732cbf42c4f6f7f8a2a948e38689e4037f32f798 | diff --git a/webapp.js b/webapp.js
index <HASH>..<HASH> 100644
--- a/webapp.js
+++ b/webapp.js
@@ -231,7 +231,7 @@ function registerEvents(emitter) {
logger.log("cloning %s into %s", data.repo_ssh_url, dir)
var msg = "Starting git clone of repo at " + data.repo_ssh_url
striderMessage(msg)
- gitane.run(dir, data.repo_config.privkey, 'git clone ' + data.repo_ssh_url, this)
+ gitane.run(dir, data.repo_config.privkey, 'git clone --recursive ' + data.repo_ssh_url, this)
},
function(err, stderr, stdout) {
if (err) throw err | use --recursive flag with `git clone`.
means we should now pull in any submodules, too.
closes #1 | Strider-CD_strider-simple-runner | train | js |
8e233101210be513a20016933d0c6a2075a418de | diff --git a/src/sap.m/src/sap/m/MultiInput.js b/src/sap.m/src/sap/m/MultiInput.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/MultiInput.js
+++ b/src/sap.m/src/sap/m/MultiInput.js
@@ -910,8 +910,10 @@ sap.ui.define(['jquery.sap.global', './Input', './Token', './library', 'sap/ui/c
if (this.fireEvent("_validateOnPaste", {texts: aSeparatedText}, true)) {
var i = 0;
for ( i = 0; i < aSeparatedText.length; i++) {
- this.updateDomValue(aSeparatedText[i]);
- this._validateCurrentText();
+ if (aSeparatedText[i]) { // pasting from excel can produce empty strings in the array, we don't have to handle empty strings
+ this.updateDomValue(aSeparatedText[i]);
+ this._validateCurrentText();
+ }
}
}
this.cancelPendingSuggest(); | [INTERNAL] sap.m.MultiInput: Pasting text from excel corrected
Change-Id: I2b<I>da3e0da0b9ed<I>c<I>ce<I>b0e1f<I>e<I>
BCP: <I> | SAP_openui5 | train | js |
90c0365f02cc0a4c1f645a906bdeda24b4eb30e2 | diff --git a/libraries/lithium/console/command/Create.php b/libraries/lithium/console/command/Create.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/console/command/Create.php
+++ b/libraries/lithium/console/command/Create.php
@@ -16,13 +16,8 @@ use \lithium\util\String;
* The `create` command allows you to rapidly develop your models, views, controllers, and tests
* by generating the minimum code necessary to test and run your application.
*
- * `li3 create model Post`
- * `li3 create test model Post
- * `li3 create mock model Post`
- * `li3 create controller Posts
- * `li3 create test controller Posts`
- * `li3 create mock controller Posts`
- * `li3 create view Post index`
+ * `li3 create --template=controller Posts`
+ * `li3 create --template=model Post`
*
*/
class Create extends \lithium\console\Command { | Fixing syntax of 'li3 create' examples.
Only fixed those work for me, removed the others. I'll update add/update the others as the are implemented. | UnionOfRAD_framework | train | php |
46a7047611f43f46e4b05bdba66c181a232d4432 | diff --git a/spec/z/dollar_spec.rb b/spec/z/dollar_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/z/dollar_spec.rb
+++ b/spec/z/dollar_spec.rb
@@ -22,7 +22,8 @@ describe 'Flor a-to-z' do
rad = %{
set f.a
"sequence"
- $(f.a)
+ #$(f.a)
+ f.a
1
2
} | simplify / explore z/dollar_spec.rb | floraison_flor | train | rb |
355334a6a53672394b343cba03939d878ffe7806 | diff --git a/src/InfoViz/Native/MutualInformationDiagram/index.js b/src/InfoViz/Native/MutualInformationDiagram/index.js
index <HASH>..<HASH> 100644
--- a/src/InfoViz/Native/MutualInformationDiagram/index.js
+++ b/src/InfoViz/Native/MutualInformationDiagram/index.js
@@ -1,4 +1,4 @@
-/* global document, window */
+/* global document */
import d3 from 'd3';
import style from 'PVWStyle/InfoVizNative/InformationDiagram.mcss';
@@ -143,7 +143,7 @@ function informationDiagram(publicAPI, model) {
}
};
- publicAPI.updateStatusBarText = (msg) => d3.select(model.container).select('input.status-bar-text').attr('value', msg);
+ publicAPI.updateStatusBarText = msg => d3.select(model.container).select('input.status-bar-text').attr('value', msg);
publicAPI.selectStatusBarText = () => {
// select text so user can press ctrl-c if desired. | fix(MutualInformationDiagram): Lint fixes to allow release build | Kitware_paraviewweb | train | js |
cc55f9de3850f1b28ad81ae2c24c06ff7f570a7c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -87,6 +87,8 @@ setup(
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
+ 'Framework :: Django :: 1.11',
+ 'Framework :: Django :: 2.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent', | Updates Django Framework versions to setup file
Adds missing Django framework versions to reflect current project support. | aschn_drf-tracking | train | py |
637fe1c0e7339ce0e97d273074aea71f3fd77159 | diff --git a/output/html/assets.php b/output/html/assets.php
index <HASH>..<HASH> 100644
--- a/output/html/assets.php
+++ b/output/html/assets.php
@@ -119,7 +119,7 @@ class QM_Output_Html_Assets extends QM_Output_Html {
}
echo '<td valign="top">' . $script->handle . '<br><span class="qm-info">' . $src . '</span></td>';
- echo '<td valign="top">' . implode( ', ', $script->deps ) . '</td>';
+ echo '<td valign="top">' . implode( '<br>', $script->deps ) . '</td>';
// echo '<td valign="top">' . $component->name . '</td>';
echo '<td valign="top">' . $ver . '</td>'; | List each script and style dependency on a new line. | johnbillion_query-monitor | train | php |
f1736a3f3d20f837ef9f9478693039b4ea322a12 | diff --git a/lib/semverse/constraint.rb b/lib/semverse/constraint.rb
index <HASH>..<HASH> 100644
--- a/lib/semverse/constraint.rb
+++ b/lib/semverse/constraint.rb
@@ -231,6 +231,9 @@ module Semverse
"#<#{self.class.to_s} #{to_s}>"
end
+ # The string representation of this constraint.
+ #
+ # @return [String]
def to_s
out = "#{operator} #{major}"
out << ".#{minor}" if minor | Add docs for Constraint#to_s | berkshelf_semverse | train | rb |
f81c58e982fad03ecb9671d22e77d0921aec189f | diff --git a/trunk/mapreduce/src/java/com/marklogic/mapreduce/ForestInputFormat.java b/trunk/mapreduce/src/java/com/marklogic/mapreduce/ForestInputFormat.java
index <HASH>..<HASH> 100644
--- a/trunk/mapreduce/src/java/com/marklogic/mapreduce/ForestInputFormat.java
+++ b/trunk/mapreduce/src/java/com/marklogic/mapreduce/ForestInputFormat.java
@@ -147,7 +147,7 @@ public class ForestInputFormat<VALUE> extends
}
int comp = InternalUtilities.compareUnsignedLong(offset,
treeDataSize);
- if (comp >= 0) {
+ if (comp > 0) {
throw new RuntimeException(
"TreeIndex offset is out of bound: position = "
+ position + ", offset = " + offset | Bug:<I> - Allow tree data size to reach end of the file. | marklogic_marklogic-contentpump | train | java |
0e6c1dc38106f7681bd92ec0a0e02164453357c4 | diff --git a/src/main/java/com/j256/ormlite/field/FieldType.java b/src/main/java/com/j256/ormlite/field/FieldType.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/j256/ormlite/field/FieldType.java
+++ b/src/main/java/com/j256/ormlite/field/FieldType.java
@@ -399,6 +399,10 @@ public class FieldType {
return field;
}
+ public String getTableName() {
+ return tableName;
+ }
+
public String getFieldName() {
return field.getName();
} | Added getter for table-name. | j256_ormlite-core | train | java |
20ce1fc543e0b0728e3f3f07f3e1eaf12b38d904 | diff --git a/tests/test_syslog_rfc5424_formatter.py b/tests/test_syslog_rfc5424_formatter.py
index <HASH>..<HASH> 100644
--- a/tests/test_syslog_rfc5424_formatter.py
+++ b/tests/test_syslog_rfc5424_formatter.py
@@ -29,11 +29,11 @@ class RFC5424FormatterTestCase(TestCase):
assert f.format(r) == '1 1970-01-01T00:00:00Z the_host root 1 - - A Message'
def test_non_utc(*args):
- with mock.patch.dict(os.environ, {'TZ': 'America/Los_Angeles'}):
+ with mock.patch.dict(os.environ, {'TZ': 'America/Phoenix'}):
time.tzset()
f = RFC5424Formatter()
r = logging.makeLogRecord({'name': 'root', 'msg': 'A Message'})
- assert f.format(r) == '1 1969-12-31T16:00:00-07:00 the_host root 1 - - A Message'
+ assert f.format(r) == '1 1969-12-31T17:00:00-07:00 the_host root 1 - - A Message'
def test_long_pid(*args):
with mock.patch('os.getpid', return_value=999999): | run non-UTC test in a timezone without DST so that tests work in the winter | EasyPost_syslog-rfc5424-formatter | train | py |
7fd23345c9ad9cc81616b635f6d6a56a1b9ab11a | diff --git a/daemon/kill.go b/daemon/kill.go
index <HASH>..<HASH> 100644
--- a/daemon/kill.go
+++ b/daemon/kill.go
@@ -99,7 +99,19 @@ func (daemon *Daemon) killWithSignal(container *containerpkg.Container, sig int)
if errdefs.IsNotFound(err) {
unpause = false
logrus.WithError(err).WithField("container", container.ID).WithField("action", "kill").Debug("container kill failed because of 'container not found' or 'no such process'")
- go daemon.handleContainerExit(container, nil)
+ go func() {
+ // We need to clean up this container but it is possible there is a case where we hit here before the exit event is processed
+ // but after it was fired off.
+ // So let's wait the container's stop timeout amount of time to see if the event is eventually processed.
+ // Doing this has the side effect that if no event was ever going to come we are waiting a a longer period of time uneccessarily.
+ // But this prevents race conditions in processing the container.
+ ctx, cancel := context.WithTimeout(context.TODO(), time.Duration(container.StopTimeout())*time.Second)
+ defer cancel()
+ s := <-container.Wait(ctx, containerpkg.WaitConditionNotRunning)
+ if s.Err() != nil {
+ daemon.handleContainerExit(container, nil)
+ }
+ }()
} else {
return errors.Wrapf(err, "Cannot kill container %s", container.ID)
} | Wait for container exit before forcing handler
This code assumes that we missed an exit event since the container is
still marked as running in Docker but attempts to signal the process in
containerd returns a "process not found" error.
There is a case where the event wasn't missed, just that it hasn't been
processed yet.
This change tries to work around that possibility by waiting to see if
the container is eventually marked as stopped. It uses the container's
configured stop timeout for this. | moby_moby | train | go |
438804b64b97a6f686c961ed30c4df6d38a210cd | diff --git a/molgenis-data-validation/src/main/java/org/molgenis/data/validation/meta/AttributeValidator.java b/molgenis-data-validation/src/main/java/org/molgenis/data/validation/meta/AttributeValidator.java
index <HASH>..<HASH> 100644
--- a/molgenis-data-validation/src/main/java/org/molgenis/data/validation/meta/AttributeValidator.java
+++ b/molgenis-data-validation/src/main/java/org/molgenis/data/validation/meta/AttributeValidator.java
@@ -322,7 +322,7 @@ public class AttributeValidator
static
{
- // transitions to EMAIL and HYPERLINK not allowed because existing values not checked by PostgreSQL
+ // transitions to EMAIL and HYPERLINK not allowed because existing values can not be validated
// transitions to CATEGORICAL_MREF and MREF not allowed because junction tables updated not implemented
// transitions to FILE not allowed because associated file in FileStore not created/removed
DATA_TYPE_ALLOWED_TRANSITIONS = new EnumMap<>(AttributeType.class); | Datasource does not need to be postgres | molgenis_molgenis | train | java |
d3ade5050c7f7887a853f6fa19ac8c3edbe4b71c | diff --git a/zipline/transforms/utils.py b/zipline/transforms/utils.py
index <HASH>..<HASH> 100644
--- a/zipline/transforms/utils.py
+++ b/zipline/transforms/utils.py
@@ -136,7 +136,7 @@ class StatefulTransform(object):
# IMPORTANT: Messages may contain pointers that are shared with
# other streams. Transforms that modify their input
# messages should only manipulate copies.
- log.info('Running StatefulTransform [%s]' % self.get_hash())
+ log.debug('Running StatefulTransform [%s]' % self.get_hash())
for message in stream_in:
# we only handle TRADE events.
if (hasattr(message, 'type')
@@ -157,7 +157,7 @@ class StatefulTransform(object):
out_message[self.namestring] = tnfm_value
yield out_message
- log.info('Finished StatefulTransform [%s]' % self.get_hash())
+ log.debug('Finished StatefulTransform [%s]' % self.get_hash())
class EventWindow(object): | MAINT: Tune logging of StateTransform start/end to debug.
These log lines are useful for debugging, but a bit spurious
on every algorithm run. | quantopian_zipline | train | py |
2671974715e802c552085e9d406aab26d2d016a8 | diff --git a/src/components/inputnumber/InputNumber.js b/src/components/inputnumber/InputNumber.js
index <HASH>..<HASH> 100644
--- a/src/components/inputnumber/InputNumber.js
+++ b/src/components/inputnumber/InputNumber.js
@@ -788,6 +788,10 @@ export class InputNumber extends Component {
}
validateValue(value) {
+ if (value === '-' || value == null) {
+ return null;
+ }
+
if (this.props.min !== null && value < this.props.min) {
return this.props.min;
}
@@ -796,10 +800,6 @@ export class InputNumber extends Component {
return this.props.max;
}
- if (value === '-') { // Minus sign
- return null;
- }
-
return value;
} | Fixed #<I> - InputNumber: setting "min" to anything greater than 0 implies "required" | primefaces_primereact | train | js |
cd66c179cb389c395aa0c893da51951bb69be0f1 | diff --git a/salt/modules/nacl.py b/salt/modules/nacl.py
index <HASH>..<HASH> 100644
--- a/salt/modules/nacl.py
+++ b/salt/modules/nacl.py
@@ -93,6 +93,7 @@ multiline encrypted secrets from pillar in a state, use the following format to
creating extra whitespace at the beginning of each line in the cert file:
.. code-block:: yaml
+
secret.txt:
file.managed:
- template: jinja | fix broken yaml code block (#<I>) | saltstack_salt | train | py |
17432924516663e27cb02d3a59500802e8d599a3 | diff --git a/src/Udb2UtilityTrait.php b/src/Udb2UtilityTrait.php
index <HASH>..<HASH> 100644
--- a/src/Udb2UtilityTrait.php
+++ b/src/Udb2UtilityTrait.php
@@ -272,9 +272,12 @@ trait Udb2UtilityTrait
/**
* Update the cdb item based on a bookingInfo object.
+ *
+ * @param CultureFeed_Cdb_Item_Event $cdbItem
+ * @param BookingInfo $bookingInfo
*/
private function updateCdbItemByBookingInfo(
- CultureFeed_Cdb_Item_Base $cdbItem,
+ CultureFeed_Cdb_Item_Event $cdbItem,
BookingInfo $bookingInfo
) { | MSS-<I>: Use CultureFeed_Cdb_Item_Event instead of CultureFeed_Cdb_Item_Base, CultureFeed_Cdb_Item_Base does not have any associated booking info | cultuurnet_udb3-udb2-bridge | train | php |
202b636cb6bf8852ab648df46c36202d09ff6efb | diff --git a/views/js/qtiCreator/widgets/interactions/mediaInteraction/states/Question.js b/views/js/qtiCreator/widgets/interactions/mediaInteraction/states/Question.js
index <HASH>..<HASH> 100755
--- a/views/js/qtiCreator/widgets/interactions/mediaInteraction/states/Question.js
+++ b/views/js/qtiCreator/widgets/interactions/mediaInteraction/states/Question.js
@@ -134,7 +134,7 @@ define([
params : {
uri : options.uri,
lang : options.lang,
- filters : 'video/mp4,video/avi,video/ogv,video/mpeg,video/ogg,video/quicktime,video/webm,video/x-ms-wmv,video/x-flv,audio/mp3,audio/vnd.wav,audio/ogg,audio/vorbis,audio/webm,audio/mpeg,application/ogg'
+ filters : 'video/mp4,video/avi,video/ogv,video/mpeg,video/ogg,video/quicktime,video/webm,video/x-ms-wmv,video/x-flv,audio/mp3,audio/vnd.wav,audio/ogg,audio/vorbis,audio/webm,audio/mpeg,application/ogg, audio/aac'
},
pathParam : 'path',
select : function(e, files){ | add search for aac files in media | oat-sa_extension-tao-itemqti | train | js |
99ec69f7c6efc62468d9095738109e1aacfc7573 | diff --git a/widgets/FoxSliderMain.php b/widgets/FoxSliderMain.php
index <HASH>..<HASH> 100755
--- a/widgets/FoxSliderMain.php
+++ b/widgets/FoxSliderMain.php
@@ -105,7 +105,7 @@ class FoxSliderMain extends \cmsgears\core\common\base\Widget {
if( !isset( $slider ) ) {
- throw new InvalidConfigException( "Slider does not exist. Please create it via admin having name set to $this->sliderName." );
+ return "<div>Slider having name set to $this->sliderName does not exist. Please create it via admin.</div>";
}
// Paths | Updated the widget to show warning instead of exception in case slider does not exist. | foxslider_cmg-plugin | train | php |
fbee1189cbab58c0fa175f3f37f39c8bdc32cea2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,10 +16,9 @@ config = {
'download_url': 'https://github.com/klavinslab/pymbt.git',
'author_email': 'nbolten _at_ gmail',
'version': '0.0.1',
- 'install_requires': ['nose', 'numpy', 'biopython'],
+ 'install_requires': ['cython', 'nose', 'numpy', 'biopython'],
'extras_require': {'plotting': ['matplotlib'],
'documentation': ['sphinx'],
- 'alignment': ['cython'],
'yeast_database': ['intermine', 'requests']},
'packages': ['pymbt',
'pymbt.analysis', | Require cython for now | klavinslab_coral | train | py |
2ae06fb088de4ee0bbb8c3bae6de13e1b8a79dfd | diff --git a/gspread/models.py b/gspread/models.py
index <HASH>..<HASH> 100644
--- a/gspread/models.py
+++ b/gspread/models.py
@@ -302,6 +302,14 @@ class Worksheet(object):
return self._title
@property
+ def gid(self):
+ """Gid of a worksheet."""
+ wid = self.id
+ widval = wid[1:] if len(wid) > 3 else wid
+ xorval = 474 if len(wid) > 3 else 31578
+ return str(int(str(widval), 36) ^ xorval)
+
+ @property
def row_count(self):
"""Number of rows"""
return int(self._element.find(_ns1('rowCount')).text) | Added gid property for worksheets | burnash_gspread | train | py |
9b4150663592f35b981bb29a42e29f4e34f9f53c | diff --git a/tests/Balanced/SuiteTest.php b/tests/Balanced/SuiteTest.php
index <HASH>..<HASH> 100644
--- a/tests/Balanced/SuiteTest.php
+++ b/tests/Balanced/SuiteTest.php
@@ -67,7 +67,7 @@ class SuiteTest extends \PHPUnit_Framework_TestCase
'4112344112344113',
null,
12,
- 2013);
+ 2016);
if ($account != null) {
$account->addCard($card);
$card = Card::get($card->uri);
@@ -523,7 +523,7 @@ class SuiteTest extends \PHPUnit_Framework_TestCase
'4112344112344113',
'123',
12,
- 2013);
+ 2016);
$this->assertEquals($card->last_four, '4113');
$this->assertFalse(property_exists($card, 'number'));
} | change the expiration date on the card in the tests so they pass | balanced_balanced-php | train | php |
c7b5c1f3b36ecd2503fd6d81deb6af59f068a066 | diff --git a/bootstrap.php b/bootstrap.php
index <HASH>..<HASH> 100644
--- a/bootstrap.php
+++ b/bootstrap.php
@@ -12,9 +12,3 @@ if (!class_exists('Mpay24\Mpay24Autoloader')) {
}
Mpay24\Mpay24Autoloader::register();
-
-if (!class_exists('Mpay24Test\Mpay24Autoloader')) {
- require __DIR__ . '/tests/Mpay24Autoloader.php';
-}
-
-Mpay24Test\Mpay24Autoloader::register(); | Don't load test classes in bootstrap.php file | mpay24_mpay24-php | train | php |
ac2ff4687e2442de91bc8d066109d2277e3df6fa | diff --git a/src/Harvest/HarvestReports.php b/src/Harvest/HarvestReports.php
index <HASH>..<HASH> 100644
--- a/src/Harvest/HarvestReports.php
+++ b/src/Harvest/HarvestReports.php
@@ -3,6 +3,8 @@
namespace Harvest;
+use Harvest\Model\Range;
+
/**
* HarvestReports
* | Update HarvestReports.php
Fixing HarvestReports namespace issues | gridonic_hapi | train | php |
0a8cf619aa06f4e785aea0b8634e3bc5b9aa23b9 | diff --git a/src/RepositoryInterface.php b/src/RepositoryInterface.php
index <HASH>..<HASH> 100644
--- a/src/RepositoryInterface.php
+++ b/src/RepositoryInterface.php
@@ -27,6 +27,8 @@ interface RepositoryInterface
* Checks out a branch or tag from the repository.
*
* @param string $version
+ *
+ * @return bool
*/
public function checkout($version);
} | Added return value to RepositoryInterface::checkout | accompli_chrono | train | php |
c1fecd5f1efd8db6a20dd6a29b06709d8b0b13b1 | diff --git a/modules/stores/URLStore.js b/modules/stores/URLStore.js
index <HASH>..<HASH> 100644
--- a/modules/stores/URLStore.js
+++ b/modules/stores/URLStore.js
@@ -56,7 +56,7 @@ var URLStore = {
* Returns the value of the current URL path.
*/
getCurrentPath: function () {
- if (_location === 'history')
+ if (_location === 'history' || _location === 'disabledHistory')
return getWindowPath();
if (_location === 'hash') | fixed getCurrentPath with disabledHistory | taion_rrtr | train | js |
eb888686e4c63e057039e7a0594de13fe361316f | diff --git a/extension/ezjscore/classes/ezjscpacker.php b/extension/ezjscore/classes/ezjscpacker.php
index <HASH>..<HASH> 100644
--- a/extension/ezjscore/classes/ezjscpacker.php
+++ b/extension/ezjscore/classes/ezjscpacker.php
@@ -493,7 +493,7 @@ class ezjscPacker
*/
static function fixImgPaths( $fileContent, $file )
{
- if ( preg_match_all( "/url\(\s*[\'|\"]?([A-Za-z0-9_\-\/\.\\%?&#=]+)[\'|\"]?\s*\)/ix", $fileContent, $urlMatches ) )
+ if ( preg_match_all( "/url\(\s*[\'|\"]?([A-Za-z0-9_\-\/\.\\%?&@#=]+)[\'|\"]?\s*\)/ix", $fileContent, $urlMatches ) )
{
$urlPaths = array();
$urlMatches = array_unique( $urlMatches[1] ); | CSS Compressing was ignoring @2x image path (#<I>)
image path like background-image: url('../images/<EMAIL>'); wasnt replaced during CSS Compressing | ezsystems_ezpublish-legacy | train | php |
63a01e7fbd19d13bc54ab4f2f6c2a59ba8325034 | diff --git a/vaspy/cli/kgen.py b/vaspy/cli/kgen.py
index <HASH>..<HASH> 100644
--- a/vaspy/cli/kgen.py
+++ b/vaspy/cli/kgen.py
@@ -183,7 +183,7 @@ def get_kpoints_from_list(structure, kpt_list, path_labels=None,
for kpt_sublist in kpt_list:
labels = []
for kpt in kpt_sublist:
- for label, kpt2 in kpt_dict.iteritems():
+ for label, kpt2 in iter(kpt_dict.items()):
if np.array_equal(kpt, kpt2):
labels.append(label)
break
@@ -294,7 +294,7 @@ def write_kpoint_files(filename, kpoints, labels, make_folders=False,
def _print_kpath_information(labels, path_str, kpt_dict):
logging.info('\nk-point path:\n\t{}'.format(path_str))
logging.info('\nk-points:')
- for label, kpoint in kpt_dict.iteritems():
+ for label, kpoint in iter(kpt_dict.items()):
coord_str = ' '.join(['{}'.format(c) for c in kpoint])
logging.info('\t{}: {}'.format(label, coord_str))
logging.info('\nk-point label indicies:') | Python 3 compatible changes for kgen dictionaries.
`dict.iteritems()` does not exist in Python 3, and is replaced with `dict.items()`.
For backwards compatibility [PEP <I>](<URL>)
suggests `d.iteritems() -> iter(d.items())`. | SMTG-UCL_sumo | train | py |
a90621f1ce2854a0e8181ce280b6be3d729f3083 | diff --git a/angr/analyses/decompiler/structurer.py b/angr/analyses/decompiler/structurer.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/decompiler/structurer.py
+++ b/angr/analyses/decompiler/structurer.py
@@ -829,8 +829,8 @@ class Structurer(Analysis):
# remove all old nodes and replace them with the new node
for idx, _, _ in candidates:
seq.nodes[idx] = None
- seq.nodes = [ n for n in seq.nodes if n is not None ]
seq.nodes[i] = new_node
+ seq.nodes = [ n for n in seq.nodes if n is not None ]
structured = True
break | Structurer: Overwrite the array element before eliminating other elements. (#<I>) | angr_angr | train | py |
bdf7e5de92d76ff6dd7cee317ffa43bed8c5d233 | diff --git a/src/transformers/generation_tf_utils.py b/src/transformers/generation_tf_utils.py
index <HASH>..<HASH> 100644
--- a/src/transformers/generation_tf_utils.py
+++ b/src/transformers/generation_tf_utils.py
@@ -177,7 +177,7 @@ class TFGenerationMixin:
tokenizer = AutoTokenizer.from_pretrained('gpt2') # Initialize tokenizer
model = TFAutoModelWithLMHead.from_pretrained('gpt2') # Download model and configuration from S3 and cache.
- input_context = 'My cute dog' # "Legal" is one of the control codes for ctrl
+ input_context = 'My cute dog'
bad_words_ids = [tokenizer.encode(bad_word, add_prefix_space=True) for bad_word in ['idiot', 'stupid', 'shut up']]
input_ids = tokenizer.encode(input_context, return_tensors='tf') # encode input context
outputs = model.generate(input_ids=input_ids, max_length=100, do_sample=True, bad_words_ids=bad_words_ids) # generate sequences without allowing bad_words to be generated | Remove accidental comment (#<I>) | huggingface_pytorch-pretrained-BERT | train | py |
08bec291fd30d8e294ada66bc4579e8bafa95e86 | diff --git a/lib/Cake/tests/cases/libs/controller/components/paginator.test.php b/lib/Cake/tests/cases/libs/controller/components/paginator.test.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/tests/cases/libs/controller/components/paginator.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/paginator.test.php
@@ -18,9 +18,11 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Controller', 'Controller', false);
-App::import('Component', 'Paginator');
-App::import('Core', array('CakeRequest', 'CakeResponse'));
+
+App::uses('Controller', 'Controller');
+App::uses('PaginatorComponent', 'Controller/Component');
+App::uses('CakeRequest', 'Network');
+App::uses('CakeResponse', 'Network');
/**
* PaginatorTestController class | Fixing class importing in paginator test | cakephp_cakephp | train | php |
b89741cc8dcb72a4efece027e64c839df7ce2275 | diff --git a/StubsController.php b/StubsController.php
index <HASH>..<HASH> 100644
--- a/StubsController.php
+++ b/StubsController.php
@@ -4,6 +4,7 @@ namespace bazilio\stubsgenerator;
use yii\console\Controller;
use yii\console\Exception;
+use yii\di\Instance;
class StubsController extends Controller
{
@@ -88,9 +89,18 @@ TPL;
}
if (isset($component['class'])) {
- $components[$name][] = $component['class'];
+ $class = $component['class'];
} elseif (isset($component['__class'])) {
- $components[$name][] = $component['__class'];
+ $class = $component['class'];
+ }
+
+ if (isset($class)) {
+ if ($class instanceof Instance)
+ {
+ $components[$name][] = get_class($class->get());
+ } else {
+ $components[$name][] = $class;
+ }
}
}
} | Simple support of Instance::of in configuration
see vendor/yiisoft/yii2/di/Container.php::get
$class is string|Instance | bazilio91_yii2-stubs-generator | train | php |
e16f5fc880b8ceab65ebb1846032d901dfe87679 | diff --git a/fastlane/lib/fastlane/version.rb b/fastlane/lib/fastlane/version.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/version.rb
+++ b/fastlane/lib/fastlane/version.rb
@@ -1,4 +1,4 @@
module Fastlane
- VERSION = '1.105.3'.freeze
+ VERSION = '1.106.0'.freeze
DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps"
end | [fastlane] Version bump (#<I>)
* New `fastlane env` command to print out the fastlane environment
* Docs: describe using next to stop executing a lane (#<I>)
* Update dependencies (#<I>)
* Remove old crash reporter code from fastlane (#<I>) | fastlane_fastlane | train | rb |
96c3ee49a8484337575961a4a4c7b8c4d9257c6c | diff --git a/src/pdfCropMargins/main_pdfCropMargins.py b/src/pdfCropMargins/main_pdfCropMargins.py
index <HASH>..<HASH> 100644
--- a/src/pdfCropMargins/main_pdfCropMargins.py
+++ b/src/pdfCropMargins/main_pdfCropMargins.py
@@ -68,13 +68,23 @@ try:
from PyPDF2 import PdfFileWriter, PdfFileReader
from PyPDF2.generic import (NameObject, createStringObject, RectangleObject,
FloatObject, IndirectObject)
- from PyPDF2.utils import PdfReadError
except ImportError:
print("\nError in pdfCropMargins: No system PyPDF2 Python package"
"\nwas found. Reinstall pdfCropMargins via pip or install that"
"\ndependency ('pip install pypdf2').\n", file=sys.stderr)
ex.cleanup_and_exit(1)
+try:
+ from PyPDF2.errors import PdfReadError
+except ImportError:
+ try:
+ from PyPDF2.utils import PdfReadError
+ except ImportError:
+ print("\nError in pdfCropMargins: The PdfReadError exception could not"
+ "\nbe found. Try updating pdfCropMargins and/or PyPDF2 via pip.",
+ file=sys.stderr)
+ ex.cleanup_and_exit(1)
+
from .calculate_bounding_boxes import get_bounding_box_list
## | added try both .utils and .errors for PdfReadError import | abarker_pdfCropMargins | train | py |
1a03505176fe58f007c700e647e2e1d383d18923 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -267,6 +267,11 @@ if mo:
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
+install_requires = []
+if sys.version_info < (3, 4):
+ # Backport of Python 3.4 enums to earlier versions
+ install_requires.append('enum34')
+
setup(
name = 'lensfunpy',
version = verstr,
@@ -297,5 +302,5 @@ setup(
packages = find_packages(),
ext_modules = extensions,
package_data = package_data,
- install_requires=['enum34'],
+ install_requires=install_requires
) | don't install enum<I> on python >= <I> | letmaik_lensfunpy | train | py |
d33b8006f0c2c6176a812aa479237105368865ab | diff --git a/gnsq/protocol.py b/gnsq/protocol.py
index <HASH>..<HASH> 100644
--- a/gnsq/protocol.py
+++ b/gnsq/protocol.py
@@ -44,13 +44,13 @@ CHANNEL_NAME_RE = re.compile(r'^[\.a-zA-Z0-9_-]+(#ephemeral)?$')
def valid_topic_name(topic):
- if not 0 < len(topic) < 33:
+ if not 0 < len(topic) < 65:
return False
return bool(TOPIC_NAME_RE.match(topic))
def valid_channel_name(channel):
- if not 0 < len(channel) < 33:
+ if not 0 < len(channel) < 65:
return False
return bool(CHANNEL_NAME_RE.match(channel)) | NSQ version <I> and later now can handle <I> char long topic and channel names | wtolson_gnsq | train | py |
294a72d697e100dadd3c03f7c8800b0e934c75db | diff --git a/test/utils.js b/test/utils.js
index <HASH>..<HASH> 100644
--- a/test/utils.js
+++ b/test/utils.js
@@ -1,4 +1,4 @@
-// var co = require('co');
+var fs = require('fs');
var path = require('path');
var test = require('tape').test;
var utils = require('../lib/utils');
@@ -82,6 +82,10 @@ test('utils.write', function (t) {
return utils.read(fp).then(function (d) {
t.deepEqual(d, data, 'file had data');
+
+ // delete test file
+ fs.unlinkSync(fp);
+
t.end();
});
}); | delete the test file after utils.write test | lukeed_taskr | train | js |
f995efe09ad1c23dcbda6bcde127b6cae1f35110 | diff --git a/webapp/app/main.py b/webapp/app/main.py
index <HASH>..<HASH> 100644
--- a/webapp/app/main.py
+++ b/webapp/app/main.py
@@ -21,7 +21,7 @@ def _unpack(stream):
font = TTFont(BytesIO(stream.read(fontlen)))
yield (desc, font)
-def checkfont(desc, font):
+def check_font(desc, font):
#familyName = desc['familyName']
#weightName = desc['weightName']
#isItalic = desc['isItalic'] | fix typo
(issue #<I>) | googlefonts_fontbakery | train | py |
521c5d7d9fe72851699868c17354b8a5352ed5fa | diff --git a/app/models/staypuft/deployment.rb b/app/models/staypuft/deployment.rb
index <HASH>..<HASH> 100644
--- a/app/models/staypuft/deployment.rb
+++ b/app/models/staypuft/deployment.rb
@@ -107,7 +107,6 @@ module Staypuft
return in_progress? ? hostgroup.openstack_hosts : {}
end
-
# Helper method for checking whether this deployment is in progress or not.
def in_progress?
ForemanTasks::Lock.locked? self, nil
@@ -323,9 +322,14 @@ module Staypuft
deployment.hostgroup
end
+ # compatibility with validates_associated
def marked_for_destruction?
false
end
+
+ def attributes=(attr_list)
+ attr_list.each { |attr, value| send "#{attr}=", value } unless attr_list.nil?
+ end
end
class NovaService < AbstractService
@@ -373,10 +377,6 @@ module Staypuft
self.single_password_confirmation = single_password
end
- def attributes=(attr_list)
- attr_list.each { |attr, value| send "#{attr}=", value } unless attr_list.nil?
- end
-
module Mode
SINGLE = 'single'
RANDOM = 'random' | minor improvements
- moving #attributes= to abstract class
- removing old unnecessary nil check | theforeman_staypuft | train | rb |
d57c42074f61688080bfeafbe3af9f9c08992a91 | diff --git a/src/main/java/io/fabric8/maven/docker/util/CredentialHelperClient.java b/src/main/java/io/fabric8/maven/docker/util/CredentialHelperClient.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/fabric8/maven/docker/util/CredentialHelperClient.java
+++ b/src/main/java/io/fabric8/maven/docker/util/CredentialHelperClient.java
@@ -38,10 +38,9 @@ public class CredentialHelperClient {
public AuthConfig getAuthConfig(String registryToLookup) throws MojoExecutionException {
try {
- final GetCommand getCommand = new GetCommand();
- JsonObject creds = getCommand.getCredentialNode(registryToLookup);
+ JsonObject creds = new GetCommand().getCredentialNode(registryToLookup);
if (creds == null) {
- creds = getCommand.getCredentialNode(EnvUtil.ensureRegistryHttpUrl(registryToLookup));
+ creds = new GetCommand().getCredentialNode(EnvUtil.ensureRegistryHttpUrl(registryToLookup));
}
return toAuthConfig(creds);
} catch (IOException e) { | fix: Don't reuse a GetCommand as its a one-shot action
Fixes #<I>. | fabric8io_docker-maven-plugin | train | java |
925972ffd87d2544eb2928e7599e96c7985b3c9a | diff --git a/jsfuck.js b/jsfuck.js
index <HASH>..<HASH> 100644
--- a/jsfuck.js
+++ b/jsfuck.js
@@ -91,7 +91,7 @@
'+': '(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]',
',': '[[]]["concat"]([][[]])+""',
'-': '(+(.0000000001)+"")[2]',
- '.': '(0)["toFixed"](1)[1]',
+ '.': '(+(+!+[]+[+!+[]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+[+!+[]]+[+[]]+[+[]])+[])[+!+[]]',
'/': '("")["italics"]()[4]',
':': 'GLOBAL["Date"]()[21]',
';': USE_CHAR_CODE, | Encode full stop in <I> chars | fasttime_JScrewIt | train | js |
81715906ebe742cb86c888d2fe2c01b5ecd1be86 | diff --git a/lib/locators.js b/lib/locators.js
index <HASH>..<HASH> 100644
--- a/lib/locators.js
+++ b/lib/locators.js
@@ -354,7 +354,7 @@ ProtractorBy.prototype.repeater = function(repeatDescriptor) {
* </ul>
*
* @example
- * // Returns the DIV for the dog, but not cat.
+ * // Returns the li for the dog, but not cat.
* var dog = element(by.cssContainingText('.pet', 'Dog'));
*/
ProtractorBy.prototype.cssContainingText = function(cssSelector, searchText) { | chore(docs): Correct comment in locators.js
example is misleading as there is no li which returned by cssContainingText | angular_protractor | train | js |
e43f75187ef7cdec70aeda9dd887f18546c02249 | diff --git a/lamvery/config.py b/lamvery/config.py
index <HASH>..<HASH> 100644
--- a/lamvery/config.py
+++ b/lamvery/config.py
@@ -139,9 +139,6 @@ class Config:
if events is None:
return {'rules': []}
- if 'rules' in events:
- return {'rules': []}
-
if isinstance(events, list):
rules = []
for e in events:
@@ -150,6 +147,9 @@ class Config:
return {'rules': rules}
+ if events.get('rules') is None:
+ return {'rules': []}
+
return events
def get_default_alias(self): | Bugfix: Can't read some of the events config | marcy-terui_lamvery | train | py |
79c86fcc70d7e60fd8cf6d67f7392cc40fb7d210 | diff --git a/scs_core/osio/config/project.py b/scs_core/osio/config/project.py
index <HASH>..<HASH> 100644
--- a/scs_core/osio/config/project.py
+++ b/scs_core/osio/config/project.py
@@ -36,6 +36,13 @@ class Project(PersistentJSONable):
# ----------------------------------------------------------------------------------------------------------------
@classmethod
+ def is_valid_channel(cls, channel):
+ return channel in ('C', 'G', 'P', 'S', 'X')
+
+
+ # ----------------------------------------------------------------------------------------------------------------
+
+ @classmethod
def construct(cls, org_id, group, location_id):
path_root = '/orgs/' + org_id + '/' | Enabled channel subscription to osio_mqtt_client. | south-coast-science_scs_core | train | py |
e890a66057ecff72cf0b28ad64e1bf5937170707 | diff --git a/tests/integration/Customer/CustomerUpdateRequestTest.php b/tests/integration/Customer/CustomerUpdateRequestTest.php
index <HASH>..<HASH> 100644
--- a/tests/integration/Customer/CustomerUpdateRequestTest.php
+++ b/tests/integration/Customer/CustomerUpdateRequestTest.php
@@ -60,7 +60,6 @@ class CustomerUpdateRequestTest extends ApiTestCase
protected function getAddress()
{
return Address::of()
- ->setKey('key-' . CustomerFixture::uniqueCustomerString())
->setCountry('DE')
->setFirstName('new-' . CustomerFixture::uniqueCustomerString() . '-firstName');
}
@@ -320,7 +319,7 @@ class CustomerUpdateRequestTest extends ApiTestCase
CustomerFixture::withUpdateableCustomer(
$client,
function (Customer $customer) use ($client) {
- $address = $this->getAddress();
+ $address = $this->getAddress()->setKey('key-' . CustomerFixture::uniqueCustomerString());
$request = RequestBuilder::of()->customers()->update($customer)
->addAction(CustomerAddAddressAction::ofAddress($address)); | WIP: adjust where to set the key | commercetools_commercetools-php-sdk | train | php |
28013fb6d6efdccd83dd2f695b8430e8297259e4 | diff --git a/test-complete/src/test/java/com/marklogic/javaclient/TestBulkSearchWithKeyValQueryDef.java b/test-complete/src/test/java/com/marklogic/javaclient/TestBulkSearchWithKeyValQueryDef.java
index <HASH>..<HASH> 100644
--- a/test-complete/src/test/java/com/marklogic/javaclient/TestBulkSearchWithKeyValQueryDef.java
+++ b/test-complete/src/test/java/com/marklogic/javaclient/TestBulkSearchWithKeyValQueryDef.java
@@ -53,7 +53,7 @@ public class TestBulkSearchWithKeyValQueryDef extends BasicJavaClientREST {
private static String restServerName = "REST-Java-Client-API-Server";
private static int restPort = 8011;
private DatabaseClient client ;
-
+/* this test is commented out untill we make decision in Issue 88
@BeforeClass
public static void setUpBeforeClass() throws Exception {
System.out.println("In setup");
@@ -347,5 +347,5 @@ public class TestBulkSearchWithKeyValQueryDef extends BasicJavaClientREST {
}
-
+*/
} | test is commented untill we see a resolution in issue <I> | marklogic_java-client-api | train | java |
53a97b129cb742c2f061a97388748a98b24bbcc8 | diff --git a/test/resources/IndexController.php b/test/resources/IndexController.php
index <HASH>..<HASH> 100644
--- a/test/resources/IndexController.php
+++ b/test/resources/IndexController.php
@@ -49,9 +49,7 @@ class IndexController extends AbstractActionController
*/
public function indexAction()
{
- $this->thumbnailer = $this->getServiceLocator()->get('WebinoImageThumb');
$image = __DIR__ . '/test.jpg';
-
$thumb = $this->thumbnailer->create(
$image, array(), array($this->thumbnailer->createReflection(40, 40, 80, true, '#a4a4a4'))
); | Fixed test IndexController, removed accidental service locator get thumbnailer | webino_WebinoImageThumb | train | php |
435500078c85f2558746893b52606bdbdda3bb13 | diff --git a/lib/bolt/version.rb b/lib/bolt/version.rb
index <HASH>..<HASH> 100644
--- a/lib/bolt/version.rb
+++ b/lib/bolt/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Bolt
- VERSION = '2.23.0'
+ VERSION = '2.24.0'
end | (GEM) update bolt version to <I> | puppetlabs_bolt | train | rb |
35824b202f492b243975750fd80345c25f68dbfa | diff --git a/djstripe/models.py b/djstripe/models.py
index <HASH>..<HASH> 100644
--- a/djstripe/models.py
+++ b/djstripe/models.py
@@ -656,10 +656,9 @@ class CurrentSubscription(TimeStampedModel):
return True
-class Invoice(TimeStampedModel):
+class Invoice(StripeObject):
# TODO - needs tests
- stripe_id = models.CharField(max_length=50)
customer = models.ForeignKey(Customer, related_name="invoices")
attempted = models.NullBooleanField()
attempts = models.PositiveIntegerField(null=True) | Invoice now inherits from StripeObject model. | dj-stripe_dj-stripe | train | py |
cfd5929d44c75e122958423f5a63eb22ad9d60b8 | diff --git a/src/lib/handleKeyEvent.js b/src/lib/handleKeyEvent.js
index <HASH>..<HASH> 100644
--- a/src/lib/handleKeyEvent.js
+++ b/src/lib/handleKeyEvent.js
@@ -36,7 +36,10 @@ export default function handleKeyEvent({
* TODO add a test for this
*/
if (multiselect) {
- ReactResponsiveSelectClassRef.updateState({ type: actionTypes.SET_OPTIONS_PANEL_CLOSED }, () => ReactResponsiveSelectClassRef.focusButton);
+ ReactResponsiveSelectClassRef.updateState(
+ { type: actionTypes.SET_OPTIONS_PANEL_CLOSED },
+ () => ReactResponsiveSelectClassRef.focusButton(),
+ );
}
}
break;
@@ -62,9 +65,7 @@ export default function handleKeyEvent({
/* remove focus from the panel when focussed */
ReactResponsiveSelectClassRef.updateState(
{ type: actionTypes.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION },
- () => {
- ReactResponsiveSelectClassRef.focusButton();
- },
+ () => ReactResponsiveSelectClassRef.focusButton(),
);
break; | multiselect focus button on tab away | benbowes_react-responsive-select | train | js |
8ede6ef4abe643c243f8a3dbc73697c904a91e26 | diff --git a/src/services/decorators.js b/src/services/decorators.js
index <HASH>..<HASH> 100644
--- a/src/services/decorators.js
+++ b/src/services/decorators.js
@@ -209,8 +209,8 @@ angular.module('schemaForm').provider('schemaFormDecorators',
'ng-if',
ngIf ?
'(' + ngIf +
- ') || (evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex }))'
- : 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex })'
+ ') || (evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex, "modelValue": model["' + form.key.join('"]["') + '"] }))'
+ : 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex, "modelValue": model["' + form.key.join('"]["') + '"] })'
);
});
} | Allow access to the modelValue inside a condition
Allowing access to the modelValue from inside a condition would make conditions inside nested loops and from dynamic schemas easier to work with. | json-schema-form_angular-schema-form | train | js |
7790e81793b9b33b775a3a438fe508662f621c04 | diff --git a/luminoso_api/client.py b/luminoso_api/client.py
index <HASH>..<HASH> 100644
--- a/luminoso_api/client.py
+++ b/luminoso_api/client.py
@@ -300,6 +300,13 @@ class LuminosoClient(object):
newclient = LuminosoClient(self._auth, self.root_url, self.root_url)
return newclient.get_raw('/')
+ def keepalive(self):
+ """
+ Send a pointless POST request so that auth doesn't time out.
+ """
+ newclient = LuminosoClient(self._auth, self.root_url, self.root_url)
+ return newclient.post('ping')
+
def upload(self, path, docs):
"""
A convenience method for uploading a set of dictionaries representing
@@ -334,7 +341,11 @@ class LuminosoClient(object):
base_path = 'jobs/id'
path = '%s%d' % (ensure_trailing_slash(base_path), job_id)
logger.info('waiting')
+ count = 0
while True:
+ count += 1
+ if count % 10 == 0:
+ self.keepalive()
response = self.get(path)
logger.info(response)
if response['stop_time']: | add keepalive to wait_for | LuminosoInsight_luminoso-api-client-python | train | py |
343a12e76ef5534dd36a1f8686a5b50c1f4303fa | diff --git a/audit.js b/audit.js
index <HASH>..<HASH> 100644
--- a/audit.js
+++ b/audit.js
@@ -245,6 +245,8 @@ function exitHandler(options, err) {
JUnit = new XMLSerializer().serializeToString(dom);
console.log( `Wrote JUnit report to reports/${output}`);
fs.writeFileSync('reports/' + output, `<?xml version="1.0" encoding="UTF-8"?>\n${JUnit}`);
+ // Report mode is much like a test mode where builds shouldn't fail if the report was created.
+ process.exit(0);
}
process.exit(vulnerabilityCount);
} | Don't fail in report mode if exit is sucessful. | OSSIndex_auditjs | train | js |
c925e37ab655cb1fa819eef4b28d4afa37abde50 | diff --git a/src/app/Traits/MediaTrait.php b/src/app/Traits/MediaTrait.php
index <HASH>..<HASH> 100755
--- a/src/app/Traits/MediaTrait.php
+++ b/src/app/Traits/MediaTrait.php
@@ -48,7 +48,7 @@ trait MediaTrait{
// uploaded file
$file = $request->file($key);
- $extension = $file->getClientOriginalExtension(); // getting image extension
+ $extension = strtolower($file->getClientOriginalExtension()); // getting image extension
$fileNameWithoutExtension = str_slug(basename($file->getClientOriginalName(), '.'.$file->getClientOriginalExtension()),'-');
$fileName = $fileNameWithoutExtension.'.'.$extension;
$fileSizeOriginal = $file->getClientSize(); | thums were not beinh creaed for images with uppercase extensions | AccioCMS_core | train | php |
f5ed7a89e35b42b6f90477eb62fa04d91fea0c72 | diff --git a/pinax/messages/views.py b/pinax/messages/views.py
index <HASH>..<HASH> 100644
--- a/pinax/messages/views.py
+++ b/pinax/messages/views.py
@@ -97,6 +97,7 @@ class ThreadDeleteView(LoginRequiredMixin, DeleteView):
"""
model = Thread
success_url = "pinax_messages:inbox"
+ template_name = "pinax/messages/thread_confirm_delete.html"
def delete(self, request, *args, **kwargs):
self.object = self.get_object()
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ setup(
description="a reusable private user messages application for Django",
name="pinax-messages",
long_description=read("README.md"),
- version="1.0.0",
+ version="1.0.1",
url="http://github.com/pinax/pinax-messages/",
license="MIT",
packages=find_packages(), | Specify template location.
If template is not explicitly specified the Django
template loader looks in the wrong location.
Update version. | pinax_pinax-messages | train | py,py |
b2e96ced67da897a606654fa95bef557600a2c42 | diff --git a/source/application/controllers/admin/article_main.php b/source/application/controllers/admin/article_main.php
index <HASH>..<HASH> 100644
--- a/source/application/controllers/admin/article_main.php
+++ b/source/application/controllers/admin/article_main.php
@@ -456,9 +456,6 @@ class Article_Main extends oxAdminDetails
$myUtilsObject = oxUtilsObject::getInstance();
$oDb = oxDb::getDb();
- $myConfig = $this->getConfig();
- $sShopId = $myConfig->getShopId();
-
$sO2CView = getViewName( 'oxobject2category' );
$sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = ".$oDb->quote( $sOldId );
$oRs = $oDb->execute( $sQ ); | Moved EE code to EE code block | OXID-eSales_oxideshop_ce | train | php |
17532b38353d4b002fab0d3372e0eb4f631bf2ee | diff --git a/emir/dataproducts.py b/emir/dataproducts.py
index <HASH>..<HASH> 100644
--- a/emir/dataproducts.py
+++ b/emir/dataproducts.py
@@ -24,7 +24,7 @@ import logging
import pyfits
from numina.recipes import Image
-from emir.instrument.headers import default
+from emir.instrument import EmirImageFactory
_logger = logging.getLogger('emir.dataproducts')
@@ -73,7 +73,7 @@ def create_raw(data=None, headers=None, default_headers=None, imgtype='image'):
if imgtype not in _result_types:
raise TypeError('%s not in %s' % (imgtype, _result_types))
- hdefault = default_headers or default
+ hdefault = default_headers or EmirImageFactory.default
hdu = pyfits.PrimaryHDU(data, hdefault[imgtype]['primary'])
@@ -95,7 +95,7 @@ def create_result(data=None, headers=None,
extensions['variance'] = (variance, variance_headers)
extensions['map'] = (exmap, exmap_headers)
- hdefault = default_headers or default
+ hdefault = default_headers or EmirImageFactory.default
for extname in ['variance', 'map']:
edata = extensions[extname] | Headers from ImageFactory | guaix-ucm_pyemir | train | py |
5d7d969324f539fb553fd99db7058fd1cb763d47 | diff --git a/etrago/tools/plot.py b/etrago/tools/plot.py
index <HASH>..<HASH> 100644
--- a/etrago/tools/plot.py
+++ b/etrago/tools/plot.py
@@ -750,6 +750,7 @@ def plot_residual_load(network):
color='red',
label="residual load")
plot.legend()
+ plot.set_ylabel("Residual load in MW")
# sorted curve
sorted_residual_load = residual_load.sort_values(
ascending=False).reset_index() | Add y label for residual load plot | openego_eTraGo | train | py |
e8908576d4e6d52b5495a8cceff249178c5641d4 | diff --git a/lib/Doctrine/ODM/MongoDB/SchemaManager.php b/lib/Doctrine/ODM/MongoDB/SchemaManager.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ODM/MongoDB/SchemaManager.php
+++ b/lib/Doctrine/ODM/MongoDB/SchemaManager.php
@@ -146,6 +146,9 @@ class SchemaManager
if ($indexes = $this->getDocumentIndexes($documentName)) {
$collection = $this->dm->getDocumentCollection($class->name);
foreach ($indexes as $index) {
+ if (!isset($index['options']['background'])) {
+ $index['options']['background'] = true;
+ }
$collection->ensureIndex($index['keys'], $index['options']);
}
} | Default index creation to be in the background. | doctrine_mongodb-odm | train | php |
c5c4c400622475b131cd18e5b0854b789f9b8983 | diff --git a/src/components/containers/PanelHeader.js b/src/components/containers/PanelHeader.js
index <HASH>..<HASH> 100644
--- a/src/components/containers/PanelHeader.js
+++ b/src/components/containers/PanelHeader.js
@@ -25,6 +25,7 @@ class PanelHeader extends Component {
hasOpen,
} = this.props;
+ // dropdown is styled with same styles as react-select component - see _dropdown.scss
const icon = <PlusIcon />;
return !children && !addAction && !allowCollapse ? null : (
<div className="panel__header">
@@ -49,7 +50,7 @@ class PanelHeader extends Component {
) : null}
{addAction ? (
- <div className="panel__header__action">
+ <div className="panel__header__action dropdown-container">
<Button
variant="primary"
className="js-add-button" | add comment about reusing styles from dropdown | plotly_react-chart-editor | train | js |
08fae77f9b89d38d45f7bd2c880cc702b6a62bbb | diff --git a/app/scripts/constants/ActionTypes.js b/app/scripts/constants/ActionTypes.js
index <HASH>..<HASH> 100644
--- a/app/scripts/constants/ActionTypes.js
+++ b/app/scripts/constants/ActionTypes.js
@@ -1,2 +1 @@
-export const EDIT_COLUMN_CONTENT = 'EDIT_COLUMN_CONTENT'
export const EDIT_WIDGET = 'EDIT_WIDGET'
diff --git a/app/scripts/stores/index.js b/app/scripts/stores/index.js
index <HASH>..<HASH> 100644
--- a/app/scripts/stores/index.js
+++ b/app/scripts/stores/index.js
@@ -1 +1,3 @@
export { default as mobilizations } from './mobilizations';
+export { default as blocks } from './blocks';
+export { default as widgets } from './widgets'; | [#<I>] add blocks and widgets stores to the index | nossas_bonde-client | train | js,js |
a6c56b99377a881635e68669ddc9a93ced1e1f95 | diff --git a/src/main/java/org/bff/javampd/monitor/StandAloneMonitorThread.java b/src/main/java/org/bff/javampd/monitor/StandAloneMonitorThread.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/bff/javampd/monitor/StandAloneMonitorThread.java
+++ b/src/main/java/org/bff/javampd/monitor/StandAloneMonitorThread.java
@@ -111,7 +111,7 @@ public class StandAloneMonitorThread implements Runnable {
}
private void resetMonitors() {
- this.monitors.forEach(monitor -> monitor.reset());
+ this.monitors.forEach(ThreadedMonitor::reset);
}
private void processResponse(List<String> response) { | replace lambda with a method reference | finnyb_javampd | train | java |
27dba655fc8901523641c7390b95fa36910a7ef9 | diff --git a/test/response.test.js b/test/response.test.js
index <HASH>..<HASH> 100644
--- a/test/response.test.js
+++ b/test/response.test.js
@@ -250,7 +250,7 @@ module.exports = {
assert.response(app,
{ url: '/' },
function(res){
- //assert.length(res.headers['set-cookie'], 1);
+ assert.length(res.headers['set-cookie'], 1);
assert.equal(
'rememberme=yes; expires=Thu, 01 Jan 1970 00:00:00 GMT; httpOnly',
res.headers['set-cookie'][0]);
@@ -268,7 +268,7 @@ module.exports = {
assert.response(app,
{ url: '/' },
function(res){
- //assert.length(res.headers['set-cookie'], 1);
+ assert.length(res.headers['set-cookie'], 1);
assert.equal(
'rememberme=; expires=Thu, 01 Jan 1970 00:00:00 GMT',
res.headers['set-cookie'][0]); | Uncommented cookie assertions previously failing | expressjs_express | train | js |
b825ce8c71ad2f2d3c60480188c83feef492558f | diff --git a/poyo/patterns.py b/poyo/patterns.py
index <HASH>..<HASH> 100644
--- a/poyo/patterns.py
+++ b/poyo/patterns.py
@@ -19,7 +19,7 @@ _SIMPLE = _INDENT + _VAR + _BLANK + _VALUE + _INLINE_COMMENT + _OPT_NEWLINE
_LIST_VALUE = (
_BLANK + r"-" + _BLANK +
- r"('.*?'|\".*?\"|[^#]+?)" +
+ r"('.*?'|\".*?\"|[^#\n]+?)" +
_INLINE_COMMENT + _OPT_NEWLINE
)
_LIST_ITEM = _BLANK_LINE + r"|" + _COMMENT + r"|" + _LIST_VALUE | Fix #<I> list pattern is too greedy | hackebrot_poyo | train | py |
9a4bea1eabb905732b556a6cf72227da8ab03e7d | diff --git a/Eloquent/Model.php b/Eloquent/Model.php
index <HASH>..<HASH> 100644
--- a/Eloquent/Model.php
+++ b/Eloquent/Model.php
@@ -1620,6 +1620,19 @@ abstract class Model implements Arrayable, ArrayAccess, CanBeEscapedWhenCastToSt
}
/**
+ * Clone the model into a new, non-existing instance without raising any events.
+ *
+ * @param array|null $except
+ * @return static
+ */
+ public function replicateQuietly(array $except = null)
+ {
+ return static::withoutEvents(function () use ($except) {
+ return $this->replicate($except);
+ });
+ }
+
+ /**
* Determine if two models have the same ID and belong to the same table.
*
* @param \Illuminate\Database\Eloquent\Model|null $model | [9.x] Add replicateQuietly to Model (#<I>)
* Add replicateQuietly method
* Add test for replicateQuietly() | illuminate_database | train | php |
7953bb58733de33bdc693cd7b2d685ab5fa093fe | diff --git a/sham/network/interfaces.py b/sham/network/interfaces.py
index <HASH>..<HASH> 100644
--- a/sham/network/interfaces.py
+++ b/sham/network/interfaces.py
@@ -16,7 +16,7 @@ class NetworkInterface(object):
def root(self):
"""
TODO(rdelinger) rename this as to_xml or something similar
- """"
+ """
self.xml_root = ElementTree.Element('interface')
self.xml_root.set('type', self.type)
if self.mac is not None: | Fixed an issue with an extra '"' in interfaces.py (issue #2) | rossdylan_sham | train | py |
050a474b6f5e000584bf5a1a8f41e3d9750faf3d | diff --git a/tasks/load-options.js b/tasks/load-options.js
index <HASH>..<HASH> 100644
--- a/tasks/load-options.js
+++ b/tasks/load-options.js
@@ -11,7 +11,18 @@
var requireDirectory = require('require-directory');
module.exports = function(grunt) {
- grunt.initConfig(requireDirectory(module, './grunt/options'));
+
+ // Load config options.
+ var options = requireDirectory(module, './grunt/options');
+
+ // Resolve options expressed as functions.
+ Object.keys(options).forEach(function(name) {
+ if(typeof options[name] === 'function') {
+ options[name] = options[name](grunt);
+ }
+ });
+
+ grunt.initConfig(options);
grunt.loadTasks('./grunt/tasks');
-};
+}; | Resolve options expressed as functions. | chriszarate_grunt-load-options | train | js |
1023fa0ca18a89364ad472a2fd7c1663b27bcb61 | diff --git a/pycbc/inference/sampler/cpnest.py b/pycbc/inference/sampler/cpnest.py
index <HASH>..<HASH> 100644
--- a/pycbc/inference/sampler/cpnest.py
+++ b/pycbc/inference/sampler/cpnest.py
@@ -30,6 +30,7 @@ from __future__ import absolute_import
import logging
import os
+import array
import cpnest
import cpnest.model as cpm
from pycbc.inference.io import (CPNestFile, validate_checkpoint_files)
@@ -228,7 +229,7 @@ class CPNestModel(cpm.Model):
def new_point(self):
point = self.model.prior_rvs()
return cpm.LivePoint(list(self.model.sampling_params),
- [point[p] for p in self.model.sampling_params])
+ array.array('d', [point[p] for p in self.model.sampling_params]))
def log_prior(self,xx):
self.model.update(**xx) | Update cpnest.py (#<I>)
This is my proposed patch for cpnest in #<I> . I leave it here for anyone interested to verify/approve/fix. | gwastro_pycbc | train | py |
e60c70c1a7954e2a9c26cdc89061f480f2e270ff | diff --git a/telethon/utils/tl_utils.py b/telethon/utils/tl_utils.py
index <HASH>..<HASH> 100644
--- a/telethon/utils/tl_utils.py
+++ b/telethon/utils/tl_utils.py
@@ -21,6 +21,8 @@ def get_display_name(entity):
if isinstance(entity, Chat) or isinstance(entity, Channel):
return entity.title
+ return '(unknown)'
+
# For some reason, .webp (stickers' format) is not registered
add_type('image/webp', '.webp')
@@ -43,7 +45,7 @@ def get_extension(media):
def get_input_peer(entity):
"""Gets the input peer for the given "entity" (user, chat or channel).
- Returns None if it was not found"""
+ A ValueError is rose if the given entity isn't a supported type."""
if (isinstance(entity, InputPeerUser) or
isinstance(entity, InputPeerChat) or
isinstance(entity, InputPeerChannel)):
@@ -56,6 +58,9 @@ def get_input_peer(entity):
if isinstance(entity, Channel):
return InputPeerChannel(entity.id, entity.access_hash)
+ raise ValueError('Cannot cast {} to any kind of InputPeer.'
+ .format(type(entity).__name__))
+
def find_user_or_chat(peer, users, chats):
"""Finds the corresponding user or chat given a peer. | Add more descriptive errors for get_input_peer (#<I>) | LonamiWebs_Telethon | train | py |
d558b2e9311e58e501d920c000fb059007d39bc4 | diff --git a/src/app/http/controllers/HCUsersController.php b/src/app/http/controllers/HCUsersController.php
index <HASH>..<HASH> 100644
--- a/src/app/http/controllers/HCUsersController.php
+++ b/src/app/http/controllers/HCUsersController.php
@@ -152,7 +152,7 @@ class HCUsersController extends HCBaseController
$list = HCUsers::with ($with)->select ($select)
// add filters
->where (function ($query) use ($select) {
- $query->where ($this->getRequestParameters ($select));
+ $query = $this->getRequestParameters ($query, $select);
});
$list = $this->checkForDeleted ($list);
@@ -160,12 +160,8 @@ class HCUsersController extends HCBaseController
// add search items
$list = $this->listSearch ($list);
- $orderData = request ()->input ('_order');
-
- if ($orderData)
- foreach ($orderData as $column => $direction)
- if (strtolower ($direction) == 'asc' || strtolower ($direction) == 'desc')
- $list = $list->orderBy ($column, $direction);
+ // ordering data
+ $list = $this->orderData($list, $select);
return $list->paginate ($this->recordsPerPage)->toArray ();
} | Adjusted controller for improved HCBaseController | interactivesolutions_honeycomb-acl | train | php |
0efe264cefbab01c82fa6b927b3f0d34d7b53556 | diff --git a/angr/path_group.py b/angr/path_group.py
index <HASH>..<HASH> 100644
--- a/angr/path_group.py
+++ b/angr/path_group.py
@@ -143,8 +143,9 @@ class PathGroup(ana.Storable):
# Util functions
#
- def copy(self):
- return PathGroup(self._project, stashes=self._copy_stashes(immutable=True), hierarchy=self._hierarchy, immutable=self._immutable)
+ def copy(self, stashes=None):
+ stashes = stashes if stashes is not None else self._copy_stashes(immutable=True)
+ return PathGroup(self._project, stashes=stashes, hierarchy=self._hierarchy, immutable=self._immutable, veritesting=self._veritesting, veritesting_options=self._veritesting_options, resilience=self._resilience, save_unconstrained=self.save_unconstrained, save_unsat=self.save_unsat)
def _copy_stashes(self, immutable=None):
'''
@@ -180,7 +181,7 @@ class PathGroup(ana.Storable):
self.stashes = new_stashes
return self
else:
- return PathGroup(self._project, stashes=new_stashes, hierarchy=self._hierarchy, immutable=self._immutable)
+ return self.copy(stashes=new_stashes)
@staticmethod
def _condition_to_lambda(condition, default=False): | Construct PathGroup with all args in copy | angr_angr | train | py |
815129d35a517346d92aca1b46df84b0f400dbcd | diff --git a/pyrsistent/_pmap.py b/pyrsistent/_pmap.py
index <HASH>..<HASH> 100644
--- a/pyrsistent/_pmap.py
+++ b/pyrsistent/_pmap.py
@@ -91,7 +91,9 @@ class PMap(object):
try:
return self[key]
except KeyError:
- raise AttributeError("PMap has no attribute '{0}'".format(key))
+ raise AttributeError(
+ "{0} has no attribute '{1}'".format(type(self).__name__, key)
+ )
def iterkeys(self):
for k, _ in self.iteritems():
diff --git a/tests/map_test.py b/tests/map_test.py
index <HASH>..<HASH> 100644
--- a/tests/map_test.py
+++ b/tests/map_test.py
@@ -463,7 +463,10 @@ def test_dot_access_of_non_existing_element_raises_attribute_error():
with pytest.raises(AttributeError) as error:
m1.b
- assert "'b'" in str(error.value)
+ error_message = str(error.value)
+
+ assert "'b'" in error_message
+ assert type(m1).__name__ in error_message
def test_pmap_unorderable(): | Using the class name to make AttributeError on __getattribute__ more informative for PRecords. | tobgu_pyrsistent | train | py,py |
cd4a99eb6f9d7c16b2dfe96a987493bc5d8c2823 | diff --git a/api.js b/api.js
index <HASH>..<HASH> 100644
--- a/api.js
+++ b/api.js
@@ -9,7 +9,7 @@ module.exports = function (route, dynamo) {
var ApiBuilder = require('claudia-api-builder');
var api = new ApiBuilder();
- var lib = require('./index.js');
+ var lib = require('./lib.js');
var root = '/' + route;
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,17 +1,3 @@
-var exports = module.exports = {};
+var exports = module.exports = require('./lib');
-//configuration
-exports.dynamo = require('./lib/dynamo');
-
-//operations
-exports.createTable = require('./lib/create-table');
-exports.create = require('./lib/create');
-exports.delete = require('./lib/delete');
-exports.get = require('./lib/get');
-exports.query = require('./lib/query');
-exports.scan = require('./lib/scan');
-exports.update = require('./lib/update');
-
-//help functions
-exports.querystring = require('./lib/querystring');
-exports.buildLink = require('./lib/buildlink');
+exports.api = require('./api'); | added api.js to index.js | muenzer_claudiajs-dynamodb | train | js,js |
5c14d689ea7148cf4a264e7f870f639f7560916d | diff --git a/test/cli/commands/helpers/isCommand.js b/test/cli/commands/helpers/isCommand.js
index <HASH>..<HASH> 100644
--- a/test/cli/commands/helpers/isCommand.js
+++ b/test/cli/commands/helpers/isCommand.js
@@ -26,6 +26,8 @@ describe('cli', () => {
expect(isCommand(commandsObject.meta)('docs')).toBeTruthy();
expect(isCommand(commandsObject.meta)('list')).toBeTruthy();
expect(isCommand(commandsObject.meta)('extra')).toBeFalsy();
+
+ expect(isCommand(commandsObject.meta.extra)('test')).toBeTruthy();
});
});
}); | Add function within nested commandgroup to testcase | rocjs_roc | train | js |
4c628ebb636463ee9532a8db6c042d529dd41bee | diff --git a/lib/autoversion.rb b/lib/autoversion.rb
index <HASH>..<HASH> 100644
--- a/lib/autoversion.rb
+++ b/lib/autoversion.rb
@@ -1,3 +1,3 @@
-module AutoVersion
+module Autoversion
end
\ No newline at end of file
diff --git a/lib/autoversion/version.rb b/lib/autoversion/version.rb
index <HASH>..<HASH> 100644
--- a/lib/autoversion/version.rb
+++ b/lib/autoversion/version.rb
@@ -1,3 +1,3 @@
-module AutoVersion
+module Autoversion
VERSION = '0.0.1'
end
\ No newline at end of file | Renamed the module to Autoversion without camelcase to better match the CLI bin name | jpettersson_autoversion | train | rb,rb |
798fb7371a6f9b522f654c6421ef9d154b38f95e | diff --git a/tests/TestDockerComposeTools.py b/tests/TestDockerComposeTools.py
index <HASH>..<HASH> 100644
--- a/tests/TestDockerComposeTools.py
+++ b/tests/TestDockerComposeTools.py
@@ -45,7 +45,10 @@ class TestDockerComposeTools(unittest.TestCase):
def test_f_AddDigestsToImageTags(self):
print('COMPOSE ADD DIGESTS')
DockerImageTools.PullImage('nginx')
- os.makedirs(os.path.join(TestTools.TEST_SAMPLE_FOLDER, 'output'), exist_ok=True)
+ outputFolder = os.path.join(TestTools.TEST_SAMPLE_FOLDER, 'output')
+ if not(os.path.isdir(outputFolder)):
+ os.makedirs(outputFolder)
+
DockerComposeTools.AddDigestsToImageTags([os.path.join(TestTools.TEST_SAMPLE_FOLDER, 'docker-compose.yml')], os.path.join(TestTools.TEST_SAMPLE_FOLDER, 'output/docker-compose.digests.yml'))
yamlData = YamlTools.GetYamlData([os.path.join(TestTools.TEST_SAMPLE_FOLDER, 'output/docker-compose.digests.yml')])
for service in yamlData['services']: | fixed bug in test for py <I> | DIPSAS_DockerBuildSystem | train | py |
001f76559a897e0fdece3640123c6fbc55f2528d | diff --git a/internal/protocol/server_parameters.go b/internal/protocol/server_parameters.go
index <HASH>..<HASH> 100644
--- a/internal/protocol/server_parameters.go
+++ b/internal/protocol/server_parameters.go
@@ -96,7 +96,7 @@ const DefaultHandshakeTimeout = 10 * time.Second
// RetiredConnectionIDDeleteTimeout is the time we keep closed sessions around in order to retransmit the CONNECTION_CLOSE.
// after this time all information about the old connection will be deleted
-const RetiredConnectionIDDeleteTimeout = time.Minute
+const RetiredConnectionIDDeleteTimeout = 5 * time.Second
// MinStreamFrameSize is the minimum size that has to be left in a packet, so that we add another STREAM frame.
// This avoids splitting up STREAM frames into small pieces, which has 2 advantages: | reduce the duration we keep the mapping for retired connection IDs alive
This duration only needs to cover typical reordering on the network.
5 seconds should be plenty. | lucas-clemente_quic-go | train | go |
1398e7c054c0db8679f7addbd2b669345b5547c3 | diff --git a/go/vt/vitessdriver/convert.go b/go/vt/vitessdriver/convert.go
index <HASH>..<HASH> 100644
--- a/go/vt/vitessdriver/convert.go
+++ b/go/vt/vitessdriver/convert.go
@@ -31,7 +31,7 @@ type converter struct {
func (cv *converter) ToNative(v sqltypes.Value) (interface{}, error) {
switch v.Type() {
- case sqltypes.Datetime:
+ case sqltypes.Datetime, sqltypes.Timestamp:
return DatetimeToNative(v, cv.location)
case sqltypes.Date:
return DateToNative(v, cv.location)
diff --git a/go/vt/vitessdriver/convert_test.go b/go/vt/vitessdriver/convert_test.go
index <HASH>..<HASH> 100644
--- a/go/vt/vitessdriver/convert_test.go
+++ b/go/vt/vitessdriver/convert_test.go
@@ -40,7 +40,7 @@ func TestToNative(t *testing.T) {
}, {
convert: &converter{},
in: sqltypes.TestValue(sqltypes.Timestamp, "2012-02-24 23:19:43"),
- out: []byte("2012-02-24 23:19:43"), // TIMESTAMP is not handled
+ out: time.Date(2012, 02, 24, 23, 19, 43, 0, time.UTC),
}, {
convert: &converter{},
in: sqltypes.TestValue(sqltypes.Time, "23:19:43"), | vitessdriver: convert sqltypes.Timestamp to time.Time values
When trying to do a scan into a time.Time type it will fail with error
unsupported Scan, storing driver.Value type []uint8 into type *time.Time
This should remedy this behavior and allow scans into time.Time. | vitessio_vitess | train | go,go |
Subsets and Splits