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
0de9af30f3f542b4d7edd89f114a05df14ab30c3
diff --git a/bcbio/structural/manta.py b/bcbio/structural/manta.py index <HASH>..<HASH> 100644 --- a/bcbio/structural/manta.py +++ b/bcbio/structural/manta.py @@ -8,6 +8,7 @@ import sys from bcbio import utils from bcbio.bam import ref from bcbio.distributed.transaction import file_transaction +from bcbio.heterogeneity import chromhacks from bcbio.pipeline import datadict as dd from bcbio.variation import vcfutils from bcbio.provenance import do, programs @@ -100,8 +101,9 @@ def _maybe_limit_chromosomes(data): """ std_chroms = [] prob_chroms = [] + noalt_calling = "noalt_calling" in dd.get_tools_on(data) for contig in ref.file_contigs(dd.get_ref_file(data)): - if contig.name.find(":") > 0: + if contig.name.find(":") > 0 or (noalt_calling and not chromhacks.is_nonalt(contig.name)): prob_chroms.append(contig.name) else: std_chroms.append(contig.name)
manta: support noalt_calling
bcbio_bcbio-nextgen
train
py
87440bba870b2432dd6d322cf9d39fe3293794eb
diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -429,9 +429,9 @@ class CakeResponse { } /** - * Sets the cookies that have been added via static method CakeResponse::addCookie() - * before any other output is sent to the client. - * Will set the cookies in the order they have been set. + * Sets the cookies that have been added via CakeResponse::cookie() before any + * other output is sent to the client. Will set the cookies in the order they + * have been set. * * @return void */
Fixed docblock. Closes #<I>
cakephp_cakephp
train
php
577c442aaebc9b00eb0c01942d0637f58d5db744
diff --git a/lago/prefix.py b/lago/prefix.py index <HASH>..<HASH> 100644 --- a/lago/prefix.py +++ b/lago/prefix.py @@ -992,6 +992,7 @@ class Prefix(object): host.wait_for_ssh() for script in deploy_scripts: + script = os.path.expanduser(os.path.expandvars(script)) with LogTask('Run script %s' % os.path.basename(script)): ret, out, err = host.ssh_script(script, show_output=False)
Expand vars and user contraptions on deploy scripts
lago-project_lago
train
py
c7a56329d71ccf736c7438197cdffb037dd4b745
diff --git a/pyodesys/symbolic.py b/pyodesys/symbolic.py index <HASH>..<HASH> 100644 --- a/pyodesys/symbolic.py +++ b/pyodesys/symbolic.py @@ -144,8 +144,9 @@ class SymbolicSys(ODESys): do not compute jacobian-vector product if instance of iterable of (symbol, expression) pairs: user provided expressions for the jacobian vector product, where each symbol - is an element of the vector being left-multiplied. Othere than these symbols, - expressions may only involve the other free symbols in :attr`dep` and :attr`params`. + is an element of the vector being left-multiplied. Other than these symbols, + expressions may only involve the other free symbols in :attr`dep` and + :attr`params`. dfdx : iterable of expressions Derivatives of :attr:`exprs` with respect to :attr`indep`. first_step_expr : expression
Fix typo in jtimes docstring
bjodah_pyodesys
train
py
db1d3ae1f6b8281f7bd1bd290116408934ae5f72
diff --git a/src/Models/User.php b/src/Models/User.php index <HASH>..<HASH> 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -7,6 +7,7 @@ use Illuminate\Auth\Authenticatable; use Illuminate\Auth\Passwords\CanResetPassword; use Illuminate\Auth\Notifications\ResetPassword; use Illuminate\Contracts\Auth\Authenticatable as IAuthenticatable; +use Illuminate\Contracts\Auth\Access\Authorizable as IAuthorizable; use Illuminate\Contracts\Auth\CanResetPassword as ICanResetPassword; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\Access\Authorizable; @@ -29,7 +30,7 @@ use Saritasa\Database\Eloquent\Entity; * @property int $role_id * @property-read string $full_name */ -class User extends Entity implements IAuthenticatable, ICanResetPassword +class User extends Entity implements IAuthenticatable, ICanResetPassword, IAuthorizable { use Authenticatable, CanResetPassword, SoftDeletes, Notifiable, Authorizable;
User utilizes Authorizable contract
Saritasa_php-eloquent-custom
train
php
536fe1cd92f2c0a2f76eb192f537f3a6a46ce21b
diff --git a/ext/byebug/extconf.rb b/ext/byebug/extconf.rb index <HASH>..<HASH> 100644 --- a/ext/byebug/extconf.rb +++ b/ext/byebug/extconf.rb @@ -1,8 +1,3 @@ -if RUBY_VERSION < '2.0' - STDERR.print("Ruby version is too old\n") - exit(1) -end - require 'mkmf' makefile_config = RbConfig::MAKEFILE_CONFIG
Remove unnecessary check Ruby version is already enforced in the gemspec.
deivid-rodriguez_byebug
train
rb
01cb876e9826d1a456d1bdf3718a434ff47160d2
diff --git a/api/src/main/resources/org/commonjava/aprox/stats/AProxVersioning.java b/api/src/main/resources/org/commonjava/aprox/stats/AProxVersioning.java index <HASH>..<HASH> 100644 --- a/api/src/main/resources/org/commonjava/aprox/stats/AProxVersioning.java +++ b/api/src/main/resources/org/commonjava/aprox/stats/AProxVersioning.java @@ -1,10 +1,10 @@ package org.commonjava.aprox.stats; -import javax.enterprise.context.ApplicationScoped; +import javax.inject.Singleton; import org.commonjava.web.json.ser.JsonAdapters; -@ApplicationScoped +@Singleton @JsonAdapters( AProxVersioningAdapter.class ) public class AProxVersioning {
make versioning @Singleton to prevent proxying
Commonjava_indy
train
java
35e1ba57785734789357f03a738e4d65152bb775
diff --git a/salt/cli/__init__.py b/salt/cli/__init__.py index <HASH>..<HASH> 100644 --- a/salt/cli/__init__.py +++ b/salt/cli/__init__.py @@ -31,12 +31,20 @@ class SaltCMD(object): type=int, dest='timeout', help='Set the return timeout for batch jobs') + parser.add_option('-E', + '--pcre', + default=False, + dest='pcre', + action='store_true' + help='Instead of using shell globs to evaluate the target'\ + + ' servers, use pcre regular expressions') options, args = parser.parse_args() opts = {} opts['timeout'] = options.timeout + opts['pcre'] = options.pcre opts['tgt'] = args[0] opts['fun'] = args[1] opts['arg'] = args[2:]
Add regex support call to the command line
saltstack_salt
train
py
90b667f1bbbcedc56c0754f9f5ebbb12b9e37044
diff --git a/app/src/Bolt/Application.php b/app/src/Bolt/Application.php index <HASH>..<HASH> 100644 --- a/app/src/Bolt/Application.php +++ b/app/src/Bolt/Application.php @@ -17,7 +17,7 @@ class Application extends Silex\Application public function __construct(array $values = array()) { $values['bolt_version'] = '1.6.0'; - $values['bolt_name'] = 'dev'; + $values['bolt_name'] = 'beta'; parent::__construct($values);
Bumping version to <I> beta
bolt_bolt
train
php
944f6bec95118540250d90c9ab321962b610b963
diff --git a/flask_appconfig/__init__.py b/flask_appconfig/__init__.py index <HASH>..<HASH> 100644 --- a/flask_appconfig/__init__.py +++ b/flask_appconfig/__init__.py @@ -11,7 +11,6 @@ class AppConfig(object): def __init__(self, app=None, *args, **kwargs): if app: self.init_app(app, *args, **kwargs) - return self def init_app(self, app, configfile=None, envvar=True, default_settings=True,
Removed return self from constructor.
mbr_flask-appconfig
train
py
09f614113d5a46c47ddf247fce1de02f8ecdcba4
diff --git a/structr-core/src/main/java/org/structr/core/parser/Functions.java b/structr-core/src/main/java/org/structr/core/parser/Functions.java index <HASH>..<HASH> 100644 --- a/structr-core/src/main/java/org/structr/core/parser/Functions.java +++ b/structr-core/src/main/java/org/structr/core/parser/Functions.java @@ -2787,6 +2787,12 @@ public class Functions { protected static boolean valueEquals(final Object obj1, final Object obj2) { + if (obj1 instanceof Enum || obj2 instanceof Enum) { + + return obj1.toString().equals(obj2.toString()); + + } + if (obj1 instanceof Number && obj2 instanceof Number) { return ((Number)obj1).doubleValue() == ((Number)obj2).doubleValue();
Fixed test for equal() function with enums
structr_structr
train
java
dcce7cac1fd850c25bfa4579c6f22bce1d3a1311
diff --git a/lib/Router.php b/lib/Router.php index <HASH>..<HASH> 100644 --- a/lib/Router.php +++ b/lib/Router.php @@ -119,7 +119,7 @@ class Router implements \Coast\App\Access, \Coast\App\Executable if (isset($this->_suffix)) { $path = "{$path}/{$this->_suffix}"; } - $parts = explode('/', ltrim($path, '/')); + $parts = explode('/', trim($path, '/')); $names = []; $stack = []; foreach ($parts as $i => $part) { @@ -169,6 +169,7 @@ class Router implements \Coast\App\Access, \Coast\App\Executable public function match($method, $path) { $method = strtoupper($method); + $path = trim($path, '/'); foreach ($this->_routes as $name => $route) { if (!in_array($method, $route['methods'])) { continue;
Tweak slash handing in router
jacksleight_coast
train
php
b7fa6f411e082920e4a5010f742f4e95c5a0fc26
diff --git a/lib/logger.js b/lib/logger.js index <HASH>..<HASH> 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -15,7 +15,7 @@ module.exports = { options = options || {}; if (winston.loggers.has(name)) { - throw new Error('Logger with name ' + name + ' already exists!'); + return winston.loggers.get(name); } var logPath = path.join(options.logDir || '', name + '.log');
Ignore duplicated log configurations. This will make it much easier for sitespeed to be able to run multiple browsertime sessions in a row.
sitespeedio_browsertime
train
js
621388e3bed00363beb57b96990e4da69bb7236f
diff --git a/src/Composer/Command/InstallCommand.php b/src/Composer/Command/InstallCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/InstallCommand.php +++ b/src/Composer/Command/InstallCommand.php @@ -208,7 +208,7 @@ EOT // force update $newPackage = $composer->getRepositoryManager()->findPackage($package->getName(), $package->getVersion()); - if ($newPackage->getSourceReference() !== $package->getSourceReference()) { + if ($newPackage && $newPackage->getSourceReference() !== $package->getSourceReference()) { $operations[] = new UpdateOperation($package, $newPackage); } }
Fix warning when no package to update is found
mothership-ec_composer
train
php
15735f1f2ca43a9f10816f6049ff4db3e4597a2e
diff --git a/jodd-json/src/test/java/jodd/json/JSONSerializationTest.java b/jodd-json/src/test/java/jodd/json/JSONSerializationTest.java index <HASH>..<HASH> 100644 --- a/jodd-json/src/test/java/jodd/json/JSONSerializationTest.java +++ b/jodd-json/src/test/java/jodd/json/JSONSerializationTest.java @@ -710,6 +710,19 @@ class JSONSerializationTest { assertEquals(expected_json, actual_json); } + @Test + void testSerializeLongArray() throws Exception { + final long[] input = new long[]{0L, -0L, 1L, -1L, 578437435345345L, -345357348234782L}; + + final String expected_json = "[0,0,1,-1,578437435345345,-345357348234782]"; + + final String actual_json = new JsonSerializer().serialize(input); + + // asserts + assertNotNull(actual_json); + assertEquals(expected_json, actual_json); + } + // ---------------------------------------------------------------- custom asserts
tests for LongArraySerializer added
oblac_jodd
train
java
2cba235a3247bc481d08473f60aac5e3951ddf10
diff --git a/src/test/java/com/github/ansell/csv/stream/CSVStreamExceptionTest.java b/src/test/java/com/github/ansell/csv/stream/CSVStreamExceptionTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/github/ansell/csv/stream/CSVStreamExceptionTest.java +++ b/src/test/java/com/github/ansell/csv/stream/CSVStreamExceptionTest.java @@ -29,6 +29,8 @@ public class CSVStreamExceptionTest { * * @param clazz * utility class to verify. + * @see <a href="http://stackoverflow.com/a/10872497/638674">Source at + * StackOverflow</a> */ public static void assertUtilityClassWellDefined(final Class<?> clazz) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
Add source for test method from StackOverflow
ansell_csvstream
train
java
0e80e40216f76069308bb77319ed0e9ee993e66a
diff --git a/rules/bodySelectors.js b/rules/bodySelectors.js index <HASH>..<HASH> 100644 --- a/rules/bodySelectors.js +++ b/rules/bodySelectors.js @@ -34,8 +34,8 @@ function rule(analyzer) { if ((firstTag === 'html') && (bodyIndex === 1) && (isDescendantCombinator || isShortExpression)) { isRedundant = false; } - // matches "body .foo", but not "body > .bar' nor "body.foo .bar" - else if ((bodyIndex === 0) && isDescendantCombinator && isShortExpression) { + // matches "body > .bar" (issue #82) + else if ((bodyIndex === 0) && isDescendantCombinator) { isRedundant = false; } // matches "body.foo ul li a" diff --git a/test/rules/bodySelectors.js b/test/rules/bodySelectors.js index <HASH>..<HASH> 100644 --- a/test/rules/bodySelectors.js +++ b/test/rules/bodySelectors.js @@ -24,6 +24,12 @@ exports.tests = [ } }, { + css: 'body > h1 .foo {}', + metrics: { + redundantBodySelectors: 0 + } + }, + { css: 'html > body #foo .bar {}', metrics: { redundantBodySelectors: 0
Do not treat "body > .foo .bar" as redundant Resolves #<I>
macbre_analyze-css
train
js,js
af8b435b15c3809669d8440eafee73863027bc73
diff --git a/test/unit/Connection.test.js b/test/unit/Connection.test.js index <HASH>..<HASH> 100644 --- a/test/unit/Connection.test.js +++ b/test/unit/Connection.test.js @@ -1,3 +1,4 @@ +import { Server } from 'ws' import { wait } from 'streamr-test-utils' import Debug from 'debug' @@ -19,12 +20,30 @@ describe('Connection', () => { let onDone let onError let onMessage + let wss + let port let expectErrors = 0 // check no errors by default + beforeAll((done) => { + wss = new Server({ + port: 0, + }).once('listening', () => { + port = wss.address().port + done() + }) + + wss.on('connection', (ws) => { + ws.on('message', (msg) => ws.send(msg)) + }) + }) + + afterAll((done) => { + wss.close(done) + }) beforeEach(() => { s = new Connection({ - url: 'wss://echo.websocket.org/', + url: `ws://localhost:${port}/`, maxRetries: 2 })
Use local websocket server in connection unit tests.
streamr-dev_streamr-client-javascript
train
js
7e8f922047e5c8b8615b815dd7ac947b539bc3e5
diff --git a/lib/dmllib.php b/lib/dmllib.php index <HASH>..<HASH> 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -629,9 +629,15 @@ function get_recordset_sql($sql, $limitfrom=null, $limitnum=null) { */ function recordset_to_array($rs) { if ($rs && $rs->RecordCount() > 0) { + /// First of all, we are going to get the name of the first column + /// to introduce it back after transforming the recordset to assoc array + /// See http://docs.moodle.org/en/XMLDB_Problems, fetch mode problem. + $firstcolumn = $rs->FetchField(0); + /// Get the whole associative array if ($records = $rs->GetAssoc(true)) { foreach ($records as $key => $record) { - $objects[$key] = (object) $record; + $record[$firstcolumn->name] = $key;/// Re-add the assoc field + $objects[$key] = (object) $record; /// To object } return $objects; } else {
Adding back the first column in the recordset, that is out after GetAssoc(), in order to: - Don't get our first named column under some drivers. - Be able to migrate to ADODB_FETCH_ASSOC soon. For more info, <URL> section.
moodle_moodle
train
php
0d844a4af701cfa46ac226e33a96b5939f11fe9f
diff --git a/app/models/blogue/post.rb b/app/models/blogue/post.rb index <HASH>..<HASH> 100644 --- a/app/models/blogue/post.rb +++ b/app/models/blogue/post.rb @@ -1,5 +1,10 @@ +require 'active_model' + module Blogue class Post + extend ::ActiveModel::Naming + include ::ActiveModel::Conversion + class << self def find(id) all.find{ |p| p.id == id } @@ -48,6 +53,10 @@ module Blogue @path = path end + def persisted? + true + end + def id self.class.extract_post_id(path) end
Modelize Blogue::Post for use with Rails helpers
maxim_blogue
train
rb
99551052d1d15a943802410bdd58d68e11454148
diff --git a/dynaconf/cli.py b/dynaconf/cli.py index <HASH>..<HASH> 100644 --- a/dynaconf/cli.py +++ b/dynaconf/cli.py @@ -235,7 +235,7 @@ def init(fileformat, path, env, _vars, _secrets, wg, y, django): `ENV_FOR_DYNACONF=production` just pass --env=production and then .env will also be created and the env defined to production. """ - click.echo("Cofiguring your Dynaconf environment") + click.echo("Configuring your Dynaconf environment") env = env or settings.current_env.lower()
Fix typo in CLI init (#<I>)
rochacbruno_dynaconf
train
py
4903339cc62dceb2136806698ab744acbe1a5f00
diff --git a/castWebApi.js b/castWebApi.js index <HASH>..<HASH> 100644 --- a/castWebApi.js +++ b/castWebApi.js @@ -30,7 +30,7 @@ interpretArguments(); if (!windows) { startApi(); } else { - console.log( process.argv[1].split("castWebApi.js")[0] ); + console.log( process.argv[1].split("\bin\cast-web-api")[0] ); } function startApi() {
Changed --windows for global install path
vervallsweg_cast-web-api
train
js
e0395e965ac148467d35e1376f8905a56ce31052
diff --git a/cherrypy/lib/profiler.py b/cherrypy/lib/profiler.py index <HASH>..<HASH> 100644 --- a/cherrypy/lib/profiler.py +++ b/cherrypy/lib/profiler.py @@ -52,9 +52,8 @@ except ImportError: pstats = None import warnings msg = ("Your installation of Python does not have a profile module. " - "If you're on Debian, you can apt-get python2.4-profiler from " - "non-free in a separate step. See http://www.cherrypy.org/wiki/" - "ProfilingOnDebian for details.") + "If you're on Debian, try `sudo apt-get install python-profiler`. " + "See http://www.cherrypy.org/wiki/ProfilingOnDebian for details.") warnings.warn(msg) import os, os.path
Fixed outdated warning for profiler on Debian.
cherrypy_cheroot
train
py
2b1513356d387cb35fc2403fa0976817d75eb561
diff --git a/src/components/contextmenu/ContextMenu.js b/src/components/contextmenu/ContextMenu.js index <HASH>..<HASH> 100644 --- a/src/components/contextmenu/ContextMenu.js +++ b/src/components/contextmenu/ContextMenu.js @@ -286,7 +286,7 @@ export class ContextMenu extends Component { } componentDidUpdate(prevProps, prevState) { - if (this.state.visible && prevState.reshow !== this.state.reshow) { + if (this.state.visible && (prevState.reshow !== this.state.reshow || prevProps.model !== this.props.model)) { let event = this.currentEvent; this.setState({ visible: false,
Fixed #<I> - Lazy loaded menu overflowing the page
primefaces_primereact
train
js
5cbe0650ae3a863767371ec9c27955dcb855a93c
diff --git a/openy_lily/scripts/ymca.js b/openy_lily/scripts/ymca.js index <HASH>..<HASH> 100644 --- a/openy_lily/scripts/ymca.js +++ b/openy_lily/scripts/ymca.js @@ -183,7 +183,7 @@ }); $('.try-the-y-toggle').not('.active').on('click', function () { $('html, body').animate({ - scrollTop: $("#webform-submission-one-week-pass-paragraph-191-form").offset().top - 150 + scrollTop: $("#membership-page .webform form").offset().top - 150 }, 500); }); });
[YLI-<I>]: Automatically open membership webform and scroll to it if we have hash in URL.
ymcatwincities_openy
train
js
c607a6587659acf6efbe2286bd273b146553b26f
diff --git a/tests/WidgetTest/ValidatorTest.php b/tests/WidgetTest/ValidatorTest.php index <HASH>..<HASH> 100644 --- a/tests/WidgetTest/ValidatorTest.php +++ b/tests/WidgetTest/ValidatorTest.php @@ -727,7 +727,7 @@ class ValidatorTest extends TestCase public function testIntAsMessage() { - $validate = $this->validate(array( + $validator = $this->validate(array( 'data' => array( 'email' => 'twinhuang', ), @@ -740,6 +740,20 @@ class ValidatorTest extends TestCase 'email' => 123, ) )); - $this->assertEquals(123, $validate->getFirstMessage()); + $this->assertEquals(123, $validator->getFirstMessage()); + } + + public function testNullRules() + { + $validator = $this->validate(array( + 'rules' => null + )); + $this->assertTrue($validator->isValid()); + + $validator = $this->validate(array( + 'rules' => null, + 'messages' => null + )); + $this->assertTrue($validator->isValid()); } }
added test for null as rules and messages value
twinh_wei
train
php
d0ed8875b094e17ea25541f14d53d90508b2352f
diff --git a/src/Api/Forms/Form.php b/src/Api/Forms/Form.php index <HASH>..<HASH> 100644 --- a/src/Api/Forms/Form.php +++ b/src/Api/Forms/Form.php @@ -4,8 +4,14 @@ namespace seregazhuk\PinterestBot\Api\Forms; abstract class Form { + /** + * @return array + */ abstract protected function getData(); + /** + * @return array + */ public function toArray(){ return array_filter($this->getData(), function($item){ return !is_null($item);
upd: forms refactoring
seregazhuk_php-pinterest-bot
train
php
e4cb7b80d59a4154327ea96f4a040ef18ef90c5b
diff --git a/rpc/handler.go b/rpc/handler.go index <HASH>..<HASH> 100644 --- a/rpc/handler.go +++ b/rpc/handler.go @@ -151,8 +151,8 @@ func (h *handler) handleMsg(msg *jsonrpcMessage) { // call goroutines to shut down. func (h *handler) close(err error, inflightReq *requestOp) { h.cancelAllRequests(err, inflightReq) - h.cancelRoot() h.callWG.Wait() + h.cancelRoot() h.cancelServerSubscriptions(err) }
rpc: cancel root context after all requests are served (#<I>)
ethereum_go-ethereum
train
go
ff445f13aafe3946e1b8aedc1bf216f147b5cb98
diff --git a/packages/tiptap-extensions/src/nodes/TodoItem.js b/packages/tiptap-extensions/src/nodes/TodoItem.js index <HASH>..<HASH> 100644 --- a/packages/tiptap-extensions/src/nodes/TodoItem.js +++ b/packages/tiptap-extensions/src/nodes/TodoItem.js @@ -34,7 +34,7 @@ export default class TodoItem extends Node { }, }, draggable: true, - content: 'paragraph block*', + content: 'paragraph*', toDOM: node => { const { done } = node.attrs
no nested blocks in TodoItem
scrumpy_tiptap
train
js
2730e3619a76a25b0197dccfb9b6989bbb3437f3
diff --git a/src/toil/batchSystems/mesos/executor.py b/src/toil/batchSystems/mesos/executor.py index <HASH>..<HASH> 100755 --- a/src/toil/batchSystems/mesos/executor.py +++ b/src/toil/batchSystems/mesos/executor.py @@ -117,17 +117,17 @@ class MesosExecutor(mesos.interface.Executor): finally: del self.runningTasks[task.task_id.value] - def runJob(batchjob): + def runJob(job): """ - :type batchjob: toil.batchSystems.mesos.ToilJob + :type job: toil.batchSystems.mesos.ToilJob :rtype: subprocess.Popen """ - if batchjob.userScript: - batchjob.userScript.register() - log.debug("Invoking command: '%s'", batchjob.command) + if job.userScript: + job.userScript.register() + log.debug("Invoking command: '%s'", job.command) with self.popenLock: - return subprocess.Popen(batchjob.command, shell=True) + return subprocess.Popen(job.command, shell=True) def sendUpdate(taskState, message=''): log.debug("Sending status update ...")
Renamed the only occurrence of batchjob in a parameter docstring Such that we can now globally replace batchjob with job in all comments
DataBiosphere_toil
train
py
f433fc255069847cdc9f6ece79dc82ba641b3408
diff --git a/lib/fast-tcpn/version.rb b/lib/fast-tcpn/version.rb index <HASH>..<HASH> 100644 --- a/lib/fast-tcpn/version.rb +++ b/lib/fast-tcpn/version.rb @@ -1,3 +1,3 @@ module FastTCPN - VERSION = '0.0.4' + VERSION = '0.0.4.pre1' end
version bump s Please enter the commit message for your changes. Lines starting
wrzasa_fast-tcpn
train
rb
548a03ae2c3049ff63d46ab3f71a8954a47525fb
diff --git a/cli/lib/cli/commands/job.rb b/cli/lib/cli/commands/job.rb index <HASH>..<HASH> 100644 --- a/cli/lib/cli/commands/job.rb +++ b/cli/lib/cli/commands/job.rb @@ -17,9 +17,9 @@ module Bosh::Cli::Command say "create\t#{job_dir}" FileUtils.mkdir_p(job_dir) - config_dir = File.join(job_dir, "config") - say "create\t#{config_dir}" - FileUtils.mkdir_p(config_dir) + templates_dir = File.join(job_dir, "templates") + say "create\t#{templates_dir}" + FileUtils.mkdir_p(templates_dir) spec_file = File.join(job_dir, "spec") say "create\t#{spec_file}"
Renamed 'config' to 'templates' in job generator
cloudfoundry_bosh
train
rb
62e57484b59dda70930520828e5f35b26d404cbf
diff --git a/did/plugins/jira.py b/did/plugins/jira.py index <HASH>..<HASH> 100644 --- a/did/plugins/jira.py +++ b/did/plugins/jira.py @@ -252,8 +252,14 @@ class JiraStats(StatsGroup): headers = { "Content-type": "application/json", "Accept": "application/json"} - self._session.get(self.auth_url, headers=headers, data=data) + response = self._session.get( + self.auth_url, headers=headers, data=data) else: gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=DISABLED) - self._session.get(self.auth_url, auth=gssapi_auth) + response = self._session.get(self.auth_url, auth=gssapi_auth) + try: + response.raise_for_status() + except requests.exceptions.HTTPError as error: + log.error(error) + raise ReportError('Jira authentication failed.') return self._session
Handle authentication errors in the Jira plugin This should also fix BZ#<I>.
psss_did
train
py
aefe5c93e4af2b1e0011892d66b74f574c12baa8
diff --git a/src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java b/src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java +++ b/src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java @@ -26,12 +26,14 @@ import com.google.gwt.dom.client.Element; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.Event; import org.gwtbootstrap3.client.ui.TextBox; +import org.gwtbootstrap3.extras.typeahead.client.base.CollectionDataset; import org.gwtbootstrap3.extras.typeahead.client.base.Dataset; import org.gwtbootstrap3.extras.typeahead.client.base.Suggestion; import org.gwtbootstrap3.extras.typeahead.client.events.*; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; /** * Twitter typeahead.js @@ -47,6 +49,7 @@ public class Typeahead<T> extends TextBox { private int minLength = 1; public Typeahead() { + setDatasets(new CollectionDataset(Collections.emptyList())); } /**
Give Typeahead a default empty dataset Currently Typeahead's dataset is null by default constructor, which will cause exceptions when it's declared in XML. Fixed by adding a default empty dataset.
gwtbootstrap3_gwtbootstrap3-extras
train
java
6e7fddfae76c1a6bcffa048fe2fb41586fa05f8a
diff --git a/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php b/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php +++ b/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php @@ -59,20 +59,6 @@ class MemcachedCacheTest extends CacheTest $this->assertTrue($cache->contains('key'), 'Memcache provider should support TTL > 30 days'); } - /** - * {@inheritDoc} - * - * @dataProvider falseCastedValuesProvider - */ - public function testFalseCastedValues($value) - { - if (false === $value) { - $this->markTestIncomplete('Memcached currently doesn\'t support saving `false` values. '); - } - - parent::testFalseCastedValues($value); - } - public function testGetMemcachedReturnsInstanceOfMemcached() { $this->assertInstanceOf('Memcached', $this->_getCacheDriver()->getMemcached());
#<I> - Removing duplicated test (due to merge conflict)
doctrine_cache
train
php
f1a543074a8d26c811b9db01bf39468a5456196d
diff --git a/pyrem/task.py b/pyrem/task.py index <HASH>..<HASH> 100644 --- a/pyrem/task.py +++ b/pyrem/task.py @@ -255,6 +255,9 @@ class RemoteTask(SubprocessTask): ``return_values[\'retcode\']`` will contain the return code of the ssh command, which should currently be ignored. + Attributes: + host (str): The name of the host the task will run on. + Args: host (str): The host to run on. @@ -270,7 +273,7 @@ class RemoteTask(SubprocessTask): def __init__(self, host, command, quiet=False, return_output=False, kill_remote=True): assert isinstance(command, list) - self._host = host + self.host = host # TODO: disallow changing this attribute self._kill_remote = kill_remote if kill_remote: @@ -299,7 +302,7 @@ class RemoteTask(SubprocessTask): # Silence the kill_proc to prevent messages about already killed procs if self._kill_remote: kill_proc = Popen( - ['ssh', self._host, 'kill -9 `cat %s` ; rm %s' % + ['ssh', self.host, 'kill -9 `cat %s` ; rm %s' % (self._tmp_file_name, self._tmp_file_name)], stdout=self._DEVNULL, stderr=self._DEVNULL, stdin=self._DEVNULL) kill_proc.wait()
Changing host of RemoteTask to attribute
emichael_PyREM
train
py
81c1ffd36c1218e762e6d95f9733209f7bbf48b7
diff --git a/taxtastic/subcommands/reroot.py b/taxtastic/subcommands/reroot.py index <HASH>..<HASH> 100644 --- a/taxtastic/subcommands/reroot.py +++ b/taxtastic/subcommands/reroot.py @@ -1,10 +1,10 @@ """Reroots a reference package""" +import logging from Bio import Phylo from taxtastic import algotax, refpkg -import logging log = logging.getLogger(__name__) def build_parser(parser): @@ -33,6 +33,6 @@ def action(args): with rp.resource('tree_file', 'w') as fobj: Phylo.write(tree, fobj, 'newick', branchlengths_only=True, - format_branchlength=lambda bl: '%0.6f' % (bl,)) + format_branch_length='%0.6f') rp.rehash('tree_file') rp.save()
Update arguments to Phylo.write As of BioPython commit decd2a<I>fa<I>cc<I>aaaf4c<I>d3af<I>c<I>fa1d9: * NewickIO argument format_branchlength -> format_branch_length * Takes format string, rather than callback
fhcrc_taxtastic
train
py
4502019340a602c90b7b3790c0a1f33f6e0d15a1
diff --git a/salt/client/__init__.py b/salt/client/__init__.py index <HASH>..<HASH> 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -791,17 +791,11 @@ class LocalClient(object): if event is None: event = self.event while True: - try: - raw = event.get_event_noblock() - if raw and raw.get('tag', '').startswith(jid): - yield raw - else: - yield None - except zmq.ZMQError as ex: - if ex.errno == errno.EAGAIN or ex.errno == errno.EINTR: - yield None - else: - raise + raw = event.get_event_noblock() + if raw and raw.get('tag', '').startswith(jid): + yield raw + else: + yield None def get_iter_returns( self,
The exception is properly caught inthe event system now
saltstack_salt
train
py
61d8bc7771840d0734a727d24a72b99a1b49dd2d
diff --git a/Controller/Api/MediaController.php b/Controller/Api/MediaController.php index <HASH>..<HASH> 100644 --- a/Controller/Api/MediaController.php +++ b/Controller/Api/MediaController.php @@ -305,6 +305,8 @@ class MediaController $mediaProvider = $this->mediaPool->getProvider($provider); } catch (\RuntimeException $ex) { throw new NotFoundHttpException($ex->getMessage(), $ex); + } catch (\InvalidArgumentException $ex) { + throw new NotFoundHttpException($ex->getMessage(), $ex); } return $this->handleWriteMedium($request, $medium, $mediaProvider);
fix exception (features from sandbox)
sonata-project_SonataMediaBundle
train
php
6fdb236af5481dd5730642aee1c7a0a25af1283b
diff --git a/src/Blueprint.php b/src/Blueprint.php index <HASH>..<HASH> 100644 --- a/src/Blueprint.php +++ b/src/Blueprint.php @@ -351,5 +351,7 @@ abstract class Blueprint $this->activeTransformations = []; $this->insert_records = []; $this->set = []; + $queryclass = get_class($this->query); + $this->query = new $queryclass(); } } \ No newline at end of file
Added fix to query resetting
sypherlev_blueprint
train
php
6aabde37d63ec63d78eb781f0fab5d22723a69e9
diff --git a/datastore-mongodb/src/main/java/org/opencb/datastore/mongodb/MongoDBNativeQuery.java b/datastore-mongodb/src/main/java/org/opencb/datastore/mongodb/MongoDBNativeQuery.java index <HASH>..<HASH> 100644 --- a/datastore-mongodb/src/main/java/org/opencb/datastore/mongodb/MongoDBNativeQuery.java +++ b/datastore-mongodb/src/main/java/org/opencb/datastore/mongodb/MongoDBNativeQuery.java @@ -145,12 +145,17 @@ public class MongoDBNativeQuery { BulkWriteRequestBuilder builder = bulk.find(query); if (upsert) { - builder.upsert(); - } - if (multi) { - builder.update(update); + if (multi) { + builder.upsert().update(update); + } else { + builder.upsert().updateOne(update); + } } else { - builder.updateOne(update); + if (multi) { + builder.update(update); + } else { + builder.updateOne(update); + } } } return bulk.execute();
mongodb: Bugfixed, bulk insert was ignoring upsert option.
opencb_datastore
train
java
35d8e6e9dcb44d54312cb95ddc2eef0e1f808dbf
diff --git a/feedjack/views.py b/feedjack/views.py index <HASH>..<HASH> 100644 --- a/feedjack/views.py +++ b/feedjack/views.py @@ -211,16 +211,16 @@ def ajax_store(request): content_type='application/json': _ajax_headers(type( 'true' if content is None else content, content_type=content_type )) - if not request.is_ajax()\ - or request.method not in ('GET', 'POST', 'HEAD'): - return _ajax_headers(HttpResponseBadRequest( - 'Ajax/json-only backend for tracked get/post reqz' )) - - if request.method == 'HEAD': # just echo request tracking header + if request.method in ('HEAD', 'OPTIONS'): response = build_response('') - response['X-Feedjack-Tracking'] = fj_track_header + if request.method == 'HEAD': response['X-Feedjack-Tracking'] = fj_track_header + if request.method == 'OPTIONS': response['Access-Control-Allow-Origin'] = '*' return response + if not request.is_ajax() or request.method not in ('GET', 'POST'): + return _ajax_headers(HttpResponseBadRequest( + 'Ajax/json-only backend for tracked get/post reqz' )) + response = None storage_key = '{site_key}__{track_header}' if not fj_track_header:
views.ajax_store: added handling of OPTIONS requests that browser issues to check cross-domain access
mk-fg_feedjack
train
py
919618e5aa6edcede9872c71c3ff164e3cf66cea
diff --git a/filesystem/Filesystem.php b/filesystem/Filesystem.php index <HASH>..<HASH> 100644 --- a/filesystem/Filesystem.php +++ b/filesystem/Filesystem.php @@ -152,7 +152,7 @@ class Filesystem extends Object { // Update the image tracking of all pages if($syncLinkTracking) { if(class_exists('SiteTree')) { - $origDisableSubsiteFilter = Subsite::$disable_subsite_filter; + if(class_exists('Subsite')) $origDisableSubsiteFilter = Subsite::$disable_subsite_filter; if(class_exists('Subsite')) Subsite::$disable_subsite_filter = true; foreach(DataObject::get("SiteTree") as $page) { // syncLinkTracking is called by SiteTree::onBeforeWrite().
BUGFIX Checking for existence of Subsite correctly in Filesystem::sync()
silverstripe_silverstripe-framework
train
php
e70dc879445cbb253a0ba82747fababb6a13c1e5
diff --git a/pom.rb b/pom.rb index <HASH>..<HASH> 100644 --- a/pom.rb +++ b/pom.rb @@ -70,7 +70,7 @@ project 'rp5extras', 'https://github.com/ruby-processing/JRubyArt' do plugin( :jar, '2.6', archive: { - 'manifestFile' => 'MANIFEST.MF' + manifestFile: 'MANIFEST.MF' # camel case reqd } ) end
use more modern hash form even for manifest
ruby-processing_JRubyArt
train
rb
d9125516d8e9bef1e524ebc8b01621be9ce3a9bc
diff --git a/lib/heroku/client.rb b/lib/heroku/client.rb index <HASH>..<HASH> 100644 --- a/lib/heroku/client.rb +++ b/lib/heroku/client.rb @@ -488,11 +488,11 @@ Check the output of "heroku ps" and "heroku logs" for more information. end def releases(app) - json_decode get("/apps/#{app}/releases").to_s + json_decode get("/apps/#{app}/releases", :accept => :json).to_s end def release(app, release) - json_decode get("/apps/#{app}/releases/#{release}").to_s + json_decode get("/apps/#{app}/releases/#{release}", :accept => :json).to_s end def rollback(app, release=nil)
make releases apis accept json
heroku_legacy-cli
train
rb
73a21670488810fa168c113e1a6823fd46e6b01f
diff --git a/director/lib/director/jobs/update_deployment.rb b/director/lib/director/jobs/update_deployment.rb index <HASH>..<HASH> 100644 --- a/director/lib/director/jobs/update_deployment.rb +++ b/director/lib/director/jobs/update_deployment.rb @@ -171,11 +171,13 @@ module Bosh::Director update deployment.db.transaction do + deployment.remove_all_releases deployment.remove_all_release_versions # Now we know that deployment has succeeded and can remove # previous partial deployments release version references # to be able to delete these release versions later. @deployment_plan.releases.each do |release| + deployment.add_release(release.release) deployment.add_release_version(release.release_version) end end
Delete release depenedency after deployment. Change-Id: I6a<I>d<I>aec<I>b<I>a7c2fbff5c<I>efb
cloudfoundry_bosh
train
rb
2432577cd330fb8542cb72ebcadde4ede4fbcd1c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ module.exports = function (gulp, opts) { var matches = str.match(/^(\.?\/?node_modules\/.bin\/)?(.*)$/) return matches[1] ? matches[2] : str }, - scripts = require(path.join(process.cwd(), 'package.json')).scripts, + scripts = require(path.join(process.cwd(), 'package.json')).scripts || {}, command = (scripts.test && o.withoutNpmRun) ? scripts.test : 'npm test', run = require('childish-process')({ childish: {
don't assume that scripts exist in package.json
gulpsome_gulp-npm-test
train
js
95bb50f6e3cca2677094d838ca0ec31f064806a0
diff --git a/src/lib/API/ContentData/FieldTypeData/SelectionDataProvider.php b/src/lib/API/ContentData/FieldTypeData/SelectionDataProvider.php index <HASH>..<HASH> 100644 --- a/src/lib/API/ContentData/FieldTypeData/SelectionDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/SelectionDataProvider.php @@ -31,6 +31,9 @@ class SelectionDataProvider implements FieldTypeDataProviderInterface $isMultiple = $fieldSettings['isMultiple']; $availableOptions = $fieldSettings['options']; + if (empty($availableOptions)) { + return new Value(); + } $numberOfOptionsToPick = $isMultiple ? random_int(1, count($availableOptions)) : 1; $randomOptionIndices = array_rand(range(0, count($availableOptions) - 1), $numberOfOptionsToPick);
IBX-<I> handled the case when there are no options for selection
ezsystems_BehatBundle
train
php
646ab4d3838683458d240acb5ef6d8532bd37fa7
diff --git a/lib/watchdog.js b/lib/watchdog.js index <HASH>..<HASH> 100644 --- a/lib/watchdog.js +++ b/lib/watchdog.js @@ -27,21 +27,26 @@ WatchDog.prototype.start = function(){ } if(err){ - return self.emit(err); - } - - if(job){ + self.emit(err); //We do want to schedule the timer again even if an error occurs + } else if(job){ job.fail('Timed out', function(err, job){ if(err){ return self.emit(err); } self.emit('timedout', job.data); + + //If a job to timeout was found, execute cleanup again immediately to more quickly work + //through a potential backlog of timed out tasks + cleanup(); }); + + //Prevent scheduling the timer again as we will kick if off again immediately in the callback + return; } - }); - self.timer = setTimeout(cleanup, self.options.interval); + self.timer = setTimeout(cleanup, self.options.interval); + }); })(); };
If the watchdog finds a timedout job, have it check again immediately for more to work through a potential backlog of timed out tasks
scttnlsn_monq
train
js
946082a9ba6f5bd6ef45604a6a871d371bffde47
diff --git a/tests/test_basics.py b/tests/test_basics.py index <HASH>..<HASH> 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -61,6 +61,14 @@ class BasicTests(CliTestCase): output = self.run_line("globus whoami", config={}, assert_exit_code=1) self.assertIn("No login information available", output) + def test_json_raw_string_output(self): + """ + Get single-field jmespath output and make sure it's quoted + """ + output = self.run_line("globus whoami --jmespath Username").strip() + self.assertEquals( + '"{}"'.format(get_user_data()["clitester1a"]["username"]), output) + def test_auth_call_no_auth(self): """ Runs get-identities with config set to be empty,
Test that jmespath output is JSON on single val Simple test using whoami, checks exact output.
globus_globus-cli
train
py
5668858df3c97555558b4d15a0b1be86f8ec0b9f
diff --git a/lib/acme/client/version.rb b/lib/acme/client/version.rb index <HASH>..<HASH> 100644 --- a/lib/acme/client/version.rb +++ b/lib/acme/client/version.rb @@ -1,5 +1,5 @@ module Acme class Client - VERSION = '0.3.4'.freeze + VERSION = '0.3.5'.freeze end end
Bump gem version to <I>
unixcharles_acme-client
train
rb
eecbaa6492b1429d605a1640f0f116f11b43f89f
diff --git a/pyvex/lifting/__init__.py b/pyvex/lifting/__init__.py index <HASH>..<HASH> 100644 --- a/pyvex/lifting/__init__.py +++ b/pyvex/lifting/__init__.py @@ -99,7 +99,10 @@ def lift(data, addr, arch, max_bytes=None, max_inst=None, bytes_offset=0, opt_le continue u_data = ffi.buffer(c_data + skip, max_bytes)[:] else: - u_data = py_data[skip : skip + max_bytes] + if max_bytes is None: + u_data = py_data[skip:] + else: + u_data = py_data[skip:skip + max_bytes] else: raise RuntimeError("Incorrect lifter configuration. What type of data does %s expect?" % lifter.__class__)
port patch from #<I>: don't crash in py lifter when max_bytes is None
angr_pyvex
train
py
e815371d9f66d3c50dcec55e6114a372bd1f5809
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,18 +10,18 @@ retry_classifiers = [ 'Topic :: Utilities', ] -with open('README', 'r') as fp: - retry_long_description = fp.read() +description = 'A small and simple library to retry functions' setup( name='retry', version=retry.__version__, author=retry.__author__, - author_email='seemethere101@gmail.com', - url='https://github.com/seemethere/retry', + author_email=retry.__email__, + url=retry.__url__, py_modules=['retry'], - description='A small and simple library to retry functions', - long_description=retry_long_description, + description=description, + long_description=description, license=retry.__license__, - classifiers=retry_classifiers + classifiers=retry_classifiers, + test_requires=['pytest'] )
Moving some things around, adding test_requires
seemethere_retry.it
train
py
ccf1fc3501131284fe154d83f7fcf68d0fa8a170
diff --git a/src/viewport.js b/src/viewport.js index <HASH>..<HASH> 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -246,6 +246,7 @@ export class Viewport extends PIXI.Container this._worldHeight = worldHeight } this.plugins.resize() + this.dirty = true } /**
Mark viewport dirty after resizing
davidfig_pixi-viewport
train
js
1fdf1b91229410eda3cb0f250c982c859b76a540
diff --git a/website/data/alert-banner.js b/website/data/alert-banner.js index <HASH>..<HASH> 100644 --- a/website/data/alert-banner.js +++ b/website/data/alert-banner.js @@ -1,12 +1,11 @@ export const ALERT_BANNER_ACTIVE = true // https://github.com/hashicorp/web-components/tree/master/packages/alert-banner export default { - tag: 'ANNOUNCEMENT', - url: 'https://www.hashicorp.com/blog/announcing-hashicorp-nomad-1-2', - text: - 'Nomad 1.2.0 is now generally available, which includes 3 new major features and many improvements.', - linkText: 'Learn more', + tag: 'Blog post', + url: 'https://www.hashicorp.com/blog/a-new-chapter-for-hashicorp', + text: 'HashiCorp shares have begun trading on the Nasdaq. Read the blog from our founders, Mitchell Hashimoto and Armon Dadgar.', + linkText: 'Read the post', // Set the expirationDate prop with a datetime string (e.g. '2020-01-31T12:00:00-07:00') // if you'd like the component to stop showing at or after a certain date - expirationDate: '2021-11-23T00:00:00-07:00', + expirationDate: '2021-12-17T23:00:00-07:00', }
Update the banner (#<I>)
hashicorp_nomad
train
js
20d50de0b9280ad454ea3741b41462eb8156275f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ """Setup for ResurceSync library and client implementation.""" -from setuptools import setup +from setuptools import setup, Command +import os # setuptools used instead of distutils.core so that # dependencies can be handled automatically @@ -16,6 +17,27 @@ if match: else: raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE)) +class Coverage(Command): + """Class to allow coverage run from setup.""" + + description = "run coverage" + user_options = [] + + def initialize_options(self): + """Empty initialize_options.""" + pass + + def finalize_options(self): + """Empty finalize_options.""" + pass + + def run(self): + """Run coverage program.""" + os.system("coverage run --source=resync setup.py test") + os.system("coverage report") + os.system("coverage html") + print("See htmlcov/index.html for details.") + setup( name='resync', version=version, @@ -43,4 +65,7 @@ setup( "testfixtures" ], test_suite="tests", + cmdclass={ + 'coverage': Coverage, + }, )
Add coverage option to setup.py
resync_resync
train
py
8d7756f05d10edba6de71c02987dda78ef5ed3f2
diff --git a/Manager/UserManager.php b/Manager/UserManager.php index <HASH>..<HASH> 100644 --- a/Manager/UserManager.php +++ b/Manager/UserManager.php @@ -916,7 +916,8 @@ class UserManager $publicUrl = $user->getFirstName() . '.' . $user->getLastName(); $publicUrl = strtolower(str_replace(' ', '-', $publicUrl)); $searchedUsers = $this->objectManager->getRepository('ClarolineCoreBundle:User')->findOneByPublicUrl($publicUrl); - if (null !== $searchedUsers) $publicUrl .= $user->getId(); + + if (null !== $searchedUsers) $publicUrl .= '_' . uniqid(); return $publicUrl; }
[CoreBundle] Add uniqid to publicurl.
claroline_Distribution
train
php
1df3fbca47a4d6392ddc65ae0751623b714f1023
diff --git a/psiturk/models.py b/psiturk/models.py index <HASH>..<HASH> 100644 --- a/psiturk/models.py +++ b/psiturk/models.py @@ -125,8 +125,7 @@ class Participant(Base): event["timestamp"] ) ) - - return outstring.getvalue() + return outstring.getvalue() except: print(("Error reading record:", self)) return "" @@ -150,7 +149,7 @@ class Participant(Base): questiondata[question] ) ) - return outstring.getvalue() + return outstring.getvalue() except: print(("Error reading record:", self))
Fix scoping bug in download_datafiles The variable `outstring` defined in a `with` statement is used outside the scope of the `with` in `get_question_data` and `get_event_data`, resulting in question and event data both throwing "Error reading record" errors (the exception being "I/O operation on closed file") when running `download_datafiles` from the psiturk shell.
NYUCCL_psiTurk
train
py
7336cb5133fd03f0cf512bc3c0a2bc6ef6f279e0
diff --git a/lib/enju_biblio/biblio_helper.rb b/lib/enju_biblio/biblio_helper.rb index <HASH>..<HASH> 100644 --- a/lib/enju_biblio/biblio_helper.rb +++ b/lib/enju_biblio/biblio_helper.rb @@ -11,7 +11,7 @@ module EnjuBiblio when 'online_resource' image_tag('icons/monitor.png', size: '16x16', class: 'enju_icon', alt: carrier_type.display_name.localize) else - image_tag('icons/help.png', size: '16x16', class: 'enju_icon', alt: t('page.unknown')) + image_tag(carrier_type_path(carrier_type, format: :download), size: '16x16', class: 'enju_icon', alt: carrier_type.display_name.localize) end rescue NoMethodError image_tag('icons/help.png', size: '16x16', class: 'enju_icon', alt: t('page.unknown'))
display uploaded carrier_type icon next-l/enju_leaf#<I>
next-l_enju_biblio
train
rb
42684b45d0abe619ae0ee9eb90272c5a9bc811ad
diff --git a/src/app/account/services/services.controller.js b/src/app/account/services/services.controller.js index <HASH>..<HASH> 100644 --- a/src/app/account/services/services.controller.js +++ b/src/app/account/services/services.controller.js @@ -24,13 +24,13 @@ angular.module("mopify.account.services", [ name: "Spotify", description: "Search and manage playlists and get the latests charts", image: "http://icons.iconarchive.com/icons/danleech/simple/256/spotify-icon.png", - connected: ($scope.connectedServices !== undefined) ? $scope.connectedServices.spotify : false + connected: ($scope.connectedServices !== null) ? $scope.connectedServices.spotify : false }, { name: "Facebook", description: "Get more music based on your Facebook likes.", image: "http://www.ednfoundation.org/wp-content/uploads/facebook-logo-square.png", - connected: ($scope.connectedServices !== undefined) ? $scope.connectedServices.facebook : false + connected: ($scope.connectedServices !== null) ? $scope.connectedServices.facebook : false } ];
check against null instead of undefined
dirkgroenen_mopidy-mopify
train
js
0319b14755d995ef4d1900ce8ad8fa33162e2ab8
diff --git a/src/BouncerServiceProvider.php b/src/BouncerServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/BouncerServiceProvider.php +++ b/src/BouncerServiceProvider.php @@ -5,6 +5,7 @@ namespace Silber\Bouncer; use Illuminate\Support\Arr; use Silber\Bouncer\Database\Models; use Silber\Bouncer\Console\CleanCommand; +use Laravel\Octane\Events\RequestReceived; use Illuminate\Cache\ArrayStore; use Illuminate\Support\ServiceProvider; @@ -162,5 +163,14 @@ class BouncerServiceProvider extends ServiceProvider // auto-register at the gate. We already registered Bouncer in // the container using the Factory, so now we'll resolve it. $this->app->make(Bouncer::class); + + // When using Octane, we need to re-register Bouncer at the gate + // for every new request. We'll first remove the old instance + // then create a new singleton for this particular sandbox. + $this->app->make('events')->listen(function (RequestReceived $event) { + $event->sandbox->forgetInstance(Bouncer::class); + + $event->sandbox->make(Bouncer::class); + }); } }
Octane support: re-register in sandbox app
JosephSilber_bouncer
train
php
2781563240f3754ef77f08bce529c037d6b43baf
diff --git a/Net/Notifier/WebSocket/Handshake.php b/Net/Notifier/WebSocket/Handshake.php index <HASH>..<HASH> 100644 --- a/Net/Notifier/WebSocket/Handshake.php +++ b/Net/Notifier/WebSocket/Handshake.php @@ -307,7 +307,7 @@ class Net_Notifier_WebSocket_Handshake } if ( !isset($headers['Upgrade']) - || strtolower($headers['Upgrade']) != 'websocket' + || mb_strtolower($headers['Upgrade']) != 'websocket' ) { throw new Net_Notifier_WebSocket_HandshakeFailureException( 'Upgrade header missing or not set to "websocket".' @@ -315,7 +315,7 @@ class Net_Notifier_WebSocket_Handshake } if ( !isset($headers['Connection']) - || strtolower($headers['Connection']) != 'upgrade' + || mb_strtolower($headers['Connection']) != 'upgrade' ) { throw new Net_Notifier_WebSocket_HandshakeFailureException( 'Connection header missing or not set to "Upgrade".' @@ -462,7 +462,7 @@ class Net_Notifier_WebSocket_Handshake // lowercase header values // remove leading/trailing whitespace - $values = array_map('strtolower', $values); + $values = array_map('mb_strtolower', $values); return $values; }
Explicitly use mb_string functions where we deal with user-facing strings This allows us to turn off mb_string.func_overload.
silverorange_Net_Notifier
train
php
b121e4c9e644e062320285670170b1c0c4334c2f
diff --git a/operations/spackle.js b/operations/spackle.js index <HASH>..<HASH> 100644 --- a/operations/spackle.js +++ b/operations/spackle.js @@ -22,9 +22,7 @@ const writtenFiles = [5].concat(years).flatMap((year, i, arr) => { const nextYear = arr[i + 1]; const nextFile = path.join(process.cwd(), String(nextYear), `${opPath}.js`); console.log('**', opFile, op, opPath, thisFile, nextFile); - if (op.includes('::')) { - fs.mkdirSync(path.dirname(nextFile), { recursive: true }); - } + fs.mkdirSync(path.dirname(nextFile), { recursive: true }); if (!deltas[nextYear].removed.has(op) && fs.existsSync(thisFile) && !fs.existsSync(nextFile)) { console.log(`writing: ${nextYear}/${opPath} -> ${year}/${opPath}`); const thisSpecifier = `../${year}/${opPath}`;
[meta] `spackle`: always mkdirp new files to be written
ljharb_es-abstract
train
js
f3565fbf61134d2077580aa4d784b64d6b7818ad
diff --git a/lib/ga_events/middleware.rb b/lib/ga_events/middleware.rb index <HASH>..<HASH> 100644 --- a/lib/ga_events/middleware.rb +++ b/lib/ga_events/middleware.rb @@ -9,7 +9,7 @@ module GaEvents # Handle events stored in flash # Parts borrowed from Rails: # https://github.com/rails/rails/blob/v3.2.14/actionpack/lib/action_dispatch/middleware/flash.rb - flash = env['rack.session'] && env['rack.session']['flash'] + flash = env['rack.session'] && env['rack.session']['flash'] && env['rack.session']['flash']['flashes'] GaEvents::List.init(flash && flash['ga_events']) status, headers, response = @app.call(env)
the hash key for extracting the flash content in the middleware was wrong (at least working with rails <I>)
Nix-wie-weg_ga_events
train
rb
0bf4c3ee74d9c8d403b9cfe6e270dd9b8e40a8ad
diff --git a/src/Wsdl2PhpGenerator/Xml/TypeNode.php b/src/Wsdl2PhpGenerator/Xml/TypeNode.php index <HASH>..<HASH> 100644 --- a/src/Wsdl2PhpGenerator/Xml/TypeNode.php +++ b/src/Wsdl2PhpGenerator/Xml/TypeNode.php @@ -103,7 +103,7 @@ class TypeNode extends XmlNode return $minOccurs; } } - return 1; + return null; } /**
Return null for element MinOccurs when it is not defined.
wsdl2phpgenerator_wsdl2phpgenerator
train
php
fe953dddb9f45c57ef9e0210ecbb891960ff9ac6
diff --git a/test/browser/test.js b/test/browser/test.js index <HASH>..<HASH> 100644 --- a/test/browser/test.js +++ b/test/browser/test.js @@ -606,6 +606,24 @@ function addTests() { expect(el1.firstChild.nextSibling.innerHTML).to.equal('b'); }); + it('should not alter the DOM unnecessarily in the presence of comments', function() { + var el1 = document.createElement('div'); + el1.innerHTML = '<!-- comment --><div class="div1">a</div>'; + + var el2 = el1.cloneNode(true); + + var addedNodes = []; + var discardedNodes = []; + morphdom(el1, el2, { + onNodeAdded: function(el) { addedNodes.push(el) }, + onNodeDiscarded: function(el) { discardedNodes.push(el) } + }); + + // This was a no-op update, and should have made no changes + expect(addedNodes).to.be.empty; + expect(discardedNodes).to.be.empty; + }); + // xit('should reuse DOM element with matching ID and class name (2)', function() { // // NOTE: This test is currently failing. We need to improve the special case code // // for handling incompatible root nodes.
add test for issue <I>
patrick-steele-idem_morphdom
train
js
18cff37f5a985d6a96ed66f8e1d0a39e9943d104
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from os import path setup( name = "acos-client", - version = "2.2.0", + version = "2.3.0", packages = find_packages(), author = "A10 Networks",
Bumped version after lastest additions
a10networks_acos-client
train
py
8ab3c7f795163cd433dd6decb5d4fad7be49f231
diff --git a/mongo_connector/oplog_manager.py b/mongo_connector/oplog_manager.py index <HASH>..<HASH> 100755 --- a/mongo_connector/oplog_manager.py +++ b/mongo_connector/oplog_manager.py @@ -277,6 +277,10 @@ class OplogThread(threading.Thread): try: for doc in cursor: + # Could spend a long time in this loop + if not self.running: + # Return None so we don't save our progress + return None doc['ns'] = namespace doc['_ts'] = long_ts try:
github_<I>: further improvement to exit on C-c (check for exit in dump_collection)
yougov_mongo-connector
train
py
31562f07caf83c46cbdabf4d31ab57a528583915
diff --git a/odl/set/domain.py b/odl/set/domain.py index <HASH>..<HASH> 100644 --- a/odl/set/domain.py +++ b/odl/set/domain.py @@ -259,8 +259,12 @@ class IntervalProd(Set): maxs = np.fromiter((np.max(vec) for vec in vecs), dtype=float) return np.all(mins >= self.begin) and np.all(maxs <= self.end) elif is_valid_input_array(other, self.ndim): - mins = np.min(other, axis=1) - maxs = np.max(other, axis=1) + if self.ndim == 1: + mins = np.min(other) + maxs = np.max(other) + else: + mins = np.min(other, axis=1) + maxs = np.max(other, axis=1) return np.all(mins >= self.begin) and np.all(maxs <= self.end) else: return False
ENH: make contains_all work for 1d arrays
odlgroup_odl
train
py
02d9c86d692a66c1e89188fe2508c59a4b807295
diff --git a/delegator.py b/delegator.py index <HASH>..<HASH> 100644 --- a/delegator.py +++ b/delegator.py @@ -1,6 +1,7 @@ import os import subprocess import shlex +import signal from pexpect.popen_spawn import PopenSpawn @@ -147,7 +148,7 @@ class Command(object): self.subprocess.terminate() def kill(self): - self.subprocess.kill() + self.subprocess.kill(signal.SIGINT) def block(self): """Blocks until process is complete."""
When using proc=delegator.run(...,block=False), proc.kill() would not work because it proc.kill did not specify a signal to send. This fixes that.
kennethreitz_delegator.py
train
py
b73c8505b45471f666a60b31f8397e6c2a39aba4
diff --git a/pkg/util/retry/retry.go b/pkg/util/retry/retry.go index <HASH>..<HASH> 100644 --- a/pkg/util/retry/retry.go +++ b/pkg/util/retry/retry.go @@ -24,7 +24,7 @@ import ( const defaultMaxRetries = 113 -// Expo is expontential backoff retry. +// Expo is exponential backoff retry. // initInterval is the initial waiting time to start with. // maxTime is the max time allowed to spend on the all the retries. // maxRetries is the optional max number of retries allowed with default of 13.
cleanup: fix mis-spelling in retry.go
kubernetes_minikube
train
go
3e5194a4e1701a4a3b0a8124cb3b6fe396ca8c37
diff --git a/go/libkb/resolve.go b/go/libkb/resolve.go index <HASH>..<HASH> 100644 --- a/go/libkb/resolve.go +++ b/go/libkb/resolve.go @@ -64,8 +64,11 @@ func resolveUID(au AssertionURL) ResolveResult { } r := resolveUsername(au) - G.ResolveCache.Put(ck, r) + if r.err != nil { + return r + } + G.ResolveCache.Put(ck, r) return r }
Don't cache errors in ResolveCache, fixes #<I>
keybase_client
train
go
714c61837b1cc15df51cb0dcd24aea623a5555f7
diff --git a/client/deis.py b/client/deis.py index <HASH>..<HASH> 100755 --- a/client/deis.py +++ b/client/deis.py @@ -1495,8 +1495,8 @@ class DeisClient(object): """ Sets tags for an application. - A tag is a key/value pair used to tag an application's containers. - This is often used to restrict workloads to specific hosts. + A tag is a key/value pair used to tag an application's containers and is passed to the scheduler. + This is often used to restrict workloads to specific hosts matching the scheduler-configured metadata. Usage: deis tags:set [options] <key>=<value>...
docs: clarify tags_set usage Mention that tags are passed to the scheduler.
deis_deis
train
py
ec6cbb914b4e3070ad2fd6194c2fa6de2c1080cc
diff --git a/miner/miner.go b/miner/miner.go index <HASH>..<HASH> 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -48,14 +48,16 @@ func (self *Miner) Start(coinbase common.Address) { } func (self *Miner) Register(agent Agent) { + if self.mining { + agent.Start() + } + self.worker.register(agent) } func (self *Miner) Stop() { self.mining = false self.worker.stop() - - //self.pow.(*ethash.Ethash).Stop() } func (self *Miner) HashRate() int64 { diff --git a/miner/worker.go b/miner/worker.go index <HASH>..<HASH> 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -225,7 +225,11 @@ func (self *worker) push() { for _, agent := range self.agents { atomic.AddInt64(&self.atWork, 1) - agent.Work() <- self.current.block.Copy() + if agent.Work() != nil { + agent.Work() <- self.current.block.Copy() + } else { + common.Report(fmt.Sprintf("%v %T\n", agent, agent)) + } } } }
miner: start a newly registered agent if the miner is running. Closes #<I>
ethereum_go-ethereum
train
go,go
bc1e2204c31822c1459684ddffc7d1f26f2fa79f
diff --git a/third_party/tvcm/third_party/beautifulsoup/polymer_soup.py b/third_party/tvcm/third_party/beautifulsoup/polymer_soup.py index <HASH>..<HASH> 100644 --- a/third_party/tvcm/third_party/beautifulsoup/polymer_soup.py +++ b/third_party/tvcm/third_party/beautifulsoup/polymer_soup.py @@ -8,4 +8,4 @@ import BeautifulSoup class PolymerSoup(BeautifulSoup.BeautifulSoup): """Parser for HTML files containing Polymer tags.""" NESTABLE_TAGS = BeautifulSoup.BeautifulSoup.NESTABLE_TAGS.copy() - NESTABLE_TAGS['template'] = ['template'] + NESTABLE_TAGS['template'] = []
Fixed tab button style by allowing arbitrary nesting inside the <template> tag
catapult-project_catapult
train
py
e6cb8858d5bc703ca5d0dc79e3c1f5b4d49e149b
diff --git a/cumulusci/core/config/BaseProjectConfig.py b/cumulusci/core/config/BaseProjectConfig.py index <HASH>..<HASH> 100644 --- a/cumulusci/core/config/BaseProjectConfig.py +++ b/cumulusci/core/config/BaseProjectConfig.py @@ -389,12 +389,14 @@ class BaseProjectConfig(BaseTaskFlowConfig): gh = get_github_api(github_config.username, github_config.password) return gh - def get_latest_version(self, beta=False): + def get_latest_version(self, beta=False, tag=False): """ Query Github Releases to find the latest production or beta release """ gh = self.get_github_api() repo = gh.repository(self.repo_owner, self.repo_name) if not beta: release = repo.latest_release() + if tag: + return release.tag_name version = self.get_version_for_tag(release.tag_name) if version is not None: return LooseVersion(version) @@ -402,6 +404,8 @@ class BaseProjectConfig(BaseTaskFlowConfig): for release in repo.releases(): if not release.tag_name.startswith(self.project__git__prefix_beta): continue + if tag: + return release.tag_name version = self.get_version_for_tag(release.tag_name) if version is None: continue
Add tag=True/False option to get_latest_version to allow returning the tag instead of the version
SFDO-Tooling_CumulusCI
train
py
9317cc5ca7f0ebf575f5c39f77838ebb5bab99b8
diff --git a/Connectors/PostgresConnector.php b/Connectors/PostgresConnector.php index <HASH>..<HASH> 100755 --- a/Connectors/PostgresConnector.php +++ b/Connectors/PostgresConnector.php @@ -97,6 +97,18 @@ class PostgresConnector extends Connector implements ConnectorInterface $dsn .= ";sslmode={$sslmode}"; } + if (isset($config['sslcert'])) { + $dsn .= ";sslcert={$sslcert}"; + } + + if (isset($config['sslkey'])) { + $dsn .= ";sslkey={$sslkey}"; + } + + if (isset($config['sslrootcert'])) { + $dsn .= ";sslrootcert={$sslrootcert}"; + } + return $dsn; }
Add SSL options for Postgres DSN (#<I>) * Add SSL options for Postgres DSN There is already the SSLMODE option available, but if you set it to verify-full, you would need to also set the sslrootcert with the full path of the server certificate. This way, the client will be able to check the certificate of the server and be sure it's connecting to the right one. This patch is only adding the different SSL option available for a postgres connection has stated here: <URL>
illuminate_database
train
php
388e6899a15b6cef0338408a65548362e7a1fee1
diff --git a/storage/piece_resource.go b/storage/piece_resource.go index <HASH>..<HASH> 100644 --- a/storage/piece_resource.go +++ b/storage/piece_resource.go @@ -6,6 +6,7 @@ import ( "path" "sort" "strconv" + "sync" "github.com/anacrolix/missinggo/v2/resource" @@ -103,9 +104,15 @@ func (s piecePerResourcePiece) MarkComplete() error { }() err := s.completed().Put(r) if err == nil { + var wg sync.WaitGroup for _, c := range incompleteChunks { - c.instance.Delete() + wg.Add(1) + go func(c chunk) { + defer wg.Done() + c.instance.Delete() + }(c) } + wg.Wait() } return err }
piece resource storage: Delete incomplete chunks concurrently after writing complete piece
anacrolix_torrent
train
go
c349cb66ba5d99b628e67a93315cefe805d452d1
diff --git a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index <HASH>..<HASH> 100644 --- a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -360,18 +360,25 @@ public class SpringApplication { return context; } catch (RuntimeException ex) { - multicaster.multicastEvent(new SpringApplicationErrorEvent(this, context, - args, ex)); + handleError(context, multicaster, ex, args); throw ex; } catch (Error ex) { - multicaster.multicastEvent(new SpringApplicationErrorEvent(this, context, - args, ex)); + handleError(context, multicaster, ex, args); throw ex; } } + protected void handleError(ConfigurableApplicationContext context, + ApplicationEventMulticaster multicaster, Throwable ex, String... args) { + multicaster.multicastEvent(new SpringApplicationErrorEvent(this, context, args, + ex)); + if (context != null) { + context.close(); + } + } + private void registerListeners(ApplicationEventMulticaster multicaster, Set<Object> sources) { for (Object object : sources) {
Ensure SpringApplication closes its ApplicationContext ...even if the CommandLineRunners fail and we drop to the error handling path. Fixes gh-<I>
spring-projects_spring-boot
train
java
54d9fe6e1a5c61ab536c4b993a3ec943a50fb0bd
diff --git a/drivers/java/convert_tests.py b/drivers/java/convert_tests.py index <HASH>..<HASH> 100755 --- a/drivers/java/convert_tests.py +++ b/drivers/java/convert_tests.py @@ -260,9 +260,12 @@ def escape_string(s, out): # byte to use \x instead of \u . Java doesn't accept \x so # we have to expand it back out. rpr = '\\u00' + rpr[2:] + elif rpr == '"': + rpr = r'\"' out.write(rpr) out.write('"') + def render_bytes(s, out): try: out.write("new byte[]{") @@ -281,8 +284,6 @@ def render_bytes(s, out): raise - - def attr_matches(path, node): '''Helper function. Several places need to know if they are an attribute of some root object'''
re-escape double quotes. Whoops. Broke this when I fixed \u escapes
rethinkdb_rethinkdb
train
py
7a04eb4a6ec2c876f2af65f136e60191352b94fa
diff --git a/res/tiles/tests.js b/res/tiles/tests.js index <HASH>..<HASH> 100644 --- a/res/tiles/tests.js +++ b/res/tiles/tests.js @@ -1,6 +1,7 @@ gpf.require.define({ Tile: "tile.js", - dom: "../dom.js" + dom: "../dom.js", + charts: "charts.js" }, function (require) { "use strict"; @@ -43,6 +44,13 @@ gpf.require.define({ ].join(":")}, "JSDoc") ]) ]); + }, + + drawCharts: function () { + require.charts.series({ + tests: "metrics.tests" + }); + return true; } });
Number of tests (#<I>)
ArnaudBuchholz_gpf-js
train
js
a9668fd77d29e5831742ce286f339542251d8aa2
diff --git a/src/Malenki/Bah/S.php b/src/Malenki/Bah/S.php index <HASH>..<HASH> 100644 --- a/src/Malenki/Bah/S.php +++ b/src/Malenki/Bah/S.php @@ -286,6 +286,40 @@ class S extends O implements \Countable return new S($out); } + + + + public function excerpt($phrase, $radius = 100) + { + $phrase_len = mb_strlen($phrase, C::ENCODING); + + $pos = mb_strpos( + $this->_lower()->string, + mb_strtolower($phrase, C::ENCODING) + ); + + if ($pos === false) { + return $this->sub(0, $radius); + } + + $start_pos = $pos - $radius; + + if ($start_pos <= 0) { + $start_pos = 0; + } + + $end_pos = $pos + $phrase_len + $radius; + + if ($end_pos >= count($this)) { + $end_pos = count($this); + } + + return mb_substr($this->value, $start_pos, $end_pos - $start_pos); + } + + + + public function strip($str = null) { if(is_array($str)){
Class S: start implement excerpt feature This is adapted from CakePHP String class
malenkiki_bah
train
php
65132fc6b7fc14d2ca9ed537ef59cd6caef0c83c
diff --git a/src/theme/components/Item.js b/src/theme/components/Item.js index <HASH>..<HASH> 100644 --- a/src/theme/components/Item.js +++ b/src/theme/components/Item.js @@ -59,7 +59,7 @@ export default (variables = variable) => { fontSize: variables.inputFontSize }, flexDirection: null, - height: variables.inputHeightBase + 15 + minHeight: variables.inputHeightBase + 15 }, ".inlineLabel": { "NativeBase.Label": {
Removed fixed height and added minHeight for Item-stackedLabel Fix for issue #<I>(<Input multiline> doesn't work inside <Item stackedLabel>)
GeekyAnts_NativeBase
train
js
13191395581cdc2f3f052c5564b528aad67a2bcc
diff --git a/src/radio/Radio.js b/src/radio/Radio.js index <HASH>..<HASH> 100644 --- a/src/radio/Radio.js +++ b/src/radio/Radio.js @@ -30,10 +30,18 @@ export default class Radio extends Component { 'disabled': disabled, // 禁用状态 'checked': checked, // 选中 }); + const inputProps = { + ref: (node) => { this.radio = node }, + type: 'radio', + disabled: disabled, + checked: checked || false, + value: value || children, + onChange: this.handleChange.bind(this), + } return ( <label {...other} className={cls}> <span className={`${prefixCls}-inner`}> - <input ref={(node) => { this.radio = node }} checked={checked} type="radio" disabled={disabled} value={value || children} onChange={this.handleChange.bind(this)} /> + <input {...inputProps} /> </span> <span className={`${prefixCls}-text`}>{children || value}</span> </label>
fix(Radio): Radio checked can not be undefined.
uiwjs_uiw
train
js
c5ffe0c2dac14b940b600acaccda3b387ca14a28
diff --git a/airflow/providers/amazon/aws/hooks/logs.py b/airflow/providers/amazon/aws/hooks/logs.py index <HASH>..<HASH> 100644 --- a/airflow/providers/amazon/aws/hooks/logs.py +++ b/airflow/providers/amazon/aws/hooks/logs.py @@ -66,9 +66,7 @@ class AwsLogsHook(AwsBaseHook): | 'ingestionTime' (int): The time in milliseconds the event was ingested. """ next_token = None - - event_count = 1 - while event_count > 0: + while True: if next_token is not None: token_arg: Optional[Dict[str, str]] = {'nextToken': next_token} else: @@ -94,7 +92,7 @@ class AwsLogsHook(AwsBaseHook): yield from events - if 'nextForwardToken' in response: + if next_token != response['nextForwardToken']: next_token = response['nextForwardToken'] else: return
fix: cloudwatch logs fetch logic (#<I>)
apache_airflow
train
py
359f7387d6c6072209caa8abbd9d327257100b72
diff --git a/zk_shell/tests/test_mirror_cmds.py b/zk_shell/tests/test_mirror_cmds.py index <HASH>..<HASH> 100644 --- a/zk_shell/tests/test_mirror_cmds.py +++ b/zk_shell/tests/test_mirror_cmds.py @@ -135,10 +135,11 @@ class MirrorCmdsTestCase(ShellTestCase): self.shell.onecmd("mirror %s/very %s/backup false false true" % ( self.tests_path, self.tests_path)) self.shell.onecmd("tree %s/backup" % (self.tests_path)) - expected_output = u""". -\u251c\u2500\u2500 znode3\n\u251c\u2500\u2500 nested\n\u2502 \u251c\u2500\u2500 znode\n\u2502 \u251c\u2500\u2500 znode2 -""" - self.assertEqual(expected_output, self.output.getvalue()) + + self.assertIn("znode3", self.output.getvalue()) + self.assertIn("nested", self.output.getvalue()) + self.assertIn("znode", self.output.getvalue()) + self.assertIn("znode2", self.output.getvalue()) def test_mirror_local_bad_path(self): """ try mirror non existent path in the local zk cluster """
Fix mirror tests (don't depend on tree's order, it may vary)
rgs1_zk_shell
train
py
f619bfeb5da33c2c6e58b99f8ea389c94b8877a7
diff --git a/newsletter-bundle/src/Resources/contao/modules/ModuleNewsletterReader.php b/newsletter-bundle/src/Resources/contao/modules/ModuleNewsletterReader.php index <HASH>..<HASH> 100644 --- a/newsletter-bundle/src/Resources/contao/modules/ModuleNewsletterReader.php +++ b/newsletter-bundle/src/Resources/contao/modules/ModuleNewsletterReader.php @@ -109,6 +109,12 @@ class ModuleNewsletterReader extends \Module return; } + // Overwrite the page title + if ($objNewsletter->subject != '') + { + $objPage->pageTitle = strip_insert_tags($objNewsletter->subject); + } + $arrEnclosures = array(); // Add enclosure
[Newsletter] Set the newsletter subject as page title in the newsletter reader module (see #<I>)
contao_contao
train
php
c2c3b715f3c56e204801af856ee481590af21775
diff --git a/core/src/main/java/org/bitcoinj/core/PeerGroup.java b/core/src/main/java/org/bitcoinj/core/PeerGroup.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerGroup.java +++ b/core/src/main/java/org/bitcoinj/core/PeerGroup.java @@ -1434,6 +1434,7 @@ public class PeerGroup implements TransactionBroadcaster { ipv6Unreachable = true; log.warn("IPv6 peer connect failed due to routing failure, ignoring IPv6 addresses from now on"); } + } else { backoffMap.get(address).trackFailure(); // Put back on inactive list inactives.offer(address);
PeerGroup: fix another regression with handling of disconnected peers
bitcoinj_bitcoinj
train
java
b67bdf71c93bdab64e00c3e4b7815f3c2af9627b
diff --git a/nosedjango/nosedjango.py b/nosedjango/nosedjango.py index <HASH>..<HASH> 100644 --- a/nosedjango/nosedjango.py +++ b/nosedjango/nosedjango.py @@ -25,7 +25,6 @@ logger = logging.getLogger('nose.plugins.nosedjango') NT_ROOT = re.compile(r"^[a-zA-Z]:\\$") - def get_settings_path(settings_module): ''' Hunt down the settings.py module by going up the FS path
refs #<I>: Added intentional flake8 to make sure travis + tox are working.
nosedjango_nosedjango
train
py
2ad7bd3664aba48a3536ca3409e9ce17c948f555
diff --git a/tests/integration-all/http-api/tests.js b/tests/integration-all/http-api/tests.js index <HASH>..<HASH> 100644 --- a/tests/integration-all/http-api/tests.js +++ b/tests/integration-all/http-api/tests.js @@ -211,7 +211,10 @@ describe('HTTP API Integration Test', function() { return resolveEndpoint(); }); - after(async () => { + after(async function() { + // Added temporarily to inspect random fails + // TODO: Remove once properly diagnosed + if (this.test.parent.tests.some(test => test.state === 'failed')) return; log.notice('Removing service...'); await removeService(tmpDirPath); });
test: Temporary debug patch for randomly failing test
serverless_serverless
train
js
1c3e6de0ec57558dbd1c116469988d756193a902
diff --git a/pmagpy/controlled_vocabularies3.py b/pmagpy/controlled_vocabularies3.py index <HASH>..<HASH> 100755 --- a/pmagpy/controlled_vocabularies3.py +++ b/pmagpy/controlled_vocabularies3.py @@ -76,7 +76,7 @@ class Vocabulary(object): if not requests: return False try: - req = requests.get(url, timeout=3) + req = requests.get(url, timeout=.2) if not req.ok: return [] return req
modified: controlled_vocabularies3.py
PmagPy_PmagPy
train
py
82a9418980bd0e8447e4d4965bc6ba2fcc0e1cae
diff --git a/Classes/Core/Functional/Framework/Frontend/RequestBootstrap.php b/Classes/Core/Functional/Framework/Frontend/RequestBootstrap.php index <HASH>..<HASH> 100644 --- a/Classes/Core/Functional/Framework/Frontend/RequestBootstrap.php +++ b/Classes/Core/Functional/Framework/Frontend/RequestBootstrap.php @@ -15,7 +15,6 @@ namespace TYPO3\TestingFramework\Core\Functional\Framework\Frontend; */ use TYPO3\CMS\Core\Core\Bootstrap; -use TYPO3\CMS\Core\Core\ClassLoadingInformation; use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Utility\ArrayUtility;
[BUGFIX] Missing class loading in internal request bootstrap for composer mode Resolves: #<I> Releases: master
TYPO3_testing-framework
train
php
71b5e7f7a24826c27e2e608c81b8f7851d5f3aef
diff --git a/symphony/assets/symphony.orderable.js b/symphony/assets/symphony.orderable.js index <HASH>..<HASH> 100644 --- a/symphony/assets/symphony.orderable.js +++ b/symphony/assets/symphony.orderable.js @@ -129,13 +129,7 @@ initialize: function() { object.addClass('orderable'); - object.find(settings.items).each(function() { - var item = $(this); - var handle = item.find(settings.handles); - - handle.unbind('mousedown.orderable', start); - handle.bind('mousedown.orderable', start); - }); + object.delegate(settings.items + ' ' + settings.handles, 'mousedown.orderable', start); } };
Fix issue #<I> which prevented sorting of dynamically added items
symphonycms_symphony-2
train
js
2e5768204f22cc444899fef057d9b80542c2ecc2
diff --git a/libfuse/folderlist.go b/libfuse/folderlist.go index <HASH>..<HASH> 100644 --- a/libfuse/folderlist.go +++ b/libfuse/folderlist.go @@ -127,6 +127,8 @@ func (fl *FolderList) PathType() libkbfs.PathType { return libkbfs.PrivatePathType case tlf.Public: return libkbfs.PublicPathType + case tlf.SingleTeam: + return libkbfs.SingleTeamPathType default: // TODO: support the team path. panic(fmt.Sprintf("Unsupported tlf type: %s", fl.tlfType))
libfuse: handle singleTeam type in `PathType` Otherwise, certain errors can cause a panic. Found by modalduality
keybase_client
train
go
8c90f9b44eadd2c40ba506e442230039d83ac0ae
diff --git a/src/component.js b/src/component.js index <HASH>..<HASH> 100644 --- a/src/component.js +++ b/src/component.js @@ -132,8 +132,9 @@ class Component { template.innerHTML = style; template.appendChild(options.template); } - - let clone = document.importNode(template.content, true); + + // let clone = document.importNode(template, true); + let clone = template.content.cloneNode(true); Binder.bind(clone, element, element.scope);
changed to cloneNode instead of importNode
vokeio_oxe
train
js
deb88ffa6b65de355e20c6dd9ea6037b7266dda6
diff --git a/examples/ruby/greeter_client.rb b/examples/ruby/greeter_client.rb index <HASH>..<HASH> 100755 --- a/examples/ruby/greeter_client.rb +++ b/examples/ruby/greeter_client.rb @@ -33,7 +33,7 @@ def main message = stub.say_hello(Helloworld::HelloRequest.new(name: user)).message p "Greeting: #{message}" rescue GRPC::BadStatus => e - abort "ERROR: #{e.code}, #{e.details}" + abort "ERROR: #{e.message}" end end
print the exception's message, rather than individual fields
grpc_grpc
train
rb
11ffaaab5ce04c1d6f8b856a5d9148b9a62b6515
diff --git a/src/utils/sigma.polyfills.js b/src/utils/sigma.polyfills.js index <HASH>..<HASH> 100644 --- a/src/utils/sigma.polyfills.js +++ b/src/utils/sigma.polyfills.js @@ -41,9 +41,9 @@ }; /** - * Function.prototype.bind polyfill found on MSDN. - * Code distributed under the CC Licence: - * > http://creativecommons.org/licenses/by-sa/2.5/ + * Function.prototype.bind polyfill found on MDN. + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Compatibility + * Public domain */ if (!Function.prototype.bind) Function.prototype.bind = function(oThis) {
Clarification on MDN Function#bind polyfill legal status MSDN => MDN : I killed people for less than that ;-) The code is in [the public domain](<URL>) > Code samples added on or after August <I>, <I> are in the public domain. (wiki page started on August <I> <I>)
jacomyal_sigma.js
train
js
35b4e8f9b041869c25fbc3434e6320cbc9407172
diff --git a/spec/sidekiq/batch/status_spec.rb b/spec/sidekiq/batch/status_spec.rb index <HASH>..<HASH> 100644 --- a/spec/sidekiq/batch/status_spec.rb +++ b/spec/sidekiq/batch/status_spec.rb @@ -26,9 +26,26 @@ describe Sidekiq::Batch::Status do end end + describe '#failures' do + context 'when not initalized' do + it 'returns 0 failed jobs' do + expect(subject.failures).to eq(0) + end + end + + context 'when more than 0' do + before { Sidekiq::Batch.increment_job_queue(bid) } + before { Sidekiq::Batch.process_failed_job(bid, 'FAILEDID') } + + it 'returns failed jobs' do + expect(subject.failures).to eq(1) + end + end + end + describe '#data' do it 'returns batch description' do - expect(subject.data).to eq(total: nil, failures: nil, pending: 0, created_at: nil, complete: false, failure_info: nil) + expect(subject.data).to eq(total: nil, failures: 0, pending: 0, created_at: nil, complete: false, failure_info: nil) end end end
Adding specs for Status#failures
breamware_sidekiq-batch
train
rb
f454b35b99b2b777628157cf1566af93e6a7161f
diff --git a/underscore.function.arity.js b/underscore.function.arity.js index <HASH>..<HASH> 100644 --- a/underscore.function.arity.js +++ b/underscore.function.arity.js @@ -176,6 +176,9 @@ }); _.arity = (function () { + // Allow 'new Function', as that is currently the only reliable way + // to manipulate function.length + /* jshint -W054 */ var FUNCTIONS = {}; return function arity (numberOfArgs, fun) { if (FUNCTIONS[numberOfArgs] == null) {
Allow 'new Function' for _.arity.
documentcloud_underscore-contrib
train
js
9e5ed179ad5b344c38991bb03fa7e59dd99ffd42
diff --git a/molgenis-data-elasticsearch/src/main/java/org/molgenis/data/elasticsearch/ElasticsearchService.java b/molgenis-data-elasticsearch/src/main/java/org/molgenis/data/elasticsearch/ElasticsearchService.java index <HASH>..<HASH> 100644 --- a/molgenis-data-elasticsearch/src/main/java/org/molgenis/data/elasticsearch/ElasticsearchService.java +++ b/molgenis-data-elasticsearch/src/main/java/org/molgenis/data/elasticsearch/ElasticsearchService.java @@ -812,7 +812,8 @@ public class ElasticsearchService implements SearchService, MolgenisTransactionL @Override public void rebuildIndex(Iterable<? extends Entity> entities, EntityMetaData entityMetaData) { - if (ElasticsearchRepositoryCollection.NAME.equals(entityMetaData.getBackend())) + // Skip reindexing if the backend is ElasticSearch, the data will be removed in the reindexing process + if (!ElasticsearchRepositoryCollection.NAME.equals(entityMetaData.getBackend())) { if (DependencyResolver.hasSelfReferences(entityMetaData)) {
Fix #<I>: Model registry broken. Unknown package [base]
molgenis_molgenis
train
java