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
54c07c069e4fd48da4291aaa924ef451b9776569
diff --git a/ruby/command-t/match_window.rb b/ruby/command-t/match_window.rb index <HASH>..<HASH> 100644 --- a/ruby/command-t/match_window.rb +++ b/ruby/command-t/match_window.rb @@ -40,11 +40,12 @@ module CommandT @reverse_list = options[:match_window_reverse] # save existing window dimensions so we can restore them later - @windows = [] - (0..(::VIM::Window.count - 1)).each do |i| - @windows << OpenStruct.new(:index => i, - :height => ::VIM::Window[i].height, - :width => ::VIM::Window[i].width) + @windows = (0..(::VIM::Window.count - 1)).map do |i| + OpenStruct.new( + :index => i, + :height => ::VIM::Window[i].height, + :width => ::VIM::Window[i].width + ) end set 'timeout', true # ensure mappings timeout
Change a `#each` + `#<<` to a `#map` Map better represents our intentions here, so use it.
wincent_command-t
train
rb
a20b38cdb29a4d09328af633a56567880155fcff
diff --git a/base.php b/base.php index <HASH>..<HASH> 100644 --- a/base.php +++ b/base.php @@ -1388,7 +1388,7 @@ final class Base extends Prefab implements ArrayAccess { // Match specific routes first $paths=array(); foreach ($keys=array_keys($this->hive['ROUTES']) as $key) - $paths[]=str_replace('@',"\x00".'@',$key); + $paths[]=str_replace('@','*@',$key); $vals=array_values($this->hive['ROUTES']); array_multisort($paths,SORT_DESC,$keys,$vals); $this->hive['ROUTES']=array_combine($keys,$vals);
Better route precedence order (#<I>)
bcosca_fatfree-core
train
php
b0498f8e9d9fb9683cf553d3940e5fdbc9e83f98
diff --git a/lib/chef/chef_fs/knife.rb b/lib/chef/chef_fs/knife.rb index <HASH>..<HASH> 100644 --- a/lib/chef/chef_fs/knife.rb +++ b/lib/chef/chef_fs/knife.rb @@ -125,7 +125,7 @@ class Chef realest_path = Chef::ChefFS::PathUtils.realest_path(path) if absolute_path[0,realest_path.length] == realest_path && (absolute_path.length == realest_path.length || - absolute_path[realest_path.length] =~ /#{PathUtils.regexp_path_separator}/) + absolute_path[realest_path.length,1] =~ /#{PathUtils.regexp_path_separator}/) relative_path = Chef::ChefFS::PathUtils::relative_to(absolute_path, realest_path) return relative_path == '.' ? "/#{name}" : "/#{name}/#{relative_path}" end
Fix issue where pwd cookbook path not detected correctly in Ruby <I>
chef_chef
train
rb
5f472ceecf24f2567b778785b857c40307e7c43f
diff --git a/vedo/shapes.py b/vedo/shapes.py index <HASH>..<HASH> 100644 --- a/vedo/shapes.py +++ b/vedo/shapes.py @@ -1848,7 +1848,7 @@ class Arc(Mesh): ): if len(point1) == 2: point1 = (point1[0], point1[1], 0) - if point2 is not None and len(point2): + if point2 is not None and len(point2) == 2: point2 = (point2[0], point2[1], 0) ar = vtk.vtkArcSource()
fixes bug with arc class Issue occurs when a point2 is set with a z value but is overwritten to zero in all cases
marcomusy_vtkplotter
train
py
f225a084c779fd745d2d1260a1193adb7e7f7d54
diff --git a/lib/compiler.js b/lib/compiler.js index <HASH>..<HASH> 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -174,6 +174,7 @@ // Public API functions function compile(ast) { + _env = {}; var types = { Entity: Entity, Macro: Macro,
do not leak compiler entries between compilations
l20n_l20n.js
train
js
5b6f4b84119000d45c084455bb57b43e8b76d775
diff --git a/include/pre_config.php b/include/pre_config.php index <HASH>..<HASH> 100644 --- a/include/pre_config.php +++ b/include/pre_config.php @@ -1,5 +1,6 @@ <?php -// Setup I18N -require_once "../src/Core/I18N.php"; -require_once "setup_i18n.php"; \ No newline at end of file +// Setup I18N before autoload to prevent Laravel helpers from overriding translation function __() +// These two lines must be before autoload.php +require_once (__DIR__."../src/Core/I18N.php"); +require_once (__DIR__."setup_i18n.php"); \ No newline at end of file
Fix require path to i<I>n
tsugiproject_tsugi-php
train
php
49d11b930f294775b2f77604b6a6b2c08a4c9dd0
diff --git a/openquake/commonlib/logictree.py b/openquake/commonlib/logictree.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/logictree.py +++ b/openquake/commonlib/logictree.py @@ -1274,12 +1274,7 @@ class GsimLogicTree(object): raise InvalidLogicTree( 'Found duplicated applyToTectonicRegionType=%s' % trts) branches.sort(key=lambda b: (b.bset['branchSetID'], b.id)) - - # add an .idx to each GSIM - for gsims in self.values.values(): - for idx, gsim in enumerate(gsims): - gsim.idx = idx - + # TODO: add an .idx to each GSIM ? return trts, branches def get_gsim_by_trt(self, rlz, trt):
Removed accidentally added code [skip CI] Former-commit-id: <I>de<I>d<I>c<I>eb<I>ae<I>eee [formerly 2e<I>adefd3a<I>fe<I>d6ede0b<I>] Former-commit-id: dd<I>fbca<I>ef<I>a8cfe5cc<I>f0e<I>b<I>f
gem_oq-engine
train
py
756782d8d65d7299b7e76346967724cc537b2933
diff --git a/lib/vagrant-mutate/converter/kvm.rb b/lib/vagrant-mutate/converter/kvm.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant-mutate/converter/kvm.rb +++ b/lib/vagrant-mutate/converter/kvm.rb @@ -44,6 +44,7 @@ module VagrantMutate qemu_bin_list = [ '/usr/bin/qemu-system-x86_64', '/usr/bin/qemu-system-i386', '/usr/bin/qemu-kvm', + '/usr/libexec/qemu-kvm', '/usr/bin/kvm' ] qemu_bin = qemu_bin_list.detect { |binary| File.exists? binary } unless qemu_bin
Include CentOS <I>/RHEL <I>-friendly Qemu paths. $ rpm -ql qemu-kvm | egrep /qemu-kvm$ /usr/libexec/qemu-kvm /usr/share/qemu-kvm (The latter is a directory.)
sciurus_vagrant-mutate
train
rb
18e3807cd763d3d8e598756159de570a15d99c89
diff --git a/test/e2e/common/events.go b/test/e2e/common/events.go index <HASH>..<HASH> 100644 --- a/test/e2e/common/events.go +++ b/test/e2e/common/events.go @@ -121,7 +121,7 @@ func ObserveEventAfterAction(f *framework.Framework, eventPredicate func(*v1.Eve e, ok := obj.(*v1.Event) ginkgo.By(fmt.Sprintf("Considering event: \nType = [%s], Name = [%s], Reason = [%s], Message = [%s]", e.Type, e.Name, e.Reason, e.Message)) framework.ExpectEqual(ok, true) - if ok && eventPredicate(e) { + if eventPredicate(e) { observedMatchingEvent = true } },
Remove duplicated check in ObserveEventAfterAction In ObserveEventAfterAction(), observedMatchingEvent is set if ok is true. Now the ok is already checked with framework.ExpectEqual(). So this removes duplicated check for code cleanup.
kubernetes_kubernetes
train
go
3dc313a5250d2864fb63798d7d4b49c69d7bf76f
diff --git a/Behaviours/Timestampable/TimestampableSubscriber.php b/Behaviours/Timestampable/TimestampableSubscriber.php index <HASH>..<HASH> 100755 --- a/Behaviours/Timestampable/TimestampableSubscriber.php +++ b/Behaviours/Timestampable/TimestampableSubscriber.php @@ -15,9 +15,13 @@ namespace WellCommerce\Bundle\DoctrineBundle\Behaviours\Timestampable; use Doctrine\Common\EventSubscriber; use Doctrine\ORM\Event\LoadClassMetadataEventArgs; use Doctrine\ORM\Events; -use WellCommerce\Bundle\AppBundle\Doctrine\AbstractSubscriber; -class TimestampableSubscriber extends AbstractSubscriber implements EventSubscriber +/** + * Class TimestampableSubscriber + * + * @author Adam Piotrowski <[email protected]> + */ +class TimestampableSubscriber implements EventSubscriber { /** * @var array Timestampable fields @@ -102,4 +106,17 @@ class TimestampableSubscriber extends AbstractSubscriber implements EventSubscri ]); } } + + /** + * Checks whether the class contains such a method + * + * @param \ReflectionClass $class + * @param string $methodName + * + * @return bool + */ + protected function hasMethod(\ReflectionClass $class, $methodName) + { + return $class->hasMethod($methodName); + } }
Removed deprecated AbstractSubscriber (cherry picked from commit dd<I>ac<I>fb<I>f<I>a<I>b<I>adb<I>)
WellCommerce_WishlistBundle
train
php
6f74302089fed2061baa98531b0ca39a9f13f37b
diff --git a/src/org/jcodings/EncodingList.java b/src/org/jcodings/EncodingList.java index <HASH>..<HASH> 100644 --- a/src/org/jcodings/EncodingList.java +++ b/src/org/jcodings/EncodingList.java @@ -133,8 +133,8 @@ final class EncodingList { {"R", "UTF8-MAC", "UTF-8"}, {"A", "UTF-8-MAC", "UTF8-MAC"}, {"A", "UTF-8-HFS", "UTF8-MAC" /* Emacs 23.2 */}, - {"D", "UTF-16"}, - {"D", "UTF-32"}, + {"R", "UTF-16", "UTF-16BE"}, + {"R", "UTF-32", "UTF-32BE"}, {"A", "UCS-2BE", "UTF-16BE"}, {"A", "UCS-4BE", "UTF-32BE"}, {"A", "UCS-4LE", "UTF-32LE"},
UTF-<I>/<I> are actually replicas of the BE versions.
jruby_jcodings
train
java
33b2dc304be39aec8329716dabb68463926be741
diff --git a/src/client/js/client.js b/src/client/js/client.js index <HASH>..<HASH> 100644 --- a/src/client/js/client.js +++ b/src/client/js/client.js @@ -102,11 +102,8 @@ define([ return Object.keys(value); } else if (key === 'users') { return Object.keys(value); - } else if (key === 'root') { - return { - current: value.current, - previous: value.previous - }; + } else if (key === 'rootObject') { + return; } else if (key === 'undoRedoChain') { if (value) { chain = {
Fix circular json in client during debug=true Former-commit-id: caa5a<I>ee<I>e7fb2bc<I>ab<I>f5d<I>b<I>e6b
webgme_webgme-engine
train
js
136143a38976e17b96d690cc71f982a8f4acb808
diff --git a/ubcpi/static/js/src/ubcpi.js b/ubcpi/static/js/src/ubcpi.js index <HASH>..<HASH> 100644 --- a/ubcpi/static/js/src/ubcpi.js +++ b/ubcpi/static/js/src/ubcpi.js @@ -171,8 +171,8 @@ function PeerInstructionXBlock(runtime, element, data) { left: 0 }; - var width = 900 - margin.left - margin.right; - var height = 300 - margin.top - margin.bottom; + var width = 750 - margin.left - margin.right; + var height = 250 - margin.top - margin.bottom; var svg = d3.select(containerSelector) .append("svg")
CHANGED height and width of the SVG charts to ensure they fit within the edX container in the LMS view for desktop. TODO: Ensure they work on smaller screens.
ubc_ubcpi
train
js
3827089579a4bf4bb6c049d4790e07da238cb22d
diff --git a/openfisca_web_api/controllers.py b/openfisca_web_api/controllers.py index <HASH>..<HASH> 100644 --- a/openfisca_web_api/controllers.py +++ b/openfisca_web_api/controllers.py @@ -123,6 +123,7 @@ def api1_simulate(req): inputs, error = conv.pipe( conv.make_input_to_json(), conv.test_isinstance(dict), + conv.not_none, )(req.body, state = ctx) if error is not None: return wsgihelpers.respond_json(ctx,
Fail when POSTed body is empty.
openfisca_openfisca-web-api
train
py
19975ec852d8978ff43ad29312c82dc5f1096a34
diff --git a/InMemoryFilesystemAdapter.php b/InMemoryFilesystemAdapter.php index <HASH>..<HASH> 100644 --- a/InMemoryFilesystemAdapter.php +++ b/InMemoryFilesystemAdapter.php @@ -107,7 +107,7 @@ class InMemoryFilesystemAdapter implements FilesystemAdapter $this->write($filePath, '', $config); } - public function setVisibility(string $path, $visibility): void + public function setVisibility(string $path, string $visibility): void { $path = $this->preparePath($path);
Tighten visibility typehint, always string.
thephpleague_flysystem-memory
train
php
659630368a71a70aa34ef6c73c76e1dc36c608f5
diff --git a/drools-planner-core/src/main/java/org/drools/planner/config/solver/SolverConfig.java b/drools-planner-core/src/main/java/org/drools/planner/config/solver/SolverConfig.java index <HASH>..<HASH> 100644 --- a/drools-planner-core/src/main/java/org/drools/planner/config/solver/SolverConfig.java +++ b/drools-planner-core/src/main/java/org/drools/planner/config/solver/SolverConfig.java @@ -60,7 +60,7 @@ public class SolverConfig { protected ScoreDirectorFactoryConfig scoreDirectorFactoryConfig = new ScoreDirectorFactoryConfig(); @XStreamAlias("termination") - private TerminationConfig terminationConfig = new TerminationConfig(); + private TerminationConfig terminationConfig; @XStreamImplicit() protected List<SolverPhaseConfig> solverPhaseConfigList = null;
benchmarker: Don't print obsolete defaulted xml solver configuration: terminationConfig fix
kiegroup_optaplanner
train
java
441c6ebb51999f7bed38325b877bdb7f7d90404f
diff --git a/pycdlib/pycdlib.py b/pycdlib/pycdlib.py index <HASH>..<HASH> 100644 --- a/pycdlib/pycdlib.py +++ b/pycdlib/pycdlib.py @@ -689,13 +689,13 @@ class PyCdlib(object): block_size = vd.logical_block_size() parent_links = [] child_links = [] - last_record = None while dirs: dir_record = dirs.popleft() self._seek_to_extent(dir_record.extent_location()) length = dir_record.file_length() offset = 0 + last_record = None while length > 0: # read the length byte for the directory record lenraw = self.cdfp.read(1)
Fix a small bug in walk_directories. We were assigning last_record as if it were a global ISO entity, but that's not the case. We only want to compare the current record to the last record within this parent directory record, so reassign last_record to None as we descend into each directory record extent.
clalancette_pycdlib
train
py
155ffb990a256ae5f2419e5b19a0708df32fcce5
diff --git a/lib/util.js b/lib/util.js index <HASH>..<HASH> 100644 --- a/lib/util.js +++ b/lib/util.js @@ -51,7 +51,7 @@ function getAllApps( deviceId, cb ){ if ( data.exists() ){ - module.exports.records.userApps = data.val(); + module.exports.records.apps = data.val(); var appMap = data.val(); async.eachOf(appMap, function(meta, appId, cb){ @@ -88,7 +88,7 @@ function getAllApps( deviceId, cb ){ } else { // no apps found // - module.exports.records.userApps = null; + module.exports.records.apps = null; debug('no apps found') cb(null, deviceId ) }
fix records.userApps to be just apps
matrix-io_matrix-firebase
train
js
eb2efb6fc7cc8016c651ae6b47be1ed5dd448eb0
diff --git a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/AbstractExtensionHandler.java b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/AbstractExtensionHandler.java index <HASH>..<HASH> 100644 --- a/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/AbstractExtensionHandler.java +++ b/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/handler/internal/AbstractExtensionHandler.java @@ -71,8 +71,8 @@ public abstract class AbstractExtensionHandler implements ExtensionHandler public void upgrade(LocalExtension previousLocalExtension, LocalExtension newLocalExtension, String namespace, Request request) throws InstallException { - upgrade(previousLocalExtension != null ? Arrays.asList(previousLocalExtension) : Collections.EMPTY_LIST, - newLocalExtension, namespace, request); + upgrade(previousLocalExtension != null ? Arrays.asList((InstalledExtension) previousLocalExtension) + : Collections.<InstalledExtension>emptyList(), newLocalExtension, namespace, request); } @Override
[misc] Improve codestyle
xwiki_xwiki-commons
train
java
c714509aeec0cc81214430b29285f0bb4d893122
diff --git a/virtualchain/lib/indexer.py b/virtualchain/lib/indexer.py index <HASH>..<HASH> 100644 --- a/virtualchain/lib/indexer.py +++ b/virtualchain/lib/indexer.py @@ -45,6 +45,7 @@ import time import traceback import cPickle as pickle import imp +import simplejson from collections import defaultdict @@ -729,7 +730,7 @@ class StateEngine( object ): all_values.append( str(len(str(field_value))) + ":" + str(field_value) ) if len(missing) > 0: - log.error("Missing fields; dump follows:\n%s" % json.dumps( opdata, indent=4, sort_keys=True )) + log.error("Missing fields; dump follows:\n%s" % simplejson.dumps( opdata, indent=4, sort_keys=True )) raise Exception("BUG: missing fields '%s'" % (",".join(missing))) if verbose:
use simplejson for dumping transactions, since it handles Decimal
blockstack_virtualchain
train
py
809d746334ed2169e7bc9d062c726126cadaccfd
diff --git a/src/Bitpay/Autoloader.php b/src/Bitpay/Autoloader.php index <HASH>..<HASH> 100644 --- a/src/Bitpay/Autoloader.php +++ b/src/Bitpay/Autoloader.php @@ -41,22 +41,27 @@ class Autoloader } /** - * Give a class name and it will require the file + * Give a class name and it will require the file. * * @param string $class + * @return bool */ public static function autoload($class) { $isBitpay = false; + if (0 === strpos($class, 'Bitpay')) { $isBitpay = true; } $file = __DIR__ . '/../' . str_replace(array('\\'), array('/'), $class) . '.php'; - if (is_file($file)) { + + if (is_file($file) && is_readable($file)) { require_once $file; - return; + return true; + } else { + throw new \Exception(sprintf('Class file "%s" is not readable or has been moved.', $file)); } if ($isBitpay) {
Added additional file check & exception handling
bitpay_php-bitpay-client
train
php
3121ef15ab8e30faf564ba27d7f9ea34c12714ef
diff --git a/lib/fog/hp/requests/compute/list_key_pairs.rb b/lib/fog/hp/requests/compute/list_key_pairs.rb index <HASH>..<HASH> 100644 --- a/lib/fog/hp/requests/compute/list_key_pairs.rb +++ b/lib/fog/hp/requests/compute/list_key_pairs.rb @@ -33,8 +33,10 @@ module Fog key_pairs = [] key_pairs = self.data[:key_pairs].values unless self.data[:key_pairs].nil? + puts "Key Pairs Raw: #{key_pairs.inspect} " + response.status = [200, 203][rand(1)] - response.body = { 'keypairs' => key_pairs.map {|keypair| keypair.reject {|key, value| !['public_key', 'name', 'fingerprint'].include?(key)}} } + response.body = { 'keypairs' => key_pairs.map {|keypair| keypair['keypair'].reject {|key,value| !['public_key', 'name', 'fingerprint'].include?(key)}} } response end
Fix issue with list in mock mode.
fog_fog
train
rb
e6263dfcde613563c65497f7cbabd10f13724b47
diff --git a/pkcs11_test.go b/pkcs11_test.go index <HASH>..<HASH> 100644 --- a/pkcs11_test.go +++ b/pkcs11_test.go @@ -72,6 +72,7 @@ func TestInitialize(t *testing.T) { if e := p.Initialize(); e != nil { t.Fatalf("init error %s\n", e) } + p.Finalize() p.Destroy() }
Call Finalize() in the TestInitialize
miekg_pkcs11
train
go
f29d7bb549e53e9259890e8695c469d2cad882ef
diff --git a/uniform/actions/email.php b/uniform/actions/email.php index <HASH>..<HASH> 100644 --- a/uniform/actions/email.php +++ b/uniform/actions/email.php @@ -22,6 +22,7 @@ uniform::$actions['email'] = function ($form, $actionOptions) { 'sender' => a::get($actionOptions, 'sender'), 'service' => a::get($actionOptions, 'service', 'mail'), 'service-options' => a::get($actionOptions, 'service-options', []), + 'params' => a::get($actionOptions, 'params', []), ]; // remove newlines to prevent malicious modifications of the email
Issue #<I> - passing 'params' action info through to the email template
mzur_kirby-uniform
train
php
b78f61e03d9f0d8483d2acfaf1ab20c7ad81a3f6
diff --git a/src/now.js b/src/now.js index <HASH>..<HASH> 100755 --- a/src/now.js +++ b/src/now.js @@ -183,6 +183,11 @@ const main = async (argv_) => { } } + // Support top-level "sh" config + if (config && !config.sh) { + config.sh = config; + } + let authConfigExists try { @@ -216,6 +221,11 @@ const main = async (argv_) => { return 1; } + // Support top-level "sh" auth + if (!Array.isArray(authConfig.credentials) && authConfig.token) { + authConfig.credentials = [{ provider: 'sh', token: authConfig.token }]; + } + if (!Array.isArray(authConfig.credentials)) { console.error( error(
Add support for top-level "sh" auth
zeit_now-cli
train
js
b43217ace93aeea26085e9929ccd47857c495ba9
diff --git a/vasppy/summary.py b/vasppy/summary.py index <HASH>..<HASH> 100644 --- a/vasppy/summary.py +++ b/vasppy/summary.py @@ -74,10 +74,7 @@ class Summary: self.meta = VASPMeta.from_file( 'vaspmeta.yaml' ) except FileNotFoundError as e: raise type(e)( str(e) + ' in {}'.format( directory )).with_traceback( sys.exc_info()[2] ) - try: - self.parse_vasprun() - except as e: - raise type(e)( str(e) + ' in {}'.format( directory )).with_traceback( sys.exc_info()[2] ) + self.parse_vasprun() self.print_methods = { 'title': self.print_title, 'type': self.print_type, 'status': self.print_status,
Fixed error in Vasprun.xml readin
bjmorgan_vasppy
train
py
cda2eb5a2004d0ca3f71eee96cca37e384a85168
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java @@ -141,7 +141,7 @@ class IndexedCursor<S extends Storable> extends AbstractCursor<S> { } } }); - } catch (RepositoryException re) { + } catch (Exception re) { LogFactory.getLog(getClass()).error ("Unable to inspect inconsistent index entry " + indexEntry, re);
Handle more exceptions with broken indexes.
Carbonado_Carbonado
train
java
c67043f1ed3eed5d368f583dac71b8a57fc4abc2
diff --git a/test-runner.js b/test-runner.js index <HASH>..<HASH> 100644 --- a/test-runner.js +++ b/test-runner.js @@ -15,8 +15,8 @@ var mocha = new Mocha({ // 2 - dpms version is 1.1. // 3 - to be dpms capable. var run_dpms_test = function(X, cb) { - X.require('dpms', function(ext) { - if (!util.isError(ext)) { + X.require('dpms', function(err, ext) { + if (!util.isError(err)) { dpms = ext; dpms.GetVersion(undefined, undefined, function(err, version) { if (!err && version[0] === 1 && version[1] === 1) { @@ -42,8 +42,8 @@ var run_xtest_test = function(X, cb) { }; var run_randr_test = function(X, cb) { - X.require('randr', function(ext) { - if (!util.isError(ext)) { + X.require('randr', function(err, ext) { + if (!util.isError(err)) { randr = ext; randr.QueryVersion(1, 2, function(err, version) { if (err) {
Receive xrandr & dpms exts correctly in tests This makes tests pass that were failing with null reference errors. `XClient.require` was passing the callback function to `requireExt`, which called it with parameters `null, ext` on success. The callback itself seemed to assume it will get only one parameter, which is either the extension on an error, hence why it tried to call methods on a `null`.
sidorares_node-x11
train
js
429ac9c999278938b2d7d2bb555ba489ee18f162
diff --git a/engines/bastion/app/assets/javascripts/bastion/content-hosts/content-hosts.controller.js b/engines/bastion/app/assets/javascripts/bastion/content-hosts/content-hosts.controller.js index <HASH>..<HASH> 100644 --- a/engines/bastion/app/assets/javascripts/bastion/content-hosts/content-hosts.controller.js +++ b/engines/bastion/app/assets/javascripts/bastion/content-hosts/content-hosts.controller.js @@ -50,7 +50,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostsController', nutupane.enableSelectAllResults(); if ($location.search()['select_all']) { - nutupane.table.selectAllResults(true); + nutupane.table.initialSelectAll = true; } $scope.contentHostTable.getStatusColor = ContentHostsHelper.getStatusColor;
Fixes #<I>: Host collection action links will properly select hosts, BZ<I>.
Katello_katello
train
js
595dedfe9aa3d7dd0db5743200142129c1232378
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,7 +9,7 @@ define('CACHE', sys_get_temp_dir() . '/TwigViewTmp/cache/'); define('DS', DIRECTORY_SEPARATOR); define('PLUGIN_REPO_ROOT', dirname(__DIR__) . DS); -$TMP = new \Cake\Utility\Folder(TMP); +$TMP = new \Cake\Filesystem\Folder(TMP); $TMP->create(TMP . 'cache/models', 0777); $TMP->create(TMP . 'cache/persistent', 0777); $TMP->create(TMP . 'cache/views', 0777);
Folder and File are now in their own namespace as a result of: <URL>
WyriHaximus_TwigView
train
php
2648fa0d88c27c302e96b677310265592c179a5c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,9 @@ module.exports = function() { }); return replaceString; } else { - return '@import "' + filename + '";\n' + if (filename.substr(-4).match(/sass|scss/i)) { + return '@import "' + filename + '";\n' + } } }
Import only scss/sass files
mathisonian_gulp-sass-bulk-import
train
js
dfcbbfb3f04f17b7184ca1bf9f8af4684b093d4b
diff --git a/vision/setup.py b/vision/setup.py index <HASH>..<HASH> 100644 --- a/vision/setup.py +++ b/vision/setup.py @@ -26,6 +26,8 @@ with io.open(os.path.join(PACKAGE_ROOT, 'README.rst'), 'r') as readme_file: REQUIREMENTS = [ 'google-cloud-core >= 0.24.0, < 0.25dev', + 'google-gax >= 0.15.7, < 0.16dev', + 'googleapis-common-protos[grpc] >= 1.5.2, < 2.0dev', ] EXTRAS_REQUIRE = { ':python_version<"3.4"': ['enum34'],
Fix deps (#<I>)
googleapis_google-cloud-python
train
py
9b2b39aaaaa98f35b86747d946cbd2c03cb01ab4
diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index <HASH>..<HASH> 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -624,7 +624,7 @@ class LeftAndMain extends Controller implements PermissionProvider { $html = $obj->getChildrenAsUL( "", $titleEval, - $this, + singleton('CMSPageEditController'), true, $childrenMethod, $numChildrenMethod,
MINOR More specific tree links, to ensure correct CMSMain subclass is used
silverstripe_silverstripe-framework
train
php
b34d1f152f0ccbc5261621ebe92f50949016d14a
diff --git a/internal/identity_vm.go b/internal/identity_vm.go index <HASH>..<HASH> 100644 --- a/internal/identity_vm.go +++ b/internal/identity_vm.go @@ -56,10 +56,10 @@ func ModuleName(_ netcontext.Context) string { } func VersionID(_ netcontext.Context) string { - if s := os.Getenv("GAE_MODULE_VERSION"); s != "" { - return s + if s1, s2 := os.Getenv("GAE_MODULE_VERSION"), os.Getenv("GAE_MINOR_VERSION"); s1 != "" && s2 != "" { + return s1 + "." + s2 } - return string(mustGetMetadata("instance/attributes/gae_backend_version")) + return string(mustGetMetadata("instance/attributes/gae_backend_version")) + "." + string(mustGetMetadata("instance/attributes/gae_minor_version")) } func InstanceID() string {
appengine: fix VersionID by adding minor version information According to <URL>
golang_appengine
train
go
e025d74635fb19c96ac7b0b34ba12f65a122683b
diff --git a/src/Model/Refund.php b/src/Model/Refund.php index <HASH>..<HASH> 100644 --- a/src/Model/Refund.php +++ b/src/Model/Refund.php @@ -15,6 +15,7 @@ namespace Nails\Invoice\Model; use Exception; use Nails\Common\Exception\FactoryException; use Nails\Common\Exception\ModelException; +use Nails\Common\Helper\Model\Expand; use Nails\Common\Model\Base; use Nails\Common\Service\Database; use Nails\Currency; @@ -323,10 +324,8 @@ class Refund extends Base $oRefund = $this->getById( $iRefundId, [ - 'expand' => [ - 'invoice', - 'payment', - ], + new Expand('invoice', new Expand('customer')), + new Expand('payment'), ] );
Refactor Expandable field useage + add expandable field for invoice customer Fixes issue with refund receipt not being sent
nails_module-invoice
train
php
5c6ccbc75a846489c8a5b0c7dc5c697b05bf5c78
diff --git a/msm/skill_entry.py b/msm/skill_entry.py index <HASH>..<HASH> 100644 --- a/msm/skill_entry.py +++ b/msm/skill_entry.py @@ -7,6 +7,7 @@ from contextlib import contextmanager import sys import os +from threading import Lock from git import Repo, GitError from git.cmd import Git @@ -38,6 +39,8 @@ def work_dir(directory): class SkillEntry(object): + pip_lock = Lock() + def __init__(self, name, path, url='', sha='', msm=None): url = url.rstrip('/') self.name = name @@ -142,8 +145,9 @@ class SkillEntry(object): if not can_pip: pip_args = ['sudo', '-n'] + pip_args - proc = Popen(pip_args, stdout=PIPE, stderr=PIPE) - pip_code = proc.wait() + with self.pip_lock: + proc = Popen(pip_args, stdout=PIPE, stderr=PIPE) + pip_code = proc.wait() if pip_code != 0: stderr = proc.stderr.read().decode() if pip_code == 1 and 'sudo:' in stderr and pip_args[0] == 'sudo':
Add lock to pip This is to see if it helps improve stability with installation across devices
MycroftAI_mycroft-skills-manager
train
py
1fc53e41e069e8919520fb78e6b3deee2422af0b
diff --git a/Generator/Generator.php b/Generator/Generator.php index <HASH>..<HASH> 100644 --- a/Generator/Generator.php +++ b/Generator/Generator.php @@ -18,12 +18,8 @@ namespace Sensio\Bundle\GeneratorBundle\Generator; */ class Generator { - protected function renderFile($skeletonDir, $template, $target, $parameters) + protected function render($skeletonDir, $template, $parameters) { - if (!is_dir(dirname($target))) { - mkdir(dirname($target), 0777, true); - } - $twig = new \Twig_Environment(new \Twig_Loader_Filesystem($skeletonDir), array( 'debug' => true, 'cache' => false, @@ -31,6 +27,15 @@ class Generator 'autoescape' => false, )); - file_put_contents($target, $twig->render($template, $parameters)); + return $twig->render($template, $parameters); + } + + protected function renderFile($skeletonDir, $template, $target, $parameters) + { + if (!is_dir(dirname($target))) { + mkdir(dirname($target), 0777, true); + } + + return file_put_contents($target, $this->render($skeletonDir, $template, $parameters)); } }
Introduce a `render` method that generates content without beeing forced to put the result in a file.
sensiolabs_SensioGeneratorBundle
train
php
b63ba548634e4d06df5031244decd5bc8af40009
diff --git a/sprd/model/Template.js b/sprd/model/Template.js index <HASH>..<HASH> 100644 --- a/sprd/model/Template.js +++ b/sprd/model/Template.js @@ -1,6 +1,10 @@ define(["sprd/data/SprdModel"], function(Model) { return Model.inherit('sprd.model.Template', { + + defaults: { + error: false + } }); }); \ No newline at end of file
fixed showing loading and error class next to template tile
spreadshirt_rAppid.js-sprd
train
js
7891f1d0cef9ed9891dc6b5fdc734274b304eb90
diff --git a/ploy_ezjail/__init__.py b/ploy_ezjail/__init__.py index <HASH>..<HASH> 100644 --- a/ploy_ezjail/__init__.py +++ b/ploy_ezjail/__init__.py @@ -532,6 +532,7 @@ class Master(BaseMaster): if len(lines) < 2: raise EzjailError("ezjail-admin list output too short:\n%s" % out.strip()) headers = self.ezjail_admin_list_headers + padding = [''] * len(headers) jails = {} prev_entry = None for line in lines[2:]: @@ -544,7 +545,7 @@ class Master(BaseMaster): # will provide us with a patch! jails[prev_entry]['ip'] = [jails[prev_entry]['ip'], line.split()[1]] else: - entry = dict(zip(headers, line.split())) + entry = dict(zip(headers, line.split() + padding)) prev_entry = entry.pop('name') jails[prev_entry] = entry return jails
Avoid exception when output of ezjail-admin list is missing some fields.
ployground_ploy_ezjail
train
py
0f94e5425322f98b9da210d5eddf48db8f91ec5f
diff --git a/e2e/elements/de.js b/e2e/elements/de.js index <HASH>..<HASH> 100644 --- a/e2e/elements/de.js +++ b/e2e/elements/de.js @@ -4,7 +4,7 @@ export default { tabBarCart: "[data-test-id='tabBar'] [data-test-id='tab_bar.cart']", tabBarBrowse: "[data-test-id='tabBar'] [data-test-id='tab_bar.browse']", tabBarHome: "[data-test-id='tabBar'] [data-test-id='tab_bar.home']", - shopLogo: "[data-test-id='Navigator'] img[alt='TestAutomation']", + shopLogo: "[data-test-id='Navigator'] img", imageSliderImage1: "[data-test-id='Slider']:nth-child(2) img[data-test-id='withoutLink']", imageSliderImage2: "[data-test-id='Slider']:nth-child(3) img[data-test-id='withoutLink']", imageWidgetWithLink1: "[data-test-id='imageWidget: /category/3537']",
PWA-<I> change shopLogo selector for multi shop usage
shopgate_pwa
train
js
d009249580bf2cfba8b4fac98bfa4fc6a5a66260
diff --git a/ndio/ramon/__init__.py b/ndio/ramon/__init__.py index <HASH>..<HASH> 100644 --- a/ndio/ramon/__init__.py +++ b/ndio/ramon/__init__.py @@ -107,6 +107,37 @@ class AnnotationType: return _ramon_types[_types[typ]] +def to_json(ramons): + """ + Converts RAMON objects into a JSON string which can be directly written out + to a .json file. You can pass either a single RAMON or a list. If you pass + a single RAMON, it will still be exported with the ID as the key. In other + words: + + type(from_json(to_json(ramon))) → list + + ...even if `type(ramon)` is a RAMON, not a list. + + Arguments: + ramons (RAMON or list): The RAMON object(s) to convert to JSON. + + Returns: + str: The JSON representation of the RAMON objects, in the schema: + + { + <id>: { + type: . . . , + metadata: { + . . . + } + }, + } + + Raises: + ValueError: If an invalid RAMON is passed. + """ + raise NotImplementedError + def from_json(json, cutout=None): """ Converts JSON to a python list of RAMON objects. if `cutout` is provided,
add signature for ramon#to_json
jhuapl-boss_intern
train
py
d1290a7db9004f266396552cdecff79298ac8bfb
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -7,7 +7,7 @@ $version = 2004032000; // The current version is a date (YYYYMMDDXX) -$release = "1.2 Final Touches"; // User-friendly version number +$release = "1.2"; // User-friendly version number ?>
OK, well, this is pretty much it.
moodle_moodle
train
php
0eed740fd84211221cc2465219f69d970867b515
diff --git a/actionview/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb index <HASH>..<HASH> 100644 --- a/actionview/test/template/digestor_test.rb +++ b/actionview/test/template/digestor_test.rb @@ -317,9 +317,7 @@ class TemplateDigestorTest < ActionView::TestCase options = options.dup finder.variants = options.delete(:variants) || [] - - node = ActionView::Digestor.tree(template_name, finder, options[:dependencies] || []) - node.digest(finder) + ActionView::Digestor.digest(name: template_name, finder: finder, dependencies: (options[:dependencies] || [])) end def dependencies(template_name)
use the class level digest method for calculating the digest
rails_rails
train
rb
de6b005fe7b0af8e298b6dc82934342319f4b4b4
diff --git a/analyzers/PhishingInitiative/phishinginitiative_scan.py b/analyzers/PhishingInitiative/phishinginitiative_scan.py index <HASH>..<HASH> 100755 --- a/analyzers/PhishingInitiative/phishinginitiative_scan.py +++ b/analyzers/PhishingInitiative/phishinginitiative_scan.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding: utf-8 from cortexutils.analyzer import Analyzer from pyeupi import PyEUPI
missing python3 in shebang #<I>
TheHive-Project_Cortex-Analyzers
train
py
6b0d7f664ab00b9984a54aa7a1d6a8e89467c88a
diff --git a/param/__init__.py b/param/__init__.py index <HASH>..<HASH> 100644 --- a/param/__init__.py +++ b/param/__init__.py @@ -1275,7 +1275,7 @@ class Selector(ObjectSelector): else: autodefault = None - default = default if default else autodefault + default = autodefault if default is None else default super(Selector,self).__init__(default=default, objects=objects, instantiate=instantiate,
Ensure Select constructor does not rely on truthiness (#<I>)
pyviz_param
train
py
e4f52589f6a8401ca7aa8168eb88ffa96c150c73
diff --git a/source/php/Helper/Cache.php b/source/php/Helper/Cache.php index <HASH>..<HASH> 100644 --- a/source/php/Helper/Cache.php +++ b/source/php/Helper/Cache.php @@ -26,7 +26,7 @@ class Cache //Alter keyGroup if ms if (function_exists('is_multisite') && is_multisite()) { - self::$keyGroup = self::$keyGroup . '-' . get_current_blog_id(); + self::$keyGroup = self::$keyGroup . '-' . get_current_blog_id() . '-'; } // Create hash string
Added missing dash to cache key.
helsingborg-stad_Modularity
train
php
90e85afb20e76560bc555d83abad3bc919388381
diff --git a/lib/natural/distance/dice_coefficient.js b/lib/natural/distance/dice_coefficient.js index <HASH>..<HASH> 100644 --- a/lib/natural/distance/dice_coefficient.js +++ b/lib/natural/distance/dice_coefficient.js @@ -51,7 +51,7 @@ function intersect (set1, set2) { function sanitize (str) { // Turn characters to lower string, remove space at the beginning and end, // replace multiple spaces in the middle by single spaces - return str.toLowerCase().replace(/^\s+|\s+$/g, '').replace(/s+/g, ' ') + return str.toLowerCase().replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '') } function diceCoefficient (str1, str2) { diff --git a/spec/dice_coefficient_spec.js b/spec/dice_coefficient_spec.js index <HASH>..<HASH> 100644 --- a/spec/dice_coefficient_spec.js +++ b/spec/dice_coefficient_spec.js @@ -32,6 +32,6 @@ describe('dice', function () { it('should compare complete texts', function () { const text1 = require('./test_data/Wikipedia_EN_FrenchRevolution.json').text const text2 = require('./test_data/Wikipedia_EN_InfluenceOfTheFrenchRevolution.json').text - expect(dice(text1, text2)).toBe(0.7897503285151117) + expect(dice(text1, text2)).toBe(0.7939374395356337) }) })
Follow up of pull request #<I> (#<I>) * Fix ReDoS in dice_coefficient Fix ReDos in `dice_coefficient.js` This related issue addresses #<I> * Repaired a test for Dice coefficient
NaturalNode_natural
train
js,js
2568c9c31360a2e16d43f9abf28cb0dfef1a5f07
diff --git a/facile-clone.js b/facile-clone.js index <HASH>..<HASH> 100644 --- a/facile-clone.js +++ b/facile-clone.js @@ -68,7 +68,7 @@ module.exports = function facileClone(x, opts) { function processKey(acc, k) { const val = x[k] - // The only real primtivies (Number and Boolean) and + // The only "real" primitivies (Number and Boolean) and // `null` + `undefined` go right through if (typeof val === 'number' || typeof val === 'boolean' || @@ -88,7 +88,7 @@ module.exports = function facileClone(x, opts) { } // all other types we just replace with a type indicator - acc[k] = { type: typeof val, val: '<deleted>' } + acc[k] = { type: typeof val, val: DELETED } return acc }
core: consistently using DELETED constant
thlorenz_facile-clone
train
js
30276787ec8b8997374531c74e48651a39946eb7
diff --git a/lib/foreman_tasks.rb b/lib/foreman_tasks.rb index <HASH>..<HASH> 100644 --- a/lib/foreman_tasks.rb +++ b/lib/foreman_tasks.rb @@ -37,7 +37,7 @@ module ForemanTasks def self.sync_task(action, *args, &block) trigger_task(false, action, *args, &block).tap do |task| - raise TaskError.new(task) if task.execution_plan.error? + raise TaskError.new(task) if task.execution_plan.error? || task.execution_plan.result == :warning end end
Fixes #<I> - Raise an exception on sync warnings (#<I>)
theforeman_foreman-tasks
train
rb
13c5c7a43e62c82088346ca36f72faa65d4b0092
diff --git a/lib/waterline/adapter/dql.js b/lib/waterline/adapter/dql.js index <HASH>..<HASH> 100644 --- a/lib/waterline/adapter/dql.js +++ b/lib/waterline/adapter/dql.js @@ -81,7 +81,10 @@ module.exports = { if(!hasOwnProperty(adapter, 'create')) return cb(new Error(err)); adapter.create(connName, this.collection, values, normalize.callback(function afterwards (err, createdRecord) { - if (err) return cb(err); + if (err) { + if (typeof err === 'object') { err.model = this.collection.globalId; } + return cb(err); + } else return cb(null, createdRecord); })); }, @@ -210,7 +213,10 @@ module.exports = { var adapter = this.connections[connName]._adapter; adapter.update(connName, this.collection, criteria, values, normalize.callback(function afterwards (err, updatedRecords) { - if (err) return cb(err); + if (err) { + if (typeof err === 'object') { err.model = this.collection.globalId; } + return cb(err); + } return cb(null, updatedRecords); })); },
in adapter/dql.create and adapter/dql.update- attach model to adapter errors if possible
balderdashy_waterline
train
js
3126d639c28d8b1b677961be88ee200a1cf2bdaf
diff --git a/lib/podio/models/item_transaction.rb b/lib/podio/models/item_transaction.rb index <HASH>..<HASH> 100644 --- a/lib/podio/models/item_transaction.rb +++ b/lib/podio/models/item_transaction.rb @@ -4,6 +4,8 @@ class Podio::ItemTransaction < ActivePodio::Base property :reason, :string property :amount, :integer + property :text, :string + property :created_on, :datetime property :ratings, :hash @@ -20,4 +22,13 @@ class Podio::ItemTransaction < ActivePodio::Base alias_method :id, :item_transaction_id + class << self + + def find(id) + member Podio.connection.get { |req| + req.url("/item_accounting/transaction/#{id}") + }.body + end + + end end
Added support for retrieving a single item transaction
podio_podio-rb
train
rb
406c0616d9f944b05e7c5ff34f7d1fa8faf7fe1b
diff --git a/core-bundle/src/Resources/contao/dca/tl_user.php b/core-bundle/src/Resources/contao/dca/tl_user.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/dca/tl_user.php +++ b/core-bundle/src/Resources/contao/dca/tl_user.php @@ -415,7 +415,7 @@ $GLOBALS['TL_DCA']['tl_user'] = array ), 'lastLogin' => array ( - 'eval' => array('rgxp'=>'datim'), + 'eval' => array('rgxp'=>'datim', 'doNotShow'=>true), 'sql' => "int(10) unsigned NOT NULL default '0'" ), 'currentLogin' => array
[Core] Hide the `lastLogin` field in the details view (see #<I>)
contao_contao
train
php
988c03ce4b6cf5c4dab2043f79239c349417619a
diff --git a/solidity/test/BancorX.js b/solidity/test/BancorX.js index <HASH>..<HASH> 100644 --- a/solidity/test/BancorX.js +++ b/solidity/test/BancorX.js @@ -164,12 +164,11 @@ contract('BancorX', async accounts => { it('should properly calculate the current lock limit after a single transaction', async () => { let amountToSend = (web3Utils.toWei('10', 'ether')).toString(10) await bancorX.xTransfer(EOS_BLOCKCHAIN, eosAddress, amountToSend) - // after the transaction, a block was mined, so the limit is 991 (not 990) - assert.equal((await bancorX.getCurrentLockLimit.call()).toString(10), (web3Utils.toWei('991', 'ether')).toString(10)) + assert.equal((await bancorX.getCurrentLockLimit.call()).toString(10), (web3Utils.toWei('990', 'ether')).toString(10)) // after 5 blocks, the limit should increase by 5 bnt await mineBlocks(5) - assert.equal((await bancorX.getCurrentLockLimit.call()).toString(10), (web3Utils.toWei('996', 'ether')).toString(10)) + assert.equal((await bancorX.getCurrentLockLimit.call()).toString(10), (web3Utils.toWei('995', 'ether')).toString(10)) // after another 5 blocks, the limit should be back to 1000 await mineBlocks(5)
Fix `BancorX.js` in compliane with a bug-fix between ganache <I> and ganache <I>.
bancorprotocol_contracts
train
js
ff5eeff28371726883b1fa2708f9dcf2952d905e
diff --git a/guacamole/src/main/frontend/src/app/notification/services/guacNotification.js b/guacamole/src/main/frontend/src/app/notification/services/guacNotification.js index <HASH>..<HASH> 100644 --- a/guacamole/src/main/frontend/src/app/notification/services/guacNotification.js +++ b/guacamole/src/main/frontend/src/app/notification/services/guacNotification.js @@ -77,12 +77,12 @@ angular.module('notification').factory('guacNotification', ['$injector', * 'text' : { * 'key' : 'NAMESPACE.SOME_TRANSLATION_KEY' * }, - * 'actions' : { + * 'actions' : [{ * 'name' : 'reconnect', * 'callback' : function () { * // Reconnection code goes here * } - * } + * }] * }); * * // To hide the status message
GUACAMOLE-<I>: Update comment block to have correct array type for actions field
glyptodon_guacamole-client
train
js
7a7dffad6a13d2764402624737a396abcb8f7fa8
diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignAutoConfiguration.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignAutoConfiguration.java index <HASH>..<HASH> 100644 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignAutoConfiguration.java +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignAutoConfiguration.java @@ -1,8 +1,10 @@ package org.springframework.cloud.netflix.feign; import feign.Contract; +import feign.Feign; import feign.Logger; import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.cloud.netflix.archaius.ArchaiusAutoConfiguration; @@ -11,6 +13,7 @@ import org.springframework.cloud.netflix.archaius.ArchaiusAutoConfiguration; * @author Spencer Gibb */ @Configuration +@ConditionalOnClass(Feign.class) @AutoConfigureAfter(ArchaiusAutoConfiguration.class) public class FeignAutoConfiguration { @Bean
make FeignAutoConfiguration conditional on class Feign.class
spring-cloud_spring-cloud-netflix
train
java
536dc60cf9371b6987a7d9489d916eefe9c99916
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ setup( author_email="[email protected]", url=url, install_requires=[ + "click", "dtoolcore>=2.4.0", ], entry_points={
Add click dependency to setup.py
jic-dtool_dtool-symlink
train
py
6c0fb3840f7c9d84338ff7c4a1285e603c7460e0
diff --git a/src/models/Answer.php b/src/models/Answer.php index <HASH>..<HASH> 100644 --- a/src/models/Answer.php +++ b/src/models/Answer.php @@ -186,7 +186,7 @@ class Answer extends \hipanel\base\Model return $this->hasMany(File::class, ['object_id' => 'id']); } - public function scenarioCommands() + public function scenarioActions() { return [ 'update' => 'update-answer', diff --git a/src/models/Thread.php b/src/models/Thread.php index <HASH>..<HASH> 100644 --- a/src/models/Thread.php +++ b/src/models/Thread.php @@ -298,7 +298,7 @@ class Thread extends \hipanel\base\Model return $this->id; } - public function scenarioCommands() + public function scenarioActions() { return [ 'open' => 'answer',
renamed scenarioActions <- scenarioCommands
hiqdev_hipanel-module-ticket
train
php,php
b2b25cd9dfc81630e5a71390599b540bc1e19d10
diff --git a/stl/base.py b/stl/base.py index <HASH>..<HASH> 100644 --- a/stl/base.py +++ b/stl/base.py @@ -336,7 +336,7 @@ class BaseMesh(logger.Logged, abc.Mapping): '''Check the mesh is valid or not''' return self.is_closed() - def is_closed(self): + def is_closed(self): # pragma: no cover """Check the mesh is closed or not""" if (self.normals.sum(axis=0) >= 1e-4).any(): self.warning('''
removed `is_closed` method from cover, might be broken
WoLpH_numpy-stl
train
py
59c3e798a7ea0ddd51f9e8a23c36d313bd812893
diff --git a/src/Responder/AbstractWithViewData.php b/src/Responder/AbstractWithViewData.php index <HASH>..<HASH> 100644 --- a/src/Responder/AbstractWithViewData.php +++ b/src/Responder/AbstractWithViewData.php @@ -68,7 +68,7 @@ abstract class AbstractWithViewData /** * @param string $method * @param array $args - * @return $this|static + * @return mixed */ public function __call($method, $args) { diff --git a/src/Responder/Error.php b/src/Responder/Error.php index <HASH>..<HASH> 100644 --- a/src/Responder/Error.php +++ b/src/Responder/Error.php @@ -90,7 +90,7 @@ class Error extends AbstractWithViewData /** * @param string $method * @param array $args - * @return ResponseInterface|$this|static + * @return ResponseInterface|$this|static|mixed */ public function __call($method, $args) {
fixed (hopefully) return value of __call methods to be compatible.
TuumPHP_Respond
train
php,php
b9c1fdb0d8e660ae31c2b66f1041e0570699b71a
diff --git a/ryu/app/wsgi.py b/ryu/app/wsgi.py index <HASH>..<HASH> 100644 --- a/ryu/app/wsgi.py +++ b/ryu/app/wsgi.py @@ -74,10 +74,27 @@ class WSGIApplication(object): self.mapper = Mapper() self.registory = {} super(WSGIApplication, self).__init__() + # XXX: Switch how to call the API of Routes for every version + match_argspec = inspect.getargspec(self.mapper.match) + if 'environ' in match_argspec.args: + # New API + self._match = self._match_with_environ + else: + # Old API + self._match = self._match_with_path_info + + def _match_with_environ(self, req): + match = self.mapper.match(environ=req.environ) + return match + + def _match_with_path_info(self, req): + self.mapper.environ = req.environ + match = self.mapper.match(req.path_info) + return match @webob.dec.wsgify def __call__(self, req): - match = self.mapper.match(environ=req.environ) + match = self._match(req) if not match: return webob.exc.HTTPNotFound()
Switch how to call the API of Routes for every version The parameter of the API of Routes differs between <I> and <I>. Routes <I> is provided by base repository of RHEL.
osrg_ryu
train
py
8fabd9488e37483bba35499b50cbc44fa615da37
diff --git a/src/Intervention/Image/Image.php b/src/Intervention/Image/Image.php index <HASH>..<HASH> 100644 --- a/src/Intervention/Image/Image.php +++ b/src/Intervention/Image/Image.php @@ -246,7 +246,7 @@ class Image */ private function setPropertiesFromResource($resource) { - if (is_resource($resource)) { + if ($this->isImageResource($resource)) { $this->resource = $resource; $this->width = imagesx($this->resource); $this->height = imagesy($this->resource); @@ -914,7 +914,7 @@ class Image imagesettile($this->resource, $color->resource); $color = IMG_COLOR_TILED; - } elseif (is_resource($color)) { + } elseif ($this->isImageResource($color)) { // fill with image resource imagesettile($this->resource, $color); @@ -1361,6 +1361,28 @@ class Image } /** + * Checks if string contains printable characters + * + * @param mixed $input + * @return boolean + */ + private function isBinary($input) + { + return ( ! ctype_print($input)); + } + + /** + * Checks if the input object is image resource + * + * @param mixed $input + * @return boolean + */ + private function isImageResource($input) + { + return (is_resource($input) && get_resource_type($input) == 'gd'); + } + + /** * Returns image stream * * @return string
added isBinary and isImageResource
Intervention_image
train
php
df632dbaa9fca8a7a2bc46d1c4d205f62a7779c0
diff --git a/src/ol/Graticule.js b/src/ol/Graticule.js index <HASH>..<HASH> 100644 --- a/src/ol/Graticule.js +++ b/src/ol/Graticule.js @@ -26,7 +26,6 @@ const DEFAULT_STROKE_STYLE = new Stroke({ }); /** - * TODO can be configurable * @type {Array<number>} * @private */
Remove old TODO in ol/Graticule Fixed with #<I>
openlayers_openlayers
train
js
b26105d3b699a7eb9ddf481ea9969c0bd9f30702
diff --git a/framework/directives/loadingPlaceholder.js b/framework/directives/loadingPlaceholder.js index <HASH>..<HASH> 100755 --- a/framework/directives/loadingPlaceholder.js +++ b/framework/directives/loadingPlaceholder.js @@ -34,14 +34,15 @@ setImmediate(function() { var div = document.createElement('div'); div.innerHTML = html.trim(); - + + var newElement = angular.element(div); newElement.css('display', 'none'); element.append(newElement); ons.compile(newElement[0]); - element.children()[0].remove(); + angular.element(element.children()[0]).remove(); newElement.css('display', 'block'); }); });
Fixed bug where "ons-loading-placeholder" didn't work for older browsers.
OnsenUI_OnsenUI
train
js
1277fa3f24f06d8631e57cc17e18b0f0ad8d01a8
diff --git a/code/extensions/SiteConfigMediaPermissionExtension.php b/code/extensions/SiteConfigMediaPermissionExtension.php index <HASH>..<HASH> 100644 --- a/code/extensions/SiteConfigMediaPermissionExtension.php +++ b/code/extensions/SiteConfigMediaPermissionExtension.php @@ -21,11 +21,11 @@ class SiteConfigMediaPermissionExtension extends DataExtension { public function updateCMSFields(FieldList $fields) { + Requirements::css(MEDIAWESOME_PATH . '/css/mediawesome.css'); $permissions = array( 'ADMIN' => 'Administrators and developers', 'SITETREE_EDIT_ALL' => 'Content authors' ); - Requirements::css(MEDIAWESOME_PATH . '/css/mediawesome.css'); // Confirm that the current CMS user has permission.
Updating a minor class definition.
nglasl_silverstripe-mediawesome
train
php
5a2016fa5241a51ec64c91705d2c3372e2691c18
diff --git a/src/Accordion/accordion-wrapper.js b/src/Accordion/accordion-wrapper.js index <HASH>..<HASH> 100644 --- a/src/Accordion/accordion-wrapper.js +++ b/src/Accordion/accordion-wrapper.js @@ -20,7 +20,10 @@ const defaultProps: AccordionWrapperProps = { }; class AccordionWrapper extends Component<AccordionWrapperProps> { - accordionStore = new AccordionContainer(); + accordionStore = new AccordionContainer({ + accordion: this.props.accordion, + onChange: this.props.onChange, + }); static defaultProps = defaultProps;
Fix AccordionWrapper initialization by passing initial 'accordion' and 'onChange' props to the container constructor.
springload_react-accessible-accordion
train
js
3ae6d15dde17a6b96682ca5f22c8041662e28cfe
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -84,6 +84,7 @@ function parse (cstr) { //color space else if (m = /^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(cstr)) { var name = m[1] + var isRGB = name === 'rgb' var base = name.replace(/a$/, '') space = base var size = base === 'cmyk' ? 4 : base === 'gray' ? 1 : 3 @@ -113,7 +114,7 @@ function parse (cstr) { }) if (name === base) parts.push(1) - alpha = parts[size] === undefined ? 1 : parts[size] + alpha = (isRGB) ? 1 : (parts[size] === undefined) ? 1 : parts[size] parts = parts.slice(0, size) }
rgb(r,g,b,a) should have alpha 1
colorjs_color-parse
train
js
66cce73076bf838d59bfbadffecb413f1b5f3168
diff --git a/master/buildbot/buildslave.py b/master/buildbot/buildslave.py index <HASH>..<HASH> 100644 --- a/master/buildbot/buildslave.py +++ b/master/buildbot/buildslave.py @@ -156,7 +156,7 @@ class AbstractBuildSlave(pb.Avatar, service.MultiService): locks.append((lock, access)) self.locks = [(l.getLock(self), la) for l, la in locks] self.lock_subscriptions = [ l.subscribeToReleases(self._lockReleased) - for l in self.locks ] + for l, la in self.locks ] def locksAvailable(self): """
changes suggested by dwlocks
buildbot_buildbot
train
py
7137b5bfcfcb27db0c4a2c0a2cf47e38061f53c7
diff --git a/pronto/term.py b/pronto/term.py index <HASH>..<HASH> 100644 --- a/pronto/term.py +++ b/pronto/term.py @@ -410,6 +410,20 @@ class Term(Entity): yield ont.get_term(neighbor) done.add(node) + def is_leaf(self) -> bool: + """Check whether the term is a leaf in the ontology. + + We define leaves as nodes in the ontology which do not have subclasses + since the subclassing relationship is directed and can be used to + create a DAG of all the terms in the ontology. + """ + ont = self._ontology() + is_a = ont.get_relationship('is_a') + for t in self._ontology().terms(): + if self.id in t.relationships.get(is_a, {}): + return False + return True + # --- Attributes --------------------------------------------------------- @property
Add `Term.is_leaf` method to check if a term has no subclasses
althonos_pronto
train
py
af34287fd11887db05b01c06a16a99e91560fee1
diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java index <HASH>..<HASH> 100644 --- a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java +++ b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java @@ -1331,7 +1331,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { private final Unsafe unsafe; HeadContext(DefaultChannelPipeline pipeline) { - super(pipeline, null, HEAD_NAME, false, true); + super(pipeline, null, HEAD_NAME, true, true); unsafe = pipeline.channel().unsafe(); setAddComplete(); }
HeadContext is inbound and outbound (#<I>) Motivation: Our HeadContext in DefaultChannelPipeline does handle inbound and outbound but we only marked it as outbound. While this does not have any effect in the current code-base it can lead to problems when we change our internals (this is also how I found the bug). Modifications: Construct HeadContext so it is also marked as handling inbound. Result: More correct code.
netty_netty
train
java
1ae4042ff562ca3fe0c7f6197b8d7fd5d634c7d1
diff --git a/chainlet/chainlink.py b/chainlet/chainlink.py index <HASH>..<HASH> 100644 --- a/chainlet/chainlink.py +++ b/chainlet/chainlink.py @@ -310,18 +310,6 @@ class GraphLink(CompoundLink): # pylint: disable=abstract-method except (StopIteration, _ElementExhausted): break - def send(self, value=None): - """Send a value to this element for processing""" - # we do one explicit loop to keep overhead low... - result = list(self.chainlet_send(value)) - if result: - return result - # ...then do the correct loop if needed - while True: - result = list(self.chainlet_send(value)) - if result: - return result - class Bundle(GraphLink): """
removed superfluous specialised send in ChainLink compound subclasses
maxfischer2781_chainlet
train
py
c00314cdd30256c1eaad19b619b26bbba6c168c1
diff --git a/src/core/fontruler.js b/src/core/fontruler.js index <HASH>..<HASH> 100644 --- a/src/core/fontruler.js +++ b/src/core/fontruler.js @@ -38,7 +38,7 @@ goog.scope(function () { * @return {string} */ FontRuler.prototype.computeStyleString_ = function(font) { - return "position:absolute;top:-999px;left:-999px;" + + return "display:block;position:absolute;top:-999px;left:-999px;" + "font-size:300px;width:auto;height:auto;line-height:normal;margin:0;" + "padding:0;font-variant:normal;white-space:nowrap;font-family:" + font.getCssName() + ";" + font.getCssVariation();
Add display:block to FontRuler so it can not be easily overridden.
typekit_webfontloader
train
js
289285ef3f3713ad7267ab2040dea0f2b3d6ed7a
diff --git a/doc/source/conf.py b/doc/source/conf.py index <HASH>..<HASH> 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -371,13 +371,14 @@ latex_documents = [ intersphinx_mapping = { - 'statsmodels': ('http://www.statsmodels.org/devel/', None), + 'dateutil': ("https://dateutil.readthedocs.io/en/latest/", None), 'matplotlib': ('https://matplotlib.org/', None), + 'numpy': ('https://docs.scipy.org/doc/numpy/', None), 'pandas-gbq': ('https://pandas-gbq.readthedocs.io/en/latest/', None), + 'py': ('https://pylib.readthedocs.io/en/latest/', None), 'python': ('https://docs.python.org/3/', None), - 'numpy': ('https://docs.scipy.org/doc/numpy/', None), 'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None), - 'py': ('https://pylib.readthedocs.io/en/latest/', None) + 'statsmodels': ('http://www.statsmodels.org/devel/', None), } import glob autosummary_generate = glob.glob("*.rst")
DOC: Add dateutil to intersphinx #<I> (#<I>)
pandas-dev_pandas
train
py
3e01f54d84d75c7f049634980eae334f3c52e3ee
diff --git a/cfg4j-consul/src/main/java/org/cfg4j/source/consul/ConsulConfigurationSource.java b/cfg4j-consul/src/main/java/org/cfg4j/source/consul/ConsulConfigurationSource.java index <HASH>..<HASH> 100644 --- a/cfg4j-consul/src/main/java/org/cfg4j/source/consul/ConsulConfigurationSource.java +++ b/cfg4j-consul/src/main/java/org/cfg4j/source/consul/ConsulConfigurationSource.java @@ -37,7 +37,7 @@ import java.util.Properties; * <p> * Read configuration from the Consul K-V store. */ -class ConsulConfigurationSource implements ConfigurationSource { +public class ConsulConfigurationSource implements ConfigurationSource { private static final Logger LOG = LoggerFactory.getLogger(ConsulConfigurationSource.class);
Make ConsulConfigurationSource public `ConsulConfigurationSource` is package private but it is the return value of the public function, `ConsulConfigurationSourceBuilder::build`. This causes problems when using kotlin b/c kotlin cannot assign any variable to type `ConsulConfigurationSource` since it is package private. Since `ConsulConfigurationSourceBuilder::build` returns an instance of `ConsulConfigurationSource`, we should make `ConsulConfigurationSource` a public class.
cfg4j_cfg4j
train
java
03c4d62f29dd4f8c5d5de3a12fc5da22783acd44
diff --git a/android/src/playn/android/AndroidNet.java b/android/src/playn/android/AndroidNet.java index <HASH>..<HASH> 100644 --- a/android/src/playn/android/AndroidNet.java +++ b/android/src/playn/android/AndroidNet.java @@ -78,10 +78,11 @@ class AndroidNet extends NetImpl { HttpResponse response = httpclient.execute(req); StatusLine status = response.getStatusLine(); int code = status.getStatusCode(); + String body = EntityUtils.toString(response.getEntity()); if (code == HttpStatus.SC_OK) { - platform.notifySuccess(callback, EntityUtils.toString(response.getEntity())); + platform.notifySuccess(callback, body); } else { - platform.notifyFailure(callback, new HttpException(code, status.getReasonPhrase())); + platform.notifyFailure(callback, new HttpException(code, body)); } } catch (Exception e) { platform.notifyFailure(callback, e);
Report the document body when reporting an HTTP error. Often times that contains information that will help clarify what in the hell is going wrong. Particularly when making REST API calls to services like Googles.
threerings_playn
train
java
db15fd92b82ad55edf2e0dcd42ebaf061cc725e6
diff --git a/lib/flor/unit/models/trap.rb b/lib/flor/unit/models/trap.rb index <HASH>..<HASH> 100644 --- a/lib/flor/unit/models/trap.rb +++ b/lib/flor/unit/models/trap.rb @@ -92,9 +92,6 @@ module Flor def match?(executor, message) -# return false if message['point'] == 'trigger' -# # FIXME that is a rough solution - return false if tconsumed && ! message['consumed'] return false if ! tconsumed && message['consumed'] diff --git a/spec/punit/trap_spec.rb b/spec/punit/trap_spec.rb index <HASH>..<HASH> 100644 --- a/spec/punit/trap_spec.rb +++ b/spec/punit/trap_spec.rb @@ -206,10 +206,8 @@ describe 'Flor punit' do .each_with_index .collect { |t, i| "#{i}:#{t.text}" }.join("\n") ).to eq(%w{ - 0:receive--0 - 1:execute-sequence-0_1 - 2:receive--0_1 - 3:receive--0 + 0:execute-sequence-0_1 + 1:receive--0_1 }.collect(&:strip).join("\n")) end end
adapt "trap" heap: spec
floraison_flor
train
rb,rb
6e78ddcc4114504d3d7ec46fcc9d8a952f34d4e9
diff --git a/unittest/reading_test.py b/unittest/reading_test.py index <HASH>..<HASH> 100644 --- a/unittest/reading_test.py +++ b/unittest/reading_test.py @@ -10,7 +10,7 @@ import unittest class TestDynaphopy(unittest.TestCase): def setUp(self): - self.structure = io.read_from_file_structure_outcar('Si_data/OUTCAR') + self.structure = io.read_from_file_structure_poscar('Si_data/POSCAR') self.structure.set_primitive_matrix([[0.0, 0.5, 0.5], [0.5, 0.0, 0.5],
Add OUTCAR file to unittest data folder
abelcarreras_DynaPhoPy
train
py
dc0abdfc8ee719e410bb79688c8f5841240b0da3
diff --git a/lib/xcodeproj/project/object/native_target.rb b/lib/xcodeproj/project/object/native_target.rb index <HASH>..<HASH> 100644 --- a/lib/xcodeproj/project/object/native_target.rb +++ b/lib/xcodeproj/project/object/native_target.rb @@ -58,7 +58,7 @@ module Xcodeproj project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] else build_configurations.first.build_settings['MACOSX_DEPLOYMENT_TARGET'] || - project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] + project.build_configurations.first.build_settings['MACOSX_DEPLOYMENT_TARGET'] end end
[NativeTarget] Fix incorrect deployment target report
CocoaPods_Xcodeproj
train
rb
56d4712498b6a142c3cfcebb7c8df5c4958a0a4b
diff --git a/Zebra_Database.php b/Zebra_Database.php index <HASH>..<HASH> 100644 --- a/Zebra_Database.php +++ b/Zebra_Database.php @@ -24,7 +24,7 @@ * For more resources visit {@link http://stefangabos.ro/} * * @author Stefan Gabos <[email protected]> - * @version 2.9.2 (last revision: February 11, 2016) + * @version 2.9.3 (last revision: February 15, 2016) * @copyright (c) 2006 - 2016 Stefan Gabos * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LESSER GENERAL PUBLIC LICENSE * @package Zebra_Database @@ -1435,7 +1435,7 @@ class Zebra_Database while ($row = $this->fetch_obj($resource)) // if $index was specified and exists in the returned row, add data to the result - if (trim($index) != '' && isset($row[$index])) $result[$row[$index]] = $row; + if (trim($index) != '' && property_exists($row, $index)) $result[$row->{$index}] = $row; // if $index was not specified or does not exists in the returned row, add data to the result else $result[] = $row;
Fixed a bug where "fetch_obj_all" method would fail if the "index" argument was given; thanks Milan Kvita
stefangabos_Zebra_Database
train
php
23fac6821ea4d050b5ee365c1688e7a20e0bbe89
diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/rest/RestApiException.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/rest/RestApiException.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/rest/RestApiException.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/rest/RestApiException.java @@ -35,8 +35,4 @@ public class RestApiException extends Exception { public RestApiException(Throwable cause) { super(cause); } - - protected RestApiException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } }
fix build with jdk6
uwolfer_gerrit-rest-java-client
train
java
9d7ed0e63a4e9907c04396d0a9a7a01ba08d2852
diff --git a/version/version.go b/version/version.go index <HASH>..<HASH> 100644 --- a/version/version.go +++ b/version/version.go @@ -26,7 +26,7 @@ import ( var ( // MinClusterVersion is the min cluster version this etcd binary is compatible with. MinClusterVersion = "3.0.0" - Version = "3.2.0-rc.0+git" + Version = "3.2.0-rc.1" APIVersion = "unknown" // Git SHA Value will be set during build
version: bump up to <I>-rc<I>
etcd-io_etcd
train
go
d4f04b61819d23bc2da8f887c57c6b04272199fa
diff --git a/test/unit/Base/CoreTest.py b/test/unit/Base/CoreTest.py index <HASH>..<HASH> 100644 --- a/test/unit/Base/CoreTest.py +++ b/test/unit/Base/CoreTest.py @@ -988,5 +988,5 @@ class CoreTest: geom2 = OpenPNM.Geometry.GenericGeometry(network=net, pores=Ps) geom1['pore.blah'] = 1.0 geom2['pore.blah'] = False - #non-bool data converted to False + # non-bool data converted to False assert sp.sum(net['pore.blah']) == 0 diff --git a/test/unit/Utilities/UtilitiesMiscTest.py b/test/unit/Utilities/UtilitiesMiscTest.py index <HASH>..<HASH> 100644 --- a/test/unit/Utilities/UtilitiesMiscTest.py +++ b/test/unit/Utilities/UtilitiesMiscTest.py @@ -3,6 +3,7 @@ import OpenPNM.Utilities.misc as misc import scipy as sp import time + class UtilitiesMiscTest: def setup_class(self):
Some pep8 fixes to pass TravisCI
PMEAL_OpenPNM
train
py,py
9a86dbabc2547dbc7c8938d678a5e0f293008b01
diff --git a/server/container_list.go b/server/container_list.go index <HASH>..<HASH> 100644 --- a/server/container_list.go +++ b/server/container_list.go @@ -42,21 +42,25 @@ func (s *Server) filterContainerList(filter *pb.ContainerFilter, origCtrList []* } c := s.ContainerServer.GetContainer(id) if c != nil { - if filter.PodSandboxId == "" || c.Sandbox() == filter.PodSandboxId { + switch { + case filter.PodSandboxId == "": + return []*oci.Container{c} + case c.Sandbox() == filter.PodSandboxId: + return []*oci.Container{c} + default: return []*oci.Container{} } - return []*oci.Container{c} } } else { if filter.PodSandboxId != "" { pod := s.ContainerServer.GetSandbox(filter.PodSandboxId) if pod == nil { return []*oci.Container{} - } else { - return pod.Containers().List() } + return pod.Containers().List() } } + logrus.Debug("no filters were applied, returning full container list") return origCtrList }
Add logging support for base condition in debug
cri-o_cri-o
train
go
ba9a5709c10f86defdd712ecb716c815428e7b98
diff --git a/src/ORM/Query.php b/src/ORM/Query.php index <HASH>..<HASH> 100644 --- a/src/ORM/Query.php +++ b/src/ORM/Query.php @@ -828,9 +828,9 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface * * This method creates query clones that are useful when working with subqueries. * - * @return \Cake\ORM\Query + * @return static */ - public function cleanCopy(): Query + public function cleanCopy(): self { $clone = clone $this; $clone->setEagerLoader(clone $this->getEagerLoader());
Remove invalid chainable typehints as per cs assert.
cakephp_cakephp
train
php
fb70a5ae28c9ccc3f48c3547bd98e84fc48e6282
diff --git a/test/Schemes/DataTest.php b/test/Schemes/DataTest.php index <HASH>..<HASH> 100644 --- a/test/Schemes/DataTest.php +++ b/test/Schemes/DataTest.php @@ -259,6 +259,9 @@ class DataTest extends PHPUnit_Framework_TestCase $res = $uri->save($newFilePath); $this->assertInstanceOf('\SplFileObject', $res); $this->assertTrue($uri->sameValueAs(DataUri::createFromPath($newFilePath))); + + // Ensure file handle of \SplFileObject gets closed. + $res = null; unlink($newFilePath); } @@ -271,6 +274,9 @@ class DataTest extends PHPUnit_Framework_TestCase $this->assertTrue($uri->sameValueAs(DataUri::createFromPath($newFilePath))); $data = file_get_contents($newFilePath); $this->assertSame(base64_encode($data), $uri->getData()); + + // Ensure file handle of \SplFileObject gets closed. + $res = null; unlink($newFilePath); }
Fix open file and resulting unlink failure.
thephpleague_uri-components
train
php
9b90d9c091a3eb80cad12309acb990138428dd18
diff --git a/safe/storage/utilities.py b/safe/storage/utilities.py index <HASH>..<HASH> 100644 --- a/safe/storage/utilities.py +++ b/safe/storage/utilities.py @@ -491,12 +491,9 @@ def buffered_bounding_box(bbox, resolution): try: resx, resy = resolution - except: + except TypeError: resx = resy = resolution - print - print resolution - bbox[0] -= resx bbox[1] -= resy bbox[2] += resx
Finished pylinting the safe module. Violations == 0, all tests and pep8 checks pass. The bar has been raised.
inasafe_inasafe
train
py
cb44357af962ccd9334cce786de044ac20ab53cd
diff --git a/.bach/build/module-info.java b/.bach/build/module-info.java index <HASH>..<HASH> 100644 --- a/.bach/build/module-info.java +++ b/.bach/build/module-info.java @@ -1,3 +1,4 @@ +import com.github.sormuras.bach.project.Feature; import com.github.sormuras.bach.project.ProjectInfo; import com.github.sormuras.bach.project.ProjectInfo.Tweak; @@ -5,6 +6,10 @@ import com.github.sormuras.bach.project.ProjectInfo.Tweak; name = "purejin", version = "8-ea", compileModulesForJavaRelease = 8, + features = { + Feature.GENERATE_API_DOCUMENTATION, + Feature.INCLUDE_SOURCES_IN_MODULAR_JAR + }, tweaks = { @Tweak(tool = "javac", with = {"-encoding", "UTF-8", "-g", "-parameters"}), @Tweak(tool = "javadoc",
adds build features to generate javadoc and add sources into jar files
jbee_silk
train
java
df8d55aeabc8c199ac425e11767181b4244a67f4
diff --git a/python/bigdl/utils/common.py b/python/bigdl/utils/common.py index <HASH>..<HASH> 100644 --- a/python/bigdl/utils/common.py +++ b/python/bigdl/utils/common.py @@ -400,10 +400,11 @@ def get_bigdl_conf(): if bigdl_python_wrapper in p and os.path.isfile(p): import zipfile with zipfile.ZipFile(p, 'r') as zip_conf: - content = zip_conf.read(bigdl_conf_file) - if sys.version_info >= (3,): - content = str(content, 'latin-1') - return load_conf(content) + if bigdl_conf_file in zip_conf.namelist(): + content = zip_conf.read(bigdl_conf_file) + if sys.version_info >= (3,): + content = str(content, 'latin-1') + return load_conf(content) raise Exception("Cannot find spark-bigdl.conf.Pls add it to PYTHONPATH.")
Fix load bigdl_conf_file exception (#<I>) * update bigdl download url * fix (#<I>) * fix jtensor (#<I>) * [Backport <I> PR<I>]Bump script (#<I>) * checkin bump-version script * add comments * check if zip file contains the conf
intel-analytics_BigDL
train
py
7ec8dfee5cd2e1cf4b795f1b1f97f3d32df52e4a
diff --git a/src/org/openscience/cdk/applications/jchempaint/action/OpenAction.java b/src/org/openscience/cdk/applications/jchempaint/action/OpenAction.java index <HASH>..<HASH> 100755 --- a/src/org/openscience/cdk/applications/jchempaint/action/OpenAction.java +++ b/src/org/openscience/cdk/applications/jchempaint/action/OpenAction.java @@ -173,7 +173,10 @@ public class OpenAction extends JCPAction { //The following do apply either to the existing or the new frame jcpPanel.lastUsedJCPP.getJChemPaintModel().setTitle(inFile.getName()); jcpPanel.lastUsedJCPP.setIsAlreadyAFile(inFile); - ((JFrame) jcpPanel.lastUsedJCPP.getParent().getParent().getParent().getParent()).setTitle(inFile.getName()); + if (jcpPanel.isEmbedded() == false) { + ((JFrame) + jcpPanel.lastUsedJCPP.getParent().getParent().getParent().getParent()).setTitle(inFile.getName()); + } return; } else {
if is embedded viewer don't try to set title of parent frame git-svn-id: <URL>
cdk_cdk
train
java
777d3c5a18f28a7e217479eae883fd5a467c40e6
diff --git a/endpoints/register.js b/endpoints/register.js index <HASH>..<HASH> 100644 --- a/endpoints/register.js +++ b/endpoints/register.js @@ -44,8 +44,18 @@ class Authentication extends Endpoint { */ async newUser (credentials, req) { let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress - let user_secret = credentials.user_key - let user_key = credentials.user_secret + let user_key = credentials.user_key + let user_secret = credentials.user_secret + + let userExists = await this.db.collection('users').findOne({ user_key: user_key }) + if (userExists) { + this.res.status(403).send({ + error: 'Registration failed.', + reason: 'User key is already taken.' + }) + return + } + let user = { user_id: 'unidentified-' + randtoken.uid(16), user_key: user_key,
added check if key is already taken
cubic-js_cubic
train
js
f4f7bc657b38be7284623f8d337b39de27086670
diff --git a/juicer/tests/TestJuicer.py b/juicer/tests/TestJuicer.py index <HASH>..<HASH> 100644 --- a/juicer/tests/TestJuicer.py +++ b/juicer/tests/TestJuicer.py @@ -12,13 +12,13 @@ class TestJuicer(unittest.TestCase): def test_rpm_search(self): self.args = self.parser.parser.parse_args('rpm-search ruby'.split()) pulp = j(self.args) - print pulp.search_rpm(name=self.args.rpmname, \ + pulp.search_rpm(name=self.args.rpmname, \ envs=self.args.environment) self.args = self.parser.parser.parse_args(\ 'rpm-search ruby --in qa'.split()) pulp = j(self.args) - print pulp.search_rpm(name=self.args.rpmname, \ + pulp.search_rpm(name=self.args.rpmname, \ envs=self.args.environment) if __name__ == '__main__':
all this output isn't really necessary
juicer_juicer
train
py
c41fb6a6d115f066281a2912c5cd19d13e3ddc5d
diff --git a/tests/Bitpay/Util/UtilTest.php b/tests/Bitpay/Util/UtilTest.php index <HASH>..<HASH> 100644 --- a/tests/Bitpay/Util/UtilTest.php +++ b/tests/Bitpay/Util/UtilTest.php @@ -167,7 +167,7 @@ class UtilTest extends \PHPUnit_Framework_TestCase foreach ($data as $datum) { $this->assertSame( $datum[1], - Util::encodeHex($datum[0]) + Util::decodeHex($datum[0]) ); } }
It always helps to test the correct function
bitpay_php-bitpay-client
train
php
94406e5913c69130c9e402a011128a18e8a6b43d
diff --git a/tasks.py b/tasks.py index <HASH>..<HASH> 100644 --- a/tasks.py +++ b/tasks.py @@ -10,4 +10,8 @@ ns.configure({ 'tests': { 'package': 'releases', }, + 'packaging': { + 'sign': True, + 'wheel': True, + }, })
Final pieces re #<I>, closes #<I>
bitprophet_releases
train
py
c16ff370031ea38165ff827a62a979787ea1930a
diff --git a/spec/dummy_app/config/routes.rb b/spec/dummy_app/config/routes.rb index <HASH>..<HASH> 100644 --- a/spec/dummy_app/config/routes.rb +++ b/spec/dummy_app/config/routes.rb @@ -1,4 +1,4 @@ Dummy::Application.routes.draw do devise_for :users - root :to => "rails_admin#index" + root :to => "rails_admin::Main#index" end
Fix dummy app default route to point to RailsAdmin::MainController
sferik_rails_admin
train
rb
9ca3b8791461081d206419a71c91979ff6bd6a23
diff --git a/SwingMapViewer/src/main/java/org/mapsforge/map/swing/view/MapView.java b/SwingMapViewer/src/main/java/org/mapsforge/map/swing/view/MapView.java index <HASH>..<HASH> 100644 --- a/SwingMapViewer/src/main/java/org/mapsforge/map/swing/view/MapView.java +++ b/SwingMapViewer/src/main/java/org/mapsforge/map/swing/view/MapView.java @@ -73,6 +73,10 @@ public class MapView extends Container implements org.mapsforge.map.view.MapView public void destroy() { this.layerManager.interrupt(); this.frameBufferController.destroy(); + this.frameBuffer.destroy(); + if (this.mapScaleBar != null) { + this.mapScaleBar.destroy(); + } } @Override
Swing MapView: add more cleaning calls in destroy
mapsforge_mapsforge
train
java
dbefcdf1d1ab118592b6b061c1a91df89f4568ff
diff --git a/lib/protobuf/rpc/stat.rb b/lib/protobuf/rpc/stat.rb index <HASH>..<HASH> 100644 --- a/lib/protobuf/rpc/stat.rb +++ b/lib/protobuf/rpc/stat.rb @@ -23,7 +23,7 @@ module Protobuf end def method - @method ||= @dispatcher.try(:method).try(:name) + @method ||= @dispatcher.try(:callable_method).try(:name) end def server=(peer) @@ -35,7 +35,7 @@ module Protobuf end def service - @service ||= @dispatcher.try(:service).try(:name) + @service ||= @dispatcher.try(:service).class.name end def sizes
Fix stat method/service integration with service dispatcher
ruby-protobuf_protobuf
train
rb
5c07508926021afef4d5f57d7c51558b803df9f5
diff --git a/persistence.js b/persistence.js index <HASH>..<HASH> 100644 --- a/persistence.js +++ b/persistence.js @@ -94,7 +94,7 @@ MemoryPersistence.prototype.removeSubscriptions = function (client, subs, cb) { var trie = this._trie if (!stored) { - stored = {} + stored = [] this._subscriptions[client.id] = stored }
Correctly default the subscriptions to an array in removeSubscriptions.
mcollina_aedes-persistence
train
js
d53ebb1153f7189b73de10ac278bacbe9453a8db
diff --git a/src/main/java/org/redisson/connection/pool/ConnectionPool.java b/src/main/java/org/redisson/connection/pool/ConnectionPool.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/redisson/connection/pool/ConnectionPool.java +++ b/src/main/java/org/redisson/connection/pool/ConnectionPool.java @@ -153,7 +153,7 @@ abstract class ConnectionPool<T extends RedisConnection> { } } - StringBuilder errorMsg = new StringBuilder("Connection pool exhausted! All connections are busy. Try to increase connection pool size."); + StringBuilder errorMsg = new StringBuilder("Publish/Subscribe connection pool exhausted! All connections are busy. Try to increase Publish/Subscribe connection pool size."); // if (!freezed.isEmpty()) { // errorMsg.append(" Disconnected hosts: " + freezed); // }
Publish/Subscribe exhausted connection poll error message fixed. #<I>
redisson_redisson
train
java
b3e6ed89120e659f682515a7c3533e924695a983
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,7 @@ /** * Pon task for docker * @module pon-task-docker - * @version 1.1.0 + * @version 1.1.1 */ 'use strict'
[ci skip] Travis CI committed after build
realglobe-Inc_pon-task-docker
train
js
d5c733e824a2fa3da7213c7b53dc73ec06b6f655
diff --git a/src/ruby/bin/interop/interop_client.rb b/src/ruby/bin/interop/interop_client.rb index <HASH>..<HASH> 100755 --- a/src/ruby/bin/interop/interop_client.rb +++ b/src/ruby/bin/interop/interop_client.rb @@ -57,7 +57,7 @@ require 'test/cpp/interop/empty' require 'signet/ssl_config' -AUTH_ENV = Google::Auth::ServiceAccountCredentials::ENV_VAR +AUTH_ENV = Google::Auth::CredentialsLoader::ENV_VAR # loads the certificates used to access the test server securely. def load_test_certs
Fixes reference to variable in the auth package
grpc_grpc
train
rb
c5b3a64d2c1eb0454fd053ebc21bd6ca0cd0a907
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,20 +4,20 @@ import account setup( - name = "django-user-accounts", - version = account.__version__, - author = "Brian Rosner", - author_email = "[email protected]", - description = "a Django user account app", - long_description = open("README.rst").read(), - license = "MIT", - url = "http://github.com/pinax/django-user-accounts", - packages = find_packages(), - install_requires = [ + name="django-user-accounts", + version=account.__version__, + author="Brian Rosner", + author_email="[email protected]", + description="a Django user account app", + long_description=open("README.rst").read(), + license="MIT", + url="http://github.com/pinax/django-user-accounts", + packages=find_packages(), + install_requires=[ "django-appconf==0.6", - "pytz==2013b" + "pytz==2013.7" ], - classifiers = [ + classifiers=[ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers",
bump pytz and lint dict
pinax_django-user-accounts
train
py