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
ae4b096be6b1ee913c3147bbda9385787a902f78
diff --git a/lib/rollbar/railtie.rb b/lib/rollbar/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/rollbar/railtie.rb +++ b/lib/rollbar/railtie.rb @@ -29,7 +29,7 @@ module Rollbar config.after_initialize do Rollbar.preconfigure do |config| - config.logger ||= ::Rails.logger + config.default_logger = proc { ::Rails.logger } config.environment ||= ::Rails.env config.root ||= ::Rails.root config.framework = "Rails: #{::Rails::VERSION::STRING}"
Set Rails.logger as Rollbar.configuration.default_logger.
rollbar_rollbar-gem
train
rb
661afae9832eb4d5eda207a28bc5723ec1ac20be
diff --git a/cmd/mirror-main.go b/cmd/mirror-main.go index <HASH>..<HASH> 100644 --- a/cmd/mirror-main.go +++ b/cmd/mirror-main.go @@ -510,11 +510,13 @@ func (mj *mirrorJob) monitorMirrorStatus(cancel context.CancelFunc) (errDuringMi errDuringMirror = true } - if mj.opts.activeActive { + // Do not quit mirroring if we are in --watch or --active-active mode + if !mj.opts.activeActive && !mj.opts.isWatch { cancel() cancelInProgress = true - continue } + + continue } if sURLs.SourceContent != nil {
mirror: Do not exit upon errors when --watch is passed (#<I>) Currently, when mirror is not able to copy an object (e.g. corrupted) and watch is specified, mirror will restart mirroring again to stop again at the same problematic object.
minio_mc
train
go
c334c94ef813096f7e8bc0a79d330070cf30bf23
diff --git a/src/Console/CreateCommand.php b/src/Console/CreateCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/CreateCommand.php +++ b/src/Console/CreateCommand.php @@ -103,6 +103,7 @@ class CreateCommand extends Command protected function installParts(SkeletonCreator $creator) { $parts = [ + new Parts\Base\Part(), new Parts\PhpUnit\Part(), new Parts\TravisCI\Part(), ];
Actually run base part when creating new package.
franzliedke_studio
train
php
f4792712ae7e6355f8f2aaaaced17d43a94dbaca
diff --git a/resource/resource.go b/resource/resource.go index <HASH>..<HASH> 100644 --- a/resource/resource.go +++ b/resource/resource.go @@ -17,6 +17,7 @@ var originRevisionTypes = map[OriginKind]RevisionType{ // Resource defines a single resource within Juju state. type Resource struct { + // Spec is the backing resource spec. Spec Spec // Origin identifies the where the resource came from.
Add a missing doc comment.
juju_juju
train
go
c77321285cc22527febdee462e3988a2ebf45a1f
diff --git a/src/org/joml/Intersectiond.java b/src/org/joml/Intersectiond.java index <HASH>..<HASH> 100644 --- a/src/org/joml/Intersectiond.java +++ b/src/org/joml/Intersectiond.java @@ -2662,7 +2662,7 @@ public class Intersectiond { * @return <code>true</code> iff both circles intersect; <code>false</code> otherwise */ public static boolean intersectCircleCircle(Vector2d centerA, double radiusSquaredA, Vector2d centerB, double radiusSquaredB, Vector3d intersectionCenterAndHL) { - return intersectCircleCircle(centerA.x, centerA.y, radiusSquaredB, centerB.x, centerB.y, radiusSquaredB, intersectionCenterAndHL); + return intersectCircleCircle(centerA.x, centerA.y, radiusSquaredA, centerB.x, centerB.y, radiusSquaredB, intersectionCenterAndHL); } /**
intersectCircleCircle forwarding the wrong param. intersectCircleCircle function was forwarding the radiusSquaredB parameter instead of radiusSquaredA.
JOML-CI_JOML
train
java
b99cbead3d8a9171b2e03148be6fbbffef5b5e6e
diff --git a/dashi/__init__.py b/dashi/__init__.py index <HASH>..<HASH> 100644 --- a/dashi/__init__.py +++ b/dashi/__init__.py @@ -18,7 +18,7 @@ from .exceptions import DashiError, BadRequestError, NotFoundError, \ UnknownOperationError, WriteConflictError from .util import Countdown, RetryBackoff -__version__ = '0.2.7' +__version__ = '0.3.0' log = logging.getLogger(__name__) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,9 +2,10 @@ import os import codecs -from dashi import __version__ -VERSION = __version__ +# STOP! you MUST also update this in dashi/__init__.py +VERSION = "0.3.0" # SEE ABOVE LINE BEFORE EDITING THIS +# HEY! did you see the above two lines? if os.path.exists("README.rst"): long_description = codecs.open('README.rst', "r", "utf-8").read()
Update versions and fix setup.py bug
nimbusproject_dashi
train
py,py
576c087ce174bd7c6209509d4b0e0dbfa856b81d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def get_install_requirements(path): setup(name='confluent-kafka', - version='1.0.1rc1', + version='1.0.1', description='Confluent\'s Python client for Apache Kafka', author='Confluent Inc', author_email='support@confluent.io',
Version <I> (#<I>)
confluentinc_confluent-kafka-python
train
py
c4e26f7f7b2b48179150c080a3a1d198efaed1db
diff --git a/examples/glyphs/airports_map.py b/examples/glyphs/airports_map.py index <HASH>..<HASH> 100644 --- a/examples/glyphs/airports_map.py +++ b/examples/glyphs/airports_map.py @@ -40,6 +40,7 @@ with urllib.request.urlopen(airports_service) as response: x_range = Range1d(start=df['geometry.x'].min() - 10000, end=df['geometry.x'].max() + 10000) y_range = Range1d(start=df['geometry.y'].min() - 10000, end=df['geometry.y'].max() + 10000) + # create plot and add tools hover_tool = HoverTool(tooltips=[("Name", "@name"), ("Elevation", "@elevation (m)")]) p = Plot(x_range=x_range, y_range=y_range, plot_height=800, plot_width=800, title=title) p.add_tools(ResizeTool(), WheelZoomTool(), PanTool(), BoxZoomTool(), hover_tool)
added additional comment and [ci enable examples]
bokeh_bokeh
train
py
8fa82bb69e28d4b125a9c38231c77600d8a16d14
diff --git a/cmd/peco/peco.go b/cmd/peco/peco.go index <HASH>..<HASH> 100644 --- a/cmd/peco/peco.go +++ b/cmd/peco/peco.go @@ -81,27 +81,31 @@ func main() { err = ctx.ReadConfig(opts.Rcfile) if err != nil { fmt.Fprintln(os.Stderr, err) - os.Exit(1) + ctx.ExitStatus = 1 + return } } if err = ctx.ReadBuffer(in); err != nil { // Nothing to process, bail out fmt.Fprintln(os.Stderr, "You must supply something to work with via filename or stdin") - os.Exit(1) + ctx.ExitStatus = 1 + return } err = peco.TtyReady() if err != nil { fmt.Fprintln(os.Stderr, err) - os.Exit(1) + ctx.ExitStatus = 1 + return } defer peco.TtyTerm() err = termbox.Init() if err != nil { fmt.Fprintln(os.Stderr, err) - os.Exit(1) + ctx.ExitStatus = 1 + return } defer termbox.Close()
Avoid using os.Exit() os.Exit() effectively cancels all our defer's. If we have resources being released there, this is a serious problem
peco_peco
train
go
ba539da6d6fb04764b5c9c89b2f7d3179ed08c02
diff --git a/src/webpack-config.js b/src/webpack-config.js index <HASH>..<HASH> 100644 --- a/src/webpack-config.js +++ b/src/webpack-config.js @@ -118,7 +118,7 @@ module.exports = function webpackConfig ({ config.plugins.push(new GlobEntriesPlugin()) // Add webextension polyfill - if (['chrome', 'opera'].includes(vendor)) { + if (['chrome', 'opera', 'edge'].includes(vendor)) { config.plugins.push( new webpack.ProvidePlugin({ browser: require.resolve('webextension-polyfill')
Apply webextension polyfill for edge platform Since Microsoft Edge version <I> they use Chromium based components. This means that Edge also needs the webextension polyfill now. fixes #<I>
webextension-toolbox_webextension-toolbox
train
js
ab4b62f50efde420c5c2985a56603458452a73b1
diff --git a/library/Garp/Cache/Manager.php b/library/Garp/Cache/Manager.php index <HASH>..<HASH> 100755 --- a/library/Garp/Cache/Manager.php +++ b/library/Garp/Cache/Manager.php @@ -74,8 +74,16 @@ class Garp_Cache_Manager { } else { foreach ($modelNames as $modelName) { $model = new $modelName(); - $cache = new Garp_Cache_Store_Versioned($model->getName().'_version'); - $cache->incrementVersion(); + self::_incrementMemcacheVersion($model); + if ($model->getObserver('Translatable')) { + // Make sure cache is cleared for all languages. + $locales = Garp_I18n::getAllPossibleLocales(); + foreach ($locales as $locale) { + $modelFactory = new Garp_I18n_ModelFactory($locale); + $i18nModel = $modelFactory->getModel($model); + self::_incrementMemcacheVersion($i18nModel); + } + } } } } @@ -201,4 +209,14 @@ class Garp_Cache_Manager { } return $tags; } + + /** + * Increment the version to invalidate a given model's cache. + * @param Garp_Model_Db $model + * @return Void + */ + protected static function _incrementMemcacheVersion(Garp_Model_Db $model) { + $cache = new Garp_Cache_Store_Versioned($model->getName().'_version'); + $cache->incrementVersion(); + } }
Tweaks that clear internationalized cache.
grrr-amsterdam_garp3
train
php
58586e22a3c75ec8b06121360f2ec0462a86a998
diff --git a/includes/common.php b/includes/common.php index <HASH>..<HASH> 100644 --- a/includes/common.php +++ b/includes/common.php @@ -559,10 +559,9 @@ set_exception_handler(function (?Throwable $exception) use ($_oldExceptionHandle echo $exception->getMessage(), "\n"; echo $exception->getTraceAsString(), "\n"; } else if (DEBUG < DEBUG_INFO || !class_exists('wulaphp\io\Response')) { - status_header(503); print_exception($exception); } else { - Response::respond(503, $exception->getMessage()); + Response::respond(500, $exception->getMessage()); } } catch (Throwable $te) { print_exception($te);
change <I> to <I>
ninggf_wulaphp
train
php
b540dd31f48e34ede3c5682ad00515c5751eb84f
diff --git a/src/feat/agencies/bootstrap.py b/src/feat/agencies/bootstrap.py index <HASH>..<HASH> 100755 --- a/src/feat/agencies/bootstrap.py +++ b/src/feat/agencies/bootstrap.py @@ -212,7 +212,7 @@ class _Bootstrap(object): def __exit__(self, type, value, traceback): if type is not None: - raise type, value, traceback + raise type(value), None, traceback if self.opts.agency_daemonize: tmp = tempfile.mktemp(suffix="feat.temp.log") log.info("run", "Logging will temporarily be done to: %s", tmp)
Fixes PEP8 warning.
f3at_feat
train
py
b6153cedb00394d48ec2a9b4db7d58816fc26cfd
diff --git a/src/edeposit/amqp/ltp/info_composer.py b/src/edeposit/amqp/ltp/info_composer.py index <HASH>..<HASH> 100755 --- a/src/edeposit/amqp/ltp/info_composer.py +++ b/src/edeposit/amqp/ltp/info_composer.py @@ -164,11 +164,15 @@ def compose_info(root_dir, files, hash_fn, aleph_record): with open(hash_fn) as f: hash_file_md5 = hashlib.md5(f.read()).hexdigest() + schema_location = "http://www.ndk.cz/standardy-digitalizace/info11.xsd" document = { "info": { + "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + "@xsi:noNamespaceSchemaLocation": schema_location, "created": time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime()), "metadataversion": "1.0", "packageid": _path_to_id(root_dir), + "mainmets": "", # not used in SIP # "mainmets": _get_localized_fn(metadata_fn, root_dir),
Added schema location and blank <mainmets> as requested. Fixed #<I>.
edeposit_edeposit.amqp.ltp
train
py
0ab980fab2c0240fde0e7a871eaed08b6ca86cca
diff --git a/src/Module/ImportSchemeCollectionProvider.php b/src/Module/ImportSchemeCollectionProvider.php index <HASH>..<HASH> 100644 --- a/src/Module/ImportSchemeCollectionProvider.php +++ b/src/Module/ImportSchemeCollectionProvider.php @@ -6,6 +6,7 @@ */ namespace BEAR\Resource\Module; +use BEAR\Package\AppInjector; use BEAR\Resource\Annotation\AppName; use BEAR\Resource\Annotation\ImportAppConfig; use BEAR\Resource\AppAdapter; @@ -54,7 +55,9 @@ class ImportSchemeCollectionProvider implements ProviderInterface { $schemeCollection = (new SchemeCollectionProvider($this->appName, $this->injector))->get(); foreach ($this->importAppConfig as $importApp) { - $adapter = new AppAdapter($this->injector, $importApp->appName); + /* @var \BEAR\Resource\ImportApp */ + $injector = class_exists(AppInjector::class) ? new AppInjector($importApp->appName, $importApp->context) : $this->injector; + $adapter = new AppAdapter($injector, $importApp->appName); $schemeCollection ->scheme('page')->host($importApp->host)->toAdapter($adapter) ->scheme('app')->host($importApp->host)->toAdapter($adapter);
quick dirty hack to fix import injector Injector should be isloated in each name space
bearsunday_BEAR.Resource
train
php
07be4bab7827a7a6db047a1d7c8f7892391ed024
diff --git a/gridtk/manager.py b/gridtk/manager.py index <HASH>..<HASH> 100644 --- a/gridtk/manager.py +++ b/gridtk/manager.py @@ -41,7 +41,7 @@ class JobManager: if hasattr(self, 'session'): raise RuntimeError('Dead lock detected. Please do not try to lock the session when it is already locked!') - if sqlalchemy_version < (0,7,8): + if sqlalchemy_version < [0,7,8]: # for old sqlalchemy versions, in some cases it is required to re-generate the enging for each session self._engine = sqlalchemy.create_engine("sqlite:///"+self._database) self._session_maker = sqlalchemy.orm.sessionmaker(bind=self._engine)
Added fix for python 3 that cannot compare tuples with lists.
bioidiap_gridtk
train
py
cc7c377bcd6f63e926d959998d10c2f04c413b06
diff --git a/salt/returners/pgjsonb.py b/salt/returners/pgjsonb.py index <HASH>..<HASH> 100644 --- a/salt/returners/pgjsonb.py +++ b/salt/returners/pgjsonb.py @@ -128,6 +128,8 @@ from __future__ import absolute_import from contextlib import contextmanager import sys import json +import time +import datetime import logging # Import salt libs @@ -254,7 +256,7 @@ def returner(ret): def event_return(events): ''' - Return event to mysql server + Return event to Pg server Requires that configuration be enabled via 'event_return' option in master config. @@ -263,8 +265,8 @@ def event_return(events): for event in events: tag = event.get('tag', '') data = event.get('data', '') - sql = '''INSERT INTO salt_events (tag, data, master_id) - VALUES (%s, %s, %s)''' + sql = '''INSERT INTO salt_events (tag, data, master_id, alter_time) + VALUES (%s, %s, %s, time.localtime()) cur.execute(sql, (tag, psycopg2.extras.Json(data), __opts__['id']))
Fill alter_time field in salt_events with current time with timezone.
saltstack_salt
train
py
886ff04fb841db140799de4c9ad683adf5093384
diff --git a/tests/test_transcript.py b/tests/test_transcript.py index <HASH>..<HASH> 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -54,15 +54,15 @@ class CmdLineApp(Cmd): """Repeats what you tell me to.""" arg = ''.join(arg) if opts.piglatin: - arg = '%s%say' % (arg[1:].rstrip(), arg[0]) + arg = '%s%say' % (arg[1:], arg[0]) if opts.shout: arg = arg.upper() repetitions = opts.repeat or 1 for i in range(min(repetitions, self.maxrepeats)): - self.stdout.write(arg) - self.stdout.write('\n') - # self.stdout.write is better than "print", because Cmd can be - # initialized with a non-standard output destination + self.poutput(arg) + # recommend using the poutput function instead of + # self.stdout.write or "print", because Cmd allows the user + # to redirect output do_say = do_speak # now "say" is a synonym for "speak" do_orate = do_speak # another synonym, but this one takes multi-line input
Updates to CmdLineApp()
python-cmd2_cmd2
train
py
a5ed1c1044c037416753fa728dcf978b4c04ad42
diff --git a/stanza/tests/constituency/test_vietnamese.py b/stanza/tests/constituency/test_vietnamese.py index <HASH>..<HASH> 100644 --- a/stanza/tests/constituency/test_vietnamese.py +++ b/stanza/tests/constituency/test_vietnamese.py @@ -58,7 +58,7 @@ def test_vi_embedding(): with tempfile.TemporaryDirectory() as tempdir: emb_filename = os.path.join(tempdir, "emb.txt") pt_filename = os.path.join(tempdir, "emb.pt") - with open(emb_filename, "w") as fout: + with open(emb_filename, "w", encoding="utf-8") as fout: fout.write(VI_EMBEDDING) pt = pretrain.Pretrain(vec_filename=emb_filename, save_to_file=False)
Set encoding in the unit test to make it run in Windows
stanfordnlp_stanza
train
py
10002dc2bef237f98c3483da7ee663e7a577eb8e
diff --git a/app/view/Gruntfile.js b/app/view/Gruntfile.js index <HASH>..<HASH> 100644 --- a/app/view/Gruntfile.js +++ b/app/view/Gruntfile.js @@ -167,6 +167,21 @@ module.exports = function(grunt) { ] }] }, + locale_datepicker: { + options: { + preserveComments: 'some' + }, + files: [{ + expand: true, + ext: '.min.js', + cwd: 'lib/datepicker', + src: '*.js', + dest: 'js/locale/datepicker', + rename: function(destBase, destPath) { + return destBase + '/' + destPath.replace('datepicker-', '').replace('-', '_'); + } + }] + }, bootstrap: { files: { 'lib/bootstrap-sass.generated/bootstrap.min.js': [
Make grunt generate uglified datepicker locale file and rename them to ease usage
bolt_bolt
train
js
b883c44eda13c62ad35a2d21c591d4d3cbfd453c
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100644 --- a/lib/config.js +++ b/lib/config.js @@ -195,6 +195,10 @@ function config (opts) { }) transport.on('error', err => { + agent.logger.error('APM Server transport error:', err.stack) + }) + + transport.on('request-error', err => { const haveAccepted = Number.isFinite(err.accepted) const haveErrors = Array.isArray(err.errors) let msg
fix: log APM Server API errors correctly (#<I>) APM Server API errors are emitted by the HTTP client as 'request-error' events. In case of more serious errors, the 'error' event is still used, but indicates that the client could not recover from the error.
elastic_apm-agent-nodejs
train
js
36911b50ed93beca250d7c7e916f5cf58d8a2e63
diff --git a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java +++ b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java @@ -326,6 +326,12 @@ public class GermanSpellerRule extends CompoundAwareHunspellRule { return Collections.singletonList("Worüber"); } else if (word.equals("par")) { return Collections.singletonList("paar"); + } else if (word.equals("vllt")) { + return Collections.singletonList("vielleicht"); + } else if (word.equals("iwie")) { + return Collections.singletonList("irgendwie"); + } else if (word.equals("sry")) { + return Collections.singletonList("sorry"); } else if (word.equals("Zynik")) { return Collections.singletonList("Zynismus"); } else if (word.matches("[aA]wa")) {
[de] suggestions for colloquial abbreviations
languagetool-org_languagetool
train
java
bb681c5a024fc2e9b552eecbd4ee614cdef266f3
diff --git a/packages/resume/index.js b/packages/resume/index.js index <HASH>..<HASH> 100644 --- a/packages/resume/index.js +++ b/packages/resume/index.js @@ -1,8 +1,5 @@ require("../../babel.register.js"); -const path = require("path"); -process.env.NODE_CONFIG_DIR = path.join(__dirname, "../../config"); - const render = require("./lib/renderHtml").default; module.exports = {
chore(resume): Remove unnecessary reference to `NODE_CONFIG_DIR`. To actually kick a patch release of `cea4edfabd<I>e1c<I>ac<I>c0e<I>b6b8add<I>c7`. Should actually find a way of doing this in #<I> without having to do this. Not the first or second or third time I've had to find something to "fix" to push a release out...
randytarampi_me
train
js
9f60746b076cf3d0d50713d2594547aa09766e1b
diff --git a/lib/memcached.js b/lib/memcached.js index <HASH>..<HASH> 100644 --- a/lib/memcached.js +++ b/lib/memcached.js @@ -596,8 +596,10 @@ Client.config = { } }; - memcached.delegateCallback = function(master, err, data, cb){ + memcached.delegateCallback = function(){ this.activeQueries--; + var master = arguments[0]; + var cb = arguments[arguments.length-1]; var args = Array.prototype.slice.call(arguments, 1, arguments.length-1); cb.apply(master, args); }; diff --git a/test/common.js b/test/common.js index <HASH>..<HASH> 100644 --- a/test/common.js +++ b/test/common.js @@ -14,7 +14,7 @@ * @type {Object} * @api public */ -var testMemcachedHost = process.env.MEMCACHED__HOST || '10.211.55.5'; +var testMemcachedHost = '127.0.0.1'; exports.servers = { single: testMemcachedHost + ':11211'
Fixed a bug in multi caused by the new queue limit. Modified mocha tests to point locally by default.
3rd-Eden_memcached
train
js,js
7a55c5fe95493146a811900d55187d0751e96ecb
diff --git a/src/Oci8/Connectors/OracleConnector.php b/src/Oci8/Connectors/OracleConnector.php index <HASH>..<HASH> 100644 --- a/src/Oci8/Connectors/OracleConnector.php +++ b/src/Oci8/Connectors/OracleConnector.php @@ -183,8 +183,11 @@ class OracleConnector extends Connector implements ConnectorInterface $address .= '(ADDRESS = (PROTOCOL = ' . $config['protocol'] . ')(HOST = ' . trim($host[$i]) . ')(PORT = ' . $config['port'] . '))'; } + // backwards compatibility for users dont have this field in their php config + $loadBalance = $config['load_balance'] ?? 'yes'; + // create a tns with multiple address connection - $config['tns'] = "(DESCRIPTION = {$address} (LOAD_BALANCE = {$config['load_balance']}) (FAILOVER = on) (CONNECT_DATA = (SERVER = DEDICATED) ({$config['service']})))"; + $config['tns'] = "(DESCRIPTION = {$address} (LOAD_BALANCE = {$loadBalance}) (FAILOVER = on) (CONNECT_DATA = (SERVER = DEDICATED) ({$config['service']})))"; } return $config;
add backwards compatibility for load balance
yajra_laravel-oci8
train
php
0043e96c9702454ae22e9b71e14298c592a6b5a5
diff --git a/core/src/main/java/tachyon/TachyonURI.java b/core/src/main/java/tachyon/TachyonURI.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/tachyon/TachyonURI.java +++ b/core/src/main/java/tachyon/TachyonURI.java @@ -102,7 +102,7 @@ public class TachyonURI implements Comparable<TachyonURI> { // Add a slash to parent's path so resolution is compatible with URI's URI parentUri = parent.mUri; String parentPath = parentUri.getPath(); - if (!parentPath.equals("")) { + if ((!parentPath.equals("")) && (!parentPath.equals("/"))) { parentPath += SEPARATOR; } try {
this commit fix the failed unit test in last commit
Alluxio_alluxio
train
java
86055f49e90128120d9bdac05822e77f31982416
diff --git a/src/app/phpbob/analyze/PhpFileBuilder.php b/src/app/phpbob/analyze/PhpFileBuilder.php index <HASH>..<HASH> 100644 --- a/src/app/phpbob/analyze/PhpFileBuilder.php +++ b/src/app/phpbob/analyze/PhpFileBuilder.php @@ -131,7 +131,7 @@ class PhpFileBuilder { switch (strtolower($codePart)) { case Phpbob::KEYWORD_EXTENDS: $inExtendsClause = true; - continue; + break; } } @@ -464,4 +464,4 @@ class PhpFileBuilder { private function createPrependingCode(PhpStatement $phpStatement) { return implode(PHP_EOL, $phpStatement->getPrependingCommentLines()); } -} \ No newline at end of file +}
continue in switch causes error in PHP <I> break
n2n_phpbob
train
php
a7e34be021c1aab69bbedf9d5fa647483ab47aba
diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100644 --- a/tests.py +++ b/tests.py @@ -35,6 +35,21 @@ class MarylandLookupTestCase(unittest.TestCase): self.assertNotEqual(us.states.lookup('Virginia'), us.states.MD) +class LookupTestCase(unittest.TestCase): + + def test_abbr_lookup(self): + for state in us.STATES: + self.assertEqual(us.states.lookup(state.abbr), state) + + def test_fips_lookup(self): + for state in us.STATES: + self.assertEqual(us.states.lookup(state.fips), state) + + def test_name_lookup(self): + for state in us.STATES: + self.assertEqual(us.states.lookup(state.name), state) + + class MappingTestCase(unittest.TestCase): def test_mapping(self):
add additional tests for lookups by name, abbr, and fips
unitedstates_python-us
train
py
23ad729f754dd4addb4601c8e972d36456743b13
diff --git a/docstamp/inkscape.py b/docstamp/inkscape.py index <HASH>..<HASH> 100644 --- a/docstamp/inkscape.py +++ b/docstamp/inkscape.py @@ -80,9 +80,12 @@ def inkscape_export(input_file, output_file, export_flag="-A", dpi=90): if not '=' in export_flag: export_flag += ' ' - arg_strings = "{}{} --export-dpi={} {}".format(export_flag, output_file, dpi, input_file) + arg_strings = [] + arg_strings += ['{}{}'.format(export_flag, output_file)] + arg_strings += ['--export-dpi={}'.format(dpi)] + arg_strings += [input_file] - return call_inkscape(arg_strings.split()) + return call_inkscape(arg_strings) def svg2pdf(svg_file_path, pdf_file_path, dpi=150):
inkscape.py: build args for cmd call as a list
PythonSanSebastian_docstamp
train
py
37a4bae369db488e1918b24e95fafdbc8eb68591
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages, Command install_requires = [ - 'Django==1.4.2', + 'Django==1.4.3', 'South==0.7.6', 'Pillow==1.7.7', 'celery==3.0.12', @@ -15,10 +15,10 @@ install_requires = [ 'django-uuidfield==0.4.0', 'django-storages==1.1.5', 'django-configurations==0.1', - 'docutils==0.8.1', - 'eventlet==0.9.16', - 'gunicorn==0.14.6', - 'netaddr==0.7.6', + 'docutils==0.10', + 'eventlet==0.10.0', + 'gunicorn==0.17.1', + 'netaddr==0.7.10', 'requests==1.0.4', ]
Upgraded a few more dependencies.
mvantellingen_localshop
train
py
381b20f11ce925792187b8cac726214f0e72d724
diff --git a/closure/goog/ui/datepicker.js b/closure/goog/ui/datepicker.js index <HASH>..<HASH> 100644 --- a/closure/goog/ui/datepicker.js +++ b/closure/goog/ui/datepicker.js @@ -1099,7 +1099,7 @@ goog.ui.DatePicker.prototype.createButton_ = function(parentNode, label, // Since this is a button, the default action is to submit a form if the // node is added inside a form. Prevent this. e.preventDefault(); - method.call(this); + method.call(this, e); }); return el;
Fix for JS error in goog.ui.DatePicker R=pupius DELTA=1 (0 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-library
train
js
44f52ce265687dee24b39d0399f019e2967ebc93
diff --git a/gspreadsheet/gspreadsheet.py b/gspreadsheet/gspreadsheet.py index <HASH>..<HASH> 100644 --- a/gspreadsheet/gspreadsheet.py +++ b/gspreadsheet/gspreadsheet.py @@ -188,6 +188,7 @@ class GSpreadsheet(object): pass self.feed = self.get_feed() + self.fieldnames = self.feed.entry[0].custom.keys() def get_client(self): """Get the google data client.""" diff --git a/gspreadsheet/tests.py b/gspreadsheet/tests.py index <HASH>..<HASH> 100644 --- a/gspreadsheet/tests.py +++ b/gspreadsheet/tests.py @@ -47,6 +47,11 @@ class Basics(TestCase): # continue in the same test to avoid making a new connection :( + # test_fieldnames_exist_and_are_accurate(self): + # assertListEqual requires python>=2.7 + self.assertListEqual(sorted(sheet.fieldnames), + sorted(['name', 'widgets', 'date', 'price'])) + # test_can_mark_row_as_readonly(self): sheet.readonly = True with self.assertRaises(ReadOnlyException):
add fieldnames property that stores fields used in the sheet
texastribune_gspreadsheet
train
py,py
d944dd1c5dc3bbfa27a72d12b9e13fd17bde7e6e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,10 @@ setup( author_email='mixxorz@gmail.com', maintainer='Mitchel Cabuloy', maintainer_email='mixxorz@gmail.com', - install_requires=open('requirements.txt').read().split(), + install_requires=[ + 'behave', + 'Django>=1.4' + ], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console',
Reverted install_requires section of setup.py to a regular list
behave_behave-django
train
py
15c49bcc48fe9898255804ebed9a66fa1c2522d9
diff --git a/Arabic/Numbers.php b/Arabic/Numbers.php index <HASH>..<HASH> 100755 --- a/Arabic/Numbers.php +++ b/Arabic/Numbers.php @@ -430,7 +430,7 @@ class I18N_Arabic_Numbers } } - if ($segment[$key] != '') { + if (isset($segment[$key]) && $segment[$key] != '') { $segment[$key] = trim($segment[$key]); } }
Check if the index is set to resolve #<I> Undefined index notice
alhoqbani_ar-php
train
php
0ef3f2c60bb540dd5ec171d6b615eeeb78677dd5
diff --git a/lib/endpoints/class-wp-rest-users-controller.php b/lib/endpoints/class-wp-rest-users-controller.php index <HASH>..<HASH> 100755 --- a/lib/endpoints/class-wp-rest-users-controller.php +++ b/lib/endpoints/class-wp-rest-users-controller.php @@ -501,7 +501,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { 'email' => $user->user_email, 'url' => $user->user_url, 'description' => $user->description, - 'link' => get_author_posts_url( $user->ID ), + 'link' => get_author_posts_url( $user->ID, $user->user_nicename ), 'nickname' => $user->nickname, 'slug' => $user->user_nicename, 'registered_date' => date( 'c', strtotime( $user->user_registered ) ),
Avoid unnecessary SQL query by passing `$user_nicename` If no `$user_nicename` is supplied, `get_author_posts_url()` calls `get_userdata()` to get the `$user_nicename`. Because we already have it, we don't need to incur an unnecessary database hit.
WP-API_WP-API
train
php
52fa63af48f07080ca06b1906b7ccd564e9fe2a4
diff --git a/jax/random.py b/jax/random.py index <HASH>..<HASH> 100644 --- a/jax/random.py +++ b/jax/random.py @@ -759,7 +759,8 @@ def gumbel(key, shape=(), dtype=onp.float64): @partial(jit, static_argnums=(1, 2)) def _gumbel(key, shape, dtype): _check_shape("gumbel", shape) - return -np.log(-np.log(uniform(key, shape, dtype))) + return -np.log(-np.log( + uniform(key, shape, dtype, minval=onp.finfo(dtype).eps, maxval=1.))) def laplace(key, shape=(), dtype=onp.float64): @@ -781,7 +782,8 @@ def laplace(key, shape=(), dtype=onp.float64): @partial(jit, static_argnums=(1, 2)) def _laplace(key, shape, dtype): _check_shape("laplace", shape) - u = uniform(key, shape, dtype, minval=-1., maxval=1.) + u = uniform( + key, shape, dtype, minval=-1. + np.finfo(dtype).epsneg, maxval=1.) return lax.mul(lax.sign(u), lax.log1p(lax.neg(lax.abs(u))))
Avoid generating non-finite values from gumbel and laplace In the case of gumbel, we take the log(-log(x)), as such we would not want to let x be 0 or 1 as we would get a non-finite number. In the case of laplace, we take the log1p(-abs(x)), as such we would not want to let x be -1 or 1 as we would get a non-finite number. This was found by inspection, I have no evidence that this happens in practice.
tensorflow_probability
train
py
751c7f9b68235624d273a021667f8c5749a34e7d
diff --git a/Entity/RealTimeCampaignRepository.php b/Entity/RealTimeCampaignRepository.php index <HASH>..<HASH> 100644 --- a/Entity/RealTimeCampaignRepository.php +++ b/Entity/RealTimeCampaignRepository.php @@ -10,9 +10,7 @@ use Mautic\CampaignBundle\Executioner\ContactFinder\Limiter\ContactLimiter; class RealTimeCampaignRepository extends CampaignRepository { - /** - * * @param EntityManager $em * @param ClassMetadata $class */ @@ -22,7 +20,7 @@ class RealTimeCampaignRepository extends CampaignRepository $class = new ClassMetadata(Campaign::class); } parent::__construct($em, $class); - } + } /** * Get pending contact IDs for a campaign through ContactLimiter, skipping @@ -49,8 +47,10 @@ class RealTimeCampaignRepository extends CampaignRepository if ($limiter->hasCampaignLimit() && $limiter->getCampaignLimitRemaining() < $limiter->getBatchLimit()) { $pulled = []; for ($i = $limiter->getCampaignLimitRemaining(); - $i >= ($limiter->getCampaignLimitRemaining() - $limiter->getBatchLimit()); $i--) { - $pulled[] = $contacts[$i]; + $i > ($limiter->getCampaignLimitRemaining() - $limiter->getBatchLimit()); --$i) { + if (isset($contacts[$i])) { + $pulled[] = $contacts[$i]; + } } $pulled = $contacts; }
[ENG-<I>] Fixed RealTimeCampaignRepository when they're limits set on ContactLimiter
TheDMSGroup_mautic-contact-source
train
php
ef64c3476d5d4db35789791c2aa3e3fd0f9d381c
diff --git a/phpsec/phpsec.crypt.php b/phpsec/phpsec.crypt.php index <HASH>..<HASH> 100644 --- a/phpsec/phpsec.crypt.php +++ b/phpsec/phpsec.crypt.php @@ -13,7 +13,7 @@ * Provides methods for encrypting data. */ class phpsecCrypt { - const ALGO = MCRYPT_BLOWFISH; + const ALGO = MCRYPT_RIJNDAEL_256; const ALGO_MODE = MCRYPT_MODE_CBC; const HASH_TYPE = 'sha256'; @@ -41,7 +41,7 @@ class phpsecCrypt { } $td = mcrypt_module_open(self::ALGO, '', self::ALGO_MODE, ''); - +print_r(mcrypt_list_algorithms()); /* Create IV. */ $iv = phpsecRand::bytes(mcrypt_enc_get_iv_size($td));
Changed default encryption algorithm to RIJNDAEL-<I>.
phpsec_phpSec
train
php
fb1e2fdc4406d0a1fb319a87cdd4568921f9aa0f
diff --git a/connection_test.go b/connection_test.go index <HASH>..<HASH> 100644 --- a/connection_test.go +++ b/connection_test.go @@ -9,6 +9,7 @@ package amqp import ( "net" + "net/url" "sync" "testing" ) @@ -75,3 +76,14 @@ func TestConcurrentClose(t *testing.T) { } wg.Wait() } + +func TestConnectionWithInvalidURIFails(t *testing.T) { + _, err := DialConfig(":,%not-a-valid-URI((", Config{}) + if err == nil { + t.Fatalf("connection with invalid URI is expected to fail") + } + + if _, urlerr := err.(*url.Error); !urlerr { + t.Fatalf("expected a url.Error, got %+v", err) + } +} \ No newline at end of file diff --git a/uri.go b/uri.go index <HASH>..<HASH> 100644 --- a/uri.go +++ b/uri.go @@ -54,6 +54,11 @@ type URI struct { func ParseURI(uri string) (URI, error) { builder := defaultURI + _, err := url.ParseRequestURI(uri) + if err != nil { + return builder, err + } + u, err := url.Parse(uri) if err != nil { return builder, err
Validate URI before attempting to use it
streadway_amqp
train
go,go
4d98d538e527a481f085351752c124ce786b11aa
diff --git a/src/main/java/net/dv8tion/jda/audio/AudioWebSocket.java b/src/main/java/net/dv8tion/jda/audio/AudioWebSocket.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/dv8tion/jda/audio/AudioWebSocket.java +++ b/src/main/java/net/dv8tion/jda/audio/AudioWebSocket.java @@ -51,7 +51,7 @@ public class AudioWebSocket extends WebSocketAdapter private boolean connected = false; private boolean ready = false; private Thread keepAliveThread; - public static WebSocket socket; + public WebSocket socket; private String endpoint; private String wssEndpoint;
made socket no longer static. This is a leftover from when I was first implementing audio. Thank you Kantenkugel the bug-hunter.
DV8FromTheWorld_JDA
train
java
57773cfa67a2e2b75def578d219d74a0c55fe884
diff --git a/ng-background.js b/ng-background.js index <HASH>..<HASH> 100644 --- a/ng-background.js +++ b/ng-background.js @@ -8,13 +8,15 @@ module.exports = angular.module('ngBackground', []) element.css({ 'background-image': 'url(' + img +')', 'background-size': attrs.ngBackgroundSize || 'cover', - 'background-position': attrs.ngBackgroundPosition || 'center' + 'background-position': attrs.ngBackgroundPosition || 'center', + 'background-repeat': attrs.ngBackgroundRepeat || 'no-repeat' }); } else { element.css({ 'background-image': '', 'background-size': '', - 'background-position': '' + 'background-position': '', + 'background-repeat': '' }); } };
add ng-background-repeat
attrs_ng-background
train
js
85aeaac23a94e4ceea70e7c0af7e3ba60a64e7ff
diff --git a/seefor.go b/seefor.go index <HASH>..<HASH> 100644 --- a/seefor.go +++ b/seefor.go @@ -128,10 +128,15 @@ func WrapBeforeHandler(handler http.Handler) Before { } // UseTimer set timer for meaturing endpoint performance. -// If timer is nil then a new timer will be created. +// If timer is nil and no timer exists +// then a new timer will be created +// else existing timer will be returned. // You can serve statistics internal using Timer as handler func (c4 *Seefor) UseTimer(timer *Timer) *Timer { if timer == nil { + if c4.timer != nil { + return c4.timer + } timer = NewTimer() } c4.timer = timer diff --git a/seefor_test.go b/seefor_test.go index <HASH>..<HASH> 100644 --- a/seefor_test.go +++ b/seefor_test.go @@ -188,6 +188,9 @@ func TestSeeforTimer(t *testing.T) { }) timer := router.UseTimer(nil) + timer2 := router.UseTimer(nil) + assert.Exactly(t, timer, timer2) + assert.True(t, assert.ObjectsAreEqual(timer, timer2)) ts := httptest.NewServer(router) defer ts.Close()
Check first if there is a timer and return it
vanng822_r2router
train
go,go
e9fe0d803d1cb116eb90953a8025708cc6d09810
diff --git a/spec/infinispan_cluster_spec.js b/spec/infinispan_cluster_spec.js index <HASH>..<HASH> 100644 --- a/spec/infinispan_cluster_spec.js +++ b/spec/infinispan_cluster_spec.js @@ -32,13 +32,17 @@ describe('Infinispan cluster client', function() { .catch(t.failed(done)).finally(done); }); - it('can iterate over entries in a cluster, one entry at the time', - tests.iterateEntries('cluster', 1, client) - ); + if (process.env.protocol == null || process.env.protocol >= '2.5') { - it('can iterate over entries in a cluster, more than one entry at the time', - tests.iterateEntries('cluster', 3, client) - ); + it('can iterate over entries in a cluster, one entry at the time', + tests.iterateEntries('cluster', 1, client) + ); + + it('can iterate over entries in a cluster, more than one entry at the time', + tests.iterateEntries('cluster', 3, client) + ); + + } it('can remove listener in cluster', function(done) { client .then(t.assert(t.clear()))
HRJS-<I> Iteration tests should only run with protocol <I> or above
infinispan_js-client
train
js
79ce376f953d8c91014e21e4365a4e1d184b5e9d
diff --git a/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/CoordinatorLayoutView.java b/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/CoordinatorLayoutView.java index <HASH>..<HASH> 100644 --- a/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/CoordinatorLayoutView.java +++ b/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/CoordinatorLayoutView.java @@ -3,6 +3,7 @@ package com.navigation.reactnative; import android.content.Context; import android.os.Build; import android.view.MotionEvent; +import android.view.View; import android.view.ViewConfiguration; import android.widget.ScrollView; @@ -47,7 +48,8 @@ public class CoordinatorLayoutView extends CoordinatorLayout { return (ScrollView) getChildAt(i); if (getChildAt(i) instanceof TabBarView) { TabBarView tabBarView = ((TabBarView) getChildAt(i)); - return (ScrollView) tabBarView.getTabAt(tabBarView.getCurrentItem()).getChildAt(0); + View tabContent = tabBarView.getTabAt(tabBarView.getCurrentItem()).getChildAt(0); + return tabContent instanceof ScrollView ? (ScrollView) tabContent : null; } } return null;
Prevented error if tab content view isn't a scrollview
grahammendick_navigation
train
java
769fe9d6d6f64f77dfb875b2231c428277fe5df7
diff --git a/growler/mw/__init__.py b/growler/mw/__init__.py index <HASH>..<HASH> 100644 --- a/growler/mw/__init__.py +++ b/growler/mw/__init__.py @@ -8,6 +8,10 @@ namespace_packages keyword in their setup.py's setup() function. """ import sys -from growler.ext import GrowlerExtensionImporter +import growler.ext -sys.modules[__name__] = GrowlerExtensionImporter(__name__) +importer = growler.ext.__class__() +importer.__path__ = 'growler.mw' +importer.__mods__ = {} + +sys.modules[__name__] = importer diff --git a/tests/test_growler_ext.py b/tests/test_growler_ext.py index <HASH>..<HASH> 100644 --- a/tests/test_growler_ext.py +++ b/tests/test_growler_ext.py @@ -5,6 +5,7 @@ import sys import pytest from unittest import mock +import growler.mw @pytest.fixture
growler.mw: Fixed old implementation, now makes its own extension importer object as module replacement.
pyGrowler_Growler
train
py,py
982676b6930108aa23b230884cc481fa5cbdca3c
diff --git a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/ReportService.java b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/ReportService.java index <HASH>..<HASH> 100755 --- a/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/ReportService.java +++ b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/ReportService.java @@ -263,6 +263,8 @@ public class ReportService { private String subcol_pct_exp = null; + private String showrows = null; + /** @@ -1209,5 +1211,12 @@ public class ReportService { public void setSubcol_pct_exp(String subcol_pct_exp) { this.subcol_pct_exp = subcol_pct_exp; } - + + public String getShowrows() { + return showrows; + } + + public void setShowrows(String showrows) { + this.showrows = showrows; + } }
add showrows in the report service
intuit_QuickBooks-V3-Java-SDK
train
java
90b5982daf156597f4937c7e5475a3c6fee831aa
diff --git a/src/joint.dia.paper.js b/src/joint.dia.paper.js index <HASH>..<HASH> 100644 --- a/src/joint.dia.paper.js +++ b/src/joint.dia.paper.js @@ -344,8 +344,10 @@ joint.dia.Paper = Backbone.View.extend({ if (this.sourceView) { this.sourceView.pointerup(evt, localPoint.x, localPoint.y); - delete this.sourceView; - + + //"delete sourceView" occasionally throws an error in chrome (illegal access exception) + this.sourceView = null; + } else { this.trigger('blank:pointerup', evt, localPoint.x, localPoint.y);
fix chrome's illegal access exception on pointerup in joint.dia.Paper
clientIO_joint
train
js
0ce27f97fab4f10e2fef1b9324cd32fe0c1dfdb3
diff --git a/test/normal-test.js b/test/normal-test.js index <HASH>..<HASH> 100644 --- a/test/normal-test.js +++ b/test/normal-test.js @@ -10,14 +10,9 @@ function parse(src) { try { return toml.parse(src); } catch (err) { - var o = {}; - Object.defineProperty(o, 'ERROR', { - get: function() { - return 'Line ' + err.line + ', column ' + err.column + ': ' + err; - }, - enumerable: true - }); - return o; + return { + ERROR: 'Line ' + err.line + ', column ' + err.column + ': ' + err + }; } }
Remove dirty hacks in test scripts
jakwings_toml-j0.4
train
js
57d0f94c90a733add931ce56d3281a359e3c306a
diff --git a/hypercorn/logging.py b/hypercorn/logging.py index <HASH>..<HASH> 100644 --- a/hypercorn/logging.py +++ b/hypercorn/logging.py @@ -13,6 +13,7 @@ class AccessLogger: self.logger = target elif target is not None: self.logger = logging.getLogger("hypercorn.access") + self.logger.propagate = False self.logger.handlers = [] if target == "-": self.logger.addHandler(logging.StreamHandler(sys.stdout))
Don't propagate access logs If logging has been setup within an application, it is used here for the access logs instead of the format specified in the hypercorn config file. Not propagating the logger fixes this. This follows the same pattern as gunicorn, as seen here: <URL>
pgjones_hypercorn
train
py
5aa4241388ab30ddc77314203e56225bb4b2f10d
diff --git a/core/DataAccess/ArchiveWriter.php b/core/DataAccess/ArchiveWriter.php index <HASH>..<HASH> 100644 --- a/core/DataAccess/ArchiveWriter.php +++ b/core/DataAccess/ArchiveWriter.php @@ -239,7 +239,7 @@ class ArchiveWriter return true; } - protected function flushSpools() + public function flushSpools() { $this->flushSpool('numeric'); $this->flushSpool('blob');
Makes flushSpools public available (#<I>)
matomo-org_matomo
train
php
1385645e8e94e746a89cf1bb46f3e79a1e6883bb
diff --git a/media/boom-assets/js/boom.assets.js b/media/boom-assets/js/boom.assets.js index <HASH>..<HASH> 100755 --- a/media/boom-assets/js/boom.assets.js +++ b/media/boom-assets/js/boom.assets.js @@ -361,7 +361,7 @@ $.widget( 'boom.browser_asset', $.boom.browser, $('#b-assets-view-thumbs div').removeClass('selected'); }) .on( 'click', '#b-button-multiaction-tag', function(){ - $.boom.dialog.open({ + var dialog = $.boom.dialog.open({ url: '/cms/tags/asset/list/' + self.selected.join( '-' ), title: 'Asset tags', width: 440, @@ -370,7 +370,17 @@ $.widget( 'boom.browser_asset', $.boom.browser, type: 'asset', id: self.selected.join( '-' ) }); - } + }, + buttons: [ + { + text: 'Close', + class : 'b-button', + icons: {primary : 'b-button-icon b-button-icon-accept'}, + click: function(event) { + $.boom.dialog.destroy(dialog); + } + } + ] }); });
Removed cancel button from asset multi-tagger
boomcms_boom-core
train
js
c609c35c03629dc38cde960b1ae957553008f712
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js index <HASH>..<HASH> 100644 --- a/bin/templates/scripts/cordova/lib/build.js +++ b/bin/templates/scripts/cordova/lib/build.js @@ -89,8 +89,15 @@ module.exports.run = function (buildOpts) { events.emit('log','\tConfiguration: ' + configuration); events.emit('log','\tPlatform: ' + (buildOpts.device ? 'device' : 'emulator')); - var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device); - return spawn('xcodebuild', xcodebuildArgs, projectPath); + var buildOutputDir = path.join(projectPath, 'build', 'device'); + + // remove the build/device folder before building + return spawn('rm', [ '-rf', buildOutputDir ], projectPath) + .then(function() { + var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device); + return spawn('xcodebuild', xcodebuildArgs, projectPath); + }); + }).then(function () { if (!buildOpts.device || buildOpts.noSign) { return;
CB-<I> - Remove build/device folder before building
apache_cordova-ios
train
js
10a3915c677fc23f2c1028812a3e26af1b9c203b
diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index <HASH>..<HASH> 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -521,13 +521,13 @@ class TargetAndroid(Target): try: with open(join(self.pa_dir, "setup.py")) as fd: setup = fd.read() - deps = re.findall("install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[1] + deps = re.findall("^install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0] deps = ast.literal_eval(deps) except Exception: deps = [] pip_deps = [] for dep in deps: - pip_deps.append('"{}"'.format(dep)) + pip_deps.append("'{}'".format(dep)) # in virtualenv or conda env options = "--user"
Updates p4a deps parsing Now deals with conditional statements introduced in: <URL>
kivy_buildozer
train
py
2f0a49d04ae55c61acdd7741fdf260b1868cfebb
diff --git a/lib/step.js b/lib/step.js index <HASH>..<HASH> 100755 --- a/lib/step.js +++ b/lib/step.js @@ -64,25 +64,24 @@ function Step() { next.parallel = function () { var i = counter; counter++; + function check() { - counter--; if (counter === 0) { // When they're all done, call the callback next.apply(null, results); } } + process.nextTick(check); // Ensures that check is called at least once + return function () { + counter--; // Compress the error from any result to the first argument if (arguments[0]) { results[0] = arguments[0]; } // Send the other results as arguments results[i + 1] = arguments[1]; - if (lock) { - process.nextTick(check); - return - } - check(); + if (!lock) { check(); } }; };
Made next.parallel more consistent with next.group
creationix_step
train
js
e919a008485b3739706968e6ab6ce752f3245e03
diff --git a/activerecord/test/cases/attributes_test.rb b/activerecord/test/cases/attributes_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/attributes_test.rb +++ b/activerecord/test/cases/attributes_test.rb @@ -241,7 +241,7 @@ module ActiveRecord test "attributes not backed by database columns are always initialized" do OverloadedType.create! - model = OverloadedType.first + model = OverloadedType.last assert_nil model.non_existent_decimal model.non_existent_decimal = "123" @@ -253,7 +253,7 @@ module ActiveRecord attribute :non_existent_decimal, :decimal, default: 123 end child.create! - model = child.first + model = child.last assert_equal 123, model.non_existent_decimal end @@ -264,7 +264,7 @@ module ActiveRecord attribute :foo, :string, default: "lol" end child.create! - model = child.first + model = child.last assert_equal "lol", model.foo
Should find last created record Tables in tests are not always empty so `klass.first` does not always find last created record. Fixes #<I>.
rails_rails
train
rb
fbd9c284d27c42d82e22eba0ba175c775d6545c0
diff --git a/lxd/device/nic_bridged.go b/lxd/device/nic_bridged.go index <HASH>..<HASH> 100644 --- a/lxd/device/nic_bridged.go +++ b/lxd/device/nic_bridged.go @@ -28,6 +28,7 @@ import ( "github.com/lxc/lxd/lxd/revert" "github.com/lxc/lxd/lxd/util" "github.com/lxc/lxd/shared" + "github.com/lxc/lxd/shared/api" log "github.com/lxc/lxd/shared/log15" "github.com/lxc/lxd/shared/logger" ) @@ -83,6 +84,10 @@ func (d *nicBridged) validateConfig(instConf instance.ConfigReader) error { return errors.Wrapf(err, "Error loading network config for %q", d.config["network"]) } + if n.Status() == api.NetworkStatusPending { + return fmt.Errorf("Specified network is not fully created") + } + if n.Type() != "bridge" { return fmt.Errorf("Specified network must be of type bridge") }
lxc/device/nic/bridged: Only allow using non-Pending networks
lxc_lxd
train
go
d2515d99e0d0d15ef5e9514d9ea0cd1099a056d7
diff --git a/django_q/models.py b/django_q/models.py index <HASH>..<HASH> 100644 --- a/django_q/models.py +++ b/django_q/models.py @@ -141,6 +141,7 @@ class Schedule(models.Model): return self.func success.boolean = True + last_run.allow_tags = True class Meta: app_label = 'django_q'
fixed regression of task link in schedule admin
Koed00_django-q
train
py
ee074a59af1fe89b5231a3ac83655bceb974eac3
diff --git a/access_group.go b/access_group.go index <HASH>..<HASH> 100644 --- a/access_group.go +++ b/access_group.go @@ -101,7 +101,7 @@ type AccessGroupCertificateCommonName struct { type AccessGroupGSuite struct { Gsuite struct { Email string `json:"email"` - IdentityProviderID string `json:"identity_provider_id"` + ConnectionID string `json:"connection_id"` } `json:"gsuite"` } @@ -125,7 +125,7 @@ type AccessGroupAzure struct { type AccessGroupOkta struct { Okta struct { Name string `json:"name"` - IdentityProviderID string `json:"identity_provider_id"` + ConnectionID string `json:"connection_id"` } `json:"okta"` }
Update the Okta and Gsuite access group structs to match the 'connection_id' format returned by the API (#<I>) identity_provider_id is not the returned value within the access group object at least for okta or gsuite This is related to <URL>
cloudflare_cloudflare-go
train
go
0705efa55eedb15bf0748cee7fa4223d2d7f74bc
diff --git a/packages/insomnia-app/app/models/settings.js b/packages/insomnia-app/app/models/settings.js index <HASH>..<HASH> 100644 --- a/packages/insomnia-app/app/models/settings.js +++ b/packages/insomnia-app/app/models/settings.js @@ -79,7 +79,7 @@ export function init(): BaseSettings { updateAutomatically: true, disableUpdateNotification: false, environmentHighlightColorStyle: 'sidebar-indicator', - autocompleteDelay: 700, + autocompleteDelay: 1200, fontMonospace: null, fontInterface: null, fontSize: 13,
Change default autocomplete delay from <I>ms to <I>ms
getinsomnia_insomnia
train
js
bcff678f21c9afd791a3a5eb2ed198ce8c927d64
diff --git a/client/state/notification-settings/actions.js b/client/state/notification-settings/actions.js index <HASH>..<HASH> 100644 --- a/client/state/notification-settings/actions.js +++ b/client/state/notification-settings/actions.js @@ -56,10 +56,9 @@ export const fetchSettings = () => ( dispatch ) => { data, } ) ) - .catch( ( error ) => + .catch( () => dispatch( { type: NOTIFICATION_SETTINGS_FETCH_FAILED, - error, } ) ); }; @@ -103,16 +102,13 @@ export const saveSettings = ( source, settings, applyToAll = false ) => ( dispat dispatch( showSaveSuccessNotice() ); dispatch( { type: NOTIFICATION_SETTINGS_SAVE_COMPLETE, - error: undefined, data, } ); } ) - .catch( ( error ) => { + .catch( () => { dispatch( showSaveErrorNotice() ); dispatch( { type: NOTIFICATION_SETTINGS_SAVE_FAILED, - error, - data: undefined, } ); } ); };
State: Cleanup notification settings action creators (#<I>)
Automattic_wp-calypso
train
js
db9b2f5405643b3584eaa90b05a3dbfa19d717fb
diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index <HASH>..<HASH> 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -20,6 +20,7 @@ package main import ( "math/rand" "os" + "strings" "time" "github.com/ethereum/go-ethereum/log" @@ -34,7 +35,7 @@ func main() { app.Flags = []cli.Flag{ cli.StringFlag{ Name: "network", - Usage: "name of the network to administer", + Usage: "name of the network to administer (no spaces or hyphens, please)", }, cli.IntFlag{ Name: "loglevel", @@ -47,6 +48,10 @@ func main() { log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(c.Int("loglevel")), log.StreamHandler(os.Stdout, log.TerminalFormat(true)))) rand.Seed(time.Now().UnixNano()) + network := c.String("network") + if strings.Contains(network, " ") || strings.Contains(network, "-") { + log.Crit("No spaces or hyphens allowed in network name") + } // Start the wizard and relinquish control makeWizard(c.String("network")).run() return nil
cmd/puppeth: add constraints to network name (#<I>) * cmd/puppeth: add constraints to network name * cmd/puppeth: update usage of network arg * cmd/puppeth: avoid package dependency on utils
ethereum_go-ethereum
train
go
a1c088c40ea46ba44c194cac7f734a936459faa5
diff --git a/GPy/models/GP_regression.py b/GPy/models/GP_regression.py index <HASH>..<HASH> 100644 --- a/GPy/models/GP_regression.py +++ b/GPy/models/GP_regression.py @@ -103,7 +103,7 @@ class GP_regression(model): return dL_dK def log_likelihood_gradients(self): - return (self.kern.dK_dtheta(self.X,slices1=self.Xslices)*self.dL_dK()[:,:,None]).sum(0).sum(0) + return self.kern.dK_dtheta(self.X,partial=self.dL_dK()) def predict(self,Xnew, slices=None): """
made GP_regression wwork with partial-passed gradients
SheffieldML_GPy
train
py
a92b91336c5cb62b170abe2784916b7e998005f8
diff --git a/lib/github_changelog_generator/options.rb b/lib/github_changelog_generator/options.rb index <HASH>..<HASH> 100644 --- a/lib/github_changelog_generator/options.rb +++ b/lib/github_changelog_generator/options.rb @@ -105,7 +105,11 @@ module GitHubChangelogGenerator def print_options return unless self[:verbose] Helper.log.info "Using these options:" - pp(censored_values) + # For ruby 2.5.0+ + censored_values.each do |key, value| + print(key.inspect, "=>", value.inspect) + puts "" + end puts "" end
fix #<I>; Hang on pretty print of options in <I>-rc (#<I>) * fix #<I>; Hang on pretty print of options in <I>-rc * [formatting] Use #inspect
github-changelog-generator_github-changelog-generator
train
rb
828ab14120035dcf43375599392d02278e81583f
diff --git a/models/paper2/get_pc_sites.py b/models/paper2/get_pc_sites.py index <HASH>..<HASH> 100644 --- a/models/paper2/get_pc_sites.py +++ b/models/paper2/get_pc_sites.py @@ -35,12 +35,19 @@ for db in dbs: if not proteins: continue for protein in proteins: + name = bpc.BiopaxProcessor._get_element_name(protein) + db_refs = bpc.BiopaxProcessor._get_db_refs(protein) + agent = Agent(name, mods=[mc], db_refs=db_refs) reactions = protein.getParticipantOf().toArray() + if not reactions: + upstream = protein.getMemberPhysicalEntityOf().toArray() + for u in upstream: + reactions += u.getParticipantOf().toArray() for reaction in reactions: - for contr in reaction.getControlledOf().toArray(): - name = bpc.BiopaxProcessor._get_element_name(protein) - db_refs = bpc.BiopaxProcessor._get_db_refs(protein) - agent = Agent(name, mods=[mc], db_refs=db_refs) + controls = reaction.getControlledOf().toArray() + if not controls: + agents.append(agent) + for contr in controls: agents.append(agent) with open('pc_%s_modified_agents.pkl' % db, 'wb') as fh:
Collect modified agents by reactions/controls
sorgerlab_indra
train
py
04996059681cc8256cf00812756041f289757b21
diff --git a/src/ProxyManager/Exception/ExceptionInterface.php b/src/ProxyManager/Exception/ExceptionInterface.php index <HASH>..<HASH> 100644 --- a/src/ProxyManager/Exception/ExceptionInterface.php +++ b/src/ProxyManager/Exception/ExceptionInterface.php @@ -4,9 +4,11 @@ declare(strict_types=1); namespace ProxyManager\Exception; +use Throwable; + /** * Base exception class for the proxy manager */ -interface ExceptionInterface +interface ExceptionInterface extends Throwable { }
`ExceptionInterface` must be `Throwable` in order to be caught
Ocramius_ProxyManager
train
php
ce2e0b7373125f6b243e7241feb01eda0f5f2ce7
diff --git a/src/main/java/io/github/bonigarcia/wdm/Downloader.java b/src/main/java/io/github/bonigarcia/wdm/Downloader.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/github/bonigarcia/wdm/Downloader.java +++ b/src/main/java/io/github/bonigarcia/wdm/Downloader.java @@ -48,7 +48,7 @@ public class Downloader { File binary = null; // Check if binary exists - boolean download = !targetFile.getParentFile().exists() + boolean download = !targetFile.exists() || WdmConfig.getBoolean("wdm.override"); if (!download) {
Check for target file existence The parent directory could already exists
bonigarcia_webdrivermanager
train
java
5704b68514719a0f50e4fea04fc730db79f0feb6
diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/Float.php b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/Float.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/Float.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/Float.php @@ -100,16 +100,12 @@ class Float implements Converter { if ( !empty( $storageDef->dataFloat1 ) ) { - $fieldDef->fieldTypeConstraints->validators = array( - self::FLOAT_VALIDATOR_IDENTIFIER => array( 'minFloatValue' => $storageDef->dataFloat1 ) - ); + $fieldDef->fieldTypeConstraints->validators[self::FLOAT_VALIDATOR_IDENTIFIER]['minFloatValue'] = $storageDef->dataFloat1; } if ( !empty( $storageDef->dataFloat2 ) ) { - $fieldDef->fieldTypeConstraints->validators = array( - self::FLOAT_VALIDATOR_IDENTIFIER => array( 'maxFloatValue' => $storageDef->dataFloat2 ) - ); + $fieldDef->fieldTypeConstraints->validators[self::FLOAT_VALIDATOR_IDENTIFIER]['maxFloatValue'] = $storageDef->dataFloat2; } }
Make it possible to have a float min and max value
ezsystems_ezpublish-kernel
train
php
a27feb809e4d4ad5e56eb25b443d862755ba7c36
diff --git a/lib/scsocket.js b/lib/scsocket.js index <HASH>..<HASH> 100644 --- a/lib/scsocket.js +++ b/lib/scsocket.js @@ -377,6 +377,7 @@ SCSocket.prototype._suspendSubscriptions = function () { } else { newState = channel.UNSUBSCRIBED; } + this._triggerChannelUnsubscribe(channel, newState); } }; @@ -593,6 +594,8 @@ SCSocket.prototype._triggerChannelUnsubscribe = function (channel, newState) { } else { channel.state = channel.UNSUBSCRIBED; } + this._cancelPendingSubscribeCallback(channel); + if (oldState == channel.SUBSCRIBED) { channel.emit('unsubscribe', channelName); SCEmitter.prototype.emit.call(this, 'unsubscribe', channelName);
Bug fix - Channel would get stuck in pending state if the connection failed while the subscription was in the middle of being processed
SocketCluster_socketcluster-client
train
js
10c0fd26500aa81c61116296c43bc5bed5d89595
diff --git a/spec/show_models_spec.rb b/spec/show_models_spec.rb index <HASH>..<HASH> 100644 --- a/spec/show_models_spec.rb +++ b/spec/show_models_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' describe "show-models" do it "should print a list of models" do - output = mock_pry('show-models', 'exit-all') + output = mock_pry('Pry.color = false;', 'show-models', 'exit-all') ar_models = <<MODELS Beer
ShowModelsSpec: fix failing test For some strange reason it is showing wrong results because `Pry.color` at the moment of the `show-models` command invocation is set to true.
rweng_pry-rails
train
rb
8e765bf0cffe11cd9f47d89df0d271740dbda1a7
diff --git a/icekit/images_api/views.py b/icekit/images_api/views.py index <HASH>..<HASH> 100644 --- a/icekit/images_api/views.py +++ b/icekit/images_api/views.py @@ -10,7 +10,7 @@ from . import serializers Image = apps.get_model('icekit_plugins_image.Image') -class ImageViewSet(viewsets.ReadOnlyModelViewSet): +class ImageViewSet(viewsets.ModelViewSet): """ Read only viewset for image objects. """ @@ -18,8 +18,9 @@ class ImageViewSet(viewsets.ReadOnlyModelViewSet): serializer_class = serializers.ImageSerializer # NOTE: `get_queryset` method is used instead of this `queryset` class # attribute to return results, but we still need this defined here so - # the API router can auto-generate the right endpoint URL. - queryset = Image.objects.all() + # the API router can auto-generate the right endpoint URL and apply + # `DjangoModelPermissions`. + queryset = Image.objects.none() def get_queryset(self): return Image.objects.all()
#<I> Enable writing to the images API now that auth and perms are OK
ic-labs_django-icekit
train
py
5a4d62ed11b6070f2ea0414d98b14d5821050762
diff --git a/src/java/org/apache/cassandra/streaming/StreamOutManager.java b/src/java/org/apache/cassandra/streaming/StreamOutManager.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/streaming/StreamOutManager.java +++ b/src/java/org/apache/cassandra/streaming/StreamOutManager.java @@ -171,24 +171,4 @@ public class StreamOutManager { return Collections.unmodifiableList(files); } - - public class StreamFile extends File - { - private long ptr = 0; - public StreamFile(String path) - { - super(path); - ptr = 0; - } - - private void update(long ptr) - { - this.ptr = ptr; - } - - public long getPtr() - { - return ptr; - } - } }
nix StreamFile. Patch by gdusbabek, reviewed by stuhood. CASSANDRA-<I> git-svn-id: <URL>
Stratio_stratio-cassandra
train
java
4007b91c8204266e71824d05bbf46873089611b4
diff --git a/elytron/src/main/java/org/wildfly/extension/elytron/ModifiableKeyStoreDecorator.java b/elytron/src/main/java/org/wildfly/extension/elytron/ModifiableKeyStoreDecorator.java index <HASH>..<HASH> 100644 --- a/elytron/src/main/java/org/wildfly/extension/elytron/ModifiableKeyStoreDecorator.java +++ b/elytron/src/main/java/org/wildfly/extension/elytron/ModifiableKeyStoreDecorator.java @@ -61,7 +61,7 @@ import static org.wildfly.extension.elytron._private.ElytronSubsystemMessages.RO * * @author <a href="mailto:jkalina@redhat.com">Jan Kalina</a> */ -public class ModifiableKeyStoreDecorator extends DelegatingResourceDefinition { +class ModifiableKeyStoreDecorator extends DelegatingResourceDefinition { static ResourceDefinition wrap(ResourceDefinition resourceDefinition) { return new ModifiableKeyStoreDecorator(resourceDefinition);
[WFCORE-<I>] The class ModifiableKeyStoreDecorator should not be public.
wildfly_wildfly-core
train
java
27807dad6b4d382092eb963f40bbcd5f5c2faa8b
diff --git a/colin/utils/cont.py b/colin/utils/cont.py index <HASH>..<HASH> 100644 --- a/colin/utils/cont.py +++ b/colin/utils/cont.py @@ -91,13 +91,17 @@ class Image(object): atomic_source = "docker:" + image_name.name e = os.environ.copy() - e["ATOMIC_OSTREE_REPO"] = self.ostree_path # must not exist, ostree will create it - out = subprocess.check_output( - ["atomic", "--debug", "pull", "--storage", "ostree", atomic_source], - env=e) - logger.debug("output of atomic command:") - logger.debug(out) + e["ATOMIC_OSTREE_REPO"] = self.ostree_path + cmd = ["atomic", "pull", "--storage", "ostree", atomic_source] + try: + out = subprocess.check_output(cmd, env=e, stderr=subprocess.STDOUT) + except subprocess.CalledProcessError: + logger.error("Failed to pull selected container image. Does it exist?") + raise + else: + logger.debug("output of atomic command:") + logger.debug(out) archive_file_name = "archive.tar" archive_path = os.path.join(self.tmpdir, archive_file_name)
nicer error message when an image can't be pulled
user-cont_colin
train
py
642dd65a8b898664dff127e2459f7cc6a3953ebb
diff --git a/Fields/MulticheckboxField.php b/Fields/MulticheckboxField.php index <HASH>..<HASH> 100644 --- a/Fields/MulticheckboxField.php +++ b/Fields/MulticheckboxField.php @@ -85,8 +85,14 @@ class MulticheckboxField extends Field $checked = array(); - foreach ($values as $name => $one) { - $checked[$this->nameFor($name)] = true; + if ( $this->is_numeric_array( $values ) ) { + foreach ( $values as $name ) { + $checked[ $this->nameFor( $name ) ] = true; + } + } else { + foreach ( $values as $name => $one ) { + $checked[ $this->nameFor( $name ) ] = true; + } } foreach ($this->checkboxes as $checkbox) { @@ -97,6 +103,21 @@ class MulticheckboxField extends Field } } } + + protected function is_numeric_array( $array ) { + + $i = 0; + + foreach ( $array as $key => $_ ) { + if ( $i !== $key ) { + return false; + } + + $i++; + } + + return true; + } public function getValue() {
Make MulticheckboxField getValue and setValue compatible Previously, `setValue` expected an array of options to `true`. However, `getValue` returns an array of options. The previous behavior is retained for compatibility with PHP `$_POST` and manual usage of `setValue`.
Gregwar_Formidable
train
php
c7b2aa8fc8ef1a3b31c496686077934cf511fe5d
diff --git a/db/migrate/20150605151945_create_pd_regime_bags.rb b/db/migrate/20150605151945_create_pd_regime_bags.rb index <HASH>..<HASH> 100644 --- a/db/migrate/20150605151945_create_pd_regime_bags.rb +++ b/db/migrate/20150605151945_create_pd_regime_bags.rb @@ -1,9 +1,9 @@ class CreatePDRegimeBags < ActiveRecord::Migration def change create_table :pd_regime_bags do |t| - t.integer :pd_regime_id - t.integer :bag_type_id, null: false - t.integer :volume, null: false + t.references :pd_regime, null: false, foreign_key: true + t.references :bag_type, null: false, foreign_key: true + t.integer :volume, null: false t.integer :per_week t.boolean :monday t.boolean :tuesday
Added missing null: false for pd_regime_bags migration required fields.
airslie_renalware-core
train
rb
9936e4befe89d32cee064d25b35d353e04385db7
diff --git a/pysc2/bin/replay_actions.py b/pysc2/bin/replay_actions.py index <HASH>..<HASH> 100755 --- a/pysc2/bin/replay_actions.py +++ b/pysc2/bin/replay_actions.py @@ -371,7 +371,7 @@ def main(unused_argv): replay_queue_thread.daemon = True replay_queue_thread.start() - for i in range(FLAGS.parallel): + for i in range(min(len(replay_list), FLAGS.parallel)): p = ReplayProcessor(i, run_config, replay_queue, stats_queue) p.daemon = True p.start()
Faster startup time if you're only checking a few replays. PiperOrigin-RevId: <I>
deepmind_pysc2
train
py
55e07545c56ce51667538f2cfa5c66831c350ff5
diff --git a/src/MediaObserver.php b/src/MediaObserver.php index <HASH>..<HASH> 100644 --- a/src/MediaObserver.php +++ b/src/MediaObserver.php @@ -10,7 +10,9 @@ class MediaObserver { public function creating(Media $media) { - $media->setHighestOrderNumber(); + if ($media->shouldSortWhenCreating()) { + $media->setHighestOrderNumber(); + } } public function updating(Media $media)
add missing condition - should sort when creating (#<I>)
spatie_laravel-medialibrary
train
php
253a7359d3f55d4496dcfd818e3fc06a7e764c64
diff --git a/pact/pact-compiler/src/main/java/eu/stratosphere/pact/compiler/dataproperties/RequestedLocalProperties.java b/pact/pact-compiler/src/main/java/eu/stratosphere/pact/compiler/dataproperties/RequestedLocalProperties.java index <HASH>..<HASH> 100644 --- a/pact/pact-compiler/src/main/java/eu/stratosphere/pact/compiler/dataproperties/RequestedLocalProperties.java +++ b/pact/pact-compiler/src/main/java/eu/stratosphere/pact/compiler/dataproperties/RequestedLocalProperties.java @@ -20,7 +20,6 @@ import java.util.Arrays; import eu.stratosphere.pact.common.contract.Ordering; import eu.stratosphere.pact.common.util.FieldList; import eu.stratosphere.pact.common.util.FieldSet; -import eu.stratosphere.pact.compiler.CompilerException; import eu.stratosphere.pact.compiler.plan.OptimizerNode; import eu.stratosphere.pact.compiler.plan.candidate.Channel; import eu.stratosphere.pact.compiler.util.Utils;
Removed unnecessary import from RequestedLocalProperties.
apache_flink
train
java
c2549af2d3c8e297ebbf7d1f009c9a65fc8254e4
diff --git a/packages/generator/hub-widget/index.js b/packages/generator/hub-widget/index.js index <HASH>..<HASH> 100644 --- a/packages/generator/hub-widget/index.js +++ b/packages/generator/hub-widget/index.js @@ -117,6 +117,10 @@ module.exports = class HubWidgetGenerator extends Generator { dependencies: Object.assign({}, packageJson.dependencies, { 'hub-dashboard-addons': this.props.hubDashboardAddons, '@jetbrains/hub-widget-ui': this.props.jetbrainsHubWidgetUi + }), + scripts: Object.assign({}, packageJson.scripts, { + build: 'webpack -p', // Widgets with sourcemaps take to much space + dist: `npm run build && rm -f ${this.props.projectName}.zip && zip -r -j ${this.props.projectName}.zip ./dist` }) }); return JSON.stringify(newPackageJson, null, INDENT);
Include "dist" script to Yoman-generated widgets
JetBrains_ring-ui
train
js
2d09f3226672e3f9ba6407841180d2fcf084d7d4
diff --git a/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java b/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java index <HASH>..<HASH> 100644 --- a/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java +++ b/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java @@ -1454,7 +1454,8 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma } /** Utility method for a work-around to MSHARED-998 */ - private Artifact findClassifierArtifactInAllDeps(final Iterable<ArtifactResult> allDeps, final ArtifactCoordinate theCoord) { + private Artifact findClassifierArtifactInAllDeps(final Iterable<ArtifactResult> allDeps, final ArtifactCoordinate theCoord) + throws DependencyNotFoundException { Artifact result = null; for (final ArtifactResult res : allDeps) { if (sameArtifact(res, theCoord)) { @@ -1462,6 +1463,10 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma break; } } + if (result == null) { + throw new DependencyNotFoundException(String.format("Expected dependency not found in resolved artifacts for " + + "dependency %s", theCoord)); + } return result; }
Add an accidentally forgotten throw of DependencyNotFoundException when the artifact cannot be resolved
jeremylong_DependencyCheck
train
java
3e02edc01a93db3572badc178c81a46e57fc11de
diff --git a/src/logic/DomainVariationsGenerator.php b/src/logic/DomainVariationsGenerator.php index <HASH>..<HASH> 100644 --- a/src/logic/DomainVariationsGenerator.php +++ b/src/logic/DomainVariationsGenerator.php @@ -8,7 +8,7 @@ * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) */ -namespace hipanel\modules\domain\logic; +namespace hipanel\modules\domain\logic; use hipanel\helpers\ArrayHelper; use hipanel\modules\domain\forms\CheckForm; @@ -78,7 +78,15 @@ class DomainVariationsGenerator { $domains = $this->generateVariations(); if (Yii::$app->user->can('test.beta')) { - $domains = array_merge($domains, $this->generateSuggestions()); + $suggestions = $this->generateSuggestions(); + foreach ($suggestions as $suggestion) { + $key = array_search(strtolower($suggestion['fqdn']), $domains); + if ($key === false) { + array_push($domains, $suggestion); + } else { + $domains[$key] = array_map('strtolower', $suggestion); + } + } } $this->orderVariations($domains);
Remove dupliactes for domain suggestions
hiqdev_hipanel-module-domain
train
php
c8ead05b149b02a8068c753341705a42438683f7
diff --git a/lib/modules/workspace_commands.rb b/lib/modules/workspace_commands.rb index <HASH>..<HASH> 100644 --- a/lib/modules/workspace_commands.rb +++ b/lib/modules/workspace_commands.rb @@ -30,6 +30,7 @@ module Bcome::WorkspaceCommands if attribute_value desc += "\t#{key}".cyan desc += "\s" * (12 - key.length) + attribute_value = (value == :identifier) ? attribute_value.underline : attribute_value desc += attribute_value.green + "\n" end end diff --git a/patches/string.rb b/patches/string.rb index <HASH>..<HASH> 100644 --- a/patches/string.rb +++ b/patches/string.rb @@ -32,6 +32,10 @@ class String return "\e[1m#{self}\033[0m" end + def underline + return "\e[4m#{self}\e[0m" + end + def method_missing(method_sym, *arguments, &black) unless colour_code = colour_codes[method_sym] super
Added underline string method,and underlined node names
webzakimbo_bcome-kontrol
train
rb,rb
896756798fd38dc83d97dbb321a40b237945a5e8
diff --git a/tests/test_mp3.py b/tests/test_mp3.py index <HASH>..<HASH> 100644 --- a/tests/test_mp3.py +++ b/tests/test_mp3.py @@ -3,5 +3,5 @@ import unittest import base -class Mp3TestCase(base.BaseParserTestCase, unittest.TestCase): +class Mp3TestCase(base.ShellParserTestCase, unittest.TestCase): extension = 'mp3' diff --git a/tests/test_ogg.py b/tests/test_ogg.py index <HASH>..<HASH> 100644 --- a/tests/test_ogg.py +++ b/tests/test_ogg.py @@ -3,5 +3,5 @@ import unittest import base -class OggTestCase(base.BaseParserTestCase, unittest.TestCase): +class OggTestCase(base.ShellParserTestCase, unittest.TestCase): extension = 'ogg'
switched to ShellParserTestCase
deanmalmgren_textract
train
py,py
9a50242fd17464f91dfd07215ccdb37c22855fe1
diff --git a/dist/lib/listeners.js b/dist/lib/listeners.js index <HASH>..<HASH> 100644 --- a/dist/lib/listeners.js +++ b/dist/lib/listeners.js @@ -276,6 +276,7 @@ function onUnmount() { _deleteInstance(this); _unbindClicks(); + if (_focusedInstance === this) _focus(null); } exports.setBinding = setBinding;
add compiled bug fix for dist
glortho_react-keydown
train
js
5cca862d856b1ff0338f48e6bd9bd69546b28d46
diff --git a/src/Orchestra/Auth/Guard.php b/src/Orchestra/Auth/Guard.php index <HASH>..<HASH> 100644 --- a/src/Orchestra/Auth/Guard.php +++ b/src/Orchestra/Auth/Guard.php @@ -1,7 +1,5 @@ <?php namespace Orchestra\Auth; -use Closure; - class Guard extends \Illuminate\Auth\Guard { /** @@ -14,10 +12,10 @@ class Guard extends \Illuminate\Auth\Guard /** * Setup roles event listener. * - * @param Closure $event + * @param \Closure|string $event * @return void */ - public function setup(Closure $event) + public function setup($event) { $this->userRoles = null; $this->events->forget('orchestra.auth: roles');
Auth::setup() should be able to take string as well.
orchestral_auth
train
php
8ddaae6d17db0eebeff8ca03183e606ac45255b0
diff --git a/IPython/html/static/widgets/js/init.js b/IPython/html/static/widgets/js/init.js index <HASH>..<HASH> 100644 --- a/IPython/html/static/widgets/js/init.js +++ b/IPython/html/static/widgets/js/init.js @@ -23,5 +23,5 @@ define([ } } - return WidgetManager; + return {'WidgetManager': WidgetManager}; }); diff --git a/IPython/html/static/widgets/js/widget.js b/IPython/html/static/widgets/js/widget.js index <HASH>..<HASH> 100644 --- a/IPython/html/static/widgets/js/widget.js +++ b/IPython/html/static/widgets/js/widget.js @@ -4,7 +4,7 @@ define(["widgets/js/manager", "underscore", "backbone"], -function(WidgetManager, _, Backbone){ +function(widgetmanager, _, Backbone){ var WidgetModel = Backbone.Model.extend({ constructor: function (widget_manager, model_id, comm) { @@ -261,7 +261,7 @@ function(WidgetManager, _, Backbone){ }, }); - WidgetManager.register_widget_model('WidgetModel', WidgetModel); + widgetmanager.WidgetManager.register_widget_model('WidgetModel', WidgetModel); var WidgetView = Backbone.View.extend({
Fix imports of "modules", required after converting everything into dictionary returns.
jupyter-widgets_ipywidgets
train
js,js
e47a1014e347e09a8c0e478d008d5f262ba29145
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -103,5 +103,5 @@ def version_can_handle_msgpack_result; 12 end def version_cannot_handle_non_delivery_result; 12 end def version_can_handle_non_delivery_result; 13 end -def version_cannot_handle_http_result; 22 end -def version_can_handle_http_result; 23 end +def version_cannot_handle_http; 22 end +def version_can_handle_http; 23 end
IV-<I> Fix version handling names in spec_helper
rightscale_right_agent
train
rb
bc89216d2d613553a51a3d96f14d696cb0465dc3
diff --git a/integrations/server_test.go b/integrations/server_test.go index <HASH>..<HASH> 100644 --- a/integrations/server_test.go +++ b/integrations/server_test.go @@ -69,8 +69,8 @@ func TestServer(t *testing.T) { }, }, wants: wants{ - statusCode: 401, - body: `{"code":401,"message":"User is not authorized"}`, + statusCode: 403, + body: `{"code":403,"message":"User is not authorized"}`, }, }, {
Repair go integration spec - we return <I>s now
influxdata_influxdb
train
go
badf3539789d15206a789c9a9cc08f7452998c64
diff --git a/login.php b/login.php index <HASH>..<HASH> 100644 --- a/login.php +++ b/login.php @@ -50,9 +50,10 @@ $password = WT_Filter::post('password'); $timediff = WT_Filter::postInteger('timediff', -43200, 50400, 0); // Same range as date('Z') // These parameters may come from the URL which is emailed to users. -if (empty($action)) $action = WT_Filter::get('action'); -if (empty($user_name)) $user_name = WT_Filter::get('user_name', WT_REGEX_USERNAME); -if (empty($user_hashcode)) $user_hashcode = WT_Filter::get('user_hashcode'); +if (!$action) $action = WT_Filter::get('action'); +if (!$user_name) $user_name = WT_Filter::get('user_name', WT_REGEX_USERNAME); +if (!$user_hashcode) $user_hashcode = WT_Filter::get('user_hashcode'); +if (!$url) $url = WT_Filter::getUrl('url'); // This parameter may come from generated login links if (!$url) {
Fix: url parameter being lost during login
fisharebest_webtrees
train
php
d587b6886360332df99b65e834e369e06889ee33
diff --git a/builtin/providers/aws/resource_aws_redshift_cluster_test.go b/builtin/providers/aws/resource_aws_redshift_cluster_test.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_redshift_cluster_test.go +++ b/builtin/providers/aws/resource_aws_redshift_cluster_test.go @@ -844,6 +844,8 @@ func testAccAWSRedshiftClusterConfig_notPubliclyAccessible(rInt int) string { cluster_subnet_group_name = "${aws_redshift_subnet_group.foo.name}" publicly_accessible = false skip_final_snapshot = true + + depends_on = ["aws_internet_gateway.foo"] }`, rInt, rInt) } @@ -902,6 +904,8 @@ func testAccAWSRedshiftClusterConfig_updatePubliclyAccessible(rInt int) string { cluster_subnet_group_name = "${aws_redshift_subnet_group.foo.name}" publicly_accessible = true skip_final_snapshot = true + + depends_on = ["aws_internet_gateway.foo"] }`, rInt, rInt) }
provider/aws: Add an explicit depends on for the internet gateway, should help this test pass
hashicorp_terraform
train
go
40bd6cd48a1b825f1ab02e2302a21bfea436ffff
diff --git a/logr.go b/logr.go index <HASH>..<HASH> 100644 --- a/logr.go +++ b/logr.go @@ -365,10 +365,16 @@ type LogSink interface { // This is an optional interface and implementations are not required to // support it. type CallDepthLogSink interface { - // WithCallDepth returns a Logger that will offset the call stack by the - // specified number of frames when logging call site information. If depth - // is 0 the attribution should be to the direct caller of this method. If - // depth is 1 the attribution should skip 1 call frame, and so on. + // WithCallDepth returns a LogSink that will offset the call + // stack by the specified number of frames when logging call + // site information. + // + // If depth is 0, the LogSink should skip exactly the number + // of call frames defined in RuntimeInfo.CallDepth when Info + // or Error are called, i.e. the attribution should be to the + // direct caller of Logger.Info or Logger.Error. + // + // If depth is 1 the attribution should skip 1 call frame, and so on. // Successive calls to this are additive. WithCallDepth(depth int) LogSink }
CallDepthLogSink: clarify relationship with RuntimeInfo Implementors of the interface might miss that they need to skip additional levels because of logr's own helper function.
go-logr_logr
train
go
d30755c996bfe256f47c6977297547f221e88fa0
diff --git a/shared/chat/conversation/messages/attachment.js b/shared/chat/conversation/messages/attachment.js index <HASH>..<HASH> 100644 --- a/shared/chat/conversation/messages/attachment.js +++ b/shared/chat/conversation/messages/attachment.js @@ -38,7 +38,7 @@ function PreviewImage ({message: {attachmentDurationMs, previewDurationMs, previ position: 'relative', alignItems: 'flex-end', } - const imgStyle = {...globalStyles.rounded, ...(previewSize ? {width: previewSize.width, height: previewSize.height} : {maxHeight: 320, maxWidth: 320})} + const imgStyle = {borderRadius: 4, ...(previewSize ? {width: previewSize.width, height: previewSize.height} : {maxHeight: 320, maxWidth: 320})} switch (messageState) { case 'uploading':
Increase attachment preview border radius to match mockups
keybase_client
train
js
fd5bec49862aad6a236ffcc089a2c7af41fc8013
diff --git a/images/app/controllers/refinery/admin/images_controller.rb b/images/app/controllers/refinery/admin/images_controller.rb index <HASH>..<HASH> 100644 --- a/images/app/controllers/refinery/admin/images_controller.rb +++ b/images/app/controllers/refinery/admin/images_controller.rb @@ -149,7 +149,7 @@ module Refinery def permitted_image_params [ - { image: [] }, :image_size, :image_title, :image_alt + :image, :image_size, :image_title, :image_alt ] end
Fix permitted params allowing new images to be uploaded
refinery_refinerycms
train
rb
075fbb8c2a450f3025764ae3f9ea8dea5a04bdaf
diff --git a/extensions/management/modelviz.py b/extensions/management/modelviz.py index <HASH>..<HASH> 100644 --- a/extensions/management/modelviz.py +++ b/extensions/management/modelviz.py @@ -42,7 +42,6 @@ __contributors__ = [ import getopt, sys from django.core.management import setup_environ -from django.utils.encoding import mark_safe try: import settings @@ -51,6 +50,7 @@ except ImportError: else: setup_environ(settings) +from django.utils.safestring import mark_safe from django.template import Template, Context from django.db import models from django.db.models import get_models
Adrians cleanup in Changeset <I> revailed an incorrect import. thanks mariocesar.c<I> for the report!
django-extensions_django-extensions
train
py
f21c6f8d9d286844e44875e1f31134f61945f35c
diff --git a/handlers/new.go b/handlers/new.go index <HASH>..<HASH> 100644 --- a/handlers/new.go +++ b/handlers/new.go @@ -4,6 +4,7 @@ import ( "crypto/rand" "encoding/hex" "errors" + "flag" "fmt" "log" "net/http" @@ -13,6 +14,8 @@ import ( "github.com/coreos/go-etcd/etcd" ) +var baseURI = flag.String("host", "https://discovery.etcd.io", "base location for computed token URI") + func generateCluster() string { b := make([]byte, 16) _, err := rand.Read(b) @@ -78,5 +81,5 @@ func NewTokenHandler(w http.ResponseWriter, r *http.Request) { log.Println("New cluster created", token) - fmt.Fprintf(w, "https://discovery.etcd.io/"+token) + fmt.Fprintf(w, "%s/%s", *baseURI, token) }
http: Allow configuration of the URI from /new This patch adds a new flag, `--host`, which permits runtime configuration of the URI returned by the `/new` handler. The default behavior is the current hardcoded behavior, which always directs clients to <URL>
coreos_discovery.etcd.io
train
go
10a8fbe742da6fdc3b0778db6f9d33c8d41602fb
diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -236,7 +236,7 @@ class Mailer implements MailerContract, MailQueueContract // message. This is primarily useful during local development in which each // message should be delivered into a single mail address for inspection. if (isset($this->to['address'])) { - $this->setGlobalTo($message); + $this->setGlobalToAndRemoveCcAndBcc($message); } // Next we will determine if the message should be sent. We give the developer @@ -347,7 +347,7 @@ class Mailer implements MailerContract, MailQueueContract * @param \Illuminate\Mail\Message $message * @return void */ - protected function setGlobalTo($message) + protected function setGlobalToAndRemoveCcAndBcc($message) { $message->to($this->to['address'], $this->to['name'], true); $message->cc(null, null, true);
Rename `setGlobalTo` to `setGlobalToAndRemoveCcAndBcc` (#<I>) It's really counter intuitive to have a setter destroy unrelated data, best to be honest and complete about it.
laravel_framework
train
php
1ad02f526c3c0e2488f54c6028e998370839c7a5
diff --git a/menuconfig.py b/menuconfig.py index <HASH>..<HASH> 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -318,7 +318,7 @@ _STYLES = { separator=fg:white,bg:cyan,bold help=path frame=fg:white,bg:cyan,bold - body=fg:brightwhite,bg:blue + body=fg:white,bg:blue edit=fg:black,bg:white """ }
menuconfig: Avoid the non-ANSI 'brightwhite' color in the aquatic theme Not available with TERM=xterm (as opposed to xterm-<I>color). Use fg:white instead of fg:brightwhite for dialog box bodies. Not a huge difference. Came up in <URL>
ulfalizer_Kconfiglib
train
py
8e6eb3056b810a69a9fbfc4b9b4f4e0ffd2bae34
diff --git a/src/test/java/net/openhft/performance/tests/network/SimpleServerAndClientTest.java b/src/test/java/net/openhft/performance/tests/network/SimpleServerAndClientTest.java index <HASH>..<HASH> 100755 --- a/src/test/java/net/openhft/performance/tests/network/SimpleServerAndClientTest.java +++ b/src/test/java/net/openhft/performance/tests/network/SimpleServerAndClientTest.java @@ -30,10 +30,7 @@ import net.openhft.chronicle.wire.TextWire; import net.openhft.chronicle.wire.Wire; import net.openhft.chronicle.wire.WireType; import org.jetbrains.annotations.NotNull; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import java.io.IOException; import java.nio.channels.SocketChannel; @@ -62,6 +59,7 @@ public class SimpleServerAndClientTest { } @Test + @Ignore("Fails on Teamcity ") public void test() throws IOException, TimeoutException { // this the name of a reference to the host name and port, // allocated automatically when to a free port on localhost
networkj#8 test passes locally but not in teamcity on the same machine.
OpenHFT_Chronicle-Network
train
java
0b2f1200a5146bd14b1d63059a90585ac163be5b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -10,8 +10,7 @@ module.exports = function () { var cmd = 'open'; var args = [ - '-a', - 'ScreenSaverEngine' + '/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app' ]; return pify(execFile, Promise)(cmd, args);
Use alternative approach to start screensaver
gillstrom_osx-screensaver
train
js
13c28d327a1f46057458e49236c27b1e35276b09
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setup_data = { 'name': 'pylibdmtx', 'version': pylibdmtx.__version__, 'author': 'Lawrence Hudson', - 'author_email': 'l.hudson@nhm.ac.uk', + 'author_email': 'quicklizard@googlemail.com', 'url': URL, 'license': 'MIT', 'description': pylibdmtx.__doc__, @@ -49,8 +49,9 @@ setup_data = { }, 'tests_require': [ # TODO How to specify OpenCV? 'cv2>=2.4.8', - PILLOW, + 'mock>=2.0.0; python_version=="2.7"', 'numpy>=1.8.2', + PILLOW, ], 'include_package_data': True, 'classifiers': [
Correct email address. Add mock as test dependency
NaturalHistoryMuseum_pylibdmtx
train
py