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
367e984a36184f66be60fcdccdbf11220cee2734
diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/SQLSelectTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/SQLSelectTest.java index <HASH>..<HASH> 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/SQLSelectTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/SQLSelectTest.java @@ -193,7 +193,7 @@ public class SQLSelectTest { Assert.assertEquals(resultset.size(), 1); Assert.assertEquals(resultset.get(0).getIdentity(), doc.getIdentity()); - // doc.delete(); + doc.delete(); } @Test
Fail of com.orientechnologies.orient.test.database.auto.SQLSelectTest.queryContainsInEmbeddedList test on IBM JDK was fixed.
orientechnologies_orientdb
train
java
600e8065b1b7aef422c80038c76dbca85974fe9d
diff --git a/src/org/jgroups/stack/AckReceiverWindow.java b/src/org/jgroups/stack/AckReceiverWindow.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/stack/AckReceiverWindow.java +++ b/src/org/jgroups/stack/AckReceiverWindow.java @@ -20,7 +20,7 @@ import java.util.concurrent.ConcurrentMap; * a sorted set incurs overhead. * * @author Bela Ban - * @version $Id: AckReceiverWindow.java,v 1.36 2010/01/19 14:39:58 belaban Exp $ + * @version $Id: AckReceiverWindow.java,v 1.37 2010/01/19 14:44:10 belaban Exp $ */ public class AckReceiverWindow { private AtomicLong next_to_remove=new AtomicLong(0); @@ -103,7 +103,7 @@ public class AckReceiverWindow { * @return */ public List<Message> removeMany(AtomicBoolean processing) { - List<Message> retval=new ArrayList<Message>(msgs.size()); // we remove msgs.size() messages *max* + List<Message> retval=new LinkedList<Message>(); // we remove msgs.size() messages *max* Message msg; while((msg=msgs.remove(next_to_remove.get())) != null) { next_to_remove.incrementAndGet();
replaced ArrayList with LinkedList
belaban_JGroups
train
java
5bce20627f4f8b60f868c1a8d82ee0162e1a423c
diff --git a/server/rpc_service.go b/server/rpc_service.go index <HASH>..<HASH> 100644 --- a/server/rpc_service.go +++ b/server/rpc_service.go @@ -169,8 +169,7 @@ func (server *server) register(rcvr interface{}) error { s.rcvr = reflect.ValueOf(rcvr) sname := reflect.Indirect(s.rcvr).Type().Name() if sname == "" { - log.Log("rpc: no service name for type", s.typ.String()) - return errors.New("rpc: no service name for type" + s.typ.String()) + log.Fatal("rpc: no service name for type", s.typ.String()) } if !isExported(sname) { s := "rpc Register: type " + sname + " is not exported"
Switch that back to Fatal since we've added the convenience method
micro_go-micro
train
go
c2a4b1fd9bfa74ba72eb2170325ce1f54f79fa9e
diff --git a/modularodm/__init__.py b/modularodm/__init__.py index <HASH>..<HASH> 100644 --- a/modularodm/__init__.py +++ b/modularodm/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__version__ = "0.2" +__version__ = "0.2.1" from storedobject import StoredObject, FlaskStoredObject diff --git a/modularodm/storedobject.py b/modularodm/storedobject.py index <HASH>..<HASH> 100644 --- a/modularodm/storedobject.py +++ b/modularodm/storedobject.py @@ -556,7 +556,10 @@ class StoredObject(object): # Quit if no diffs if not list_on_save_after_fields and not force: - return + return { + 'success': True, + 'saved_fields': [], + } # Validate for field_name in list_on_save_after_fields: @@ -587,7 +590,10 @@ class StoredObject(object): self._set_cache(self._primary_key, self) - return True # todo raise exception on not save + return { + 'success': True, + 'saved_fields': list_on_save_after_fields, + } def reload(self):
return saved fields on save; increment minor version
cos-archives_modular-odm
train
py,py
f0e7d253b97a2a70b99b0da45ec2c670f7467905
diff --git a/lib/filepicker_rails/engine.rb b/lib/filepicker_rails/engine.rb index <HASH>..<HASH> 100644 --- a/lib/filepicker_rails/engine.rb +++ b/lib/filepicker_rails/engine.rb @@ -10,7 +10,7 @@ module FilepickerRails initializer 'filepicker_rails.action_controller' do |app| ActiveSupport.on_load(:action_controller) do - helper FilepickerRails::ApplicationHelper + ::ActionController::Base.helper(FilepickerRails::ApplicationHelper) end end end
Fix helper inclusion for Rails 5 Calling the `helper` method after upgrading to Rails 5 resulted in the following error: undefined method 'helper' for ActionController::API:Class This commit follows the lead of the following commit on another project: <URL>
filestack_filestack-rails
train
rb
fdb4663ff6d0ef4983915c56c6b1aee4deb08248
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -98,6 +98,11 @@ Texture.prototype.rotate = function(material, deg) { material.map = new self.THREE.Texture(canvas); self._applyTextureSettings(material.map); material.map.needsUpdate = true; + + if (material.uniforms && material.uniforms.map) { + material.uniforms.map.value = material.map; + material.needsUpdate = true; + } }; };
Fix Texture.rotate() for ShaderMaterial ShaderMaterial can take a `map` property, but doesn't handle updates automatically as with the built-in three.js materials. This was preventing custom materials from being updated after rotating.
deathcap_voxel-texture-shader
train
js
2f6980a4924b9fbcff21473ef87d03a8891ee939
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -55,7 +55,7 @@ repo_name = u"dtool_info" # built documents. # # The short X.Y version. -version = u"0.1.0" +version = u"0.2.0" # The full version, including alpha/beta/rc tags. release = version diff --git a/dtool_info/__init__.py b/dtool_info/__init__.py index <HASH>..<HASH> 100644 --- a/dtool_info/__init__.py +++ b/dtool_info/__init__.py @@ -1,3 +1,3 @@ """dtool_info package.""" -__version__ = "0.1.0" +__version__ = "0.2.0" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup url = "https://github.com/jic-dtool/dtool-info" -version = "0.1.0" +version = "0.2.0" readme = open('README.rst').read() setup(
Update version number to <I>
jic-dtool_dtool-info
train
py,py,py
f749478d964d87db64603fa3edd6f88016209702
diff --git a/test/com/esotericsoftware/kryo/SerializationCompatTest.java b/test/com/esotericsoftware/kryo/SerializationCompatTest.java index <HASH>..<HASH> 100644 --- a/test/com/esotericsoftware/kryo/SerializationCompatTest.java +++ b/test/com/esotericsoftware/kryo/SerializationCompatTest.java @@ -67,7 +67,7 @@ import org.objenesis.strategy.StdInstantiatorStrategy; * related tag and run the test (there's nothing here to automate creation of test files for a different version). */ public class SerializationCompatTest extends KryoTestCase { // Set to true to delete failed test files, then set back to false, set expected bytes, and run again to generate new files. - static private final boolean DELETE_FAILED_TEST_FILES = true; + static private final boolean DELETE_FAILED_TEST_FILES = false; static private final String ENDIANNESS = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "le" : "be"; static private final int JAVA_VERSION = Integer.parseInt(System.getProperty("java.version").split("\\.")[1]);
Deleting tests should be false.
EsotericSoftware_kryo
train
java
e6fa6dad129e68005943d35c9f8339f202f1a8e2
diff --git a/src/shared/js/ch.Viewport.js b/src/shared/js/ch.Viewport.js index <HASH>..<HASH> 100644 --- a/src/shared/js/ch.Viewport.js +++ b/src/shared/js/ch.Viewport.js @@ -34,7 +34,7 @@ scrolled = false; // Emits the current event - //this.emit(eve); + this.emit(eve); } function Viewport() {
#<I> Viewport: It should emit scroll and resize events.
mercadolibre_chico
train
js
9bbfee94212214de4335a78f25925903f465f40d
diff --git a/source/modules/oe/oepaypal/core/exception/oepaypalinvalidactionexception.php b/source/modules/oe/oepaypal/core/exception/oepaypalinvalidactionexception.php index <HASH>..<HASH> 100644 --- a/source/modules/oe/oepaypal/core/exception/oepaypalinvalidactionexception.php +++ b/source/modules/oe/oepaypal/core/exception/oepaypalinvalidactionexception.php @@ -24,4 +24,4 @@ */ class oePayPalInvalidActionException extends oePayPalException { -} \ No newline at end of file +} diff --git a/source/modules/oe/oepaypal/core/exception/oepaypalmissingparameterexception.php b/source/modules/oe/oepaypal/core/exception/oepaypalmissingparameterexception.php index <HASH>..<HASH> 100644 --- a/source/modules/oe/oepaypal/core/exception/oepaypalmissingparameterexception.php +++ b/source/modules/oe/oepaypal/core/exception/oepaypalmissingparameterexception.php @@ -24,4 +24,4 @@ */ class oePayPalMissingParameterException extends oePayPalException { -} \ No newline at end of file +}
ESDEV-<I> Make PayPal standalone compatible with PSR new line at the end of file
OXID-eSales_paypal
train
php,php
2d40b28cff1f2abd6c7d4f3c48b0d0c85260356f
diff --git a/zabbix/sender.py b/zabbix/sender.py index <HASH>..<HASH> 100644 --- a/zabbix/sender.py +++ b/zabbix/sender.py @@ -98,7 +98,8 @@ class ZabbixSender(object): return result - def __receive(self, socket, count): + @classmethod + def __receive(cls, socket, count): """ Reads socket to receive data from zabbix server.
__receive() is classmethod
adubkov_py-zabbix
train
py
adaf1d828abb5677172a288e157f83f0967e0726
diff --git a/intranet/apps/eighth/models.py b/intranet/apps/eighth/models.py index <HASH>..<HASH> 100644 --- a/intranet/apps/eighth/models.py +++ b/intranet/apps/eighth/models.py @@ -509,8 +509,8 @@ class EighthBlock(AbstractBaseEighthModel): blocks = (EighthBlock.objects.get_blocks_this_year().order_by( "-date", "-block_letter").filter(Q(date__lt=self.date) | (Q(date=self.date) & Q(block_letter__lt=self.block_letter)))) if quantity == -1: - return reversed(blocks) - return reversed(blocks[:quantity]) + return blocks.reverse() + return blocks[:quantity].reverse() def is_today(self): """Does the block occur today?"""
refactor: make EighthBlock.previous_blocks() return a QuerySet
tjcsl_ion
train
py
9efe2b2ced0ff12403a05d742cd8659524129ba0
diff --git a/ui-v2/app/services/clipboard/local-storage.js b/ui-v2/app/services/clipboard/local-storage.js index <HASH>..<HASH> 100644 --- a/ui-v2/app/services/clipboard/local-storage.js +++ b/ui-v2/app/services/clipboard/local-storage.js @@ -1,7 +1,7 @@ import Service from '@ember/service'; import { get } from '@ember/object'; -import Clipboard from 'npm:clipboard'; +import Clipboard from 'clipboard'; class ClipboardCallback extends Clipboard { constructor(trigger, cb) { diff --git a/ui-v2/app/services/clipboard/os.js b/ui-v2/app/services/clipboard/os.js index <HASH>..<HASH> 100644 --- a/ui-v2/app/services/clipboard/os.js +++ b/ui-v2/app/services/clipboard/os.js @@ -1,6 +1,6 @@ import Service from '@ember/service'; -import Clipboard from 'npm:clipboard'; +import Clipboard from 'clipboard'; export default Service.extend({ execute: function(trigger) {
ui: removes `npm:` imports now we have standard importing (#<I>)
hashicorp_consul
train
js,js
42feb67ce879d206ff13dbad5bfaa4f1a112e5b6
diff --git a/MAPKIT/mapkit/ColorRampGenerator.py b/MAPKIT/mapkit/ColorRampGenerator.py index <HASH>..<HASH> 100644 --- a/MAPKIT/mapkit/ColorRampGenerator.py +++ b/MAPKIT/mapkit/ColorRampGenerator.py @@ -48,6 +48,13 @@ class MappedColorRamp(object): # Add a line for the no-data values (nv) self.vrgbaList.append('nv 0 0 0 0') + def __repr__(self): + return '<MappedColorRamp Slope={0}, Intercept={1}, MinValue={2}, MaxValue={3}, Alpha={4}>'.format(self.slope, + self.intercept, + self.min, + self.max, + self.alpha) + def getColorForIndex(self, index): """ Return color for given index
Added __repr__ for MappedColorRamp object.
CI-WATER_mapkit
train
py
e5e779a5d89f90a5671ba61867101e575115b779
diff --git a/src/core/curry.js b/src/core/curry.js index <HASH>..<HASH> 100644 --- a/src/core/curry.js +++ b/src/core/curry.js @@ -43,6 +43,12 @@ function curry(fn) { value: true }) + Object.defineProperty(curried, 'length', { + enumerable: false, + writable: false, + value: fn.length + }) + return curried } diff --git a/src/core/curry.spec.js b/src/core/curry.spec.js index <HASH>..<HASH> 100644 --- a/src/core/curry.spec.js +++ b/src/core/curry.spec.js @@ -78,3 +78,11 @@ test('curry on a curried function', t => { t.end() }) + +test('curried function with arity exposed', t => { + const fn = (a, b) => a + b + const curried = curry(fn) + t.equal(curried.length, fn.length, 'returns the same arity as its uncurried counterpart') + + t.end() +})
Expose a length property for curried functions (#<I>)
evilsoft_crocks
train
js,js
3082f8a51b06f2a572239554822f422e3cdfd688
diff --git a/pyblish_qml/ipc/server.py b/pyblish_qml/ipc/server.py index <HASH>..<HASH> 100644 --- a/pyblish_qml/ipc/server.py +++ b/pyblish_qml/ipc/server.py @@ -216,6 +216,8 @@ class Server(object): def _listen(): """This runs in a thread""" + HEADER = "pyblish-qml:popen.request" + for line in iter(self.popen.stdout.readline, b""): if six.PY3: @@ -229,7 +231,9 @@ class Server(object): sys.stdout.write(line) else: - if response.get("header") == "pyblish-qml:popen.request": + if (hasattr(response, "get") and + response.get("header") == HEADER): + payload = response["payload"] args = payload["args"]
Ensure object has method 'get' before `.get()` This would make debug a bit easier.
pyblish_pyblish-qml
train
py
5aad149b24f88c29ea7b775153b5cd58676342b3
diff --git a/processing/src/main/java/io/druid/query/topn/PooledTopNAlgorithm.java b/processing/src/main/java/io/druid/query/topn/PooledTopNAlgorithm.java index <HASH>..<HASH> 100644 --- a/processing/src/main/java/io/druid/query/topn/PooledTopNAlgorithm.java +++ b/processing/src/main/java/io/druid/query/topn/PooledTopNAlgorithm.java @@ -146,10 +146,10 @@ public class PooledTopNAlgorithm @Override protected void scanAndAggregate( - PooledTopNParams params, - int[] positions, - BufferAggregator[] theAggregators, - int numProcessed + final PooledTopNParams params, + final int[] positions, + final BufferAggregator[] theAggregators, + final int numProcessed ) { final ByteBuffer resultsBuf = params.getResultsBuf(); @@ -167,7 +167,8 @@ public class PooledTopNAlgorithm while (!cursor.isDone()) { final IndexedInts dimValues = dimSelector.getRow(); - for (int i = 0; i < dimValues.size(); ++i) { + final int size = dimValues.size(); + for (int i = 0; i < size; ++i) { final int dimIndex = dimValues.get(i); int position = positions[dimIndex]; if (SKIP_POSITION_VALUE == position) {
Make some variables in PooledTopNAlgorithm final
apache_incubator-druid
train
java
ca0e9467f04e17d1a32cf4175c8659832dab83aa
diff --git a/bin/timber.php b/bin/timber.php index <HASH>..<HASH> 100644 --- a/bin/timber.php +++ b/bin/timber.php @@ -4,7 +4,7 @@ Plugin Name: Timber Description: The WordPress Timber Library allows you to write themes using the power Twig templates. Plugin URI: http://timber.upstatement.com Author: Jared Novack + Upstatement -Version: 1.1.12 +Version: 1.2.0 Author URI: http://upstatement.com/ */ // we look for Composer files first in the plugins dir. diff --git a/lib/Timber.php b/lib/Timber.php index <HASH>..<HASH> 100644 --- a/lib/Timber.php +++ b/lib/Timber.php @@ -35,7 +35,7 @@ use Timber\Loader; */ class Timber { - public static $version = '1.1.12'; + public static $version = '1.2.0'; public static $locations; public static $dirname = 'views'; public static $twig_cache = false; diff --git a/readme.txt b/readme.txt index <HASH>..<HASH> 100644 --- a/readme.txt +++ b/readme.txt @@ -41,6 +41,10 @@ Timber is great for any WordPress developer who cares about writing good, mainta == Changelog == += 1.2.0 = +* Fixed issues with WordPress 4.7 +* Introduced Timber\CommentThread object + = 1.1.12 = * Fixed Twig issue with deprecation #1265 (thanks @codesman)! * Cleaned-up the warnings for WP.org users and disabled easy updates for major/milestone versions 331314d9aaf90a52ff1c5a213656b8c02a27c60e
Updating docs for version <I>
timber_timber
train
php,php,txt
68c69fd52f0a426e5a40a756296c2947c46c67c6
diff --git a/Tests/Spec/AmqpMessageTest.php b/Tests/Spec/AmqpMessageTest.php index <HASH>..<HASH> 100644 --- a/Tests/Spec/AmqpMessageTest.php +++ b/Tests/Spec/AmqpMessageTest.php @@ -3,9 +3,9 @@ namespace Enqueue\AmqpExt\Tests\Spec; use Interop\Amqp\Impl\AmqpMessage; -use Interop\Queue\Spec\PsrMessageSpec; +use Interop\Queue\Spec\MessageSpec; -class AmqpMessageTest extends PsrMessageSpec +class AmqpMessageTest extends MessageSpec { /** * {@inheritdoc} diff --git a/Tests/Spec/AmqpProducerTest.php b/Tests/Spec/AmqpProducerTest.php index <HASH>..<HASH> 100644 --- a/Tests/Spec/AmqpProducerTest.php +++ b/Tests/Spec/AmqpProducerTest.php @@ -3,12 +3,12 @@ namespace Enqueue\AmqpExt\Tests\Spec; use Enqueue\AmqpExt\AmqpConnectionFactory; -use Interop\Queue\Spec\PsrProducerSpec; +use Interop\Queue\Spec\ProducerSpec; /** * @group functional */ -class AmqpProducerTest extends PsrProducerSpec +class AmqpProducerTest extends ProducerSpec { /** * {@inheritdoc}
Remove "Psr" prefix from spec base tests.
php-enqueue_amqp-ext
train
php,php
c0fbfe991c305afc3fbf4f8149dd66b96207156f
diff --git a/lib/iron_mq/queues.rb b/lib/iron_mq/queues.rb index <HASH>..<HASH> 100644 --- a/lib/iron_mq/queues.rb +++ b/lib/iron_mq/queues.rb @@ -10,7 +10,7 @@ module IronMQ def path(options={}) path = "projects/#{@client.project_id}/queues" if options[:name] - path << "/#{URI.escape(options[:name])}" + path << "/#{CGI::escape(options[:name])}" end path end
Changed URI.escape to CGI::escape.
iron-io_iron_mq_ruby
train
rb
2829530ea6f3ea6b44286486a15507a282276085
diff --git a/src/Psalm/Internal/Analyzer/TypeAnalyzer.php b/src/Psalm/Internal/Analyzer/TypeAnalyzer.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Internal/Analyzer/TypeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/TypeAnalyzer.php @@ -1429,7 +1429,7 @@ class TypeAnalyzer || $input_type_part instanceof TList || ( $input_type_part instanceof TNamedObject && - $codebase->classExists($input_type_part->value) && + $codebase->classOrInterfaceExists($input_type_part->value) && $codebase->methodExists($input_type_part->value . '::__invoke') ) ) diff --git a/tests/CallableTest.php b/tests/CallableTest.php index <HASH>..<HASH> 100644 --- a/tests/CallableTest.php +++ b/tests/CallableTest.php @@ -731,6 +731,20 @@ class CallableTest extends TestCase '$method' => 'string' ] ], + 'callableInterface' => [ + '<?php + interface CallableInterface{ + public function __invoke(): bool; + } + + function takesInvokableInterface(CallableInterface $c): void{ + takesCallable($c); + } + + function takesCallable(callable $c): void { + $c(); + }' + ], ]; }
Fix #<I> - allow interface with __invoke to be called
vimeo_psalm
train
php,php
40c1a39135b7fdfee3ae7265bb9465be4ebe8f34
diff --git a/code/plugins/system/koowa/koowa.php b/code/plugins/system/koowa/koowa.php index <HASH>..<HASH> 100644 --- a/code/plugins/system/koowa/koowa.php +++ b/code/plugins/system/koowa/koowa.php @@ -38,7 +38,7 @@ class Koowa /** * Koowa version */ - const _VERSION = '0.5.2'; + const _VERSION = '0.6.0'; /** * Path to Koowa libraries
Changed version to <I>
joomlatools_joomlatools-framework
train
php
b13b149e37fcb7d62c859828637e58cdcd157a50
diff --git a/lib/resourcify/controller/actions/index.rb b/lib/resourcify/controller/actions/index.rb index <HASH>..<HASH> 100644 --- a/lib/resourcify/controller/actions/index.rb +++ b/lib/resourcify/controller/actions/index.rb @@ -2,14 +2,16 @@ module Controller::Actions module Index def index authorize _RC.new - - @records = policy_scope(_RC.includes(belongs_tos)) + + @records = _RC.includes(belongs_tos) # apply filter_by if present if @records.respond_to? "filter_by" @records = @records.filter_by(params.except(:controller, :action, :page, :size)) end + @records = policy_scope(@records) + response.headers['_meta_total'] = @records.count.to_s page = params[:page] || 1
Fixed a bug in index controller which prevents correct filtering in some situations
stephenbaidu_resourcify
train
rb
0a304bea13c68a2f0d2fc6859d2eecb339d48fb6
diff --git a/src/main/java/ninja/ListFileTreeVisitor.java b/src/main/java/ninja/ListFileTreeVisitor.java index <HASH>..<HASH> 100644 --- a/src/main/java/ninja/ListFileTreeVisitor.java +++ b/src/main/java/ninja/ListFileTreeVisitor.java @@ -70,10 +70,10 @@ class ListFileTreeVisitor extends SimpleFileVisitor<Path> { long numObjects = objectCount.inc(); if (numObjects <= limit) { output.beginObject("Contents"); - output.property("Key", file.getName()); + output.property("Key", object.getKey()); output.property("LastModified", S3Dispatcher.ISO8601_INSTANT.format(object.getLastModifiedInstant())); - output.property("Size", file.length()); + output.property("Size", object.getSizeBytes()); output.property("StorageClass", "STANDARD"); output.property("ETag", getETag(file)); output.endObject();
Uses object key instead of file name 🗄
scireum_s3ninja
train
java
bb926f63d324e119d90e3ba7ff1867adc5be42e7
diff --git a/openquake/utils/db/loader.py b/openquake/utils/db/loader.py index <HASH>..<HASH> 100644 --- a/openquake/utils/db/loader.py +++ b/openquake/utils/db/loader.py @@ -36,7 +36,7 @@ import geoalchemy import numpy import sqlalchemy -from openquake import java +from openquake import java, xml from openquake.utils import db SRC_DATA_PKG = 'org.opensha.sha.earthquake.rupForecastImpl.GEM1.SourceData' @@ -490,6 +490,8 @@ class SourceModelLoader(object): self.input_id = input_id # Java SourceModelReader object + java.jvm().java.lang.System.setProperty( + "openquake.nrml.schema", xml.nrml_schema_file()) self.src_reader = java.jclass('SourceModelReader')( self.src_model_path, self.mfd_bin_width)
Set openquake.nrml.schema for SourceModelReader.
gem_oq-engine
train
py
cc2aecd3ffaa09bac296bbafd3a345f6c1a704d1
diff --git a/discord/channel.py b/discord/channel.py index <HASH>..<HASH> 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -329,7 +329,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): Same as ``around`` in :meth:`history`. oldest_first: Optional[:class:`bool`] Same as ``oldest_first`` in :meth:`history`. - bulk: class:`bool` + bulk: :class:`bool` If ``True``, use bulk delete. Setting this to ``False`` is useful for mass-deleting a bot's own messages without :attr:`Permissions.manage_messages`. When ``True``, will fall back to single delete if current account is a user bot, or if messages are
Fix 'purge' method docstring.
Rapptz_discord.py
train
py
cac8b50d06057e9dff0d5b857b7df6033a920e21
diff --git a/lib/mollie/api/object/payment/refund.rb b/lib/mollie/api/object/payment/refund.rb index <HASH>..<HASH> 100644 --- a/lib/mollie/api/object/payment/refund.rb +++ b/lib/mollie/api/object/payment/refund.rb @@ -3,6 +3,7 @@ module Mollie module Object class Payment class Refund < Base + STATUS_QUEUED = "queued" STATUS_PENDING = "pending" STATUS_PROCESSING = "processing" STATUS_REFUNDED = "refunded" @@ -12,7 +13,10 @@ module Mollie :amount, :status, :refunded_datetime - + def queued? + status == STATUS_QUEUED + end + def pending? status == STATUS_PENDING end
Add queued status and handy accessor to refunds
mollie_mollie-api-ruby
train
rb
7418265e82dd34132e72613617cedff55a1fd4b4
diff --git a/tests/test_etcd3.py b/tests/test_etcd3.py index <HASH>..<HASH> 100644 --- a/tests/test_etcd3.py +++ b/tests/test_etcd3.py @@ -793,17 +793,7 @@ class TestClient(object): etcd3.client(password='pwd') def _enable_auth_in_etcd(self): - p = subprocess.Popen( - ['etcdctl', '-w', 'json', 'user', 'add', 'root'], - stdout=subprocess.PIPE, - stdin=subprocess.PIPE - ) - password = 'pwd\n' - if six.PY3: - password = bytes(password, 'utf-8') - p.stdin.write(password) - p.stdin.write(password) - p.stdin.close() + subprocess.call(['etcdctl', '-w', 'json', 'user', 'add', 'root:pwd']) subprocess.call(['etcdctl', 'auth', 'enable']) def _disable_auth_in_etcd(self):
test_etcd3: Fixed helper for adding auth user to not rely on stdin manipulation
kragniz_python-etcd3
train
py
e2baf2980ed6e990135db12128ca4073a6436956
diff --git a/lib/rudy/aws/ec2/volume.rb b/lib/rudy/aws/ec2/volume.rb index <HASH>..<HASH> 100644 --- a/lib/rudy/aws/ec2/volume.rb +++ b/lib/rudy/aws/ec2/volume.rb @@ -164,6 +164,8 @@ module Rudy::AWS def exists?(vol_id) vol_id = Volumes.get_vol_id(vol_id) vol = get(vol_id) + return false if vol.nil? + return false if vol.deleting? !vol.nil? end
Volumes now returns false if the volume is in "deleting" state
solutious_rudy
train
rb
2df452d1502bf924e46d92b7c6a74214f6da8033
diff --git a/lib/Phpactor.php b/lib/Phpactor.php index <HASH>..<HASH> 100644 --- a/lib/Phpactor.php +++ b/lib/Phpactor.php @@ -51,7 +51,7 @@ class Phpactor $config = $loader->load(); $config[CoreExtension::COMMAND] = $input->getFirstArgument(); - $config[FilePathResolverExtension::PARAM_APPLICATION_ROOT] = realpath(__DIR__ . '/..'); + $config[FilePathResolverExtension::PARAM_APPLICATION_ROOT] = self::resolveApplicationRoot(); $config = self::configureExtensionManager($config, $vendorDir); if ($input->hasParameterOption([ '--working-dir', '-d' ])) { @@ -186,4 +186,17 @@ class Phpactor return $config; } + + private static function resolveApplicationRoot(): string + { + $paths = [ __DIR__ . '/..', __DIR__ .'/../../../..' ]; + + foreach ($paths as $path) { + if (is_dir(realpath($path.'/vendor'))) { + return realpath($path); + } + } + + throw new RuntimeException(sprintf('Could not resolve application root, tried "%s"', implode('", "', $paths))); + } }
Define application root path according to location of vendor folder (#<I>) application path is defined differently when phpactor is installed through composer (as a required package)
phpactor_phpactor
train
php
95ac6baaa9ccfb841faa6186556abd102c8b42b5
diff --git a/examples/good/test_with_statement.py b/examples/good/test_with_statement.py index <HASH>..<HASH> 100644 --- a/examples/good/test_with_statement.py +++ b/examples/good/test_with_statement.py @@ -1,5 +1,5 @@ import io -from typing import Generator +from typing import Generator, List import pytest @@ -91,9 +91,10 @@ def test_with_raises_in_assert() -> None: """ A generator with no items will raise StopIteration """ - result = (x for x in [1]) + items: List[int] = [] + + result = (x for x in items) assert isinstance(result, Generator) - assert next(result) == 1 with pytest.raises(StopIteration): next(result)
Simplify generator test: produce no items as per comment
jamescooke_flake8-aaa
train
py
58bfcd09c585aac839758c66b880a4b5aad4007f
diff --git a/lib/plugins/gzip.js b/lib/plugins/gzip.js index <HASH>..<HASH> 100644 --- a/lib/plugins/gzip.js +++ b/lib/plugins/gzip.js @@ -9,7 +9,12 @@ var assert = require('assert-plus'); function _writeHead(originalFunction) { this.removeHeader('Content-Length'); - originalFunction.apply(this, Array.prototype.slice.call(arguments, 1)); + var argsLength = arguments.length; + var args = new Array(argsLength - 1); + for (var i = 1; i < argsLength; i++) { + args[i - 1] = arguments[i]; + } + originalFunction.apply(this, args); } ///--- API
fix: arguments leak during _writeHead (#<I>)
restify_plugins
train
js
0c7350ee8b9f792566a52367a50f38d76d05d1f4
diff --git a/db/migrate/20150312113937_create_drug_types_drugs.rb b/db/migrate/20150312113937_create_drug_types_drugs.rb index <HASH>..<HASH> 100644 --- a/db/migrate/20150312113937_create_drug_types_drugs.rb +++ b/db/migrate/20150312113937_create_drug_types_drugs.rb @@ -1,8 +1,8 @@ class CreateDrugTypesDrugs < ActiveRecord::Migration def change create_table :drug_types_drugs, id: false do |t| - t.integer :drug_id - t.integer :drug_type_id + t.references :drug, foreign_key: true + t.references :drug_type, foreign_key: true t.timestamps null: false end add_index(:drug_types_drugs, [:drug_id, :drug_type_id], unique: true)
Added foreign_key: true to drug_types_drugs migration required fields.
airslie_renalware-core
train
rb
1cefbb8b5d0ba0e687635441c04d1790e33ef76c
diff --git a/flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/dialect/JDBCDialects.java b/flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/dialect/JDBCDialects.java index <HASH>..<HASH> 100644 --- a/flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/dialect/JDBCDialects.java +++ b/flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/dialect/JDBCDialects.java @@ -129,7 +129,7 @@ public final class JDBCDialects { .map(f -> quoteIdentifier(f) + "=EXCLUDED." + quoteIdentifier(f)) .collect(Collectors.joining(", ")); return Optional.of(getInsertIntoStatement(tableName, fieldNames) + - " ON CONFLICT (" + uniqueColumns + + " ON CONFLICT (" + uniqueColumns + ")" + " DO UPDATE SET " + updateClause ); }
[FLINK-<I>] [flink-jdbc] Fix syntax for PostgreSQL dialect "upsert" statement (#<I>)
apache_flink
train
java
7ec3815ed52258773756f30b6131fc6ad87d9f6f
diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -1187,7 +1187,7 @@ def block_device_mappings(vm_): ) -def _request_eip(interface, vm_=None): +def _request_eip(interface, vm_): ''' Request and return Elastic IP ''' @@ -1685,7 +1685,7 @@ def request_instance(vm_=None, call=None): eni_devices = [] for interface in network_interfaces: log.debug('Create network interface: {0}'.format(interface)) - _new_eni = _create_eni_if_necessary(interface) + _new_eni = _create_eni_if_necessary(interface, vm_) eni_devices.append(_new_eni) params.update(_param_from_config(spot_prefix + 'NetworkInterface', eni_devices)) @@ -1726,7 +1726,7 @@ def request_instance(vm_=None, call=None): } try: rd_data = aws.query(rd_params, - location=get_location(), + location=get_location(vm_), provider=get_provider(), opts=__opts__, sigver='4')
Added vm_ to the get_location query.
saltstack_salt
train
py
6e0ccc21428c63595e1b5c0e4a993ac682f167fe
diff --git a/insteonplm/plm.py b/insteonplm/plm.py index <HASH>..<HASH> 100644 --- a/insteonplm/plm.py +++ b/insteonplm/plm.py @@ -147,7 +147,14 @@ class PLM(asyncio.Protocol): flags: Message flags """ - self.log.debug('Command 1: %x Command 2: %x cmd2: %x', command['cmd1'], command['cmd2'], cmd2) + txtcommand2 = 'None' + txtcmd2 = 'None' + if command['cmd2'] is not None: + txtcmd2 = '{:02x}'.format(command['cmd2']) + if cmd2 is not None: + txtcmd2 = '{:02x}'.format(cmd2) + + self.log.debug('Command 1: %x Command 2: %x cmd2: ', command['cmd1'], txtcommand2, txtcmd2) addr = Address(device) command1 = command['cmd1'] command2 = command['cmd2']
PLM send_standard logging bug fix.
nugget_python-insteonplm
train
py
aec7e750e0aa1c948a3c24dcb440b7a6e8cbd3b1
diff --git a/cas-server-core-services/src/main/java/org/jasig/cas/services/RegexRegisteredService.java b/cas-server-core-services/src/main/java/org/jasig/cas/services/RegexRegisteredService.java index <HASH>..<HASH> 100644 --- a/cas-server-core-services/src/main/java/org/jasig/cas/services/RegexRegisteredService.java +++ b/cas-server-core-services/src/main/java/org/jasig/cas/services/RegexRegisteredService.java @@ -27,6 +27,9 @@ public class RegexRegisteredService extends AbstractRegisteredService { @Override public void setServiceId(final String id) { serviceId = id; + + // reset the servicePattern because we just changed the serviceId + servicePattern = null; } @Override
Reset regex servicePattern when the serviceId is changed
apereo_cas
train
java
c53637102cc3d524e6aaa8e57d58ab6124ba7915
diff --git a/WordPress/Sniffs/Variables/GlobalVariablesSniff.php b/WordPress/Sniffs/Variables/GlobalVariablesSniff.php index <HASH>..<HASH> 100644 --- a/WordPress/Sniffs/Variables/GlobalVariablesSniff.php +++ b/WordPress/Sniffs/Variables/GlobalVariablesSniff.php @@ -226,7 +226,6 @@ class WordPress_Sniffs_Variables_GlobalVariablesSniff extends WordPress_Sniff { 'cat', 'lost', 'avail_post_mime_types', - '$var', 'errors', 'cat_id', 'orderby',
GlobalVariables: remove an incorrect variable from the list of WP global variables.
WordPress-Coding-Standards_WordPress-Coding-Standards
train
php
4f3cb33ccf61504b5c9aa87c53e03de1a4a0777d
diff --git a/sphinxarg/parser.py b/sphinxarg/parser.py index <HASH>..<HASH> 100644 --- a/sphinxarg/parser.py +++ b/sphinxarg/parser.py @@ -55,6 +55,7 @@ def parse_parser(parser, data=None, **kwargs): 'name': '', 'usage': parser.format_usage().strip(), 'bare_usage': _format_usage_without_prefix(parser), + 'prog': parser.prog, } _try_add_parser_attribute(data, parser, 'description') _try_add_parser_attribute(data, parser, 'epilog')
collect parser 'prog' (program name) for completeness
ribozz_sphinx-argparse
train
py
d1d899fe05d3de5a57f440ef40fd2f3f9c440f8d
diff --git a/src/Stream.php b/src/Stream.php index <HASH>..<HASH> 100644 --- a/src/Stream.php +++ b/src/Stream.php @@ -240,7 +240,11 @@ final class Stream implements StreamInterface throw new \RuntimeException('Cannot read from non-readable stream'); } - return \fread($this->stream, $length); + if (false === $result = \fread($this->stream, $length)) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $result; } public function getContents(): string
fix throw exception on read stream (#<I>) * fix throw exception on read stream * remove test on read return false
Nyholm_psr7
train
php
d8269d8973b1c2ccdfd85d1215a6509e6dc9ff05
diff --git a/pwkit/environments/ciao/data.py b/pwkit/environments/ciao/data.py index <HASH>..<HASH> 100644 --- a/pwkit/environments/ciao/data.py +++ b/pwkit/environments/ciao/data.py @@ -92,6 +92,11 @@ class BaseCIAOData (object): self.mjdref = header['MJDREF'] # TODO: use TIMEZERO correctly? self.timesys = header['TIMESYS'] + elif 'MJDREFI' in header: + self.mjdref = float(header['MJDREFI']) + if 'MJDREFF' in header: + self.mjdref += header['MJDREFF'] + self.timesys = header['TIMESYS'] def _process_hdu (self, hdu): warn ('ignoring HDU named %s', hdu.name) @@ -118,8 +123,8 @@ class GTIData (BaseCIAOData): def _process_hdu (self, hdu): - if hdu.name == 'GTI': - ccd = hdu.header['CCD_ID'] + if hdu.name in ('GTI', 'STDGTI'): + ccd = hdu.header.get('CCD_ID', 0) gti = self.gti[ccd] = fits_recarray_to_data_frame (hdu.data) gti.rename (columns={'start': 'start_met', 'stop': 'stop_met'}, inplace=True)
pwkit/environments/ciao/data.py: some hacks to be able to load Swift events files The overlap and disjunction between this and pwkit.environments.sas.data is getting worrisome. Should probably work on a Grand Unified X-ray Data Loader infrastructure, except of course that would take a lot of time and effort to get working.
pkgw_pwkit
train
py
db83be1eb3f703a68c7c569a7ee67f5f9482ae06
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="minikerberos", # Version number (initial): - version="0.0.11+supercollider", + version="0.0.11+supercollider.1", # Application author details: author="Tamas Jos", @@ -21,7 +21,7 @@ setup( # Details url="https://github.com/skelsec/minikerberos", - zip_safe = True, + zip_safe=True, # # license="LICENSE.txt", description="Kerberos manipulation library in pure Python", @@ -34,7 +34,7 @@ setup( "Operating System :: OS Independent", ), install_requires=[ - 'asn1crypto', + 'asn1crypto==0.24.0', ], # entry_points={
Fixed asn1crypto version to <I>
skelsec_minikerberos
train
py
3d744ba543b1b8a5d96c5b0cd49bd40723076610
diff --git a/lib/surrounded/version.rb b/lib/surrounded/version.rb index <HASH>..<HASH> 100644 --- a/lib/surrounded/version.rb +++ b/lib/surrounded/version.rb @@ -1,5 +1,5 @@ module Surrounded - VERSION = "0.9.2" + VERSION = "0.9.3" def self.version VERSION
releasing the no-puts version
saturnflyer_surrounded
train
rb
9fc95ada3839eb7e81b69b3c3bc23c2c78c71398
diff --git a/src/server/pps/server/worker_rc.go b/src/server/pps/server/worker_rc.go index <HASH>..<HASH> 100644 --- a/src/server/pps/server/worker_rc.go +++ b/src/server/pps/server/worker_rc.go @@ -3,7 +3,6 @@ package server import ( "context" "encoding/json" - "fmt" "strconv" client "github.com/pachyderm/pachyderm/src/client" @@ -254,11 +253,11 @@ func (a *apiServer) getWorkerOptions(pipelineName string, pipelineVersion uint64 }) workerEnv = append(workerEnv, v1.EnvVar{ Name: client.PProfPortEnv, - Value: fmt.Sprintf("%d", a.pprofPort), + Value: strconv.FormatUint(uint64(a.pprofPort), 10), }) workerEnv = append(workerEnv, v1.EnvVar{ Name: client.PeerPortEnv, - Value: fmt.Sprintf("%d", a.peerPort), + Value: strconv.FormatUint(uint64(a.peerPort), 10), }) var volumes []v1.Volume
Use strconv to format ints instead of fmt
pachyderm_pachyderm
train
go
7d5fc926792188fcc59696d74828f4a8c7647e6b
diff --git a/resources/lang/cs-CZ/forms.php b/resources/lang/cs-CZ/forms.php index <HASH>..<HASH> 100644 --- a/resources/lang/cs-CZ/forms.php +++ b/resources/lang/cs-CZ/forms.php @@ -168,7 +168,7 @@ return [ 'analytics' => [ 'analytics_google' => 'Kód pro Google Analytics', 'analytics_gosquared' => 'Kód pro GoSquared Analytics', - 'analytics_piwik_url' => 'URL of your Piwik instance', + 'analytics_piwik_url' => 'URL vaší instance Piwik', 'analytics_piwik_siteid' => 'Id webu Piwik', ], 'localization' => [ @@ -230,8 +230,8 @@ return [ ], 'seo' => [ - 'title' => 'SEO Title', - 'description' => 'SEO Description', + 'title' => 'SEO titulek', + 'description' => 'Popis SEO', ], // Buttons
New translations forms.php (Czech)
CachetHQ_Cachet
train
php
6477b43d9b6cd66026326f84e93e1ba865071621
diff --git a/py/path/testing/fscommon.py b/py/path/testing/fscommon.py index <HASH>..<HASH> 100644 --- a/py/path/testing/fscommon.py +++ b/py/path/testing/fscommon.py @@ -203,7 +203,7 @@ class CommonFSTests(common.CommonPathTests): def test_move_file(self): p = self.root.join('samplefile') - newp = p.dirpath('samplefile_moved') + newp = p.dirpath('moved_samplefile') p.move(newp) assert newp.check(file=1) assert not p.check()
[svn r<I>] avoid clashing the sample* prefix which is used by a listdir() test --HG-- branch : trunk
vmalloc_dessert
train
py
b43f2f08b38547753f520f21340cc0b9098fe6e2
diff --git a/app/lib/actions/pulp3/repository/upload_file.rb b/app/lib/actions/pulp3/repository/upload_file.rb index <HASH>..<HASH> 100644 --- a/app/lib/actions/pulp3/repository/upload_file.rb +++ b/app/lib/actions/pulp3/repository/upload_file.rb @@ -25,7 +25,7 @@ module Actions filechunk.flush actual_chunk_size = File.size(filechunk) response = uploads_api.update(upload_href, content_range(offset, offset + actual_chunk_size - 1, total_size), filechunk) - offset += actual_chunk_size - 1 + offset += actual_chunk_size ensure filechunk.close filechunk.unlink
Fixes #<I> - Upload large file from UI (#<I>)
Katello_katello
train
rb
5ddc843094adb997b5f15178d6f58169672a4f85
diff --git a/pywb/warc/resolvingloader.py b/pywb/warc/resolvingloader.py index <HASH>..<HASH> 100644 --- a/pywb/warc/resolvingloader.py +++ b/pywb/warc/resolvingloader.py @@ -117,7 +117,7 @@ class ResolvingLoader(object): if not possible_paths: continue - if isinstance(possible_paths, str): + if isinstance(possible_paths, six.string_types): possible_paths = [possible_paths] for path in possible_paths:
resolvingloader: use string_types instead of str for compat
webrecorder_pywb
train
py
46d508b39ea8b79e7154e55dd5e8dd429c098f75
diff --git a/src/Twig/Spell.php b/src/Twig/Spell.php index <HASH>..<HASH> 100644 --- a/src/Twig/Spell.php +++ b/src/Twig/Spell.php @@ -1,22 +1,33 @@ <?php - namespace js\tools\numbers2words\Twig; -use Twig\TwigFilter; use js\tools\numbers2words\Speller; use Twig\Extension\AbstractExtension; +use Twig\TwigFilter; class Spell extends AbstractExtension { public function getFilters() { return [ + new TwigFilter('spellNumber', [$this, 'spellNumber']), new TwigFilter('spellCurrencyShort', [$this, 'spellCurrencyShort']), + new TwigFilter('spellCurrency', [$this, 'spellCurrency']), ]; } + public function spellNumber($number, $language) + { + return Speller::spellNumber($number, $language); + } + public function spellCurrencyShort($amount, $language, $currency) { return Speller::spellCurrencyShort($amount, $language, $currency); } + + public function spellCurrency($amount, $language, $currency, $requireDecimal = true, $spellDecimal = false) + { + return Speller::spellCurrency($amount, $language, $currency, $requireDecimal, $spellDecimal); + } }
Adding all the Speller methods as Twig filters.
jurchiks_numbers2words
train
php
35e5c15953f076ff62ff9d0008116c952ebed6bf
diff --git a/cellbase-mongodb/src/main/java/org/opencb/cellbase/lib/mongodb/db/VariantAnnotationMongoDBAdaptor.java b/cellbase-mongodb/src/main/java/org/opencb/cellbase/lib/mongodb/db/VariantAnnotationMongoDBAdaptor.java index <HASH>..<HASH> 100644 --- a/cellbase-mongodb/src/main/java/org/opencb/cellbase/lib/mongodb/db/VariantAnnotationMongoDBAdaptor.java +++ b/cellbase-mongodb/src/main/java/org/opencb/cellbase/lib/mongodb/db/VariantAnnotationMongoDBAdaptor.java @@ -792,6 +792,7 @@ public class VariantAnnotationMongoDBAdaptor extends MongoDBAdaptor implements V consequenceTypeTemplate.setCodon(null); consequenceTypeTemplate.setStrand((String) geneInfo.get("strand")); consequenceTypeTemplate.setBiotype((String) transcriptInfo.get("biotype")); + consequenceTypeTemplate.setProteinSubstitutionScores(null); if(transcriptStrand.equals("+")) { solveTranscriptFlankingRegions(SoNames, transcriptStart, transcriptEnd, variantStart, variantEnd,
feature/consequence-type: new bugs fixed at VariantAnnotationMongoDBAdaptor
opencb_cellbase
train
java
761f666c4483b88da84d670f3ff86af1774d1708
diff --git a/checkpoints.go b/checkpoints.go index <HASH>..<HASH> 100644 --- a/checkpoints.go +++ b/checkpoints.go @@ -15,9 +15,9 @@ import ( // best block chain that a good checkpoint candidate must be. const CheckpointConfirmations = 2016 -// A checkpoint is a known good point in the block chain. Using checkpoints -// allows a few optimizations for old blocks during initial download and also -// prevents forks from old blocks. +// Checkpoint identifies a known good point in the block chain. Using +// checkpoints allows a few optimizations for old blocks during initial download +// and also prevents forks from old blocks. // // Each checkpoint is selected by the core developers based upon several // factors. See the documentation for IsCheckpointCandidate for details
Use consistent form for Checkpoint comment.
btcsuite_btcd
train
go
bb814c2babae3320909991f4be2a73928654eabc
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -188,7 +188,7 @@ module.exports = function (grunt) { 'mochaTest:unit', 'build', 'mochaTest:yaml_suite', - 'start:integration_server', + // 'start:integration_server', // 'mocha:yaml_suite' -- this will fail because of the way that PhantomJS handle's DELETE requests with body's ]);
removed the browser based tests from the build until the issue with DELETE requests is resolved
elastic_elasticsearch-js
train
js
2047784dac12db995f3f46384c3cad6e19613951
diff --git a/lib/theme/watch.js b/lib/theme/watch.js index <HASH>..<HASH> 100644 --- a/lib/theme/watch.js +++ b/lib/theme/watch.js @@ -100,7 +100,7 @@ module.exports = function *(argv) { log(`Deleted ${filePath}`, 'green') } }).catch((err) => { - log(err.stack, 'red') + log(err, 'red') }) })
Fix error reporting for watch command There is no err.stack
internalfx_quickshot
train
js
f0990d58d4be2ef2e87e321dc8aaeb957e6a2d27
diff --git a/src/components/Tooltip/Tooltip.react.js b/src/components/Tooltip/Tooltip.react.js index <HASH>..<HASH> 100644 --- a/src/components/Tooltip/Tooltip.react.js +++ b/src/components/Tooltip/Tooltip.react.js @@ -35,7 +35,7 @@ class Tooltip extends React.Component<Props, State> { const classes = cn( "tooltip", - placement ? "bs-tooltip-" + placement : null, + placement && "bs-tooltip-" + placement, { show: this.state.isShown, }, @@ -57,7 +57,7 @@ class Tooltip extends React.Component<Props, State> { </div> )} </Reference> - {this.state.isShown ? ( + {this.state.isShown && ( <Popper placement={placement} eventsEnabled={true}> {({ ref, style, placement }: PopperChildrenProps) => { return ( @@ -73,7 +73,7 @@ class Tooltip extends React.Component<Props, State> { ); }} </Popper> - ) : null} + )} </Manager> ); }
refactor(Tooltip): Change ternary operators into logical operators All null returning ternary operators ( X ? Y : null ) have been replaced with logical operators ( X && Y)
tabler_tabler-react
train
js
70d5d112d2371be64b1d79517f641e1832f72ac3
diff --git a/pkg/minikube/extract/extract.go b/pkg/minikube/extract/extract.go index <HASH>..<HASH> 100644 --- a/pkg/minikube/extract/extract.go +++ b/pkg/minikube/extract/extract.go @@ -48,6 +48,11 @@ var exclude = []string{ " - {{.profile}}", "test/integration", "pkg/minikube/reason/exitcodes.go", + "{{.err}}", + "{{.extra_option_component_name}}.{{.key}}={{.value}}", + "{{ .name }}: {{ .rejection }}", + "127.0.0.1", + "- {{.logPath}}", } // ErrMapFile is a constant to refer to the err_map file, which contains the Advice strings.
add more phrases to translations exclude list
kubernetes_minikube
train
go
daea6a52028283736b4089c25c65736c8d4e7a48
diff --git a/worker/uniter/resolver.go b/worker/uniter/resolver.go index <HASH>..<HASH> 100644 --- a/worker/uniter/resolver.go +++ b/worker/uniter/resolver.go @@ -270,8 +270,12 @@ func (s *uniterResolver) nextOp( } // This is checked early so that after a series upgrade, it is the first - // hook to be run. - if localState.UpgradeSeriesStatus == model.UpgradeSeriesNotStarted && + // hook to be run. The uniter's local state will be in the "not started" state + // if the uniter was stopped, for whatever reason, when performing a + // series upgrade. If the uniter was not stopped then it will be in the + // "prepare completed" state and should fire the hook likewise. + if (localState.UpgradeSeriesStatus == model.UpgradeSeriesNotStarted || + localState.UpgradeSeriesStatus == model.UpgradeSeriesPrepareCompleted) && remoteState.UpgradeSeriesStatus == model.UpgradeSeriesCompleteStarted { return opFactory.NewRunHook(hook.Info{Kind: hooks.PostSeriesUpgrade}) }
Ensure uniter can progress from both shutdown and no shutdown states.
juju_juju
train
go
a2fdb175819cd65699400aa317617a081fb9ee6f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -159,8 +159,13 @@ if USE_CYTHON or USE_SOURCE: extensions = optional_extensions make_dir('geomdl_core') +# Add Enum type support for Python versions < 3.4 +if sys.version_info[:2] < (3, 4): + required = ['enum34'] +else: + required = [] -setup( +data = dict( name='geomdl', version=get_property('__version__', 'geomdl'), description='Object-oriented B-Spline and NURBS evaluation library', @@ -171,7 +176,7 @@ setup( url='https://github.com/orbingol/NURBS-Python', keywords='NURBS B-Spline curve surface CAD modeling visualization surface-generator', packages=['geomdl', 'geomdl.visualization', 'geomdl.shapes'], - install_requires=['six>=1.9.0'], + install_requires=['six>=1.9.0'] + required, extras_require={ 'visualization': ['matplotlib', 'plotly'], }, @@ -199,3 +204,7 @@ setup( 'Tracker': 'https://github.com/orbingol/NURBS-Python/issues', }, ) + + +if __name__ == '__main__': + setup(**data)
Add enum<I> as a dependency
orbingol_NURBS-Python
train
py
b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27
diff --git a/src/VAPID.php b/src/VAPID.php index <HASH>..<HASH> 100644 --- a/src/VAPID.php +++ b/src/VAPID.php @@ -190,8 +190,8 @@ class VAPID } return [ - 'publicKey' => base64_encode($binaryPublicKey), - 'privateKey' => base64_encode($binaryPrivateKey) + 'publicKey' => Base64Url::encode($binaryPublicKey), + 'privateKey' => Base64Url::encode($binaryPrivateKey) ]; } } diff --git a/tests/VAPIDTest.php b/tests/VAPIDTest.php index <HASH>..<HASH> 100644 --- a/tests/VAPIDTest.php +++ b/tests/VAPIDTest.php @@ -98,7 +98,7 @@ final class VAPIDTest extends PHPUnit\Framework\TestCase $keys = VAPID::createVapidKeys(); $this->assertArrayHasKey('publicKey', $keys); $this->assertArrayHasKey('privateKey', $keys); - $this->assertEquals(strlen($keys['publicKey']), 88); - $this->assertEquals(strlen($keys['privateKey']), 44); + $this->assertGreaterThanOrEqual(86, strlen($keys['publicKey'])); + $this->assertGreaterThanOrEqual(42, strlen($keys['privateKey'])); } }
Encode VAPID key in URL-safe base<I> (#<I>) * fix base<I>encode issue * typo ~ fix Base<I>Url::encode * fix phpunit testing * fix The condition becomes ">=<I>" and ">=<I>"
web-push-libs_web-push-php
train
php,php
f603bce889e9333a7d585eb17b8954c22a09fb72
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/StatusLine.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/StatusLine.java index <HASH>..<HASH> 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/StatusLine.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/StatusLine.java @@ -59,7 +59,7 @@ public class StatusLine { ch = reader.read(); if (ch != byteArray[i]) { throw new RuntimeException(String.format("Expected '%s', found '%s' instead", string, - string.substring(0, i) + ch)); + string.substring(0, i) + (char) ch)); } } }
fix a minor bug in statusline
Azure_azure-sdk-for-java
train
java
a040e62436441ecc8bc8543700f00e7503a344dd
diff --git a/platform/rpc/nats/bus.go b/platform/rpc/nats/bus.go index <HASH>..<HASH> 100644 --- a/platform/rpc/nats/bus.go +++ b/platform/rpc/nats/bus.go @@ -89,11 +89,13 @@ func (n *NATS) AwaitPresence(instID flux.InstanceID, timeout time.Duration) erro func (n *NATS) Ping(instID flux.InstanceID) error { var response PingResponse - err := n.enc.Request(string(instID)+methodPing, ping{}, &response, timeout) - if err == nil { - err = extractError(response.ErrorResponse) + if err := n.enc.Request(string(instID)+methodPing, ping{}, &response, timeout); err != nil { + if err == nats.ErrTimeout { + err = platform.UnavailableError(err) + } + return err } - return err + return extractError(response.ErrorResponse) } // ErrorResponse is for dropping into responses so they have
Bring the bus implementation of Ping up-to-date The various platform.Platform implementations of Ping return a platform.UnavailableError if the call fails to return (including if the NATS request times out). However, the method actually used by the server is MessageBus.Ping -- the platform.Platform implementation is side-stepped. This commit makes the error handling for NATS.Ping behave the same as for natsPlatform.Ping.
weaveworks_flux
train
go
d76389f5792b20ec4f5e01029ebc765e0e8dfda4
diff --git a/Kwf/Model/Db.php b/Kwf/Model/Db.php index <HASH>..<HASH> 100644 --- a/Kwf/Model/Db.php +++ b/Kwf/Model/Db.php @@ -894,12 +894,7 @@ class Kwf_Model_Db extends Kwf_Model_Abstract $dbSelect = $this->_getDbSelect($select); if (isset($options['columns'])) { $columns = $dbSelect->getPart(Zend_Db_Select::COLUMNS); - unset($columns[0]); - foreach ($this->getOwnColumns() as $c) { - if (in_array($c, $options['columns'])) { - $columns[] = array($this->getTableName(), $c, null); - } - } + unset($columns[0]); //unset * $dbSelect->reset(Zend_Db_Select::COLUMNS); $dbSelect->setPart(Zend_Db_Select::COLUMNS, $columns); }
don't select columns twice, expr() does select them already
koala-framework_koala-framework
train
php
d985dc7c3833e96d84e3617bbdaeb4515d9df806
diff --git a/mongo.py b/mongo.py index <HASH>..<HASH> 100644 --- a/mongo.py +++ b/mongo.py @@ -653,7 +653,8 @@ class Cursor(object): """Refreshes the cursor with more data from Mongo. Returns the length of self.__data after refresh. Will exit early if - self.__data is already non-empty. + self.__data is already non-empty. Raises DatabaseException when the + cursor cannot be refreshed due to an error on the query. """ if len(self.__data) or self.__killed: return len(self.__data) @@ -663,8 +664,14 @@ class Cursor(object): request_id = self.__collection._send_message(operation, message) response = self.__collection.database()._receive_message(1, request_id) - # TODO handle non-zero response flags - assert struct.unpack("<i", response[:4])[0] == 0 + response_flag = struct.unpack("<i", response[:4])[0] + if response_flag == 1: + raise DatabaseException("cursor id '%s' not valid at server" % self.__id) + elif response_flag == 2: + error_object = bson.to_dict(response[20:]) + raise DatabaseException("database error: %s" % error_object["$err"]) + else: + assert response_flag == 0 self.__id = struct.unpack("<q", response[4:12])[0] assert struct.unpack("<i", response[12:16])[0] == self.__retrieved
handle non-zero response flags
mongodb_mongo-python-driver
train
py
b747ad4ffe7e5dffb935b7b26646ed8764ce48a2
diff --git a/src/Http/Controllers/AdminController.php b/src/Http/Controllers/AdminController.php index <HASH>..<HASH> 100644 --- a/src/Http/Controllers/AdminController.php +++ b/src/Http/Controllers/AdminController.php @@ -4,7 +4,6 @@ namespace TypiCMS\Modules\Groups\Http\Controllers; use TypiCMS\Modules\Core\Http\Controllers\BaseAdminController; use TypiCMS\Modules\Groups\Http\Requests\FormRequest; use TypiCMS\Modules\Groups\Repositories\GroupInterface; -use View; class AdminController extends BaseAdminController { @@ -22,7 +21,7 @@ class AdminController extends BaseAdminController /** * Show the form for editing the specified resource. * - * @return Response + * @return \Illuminate\Support\Facades\Response */ public function edit($model, $child = null) {
docblocks + use statments
TypiCMS_Groups
train
php
c700e470c21b1087180e882700e9f855f8b44843
diff --git a/tests/test_incident.py b/tests/test_incident.py index <HASH>..<HASH> 100644 --- a/tests/test_incident.py +++ b/tests/test_incident.py @@ -121,7 +121,18 @@ class TestIncident(unittest.TestCase): content_type="application/json") r = self.client.query(table='incident', query={}) - response = r.get_all(limit=2) + + # Trigger a request by fetching next element from the generator + r.get_all(limit=2).__next__() + + # Get last request QS + qs = httpretty.last_request().querystring + + # Make sure sysparm_limit equals limit + self.assertEqual(int(qs['sysparm_limit'][0]), 2) + + # Make sure sysparm_suppress_pagination_header is True + self.assertTrue(qs['sysparm_suppress_pagination_header']) @httpretty.activate
Validate mocked request's QS in test_get_limited_result()
rbw_pysnow
train
py
7a3fd5e148051e66f70963b688fb0a0a7a80ee01
diff --git a/lib/tasks.php b/lib/tasks.php index <HASH>..<HASH> 100644 --- a/lib/tasks.php +++ b/lib/tasks.php @@ -66,7 +66,7 @@ group('db', function() { desc("Merge a backed up database into environment"); task('merge','db', function($app) { info("merge","database {$app->env->database["name"]}"); - $file = $app->env->shared_dir."/deploy/dump.sql"; + $file = $app->env->shared_dir."/dump.sql"; if(!file_exists("./tmpdump.sql")) warn("merge","i need a backup to merge with (dump.sql). Try running db:backup first"); if(isset($app->old_url))
don't use shared/deploy/ since it never will exist.
tamagokun_pomander-wordpress
train
php
647b12e42a997f1c45675b7d4d444780fdcc51c6
diff --git a/src/Extension/CoreExtension.php b/src/Extension/CoreExtension.php index <HASH>..<HASH> 100644 --- a/src/Extension/CoreExtension.php +++ b/src/Extension/CoreExtension.php @@ -135,13 +135,15 @@ class CoreExtension extends Extension new SimpleFilter('nl2br', 'nl2br'), // array helpers - new SimpleFilter('count', 'count'), new SimpleFilter('keys', array($this, 'keysArray')), new SimpleFilter('merge', array($this, 'mergeArray')), new SimpleFilter('slice', array($this, 'sliceArray')), new SimpleFilter('implode', array($this, 'implodeArray')), new SimpleFilter('explode', array($this, 'explodeArray')), + // string/array helpers + new SimpleFilter('length', array($this, 'length')), + // escaping new SimpleFilter('e', array($this, 'escape')), new SimpleFilter('escape', array($this, 'escape')), @@ -340,6 +342,11 @@ class CoreExtension extends Extension return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); } + public function length($value) + { + return is_scalar($value) ? strlen($value) : count($value); + } + public function escape($value, $strategy = 'html', $charset = null) { if (is_numeric($value)) {
renamed "count" to "length" filter length filter counts scalars too
pagekit_razr
train
php
85105afd967513e968720099fc8938f6d275a3c3
diff --git a/Schema/Grammars/SqlServerGrammar.php b/Schema/Grammars/SqlServerGrammar.php index <HASH>..<HASH> 100755 --- a/Schema/Grammars/SqlServerGrammar.php +++ b/Schema/Grammars/SqlServerGrammar.php @@ -59,7 +59,7 @@ class SqlServerGrammar extends Grammar } /** - * Compile a create table command. + * Compile a column addition table command. * * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command
Update SqlServerGrammar.php (#<I>) The description of 'compileAdd' function seems copied from 'compileCreate'. Suggested a clearer (hopefully) description for the function.
illuminate_database
train
php
0290b5e91861e55a86e5aed5f8001c6c37365f1f
diff --git a/users.go b/users.go index <HASH>..<HASH> 100644 --- a/users.go +++ b/users.go @@ -80,6 +80,11 @@ func (users *Users) Next() bool { return false } +// Error returns users error +func (users *Users) Error() error { + return users.err +} + func (users *Users) setValues() { for i := range users.Users { users.Users[i].inst = users.inst
Added Error function to users
ahmdrz_goinsta
train
go
cb648a833d2d4b11f9dac315bc52848f4e43c3cb
diff --git a/core-bundle/src/Resources/contao/classes/FrontendTemplate.php b/core-bundle/src/Resources/contao/classes/FrontendTemplate.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/classes/FrontendTemplate.php +++ b/core-bundle/src/Resources/contao/classes/FrontendTemplate.php @@ -342,6 +342,7 @@ class FrontendTemplate extends \Template if (false === $objPage->cache && false === $objPage->clientCache) { + $response->setPrivate(); return; }
[Core] Explicitely set response to private if caching was disabled
contao_contao
train
php
ddd263ec038245d8192a40b9f008243807fd2ddb
diff --git a/rocketchat_API/rocketchat.py b/rocketchat_API/rocketchat.py index <HASH>..<HASH> 100644 --- a/rocketchat_API/rocketchat.py +++ b/rocketchat_API/rocketchat.py @@ -137,6 +137,15 @@ class RocketChat: else: raise RocketMissingParamException('userID or username required') + def users_create_token(self, user_id=None, username=None, **kwargs): + """Create a user authentication token.""" + if user_id: + return self.__call_api_post('users.createToken', userId=user_id, kwargs=kwargs) + elif username: + return self.__call_api_post('users.createToken', username=username, kwargs=kwargs) + else: + raise RocketMissingParamException('userID or username required') + # Chat def chat_post_message(self, room_id, text, **kwargs):
- added users.createToken
jadolg_rocketchat_API
train
py
2b1ced56a040955d48f8593095237c5f719c4aad
diff --git a/python/test/dev/diff.py b/python/test/dev/diff.py index <HASH>..<HASH> 100755 --- a/python/test/dev/diff.py +++ b/python/test/dev/diff.py @@ -29,7 +29,7 @@ scala_to_python = {"Graph": "Model"} def extract_scala_class(class_path): exclude_key_words = set(["*", "abstract", "Const", "Fill", "Shape", - "SplitAndSelect", "StrideSlice", "Scheduler", "StaticGraph", "DynamicGraph"]) # noqa + "SplitAndSelect", "StrideSlice", "Scheduler", "StaticGraph", "DynamicGraph", "DynamicContainer"]) # noqa include_key_words = set(["Module", "Criterion", "Container", "Cell", "TensorNumeric"]) # noqa content = "\n".join([line for line in open(class_path).readlines() if all([key not in line for key in exclude_key_words])]) # noqa match = re.search(r"class ([\w]+)[^{]+", content)
Refine container (#<I>) * move add method to subclass of container * meet code review * fix conflict code
intel-analytics_BigDL
train
py
a6cddfff7e2f2c173d53d73aaeb84f258811584f
diff --git a/src/Guzzle3/HmacAuthPlugin.php b/src/Guzzle3/HmacAuthPlugin.php index <HASH>..<HASH> 100644 --- a/src/Guzzle3/HmacAuthPlugin.php +++ b/src/Guzzle3/HmacAuthPlugin.php @@ -88,6 +88,7 @@ class HmacAuthPlugin implements EventSubscriberInterface if (!$request->hasHeader('Date')) { $time = new \DateTime(); + $time->setTimezone(new \DateTimeZone('GMT')); $request->setHeader('Date', $time->format(ClientInterface::HTTP_DATE)); }
Use GMT Timezone for Guzzle request If your server has a timezone different than GMT, a wrong header Date will be set.
acquia_http-hmac-php
train
php
8c7413f1b3fdb78148a0426ebb985b6261f60ae9
diff --git a/config/ember-try.js b/config/ember-try.js index <HASH>..<HASH> 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -71,7 +71,7 @@ module.exports = async function () { }, npm: { devDependencies: { - 'ember-source': '~3.28.0', + 'ember-source': '~3.24.0', }, ember: { edition: 'classic',
Use Ember.js <I> for ember-classic scenario until deps updated
samselikoff_ember-cli-mirage
train
js
410c1c8673dea533deb6a901cbab6e8f5a71a5b8
diff --git a/lib/apic.js b/lib/apic.js index <HASH>..<HASH> 100644 --- a/lib/apic.js +++ b/lib/apic.js @@ -132,6 +132,10 @@ define(function (require) { catch (e) { } } + + if (xhr.status === 401 && root.authorize()) { + root.unauthorize(); + } }) .always(function (a, status, b) { var xhr = status === 'success' ? b : a, // WTF diff --git a/lib/auth.js b/lib/auth.js index <HASH>..<HASH> 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -30,6 +30,10 @@ define(function (require, exports) { } } + function unauthorize() { + value = undefined; + } + for (var scheme in schemes) { authorize[scheme] = (function(scheme) { return function() { @@ -43,6 +47,7 @@ define(function (require, exports) { } this.authorize = authorize; + this.unauthorize = unauthorize; };
Added unauthorization on <I> response status
temich_apic.js
train
js,js
2f3d674141373eb1d6dd9619b18768fa942e127f
diff --git a/lib/jsonapi/consumer/parser.rb b/lib/jsonapi/consumer/parser.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/consumer/parser.rb +++ b/lib/jsonapi/consumer/parser.rb @@ -66,7 +66,7 @@ module JSONAPI::Consumer end def _body - response.body + response.body.with_indifferent_access end def _status diff --git a/lib/jsonapi/consumer/resource/connection_concern.rb b/lib/jsonapi/consumer/resource/connection_concern.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/consumer/resource/connection_concern.rb +++ b/lib/jsonapi/consumer/resource/connection_concern.rb @@ -13,18 +13,7 @@ module JSONAPI::Consumer if response.status && response.status == 204 true else - parser.build - # data = response.body - - # result_data = data.fetch(json_key, []) - # d = result_data.map do |attrs| - # attrs = attrs.dup - # if attrs.has_key?(:links) - # attrs.merge!(attrs.delete(:links)) - # end - # new(attrs) - # end end end
Proper host attribute and side-loading Closes #4 #6
jsmestad_jsonapi-consumer
train
rb,rb
754410835a9befd0cb44bef692cd9ff4eb538b3c
diff --git a/sqtf-core/src/main/java/org/sqtf/data/MethodSource.java b/sqtf-core/src/main/java/org/sqtf/data/MethodSource.java index <HASH>..<HASH> 100644 --- a/sqtf-core/src/main/java/org/sqtf/data/MethodSource.java +++ b/sqtf-core/src/main/java/org/sqtf/data/MethodSource.java @@ -23,7 +23,7 @@ class MethodSource extends DataSource { return null; } - Collection<?> collection; + Collection collection; if (Modifier.isStatic(method.getModifiers())) { collection = (Collection<?>) method.invoke(null); @@ -31,16 +31,19 @@ class MethodSource extends DataSource { collection = (Collection<?>) method.invoke(instance); } + final List<Object[]> testSet = new ArrayList<>(); + for (Object o : collection) { - if (!(o instanceof Object[])) + if (o instanceof Collection) { + testSet.add(((Collection) o).toArray()); + } else if (!(o instanceof Object[])) { return null; + } else { + testSet.add((Object[]) o); + } } - if (collection instanceof List) { - return (List<Object[]>) collection; - } else { - return new ArrayList(collection); - } + return testSet; } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { return null;
accept collections of collections and collections of arrays
BradleyWood_Software-Quality-Test-Framework
train
java
846e256b63ec4f7936b8dc43b72a95c3c5f1eb73
diff --git a/views/js/ui/resourcemgr/fileSelector.js b/views/js/ui/resourcemgr/fileSelector.js index <HASH>..<HASH> 100755 --- a/views/js/ui/resourcemgr/fileSelector.js +++ b/views/js/ui/resourcemgr/fileSelector.js @@ -152,7 +152,7 @@ define([ if(errors.length === 0){ _.delay(switchUpload, 500); } else { - feedback().error("<ul><li>" + errors.join('</li><li>') + "</li></ul>"); + feedback().error("<ul><li>" + errors.join('</li><li>') + "</li></ul>", {encodeHtml: false}); } //reset errors errors = [];
Allow html in fileselector error feedback
oat-sa_tao-core
train
js
34274b2a59bc9d912b240389c5a50031e76e11bc
diff --git a/src/gr/spinellis/umlgraph/doclet/ClassGraph.java b/src/gr/spinellis/umlgraph/doclet/ClassGraph.java index <HASH>..<HASH> 100644 --- a/src/gr/spinellis/umlgraph/doclet/ClassGraph.java +++ b/src/gr/spinellis/umlgraph/doclet/ClassGraph.java @@ -222,6 +222,12 @@ class ClassGraph { } } + /* + * The following two methods look similar, but can't + * be refactored into one, because their common interface, + * ExecutableMemberDoc, doesn't support returnType for ctors. + */ + /** Print the class's constructors m */ private void operations(ConstructorDoc m[]) { for (ConstructorDoc cd : m) { diff --git a/src/org/umlgraph/doclet/ClassGraph.java b/src/org/umlgraph/doclet/ClassGraph.java index <HASH>..<HASH> 100644 --- a/src/org/umlgraph/doclet/ClassGraph.java +++ b/src/org/umlgraph/doclet/ClassGraph.java @@ -222,6 +222,12 @@ class ClassGraph { } } + /* + * The following two methods look similar, but can't + * be refactored into one, because their common interface, + * ExecutableMemberDoc, doesn't support returnType for ctors. + */ + /** Print the class's constructors m */ private void operations(ConstructorDoc m[]) { for (ConstructorDoc cd : m) {
Comment why a refactoring is not possible.
dspinellis_UMLGraph
train
java,java
b5fb01d32021512bae2ab2b8dafc6ea1fd11d24e
diff --git a/src/main/java/com/jnape/palatable/lambda/io/IO.java b/src/main/java/com/jnape/palatable/lambda/io/IO.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/jnape/palatable/lambda/io/IO.java +++ b/src/main/java/com/jnape/palatable/lambda/io/IO.java @@ -98,14 +98,17 @@ public abstract class IO<A> implements Monad<A, IO<?>> { return new IO<A>() { @Override public A unsafePerformIO() { - return trying(IO.this::unsafePerformIO) - .recover(t -> trying(recoveryFn.apply(t)::unsafePerformIO) - .fmap(Try::success) - .recover(t2 -> { - t.addSuppressed(t2); - return failure(t); - }) - .orThrow()); + return trying(fn0(IO.this::unsafePerformIO)) + .recover(t -> { + IO<A> recoveryIO = recoveryFn.apply(t); + return trying(fn0(recoveryIO::unsafePerformIO)) + .fmap(Try::success) + .recover(t2 -> { + t.addSuppressed(t2); + return failure(t); + }) + .orThrow(); + }); } @Override
Call this a "type checker" with a straight face, I dare you
palatable_lambda
train
java
1bc8263281bedd943474a23a0ec77ca4a13417be
diff --git a/ssllabs-scan.go b/ssllabs-scan.go index <HASH>..<HASH> 100644 --- a/ssllabs-scan.go +++ b/ssllabs-scan.go @@ -275,6 +275,14 @@ func invokeGetRepeatedly(url string) (*http.Response, []byte, error) { if logLevel >= LOG_DEBUG { log.Printf("[DEBUG] Response status code (%v): %v", reqId, resp.StatusCode) } + + if logLevel >= LOG_TRACE { + for key, values := range resp.Header { + for _, value := range values { + log.Printf("[TRACE] %v: %v\n", key, value) + } + } + } // Adjust maximum concurrent requests.
In trace mode, log response headers.
ssllabs_ssllabs-scan
train
go
67c53984d44e2483433960e7ec5d17934db34c89
diff --git a/multiqc/multiqc.py b/multiqc/multiqc.py index <HASH>..<HASH> 100644 --- a/multiqc/multiqc.py +++ b/multiqc/multiqc.py @@ -356,7 +356,6 @@ def run( stderr=True, highlight=False, force_terminal=util_functions.force_term_colors(), - force_interactive=False if no_ansi else None, color_system=None if no_ansi else "auto", ) console.print( @@ -720,7 +719,6 @@ def run( console = rich.console.Console( stderr=True, force_terminal=util_functions.force_term_colors(), - force_interactive=False if no_ansi else None, color_system=None if no_ansi else "auto", ) console.print(
Revert setting force_interactive flag for rich with --no-ansi
ewels_MultiQC
train
py
b460d6c13595934e89916544d70083290e2312bc
diff --git a/src/Acl/AccessChecker.php b/src/Acl/AccessChecker.php index <HASH>..<HASH> 100644 --- a/src/Acl/AccessChecker.php +++ b/src/Acl/AccessChecker.php @@ -421,7 +421,7 @@ trait AccessChecker if ($this->hasSuperUser()) return true; - foreach ($this->roles() as $role) + foreach ($this->roles as $role) if ($role->title == $role_name) return true;
Backport path from eveseat/web#<I>
eveseat_web
train
php
0c9ef08689afd48e837065da2d3f3f9ae9c1cbcd
diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py index <HASH>..<HASH> 100644 --- a/sos/plugins/foreman.py +++ b/sos/plugins/foreman.py @@ -217,6 +217,9 @@ class Foreman(Plugin): self.add_cmd_output(_cmd, suggest_filename=dyn, timeout=600, env=self.env) + # collect http[|s]_proxy env.variables + self.add_env_var(["http_proxy", "https_proxy"]) + def build_query_cmd(self, query, csv=False): """ Builds the command needed to invoke the pgsql query as the postgres
[foreman] collect http[|s]_proxy env.variables Presence or values of the variables is crucial in some foreman-installer issues. Resolves: #<I>
sosreport_sos
train
py
d6f4965a60955281956702875ed36deb1c373f53
diff --git a/models/oxpspaymorrowoxorder.php b/models/oxpspaymorrowoxorder.php index <HASH>..<HASH> 100644 --- a/models/oxpspaymorrowoxorder.php +++ b/models/oxpspaymorrowoxorder.php @@ -68,6 +68,8 @@ class OxpsPaymorrowOxOrder extends OxpsPaymorrowOxOrder_parent * Overridden parent method. * Trigger payment (pending order) validation, similar as in checkout payment step. * + * @see \oxOrder::validatePayment() + * * @param oxBasket $oBasket * * @return null|int @@ -78,6 +80,14 @@ class OxpsPaymorrowOxOrder extends OxpsPaymorrowOxOrder_parent if ( is_null( $mReturn ) ) { + /** @var oxPayment|OxpsPaymorrowOxPayment $oPayment */ + $oPayment = oxNew( 'oxPayment' ); + $sPaymentId = (string) $oBasket->getPaymentId(); + + if ( !$oPayment->load( $sPaymentId ) or !$oPayment->isPaymorrowActiveAndMapped() ) { + return $mReturn; + } + /** @var OxpsPaymorrowRequestControllerProxy $pmGateWay */ $pmGateWay = oxNew( 'OxpsPaymorrowRequestControllerProxy');
OXDEV-<I>: Payment verification for Paymorrow payments only.
OXID-eSales_paymorrow-module
train
php
83a87e7d29b82f141dd1d176f8026cde65905b59
diff --git a/src/currencyEngineETH.js b/src/currencyEngineETH.js index <HASH>..<HASH> 100644 --- a/src/currencyEngineETH.js +++ b/src/currencyEngineETH.js @@ -1307,7 +1307,9 @@ class EthereumEngine { } const InsufficientFundsError = new Error('Insufficient funds') - InsufficientFundsError.name = 'InsufficientFundsError' + InsufficientFundsError.name = 'ErrorInsufficientFunds' + const InsufficientFundsEthError = new Error('Insufficient funds. Need more ETH') + InsufficientFundsEthError.name = 'ErrorInsufficientFundsMoreEth' // Check for insufficient funds // let nativeAmountBN = new BN(nativeAmount, 10) @@ -1327,6 +1329,9 @@ class EthereumEngine { } nativeAmount = bns.mul(totalTxAmount, '-1') } else { + if (bns.gt(nativeNetworkFee, balanceEth)) { + throw (InsufficientFundsEthError) + } nativeNetworkFee = '0' // Do not show a fee for token transations. const balanceToken = this.walletLocalData.totalBalances[currencyCode] if (bns.gt(nativeAmount, balanceToken)) {
Throw error in makeSpend if token tx doesn't have enough ETH This display an error message to the user during amount entry instead of just failing the transaction on Send.
EdgeApp_edge-currency-ethereum
train
js
99445428113ab4bcfe781169aa91ed7c6722033c
diff --git a/src/Symfony/Component/Security/Authorization/AccessDecisionManager.php b/src/Symfony/Component/Security/Authorization/AccessDecisionManager.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Security/Authorization/AccessDecisionManager.php +++ b/src/Symfony/Component/Security/Authorization/AccessDecisionManager.php @@ -161,7 +161,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface * If all voters abstained from voting, the decision will be based on the * allowIfAllAbstainDecisions property value (defaults to false). */ - public function decideConsensus(TokenInterface $token, array $attributes, $object = null) + protected function decideConsensus(TokenInterface $token, array $attributes, $object = null) { $grant = 0; $deny = 0; @@ -208,7 +208,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface * If all voters abstained from voting, the decision will be based on the * allowIfAllAbstainDecisions property value (defaults to false). */ - public function decideUnanimous(TokenInterface $token, array $attributes, $object = null) + protected function decideUnanimous(TokenInterface $token, array $attributes, $object = null) { $grant = 0; foreach ($attributes as $attribute) {
[Security] fixed method visibility
symfony_symfony
train
php
9a27c4a2f0edbc36e6f1ef7ece7fc14af73f4cd8
diff --git a/internal/config/dns/operator_dns.go b/internal/config/dns/operator_dns.go index <HASH>..<HASH> 100644 --- a/internal/config/dns/operator_dns.go +++ b/internal/config/dns/operator_dns.go @@ -90,16 +90,19 @@ func (c *OperatorDNS) Put(bucket string) error { if err = c.addAuthHeader(req); err != nil { return newError(bucket, err) } + resp, err := c.httpClient.Do(req) if err != nil { if derr := c.Delete(bucket); derr != nil { return newError(bucket, derr) } + return err } - var errorStringBuilder strings.Builder - io.Copy(&errorStringBuilder, io.LimitReader(resp.Body, resp.ContentLength)) - xhttp.DrainBody(resp.Body) + defer xhttp.DrainBody(resp.Body) + if resp.StatusCode != http.StatusOK { + var errorStringBuilder strings.Builder + io.Copy(&errorStringBuilder, io.LimitReader(resp.Body, resp.ContentLength)) errorString := errorStringBuilder.String() switch resp.StatusCode { case http.StatusConflict:
do not panic if DNS_WEBHOOK_ENDPOINT is not reachable (#<I>)
minio_minio
train
go
aab1d8e96e555c2df77904aac7b0623d30fb9607
diff --git a/vent/api/plugins.py b/vent/api/plugins.py index <HASH>..<HASH> 100644 --- a/vent/api/plugins.py +++ b/vent/api/plugins.py @@ -418,10 +418,10 @@ class Plugin: close_fds=True) self.logger.info("Pulling " + name[1] + "\n" + str(output)) - sha_str = "Digest: sha256:" - for line in output.split('\n'): - if line.startswith(sha_str): - image_id = line.split(sha_str)[1][:12] + + image_attrs = d_client.images.get(image_name).attrs + image_id = image_attrs['Id'].split(':')[1][:12] + if image_id: template.set_option(section, "built", "yes") template.set_option(section, "image_id", image_id)
Now uses attrs from docker py to grab the ID. Fixes #<I>
CyberReboot_vent
train
py
c29b233744438e10dcd991749991f975142cfe48
diff --git a/src/transaction_builder.js b/src/transaction_builder.js index <HASH>..<HASH> 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -162,14 +162,8 @@ TransactionBuilder.prototype.addOutput = function(scriptPubKey, value) { return this.tx.addOutput(scriptPubKey, value) } -TransactionBuilder.prototype.build = function() { - return this.__build(false) -} - -TransactionBuilder.prototype.buildIncomplete = function() { - return this.__build(true) -} - +TransactionBuilder.prototype.build = function() { return this.__build(false) } +TransactionBuilder.prototype.buildIncomplete = function() { return this.__build(true) } TransactionBuilder.prototype.__build = function(allowIncomplete) { if (!allowIncomplete) { assert(this.tx.ins.length > 0, 'Transaction has no inputs')
TxBuilder: build convenience functions don't need extra line breaks
BitGo_bitgo-utxo-lib
train
js
7617118d57f24ca4e3e0f01960ed98dd9d2ad4c5
diff --git a/lib/lazy_resource/ext/typhoeus.rb b/lib/lazy_resource/ext/typhoeus.rb index <HASH>..<HASH> 100644 --- a/lib/lazy_resource/ext/typhoeus.rb +++ b/lib/lazy_resource/ext/typhoeus.rb @@ -25,4 +25,13 @@ module Ethon easy_handles.size > 0 && running_count <= 0 end end + + def logger + @logger ||= DevNull.new + end +end + +class DevNull + def method_missing(*args, &block) + end end
Kill Ethon's logger, instead keeping logging internal to LazyResource.
ahlatimer_lazy_resource
train
rb
5afb660222f7eafbf6eaf5943f63fd828476bb97
diff --git a/src/transforms/TupleIndex.js b/src/transforms/TupleIndex.js index <HASH>..<HASH> 100644 --- a/src/transforms/TupleIndex.js +++ b/src/transforms/TupleIndex.js @@ -32,5 +32,5 @@ prototype.transform = function(_, pulse) { } this.modified(mod); - return pulse; + return pulse.fork(); };
TupleIndex should return a forked pulse.
vega_vega-dataflow
train
js
d9b06681ca02f1a4c68568c3c9dfcb874616f3be
diff --git a/spec/trello_spec.rb b/spec/trello_spec.rb index <HASH>..<HASH> 100644 --- a/spec/trello_spec.rb +++ b/spec/trello_spec.rb @@ -86,7 +86,7 @@ describe Trello do it { expect(Trello.public_key_url).to eq("https://trello.com/app-key") } it { expect(Trello.authorize_url(key: "foo")).to match(%r{^https://trello.com/1/authorize}) } - describe "#open_public_key_url" do + describe ".open_public_key_url" do it "launches app key endpoint" do expect(Launchy).to receive(:open).with("https://trello.com/app-key") @@ -100,7 +100,7 @@ describe Trello do end end - describe "#authorize" do + describe ".open_authorization_url" do it "launches authorize endpoint with configured public key" do app_key = "abcd1234" allow(Trello.configuration).to receive(:developer_public_key).and_return(app_key)
Match spec names with class method names
jeremytregunna_ruby-trello
train
rb
7416be949f1b12af425d10d8e0bc5e49e572c204
diff --git a/classes/Pods.php b/classes/Pods.php index <HASH>..<HASH> 100644 --- a/classes/Pods.php +++ b/classes/Pods.php @@ -1260,7 +1260,7 @@ class Pods implements Iterator { $single_multi = 'single'; - if ( $field_type ) { + if ( $is_field_set && $field_type ) { $single_multi = pods_v( $field_type . '_format_type', $this->fields[ $params->name ]['options'], $single_multi ); }
Check if field exists (non-object-field only)
pods-framework_pods
train
php
9733dbffb010189c868a9c2c1ae1a9c084b43711
diff --git a/mutagen/_ogg.py b/mutagen/_ogg.py index <HASH>..<HASH> 100644 --- a/mutagen/_ogg.py +++ b/mutagen/_ogg.py @@ -141,9 +141,10 @@ class OggPage(object): for datum in self.data: quot, rem = divmod(len(datum), 255) size += quot + 1 - if not self.finished: - # Last packet doesn't have a final lacing marker. - size -= bool(rem) + if not self.finished and rem == 0: + # Packet contains a multiple of 255 bytes and is not + # terminated, so we don't have a \x00 at the end. + size -= 1 size += sum(map(len, self.data)) return size
OggPage.size: Proper size calculation, fixes failure.
quodlibet_mutagen
train
py
fcc0885220d6269b4a9550d9b5bd82aecf8213bc
diff --git a/lib/addressable/uri.rb b/lib/addressable/uri.rb index <HASH>..<HASH> 100644 --- a/lib/addressable/uri.rb +++ b/lib/addressable/uri.rb @@ -803,6 +803,7 @@ module Addressable self.query_values = options[:query_values] if options[:query_values] self.fragment = options[:fragment] if options[:fragment] end + self.to_s end ## diff --git a/spec/addressable/uri_spec.rb b/spec/addressable/uri_spec.rb index <HASH>..<HASH> 100644 --- a/spec/addressable/uri_spec.rb +++ b/spec/addressable/uri_spec.rb @@ -157,6 +157,14 @@ describe Addressable::URI, "when created with a scheme but no hierarchical " + end end +describe Addressable::URI, "when created with ambiguous path" do + it "should raise an error" do + expect(lambda do + Addressable::URI.parse("::http") + end).to raise_error(Addressable::URI::InvalidURIError) + end +end + describe Addressable::URI, "when created with an invalid host" do it "should raise an error" do expect(lambda do
Ensure that if a URI is invalid, we know that immediately. Closes #<I>.
sporkmonger_addressable
train
rb,rb
ee2f6189de63b40758a4e8029499b0b212cc0504
diff --git a/gcm/models.py b/gcm/models.py index <HASH>..<HASH> 100644 --- a/gcm/models.py +++ b/gcm/models.py @@ -36,10 +36,15 @@ class AbstractDevice(models.Model): ordering = ['-modified_date'] def send_message(self, msg, collapse_key="message"): + if isinstance(msg, dict): + data = msg + else: + data = {'msg': msg} + return send_gcm_message( api_key=get_api_key(), regs_id=[self.reg_id], - data={'msg': msg}, + data=data, collapse_key=collapse_key)
Fix send_message to support passing generic data. If you pass a string, old behaviour is preserved, otherwise, if you pass a dict, it's passed straight as the data.
bogdal_django-gcm
train
py
3a95e2c26fbdf7fcf003e4a2c61c0dd08dd5a905
diff --git a/pokebase/__init__.py b/pokebase/__init__.py index <HASH>..<HASH> 100644 --- a/pokebase/__init__.py +++ b/pokebase/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- from .loaders import * diff --git a/pokebase/api.py b/pokebase/api.py index <HASH>..<HASH> 100644 --- a/pokebase/api.py +++ b/pokebase/api.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- """pokebase/api.py - Main file for program interface with the API. diff --git a/pokebase/loaders.py b/pokebase/loaders.py index <HASH>..<HASH> 100644 --- a/pokebase/loaders.py +++ b/pokebase/loaders.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- from .api import NamedAPIResource, SpriteResource
remove '#!/usr/bin/python' shebang lines Shebang lines are meant for executable scripts, not libraries that are imported. Libraries should not have it as it could be misleading. Besides, the recommended shebang for python is '#!/usr/bin/env python'
PokeAPI_pokebase
train
py,py,py
ae9b25e997de94e21ed3bbe69564a3c15565d61c
diff --git a/hgtools/plugins.py b/hgtools/plugins.py index <HASH>..<HASH> 100644 --- a/hgtools/plugins.py +++ b/hgtools/plugins.py @@ -58,8 +58,13 @@ def patch_egg_info(force_hg_version=False): return result egg_info.tagged_version = tagged_version -def calculate_version(options={}): +def _calculate_version(mgr, options): default_increment = options.get('increment') + repo_exists = bool(mgr.find_root()) + return (mgr.get_current_version(default_increment) + if repo_exists else default_increment) + +def calculate_version(options={}): # The version is cached in the tag_build value in setup.cfg (so that # sdist packages will have a copy of the version as determined at # the build environment). @@ -81,8 +86,7 @@ def calculate_version(options={}): # is not implemented. os.environ['HGTOOLS_FORCE_CMD'] = 'True' mgr = managers.HGRepoManager.get_first_valid_manager() - repo_exists = bool(mgr.find_root()) - version = mgr.get_current_version(default_increment) if repo_exists else default_increment + version = _calculate_version(mgr, options) return version def version_calc(dist, attr, value):
Extracted function that performs the calculation, in order to allow overriding.
jaraco_hgtools
train
py
8af69c115c20a06163b39246cc84ff21d8c8e41e
diff --git a/js/feature/featureFileReader.js b/js/feature/featureFileReader.js index <HASH>..<HASH> 100644 --- a/js/feature/featureFileReader.js +++ b/js/feature/featureFileReader.js @@ -105,7 +105,9 @@ var igv = (function (igv) { // Load the file header (not HTTP header) for an indexed file. // TODO -- note this will fail if the file header is > 65kb in size - options = igv.buildOptions(self.config, {bgz: index.tabix, range: {start: 0, size: 65000}}); + let maxSize = "vcf" === self.config.format ? 65000 : 1000; + if(self.config.filename && self.config.filename.endsWith(".gz")) maxSize /= 2; + options = igv.buildOptions(self.config, {bgz: index.tabix, range: {start: 0, size: maxSize}}); return igv.xhr.loadString(self.config.url, options) .then(function (data) {
reduce maxSize of buffer for reading indexed file "headers" (vcf header, bed file track line)
igvteam_igv.js
train
js
01170152421ecd510a5b99df72daaaa434889e71
diff --git a/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java b/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java index <HASH>..<HASH> 100644 --- a/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java +++ b/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java @@ -110,10 +110,21 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context, public void startInternal() throws LifecycleException { executorService = ExecutorServiceUtil.newExecutorService(); if (filename == null) { - String tomcatBaseProperty = OptionHelper + String tomcatBaseProperty = OptionHelper .getSystemProperty("catalina.base"); filename = tomcatBaseProperty + File.separatorChar + DEFAULT_CONFIG_FILE; + + File baseConfigFile = new File(filename); + if (!baseConfigFile.exists()) { + + String tomcatHomeProperty = OptionHelper + .getSystemProperty("catalina.home"); + + filename = tomcatHomeProperty + File.separatorChar + + DEFAULT_CONFIG_FILE; + } + getStatusManager().add( new InfoStatus("filename property not set. Assuming [" + filename + "]", this));
LOGBACK-<I> (reviewed)
tony19_logback-android
train
java