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
f044916f946e8ede94206f99e10eaaf443f63d28
diff --git a/test/integration/registerable_test.rb b/test/integration/registerable_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/registerable_test.rb +++ b/test/integration/registerable_test.rb @@ -203,7 +203,7 @@ class RegistrationTest < ActionController::IntegrationTest fill_in 'password', :with => 'pas123' fill_in 'password confirmation', :with => '' - fill_in 'current password', :with => '123456' + fill_in 'current password', :with => '12345678' click_button 'Update' assert_contain "Password doesn't match confirmation"
Use correct current_password in RegistrationTest of invalid confirmation In DatabaseAuthenticatable#update_with_password, password is now deleted if the current_password is invalid. dm-validations will not check the confirmation in that case, so this test was failing in dm-devise.
plataformatec_devise
train
rb
e445377e4ba0371d499be635b330ac979821d515
diff --git a/spec/support/pageflow/used_file_test_helper.rb b/spec/support/pageflow/used_file_test_helper.rb index <HASH>..<HASH> 100644 --- a/spec/support/pageflow/used_file_test_helper.rb +++ b/spec/support/pageflow/used_file_test_helper.rb @@ -1,10 +1,10 @@ module UsedFileTestHelper # creates a file with usage in entry # and sets the magic @entry-variable (always present in views) for file lookup - def create_used_file(model, entry: nil, **attributes) - file = create(model, attributes) + def create_used_file(model, *traits, entry: nil, **attributes) + file = create(model, *traits, attributes) @entry = entry || Pageflow::PublishedEntry.new(create(:entry, :published)) usage = file.usages.create(revision: @entry.revision) Pageflow::UsedFile.new(file, usage) end -end \ No newline at end of file +end
Allow passing traits to create_used_file Match FactoryBot API. REDMINE-<I>
codevise_pageflow
train
rb
a04980d2773feca8d769ea7496d14bd8df4e098f
diff --git a/lib/daru/date_time/offsets.rb b/lib/daru/date_time/offsets.rb index <HASH>..<HASH> 100644 --- a/lib/daru/date_time/offsets.rb +++ b/lib/daru/date_time/offsets.rb @@ -124,7 +124,7 @@ module Daru FREQ = 'S'.freeze def multiplier - 1.1574074074074073e-05 + 1.to_r / 24 / 60 / 60 end end @@ -139,7 +139,7 @@ module Daru FREQ = 'M'.freeze def multiplier - 0.0006944444444444445 + 1.to_r / 24 / 60 end end @@ -154,7 +154,7 @@ module Daru FREQ = 'H'.freeze def multiplier - 0.041666666666666664 + 1.to_r / 24 end end @@ -169,7 +169,7 @@ module Daru FREQ = 'D'.freeze def multiplier - 1.0 + 1 end end
Use Rational instead of Float (#<I>) This commit make it to be more clear what the value of `#multiplier` means.
SciRuby_daru
train
rb
76d18d147d71a79427edb93a9e011f4bf7f6d31a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,7 @@ setup(name='docrep', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Operating System :: OS Independent', ], keywords='docstrings docs docstring napoleon numpy reStructured text',
Add Python <I> as Programming Language [skip ci]
Chilipp_docrep
train
py
cc159d70902d29acdd0dc070649686c080643d72
diff --git a/packages/insomnia-app/app/ui/components/modals/request-switcher-modal.js b/packages/insomnia-app/app/ui/components/modals/request-switcher-modal.js index <HASH>..<HASH> 100644 --- a/packages/insomnia-app/app/ui/components/modals/request-switcher-modal.js +++ b/packages/insomnia-app/app/ui/components/modals/request-switcher-modal.js @@ -259,7 +259,7 @@ class RequestSwitcherModal extends React.PureComponent<Props, State> { this.setState({ searchString, - activeIndex: indexOfFirstNonActiveRequest, + activeIndex: indexOfFirstNonActiveRequest >= 0 ? indexOfFirstNonActiveRequest : 0, matchedRequests: (matchedRequests: Array<any>).slice(0, maxRequests), matchedWorkspaces: matchedWorkspaces.slice(0, maxWorkspaces), });
Fix request switcher active index when only workspaces match
getinsomnia_insomnia
train
js
c6a239763d3251591223d90b84e2d7e27d8f16c2
diff --git a/lib/gofer.js b/lib/gofer.js index <HASH>..<HASH> 100644 --- a/lib/gofer.js +++ b/lib/gofer.js @@ -96,7 +96,7 @@ function preventComplexMerge(objValue, srcValue) { return srcValue || objValue; } - return mergeWith(objValue, srcValue, preventComplexMerge); + return mergeWith({}, objValue, srcValue, preventComplexMerge); } Gofer.prototype._prepareOptions =
fix: Prevent mutation of defaults
groupon_gofer
train
js
ca1634575ee582fcb51738165fcf5b2809191526
diff --git a/broadlink/__init__.py b/broadlink/__init__.py index <HASH>..<HASH> 100644 --- a/broadlink/__init__.py +++ b/broadlink/__init__.py @@ -139,6 +139,7 @@ SUPPORTED_TYPES = { lb1: { 0x5043: ("SB800TD", "Broadlink (OEM)"), 0x504E: ("LB1", "Broadlink"), + 0x606E: ("SB500TD", "Broadlink (OEM)"), 0x60C7: ("LB1", "Broadlink"), 0x60C8: ("LB1", "Broadlink"), 0x6112: ("LB1", "Broadlink"),
Add support for Clas Ohlson SL-2 E<I> (0x<I>) (#<I>)
mjg59_python-broadlink
train
py
166816080196d241e7d571faa458c29646ad3f5c
diff --git a/src/Knp/DoctrineBehaviors/Model/Timestampable/Timestampable.php b/src/Knp/DoctrineBehaviors/Model/Timestampable/Timestampable.php index <HASH>..<HASH> 100644 --- a/src/Knp/DoctrineBehaviors/Model/Timestampable/Timestampable.php +++ b/src/Knp/DoctrineBehaviors/Model/Timestampable/Timestampable.php @@ -23,14 +23,14 @@ trait Timestampable * * @ORM\Column(type="datetime", nullable=true) */ - private $createdAt; + protected $createdAt; /** * @var DateTime $updatedAt * * @ORM\Column(type="datetime", nullable=true) */ - private $updatedAt; + protected $updatedAt; /** * Returns createdAt value.
Update src/Knp/DoctrineBehaviors/Model/Timestampable/Timestampable.php Change $createdAt, $updatedAt to protected so that it can be used in abstract class
KnpLabs_DoctrineBehaviors
train
php
18650ec3760d6293ad56fa70c3eabddcb24ccf02
diff --git a/src/main/java/org/urish/gwtit/dev/linker/GwtTitaniumLinker.java b/src/main/java/org/urish/gwtit/dev/linker/GwtTitaniumLinker.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/urish/gwtit/dev/linker/GwtTitaniumLinker.java +++ b/src/main/java/org/urish/gwtit/dev/linker/GwtTitaniumLinker.java @@ -50,6 +50,10 @@ public class GwtTitaniumLinker extends AbstractLinker { out.newline(); // grab compilation result Set<CompilationResult> results = artifacts.find(CompilationResult.class); + if (results.size() == 0) { + logger.log(TreeLogger.WARN, "Requested 0 permutations"); + return toReturn; + } if (results.size() != 1) { logger.log(TreeLogger.ERROR, "The module must have exactly one distinct" + " permutation when using the " + getDescription() + " Linker.", null);
Support for 0 permutations mode in the GWT Titanium Linker
urish_gwt-titanium
train
java
c43618754d27273f3a64ff5d2c6ed5c96125e888
diff --git a/ansible/plugins/lookup/hashivault.py b/ansible/plugins/lookup/hashivault.py index <HASH>..<HASH> 100755 --- a/ansible/plugins/lookup/hashivault.py +++ b/ansible/plugins/lookup/hashivault.py @@ -61,7 +61,7 @@ class LookupModule(LookupBase): params['username'] = self._get_environment(environments, 'VAULT_USER') params['password'] = self._get_environment(environments, 'VAULT_PASSWORD') else: - params['token'] = hashivault_default_token() + params['token'] = self._get_environment(environments, 'VAULT_TOKEN', hashivault_default_token()) return params
Add support of token from ansible environment
TerryHowe_ansible-modules-hashivault
train
py
4f81d3d51b537e51c7d90f15a6448864ac2db6ce
diff --git a/shared/archive_linux.go b/shared/archive_linux.go index <HASH>..<HASH> 100644 --- a/shared/archive_linux.go +++ b/shared/archive_linux.go @@ -85,7 +85,7 @@ func Unpack(file string, path string, blockBackend bool, runningInUserns bool, t } // Check if we're running out of space - if int64(fs.Bfree) < int64(2*fs.Bsize) { + if int64(fs.Bfree) < 10 { if blockBackend { return fmt.Errorf("Unable to unpack image, run out of disk space (consider increasing your pool's volume.size)") } else {
shared/archive: Fix out of space logic Closes #<I>
lxc_lxd
train
go
c98fbe0736b8f6e720d3c2e5210645c9f81a8822
diff --git a/templates/refinery/edge.rb b/templates/refinery/edge.rb index <HASH>..<HASH> 100644 --- a/templates/refinery/edge.rb +++ b/templates/refinery/edge.rb @@ -1,8 +1,9 @@ gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git' run 'bundle install' +rake 'db:create' generate 'refinery:cms' rake 'railties:install:migrations' -rake 'db:create db:migrate' +rake 'db:migrate' append_file 'Gemfile' do "
rake db:create needs to run before rails g refinery:cms
refinery_refinerycms
train
rb
e73045dbddbd5e1650520a8656efd20ff6dda8be
diff --git a/jwt/__init__.py b/jwt/__init__.py index <HASH>..<HASH> 100644 --- a/jwt/__init__.py +++ b/jwt/__init__.py @@ -220,13 +220,14 @@ def load(jwt): def verify_signature(payload, signing_input, header, signature, key='', verify_expiration=True, leeway=0): try: - key = prepare_key_methods[header['alg']](key) - if header['alg'].startswith('HS'): - expected = verify_methods[header['alg']](signing_input, key) + algorithm = header['alg'].upper() + key = prepare_key_methods[algorithm](key) + if algorithm.startswith('HS'): + expected = verify_methods[algorithm](signing_input, key) if not constant_time_compare(signature, expected): raise DecodeError("Signature verification failed") else: - if not verify_methods[header['alg']](signing_input, key, signature): + if not verify_methods[algorithm](signing_input, key, signature): raise DecodeError("Signature verification failed") except KeyError: raise DecodeError("Algorithm not supported")
Allow algorithm names to be upper- or lower-case The standard doesn't seem to specify whether algorithm names must be capitalized or lower-case. I had an issue with spurious failures due to a lower-case algorithm name ("hs<I>"), so here is a patch that converts the incoming name to capital letters before looking it up in the algorithm dictionary.
jpadilla_pyjwt
train
py
e8de280f7b74c8fd9033e0d8446e181ff66a062d
diff --git a/salt/loader/lazy.py b/salt/loader/lazy.py index <HASH>..<HASH> 100644 --- a/salt/loader/lazy.py +++ b/salt/loader/lazy.py @@ -213,7 +213,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): - singletons (per tag) """ - mod_dict_class = salt.utils.odict.OrderedDict + mod_dict_class = dict def __init__( self,
Use python's default dictionary implementation. No need to force order.
saltstack_salt
train
py
2643e89340dbbd7d18d60d1025f709255f36244b
diff --git a/src/IO/GeoJSON/Feature.php b/src/IO/GeoJSON/Feature.php index <HASH>..<HASH> 100644 --- a/src/IO/GeoJSON/Feature.php +++ b/src/IO/GeoJSON/Feature.php @@ -63,7 +63,7 @@ final class Feature public function withProperties(?stdClass $properties): Feature { $that = clone $this; - $this->properties = $properties; + $that->properties = $properties; return $that; }
Fix Feature::withProperties() setting value on the wrong object
brick_geo
train
php
d1332acbd8abec8baaa8efef605bfcab2fc12a0f
diff --git a/mocha.js b/mocha.js index <HASH>..<HASH> 100644 --- a/mocha.js +++ b/mocha.js @@ -4544,16 +4544,17 @@ Runner.prototype.uncaught = function(err){ Runner.prototype.run = function(fn){ var self = this - , fn = fn || function(){}; + , fn = fn || function(){} + , uncaught = function(err){ + self.uncaught(err); + }; debug('start'); // callback this.on('end', function(){ debug('end'); - process.removeListener('uncaughtException', function(err){ - self.uncaught(err); - }); + process.removeListener('uncaughtException', uncaught); fn(self.failures); }); @@ -4565,9 +4566,7 @@ Runner.prototype.run = function(fn){ }); // uncaught exception - process.on('uncaughtException', function(err){ - self.uncaught(err); - }); + process.on('uncaughtException', uncaught); return this; };
Update built mocha.js file
mochajs_mocha
train
js
5071bd6d0c8f68481ae8328828342eea0f6998c4
diff --git a/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java b/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java index <HASH>..<HASH> 100644 --- a/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java +++ b/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java @@ -759,7 +759,7 @@ public class OrganizationResourceImpl implements IOrganizationResource { ClientVersionBean avb; avb = storage.getClientVersion(organizationId, clientId, version); if (avb == null) { - throw ExceptionFactory.clientNotFoundException(clientId); + throw ExceptionFactory.clientVersionNotFoundException(clientId, version); } if (avb.getStatus() == ClientStatus.Retired) { throw ExceptionFactory.invalidClientStatusException();
fix for APIMAN-<I>
apiman_apiman
train
java
ed78941f10a37ff9e4e0bb770993f6db84983326
diff --git a/picklable_itertools/__init__.py b/picklable_itertools/__init__.py index <HASH>..<HASH> 100644 --- a/picklable_itertools/__init__.py +++ b/picklable_itertools/__init__.py @@ -283,8 +283,11 @@ class islice(BaseItertool): self._iterable = _iter(iterable) i = 0 while i < start: - next(self._iterable) - i += 1 + try: + next(self._iterable) + i += 1 + except StopIteration: + break self._stop = stop - start self._step = step diff --git a/tests/__init__.py b/tests/__init__.py index <HASH>..<HASH> 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -175,3 +175,5 @@ def test_islice(): yield (verify_same, islice, _islice, None, [1, 2, 3], 0, 3, 2) yield (verify_same, islice, _islice, None, [1, 2, 3, 4, 5], 1, 4, 3) yield (verify_same, islice, _islice, None, [1, 2, 3, 4, 5], -2, 9, 4) + yield (verify_same, islice, _islice, None, [1, 2, 3], 4, 9) + yield (verify_same, islice, _islice, None, [1, 2, 3], 0, 9, 5)
Fix bug where the starting point is beyond the end of the iterator
mila-iqia_picklable-itertools
train
py,py
c0be224e26b200a66f2639952f5a4facf81aeb97
diff --git a/satpy/resample.py b/satpy/resample.py index <HASH>..<HASH> 100644 --- a/satpy/resample.py +++ b/satpy/resample.py @@ -577,8 +577,8 @@ class NativeResampler(BaseResampler): out_shape = target_geo_def.shape in_shape = data.shape - y_repeats = out_shape[y_axis] / float(in_shape[y_axis]) - x_repeats = out_shape[x_axis] / float(in_shape[x_axis]) + y_repeats = out_shape[0] / float(in_shape[y_axis]) + x_repeats = out_shape[1] / float(in_shape[x_axis]) repeats = { y_axis: y_repeats, x_axis: x_repeats, @@ -597,6 +597,9 @@ class NativeResampler(BaseResampler): coords['y'] = y_coord if 'x' in data.coords: coords['x'] = x_coord + for dim in data.dims: + if dim not in ['y', 'x'] and dim in data.coords: + coords[dim] = data.coords[dim] return xr.DataArray(d_arr, dims=data.dims,
Fix native resampler for arrays with more than 2 dimensions
pytroll_satpy
train
py
707a735487b0b03294f56147f6422363bed8c5da
diff --git a/src/js/components/Select/Select.js b/src/js/components/Select/Select.js index <HASH>..<HASH> 100644 --- a/src/js/components/Select/Select.js +++ b/src/js/components/Select/Select.js @@ -399,6 +399,7 @@ const Select = forwardRef( {selectValue || displayLabelKey} <HiddenInput type="text" + name={name} id={id ? `${id}__input` : undefined} value={inputValue} ref={inputRef}
fix for issue #<I> (#<I>)
grommet_grommet
train
js
a963cd09601f94880dc14c572d15a697d7e98298
diff --git a/src/Frozennode/Administrator/Fields/Relationships/Relationship.php b/src/Frozennode/Administrator/Fields/Relationships/Relationship.php index <HASH>..<HASH> 100644 --- a/src/Frozennode/Administrator/Fields/Relationships/Relationship.php +++ b/src/Frozennode/Administrator/Fields/Relationships/Relationship.php @@ -72,7 +72,7 @@ abstract class Relationship extends Field { $options['self_relationship'] = $relationship->getRelated()->getTable() === $model->getTable(); //make sure the options filter is set up - $options['options_filter'] = $this->validator->arrayGet($options, 'options_filter', function() {}); + $options['options_filter'] = $this->validator->arrayGet($options, 'options_filter') ?: function() {}; //set up and check the constraints $this->setUpConstraints($options);
fixing weird legacy issue with array_get default argument (closes #<I>)
FrozenNode_Laravel-Administrator
train
php
ef88c5024bbb172da513f2cbaa268c14ce2847ee
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -51,10 +51,10 @@ setup( "toolz>=0.9.0,<1.0.0;implementation_name=='pypy'", "cytoolz>=0.9.0,<1.0.0;implementation_name=='cpython'", 'eth-keys>=0.2.0b3,<1', - 'eth-tester>=0.1.0b24,<0.1.0b25', + 'eth-tester==0.1.0b26', 'eth-utils>=1.0.2,<2', 'jsonschema>=2.6.0,<3', - 'py-evm==0.2.0a16', + 'py-evm==0.2.0a18', 'py-solc>=2.1.0,<3', 'rlp>=1.0.1,<2', 'web3>=4.2.1,<5',
Remove bytecode compilation if bytecode field not in manifest
ethpm_py-ethpm
train
py
48005898c2d57221d99b088c325311b1549f5c1f
diff --git a/src/game.js b/src/game.js index <HASH>..<HASH> 100644 --- a/src/game.js +++ b/src/game.js @@ -220,7 +220,7 @@ frameRate = ~~(0.5 + 60 / me.sys.fps); // set step size based on the updatesPerSecond - stepSize = (1000 / Math.min(me.sys.updatesPerSecond, me.sys.fps)); + stepSize = (1000 / me.sys.updatesPerSecond); accumulator = 0.0; // display should always re-draw when update speed doesn't match fps
Allow updates to run faster than draw calls
melonjs_melonJS
train
js
fca0df28e931f3243563a8e4f1670113bcb57f4f
diff --git a/htlcswitch/switch.go b/htlcswitch/switch.go index <HASH>..<HASH> 100644 --- a/htlcswitch/switch.go +++ b/htlcswitch/switch.go @@ -1402,11 +1402,22 @@ func (s *Switch) htlcForwarder() { continue } + // If the diff of num updates is negative, then some + // links may have been unregistered from the switch, so + // we'll update our stats to only include our registered + // links. + if int64(diffNumUpdates) < 0 { + totalNumUpdates = newNumUpdates + totalSatSent = newSatSent + totalSatRecv = newSatRecv + continue + } + // Otherwise, we'll log this diff, then accumulate the // new stats into the running total. - log.Infof("Sent %v satoshis received %v satoshis "+ - "in the last 10 seconds (%v tx/sec)", - int64(diffSatSent), int64(diffSatRecv), + log.Infof("Sent %d satoshis and received %d satoshis "+ + "in the last 10 seconds (%f tx/sec)", + diffSatSent, diffSatRecv, float64(diffNumUpdates)/10) totalNumUpdates += diffNumUpdates
htlcswitch: fix periodic calculation of satoshis sent/received In this commit, we fix an issue where users would be displayed negative amounts of satoshis either as sent or received. This can happen if the total amount of channel updates decreases due to channels being closed. To fix this, we properly handle a negative difference of channel updates by updating the stats logged to only include active channels/links to the switch.
lightningnetwork_lnd
train
go
3920ed3fd8cb9c2264b31c47064185891aa19461
diff --git a/Controller/ResourceController.php b/Controller/ResourceController.php index <HASH>..<HASH> 100644 --- a/Controller/ResourceController.php +++ b/Controller/ResourceController.php @@ -469,7 +469,7 @@ class ResourceController extends Controller $this->isGrantedOr403($configuration, ResourceActions::UPDATE); $resource = $this->findOr404($configuration); - if ($configuration->isCsrfProtectionEnabled() && !$this->isCsrfTokenValid($resource->getId(), $request->get('_csrf_token'))) { + if ($configuration->isCsrfProtectionEnabled() && !$this->isCsrfTokenValid((string) $resource->getId(), $request->get('_csrf_token'))) { throw new HttpException(Response::HTTP_FORBIDDEN, 'Invalid CSRF token.'); }
Exception while apply refund transition Admin refund action throws exception "Argument 1 passed to Symfony\Bundle\FrameworkBundle\Controller\Controller::isCsrfTokenValid() must be of the type string, integer given"
Sylius_SyliusResourceBundle
train
php
2eacfcaa00738f248c4be3db188860938ca9c498
diff --git a/src/WebDriver/Session.php b/src/WebDriver/Session.php index <HASH>..<HASH> 100644 --- a/src/WebDriver/Session.php +++ b/src/WebDriver/Session.php @@ -52,6 +52,8 @@ class Session * a value. * * @param string $url A URL to access + * + * @return Session */ public function open($url) { @@ -59,6 +61,8 @@ class Session $response = new Response(); $this->client->process($request, $response); + + return $this; } /**
Session::open is fluid
alexandresalome_php-webdriver
train
php
7e076f6a04d97aec4914438846715c0f7deffb6d
diff --git a/console/command/Help.php b/console/command/Help.php index <HASH>..<HASH> 100644 --- a/console/command/Help.php +++ b/console/command/Help.php @@ -155,13 +155,12 @@ class Help extends \lithium\console\Command { $methods = Inspector::methods($class)->map($map, array('collect' => false)); $results = array(); - foreach ($methods as $method) { + foreach (array_filter($methods) as $method) { $comment = Docblock::comment($method['docComment']); $name = $method['name']; $description = $comment['description']; $args = $method['args']; - $return = null; foreach ($args as &$arg) {
Fixing issue in `Help` command to filter out protected methods.
UnionOfRAD_lithium
train
php
48ff0c4928081796efa3a9e6d763101dc0ee8d6a
diff --git a/src/Form/Form.php b/src/Form/Form.php index <HASH>..<HASH> 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -2,7 +2,6 @@ namespace Sco\Admin\Form; - use Illuminate\Database\Eloquent\Model; use Sco\Admin\Contracts\Form\Elements\ElementInterface; use Sco\Admin\Contracts\Form\FormInterface;
Apply fixes from StyleCI (#3)
ScoLib_admin
train
php
219774a5851d9be61ca881f3e0a2efdb8aab86d6
diff --git a/src/litmus.js b/src/litmus.js index <HASH>..<HASH> 100644 --- a/src/litmus.js +++ b/src/litmus.js @@ -709,7 +709,6 @@ pkg.define('litmus', ['promise'], function (promise) { return handle.finished; })), function () { - run.state = finishedState; if (! run.plannedAssertionsRan()) { run.addException(new Error('wrong number of tests ran')); } @@ -717,6 +716,7 @@ pkg.define('litmus', ['promise'], function (promise) { run.failed = false; run.passed = true; } + run.state = finishedState; run.finished.resolve(); } ); @@ -751,7 +751,7 @@ pkg.define('litmus', ['promise'], function (promise) { */ TestRun.prototype.addException = function (exception) { - this._checkRunning('exception'); + this._checkRunning('exception (' + (exception.message || exception) + ')'); this.exceptions.push(exception); this._failRun(exception); };
Add exception to message about exceptions being added after test run has finished. Place wrong number of tests exception before the state is changed to finished.
usenode_litmus.js
train
js
a7eb271db02130ee8c7cf3d7688d4857f8b90525
diff --git a/src/scene.js b/src/scene.js index <HASH>..<HASH> 100755 --- a/src/scene.js +++ b/src/scene.js @@ -939,7 +939,7 @@ export default class Scene { this.config_path = config_path || Utils.pathForURL(this.config_source); } else { - this.config_path = null; + this.config_path = config_path; } return SceneLoader.loadScene(this.config_source, this.config_path).then(config => { diff --git a/src/utils/utils.js b/src/utils/utils.js index <HASH>..<HASH> 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -55,9 +55,9 @@ Utils.addBaseURL = function (url, base) { Utils.pathForURL = function (url) { if (url.search(/^(data|blob):/) === -1) { - return url.substr(0, url.lastIndexOf('/') + 1); + return url.substr(0, url.lastIndexOf('/') + 1) || './'; } - return ''; + return './'; }; Utils.cacheBusterForUrl = function (url) {
fix path expansion regression loading from local files
tangrams_tangram
train
js,js
761099358c0d49eb4c533d4dfc8748cec74a170c
diff --git a/controllers/socket/handler/player.go b/controllers/socket/handler/player.go index <HASH>..<HASH> 100644 --- a/controllers/socket/handler/player.go +++ b/controllers/socket/handler/player.go @@ -215,7 +215,7 @@ func (Player) PlayerDisableTwitchBot(so *wsevent.Client, _ struct{}) interface{} return emptySuccess } -func (Player) PlayerGetRecentLobbies(so *wsevent.Client, args struct { +func (Player) PlayerRecentLobbies(so *wsevent.Client, args struct { SteamID *string `json:"steamid"` }) interface{} { var p *player.Player
Rename PlayerGetRecentLobbies -> PlayerRecentLobbies
TF2Stadium_Helen
train
go
ff20a4496bf2fcf76b4c246b92a882d557f9314f
diff --git a/test/tabbable.test.js b/test/tabbable.test.js index <HASH>..<HASH> 100644 --- a/test/tabbable.test.js +++ b/test/tabbable.test.js @@ -93,7 +93,20 @@ describe('tabbable', function() { }); it('non-linear', function() { + var originalSort = Array.prototype.sort; + + // This sort piggy-backs on the default Array.prototype.sort, but always + // orders elements that were compared to be equal in reverse order of their + // index in the original array. We do this to simulate browsers who do not + // use a stable sort algorithm in their implementation. + Array.prototype.sort = function(compareFunction) { + return originalSort.call(this, function(a, b) { + var comparison = compareFunction ? compareFunction(a, b) : a - b; + return comparison || this.indexOf(b) - this.indexOf(a); + }) + }; var actual = fixture('non-linear').getTabbableIds(); + Array.prototype.sort = originalSort; var expected = [ // 1 'input-1',
Enhanced the non-linear test case to simulate an unstable Array sort
davidtheclark_tabbable
train
js
8bd58aa44187774cbe15a3e8e45833ba3d8af987
diff --git a/openid/store/sqlstore.py b/openid/store/sqlstore.py index <HASH>..<HASH> 100644 --- a/openid/store/sqlstore.py +++ b/openid/store/sqlstore.py @@ -1,6 +1,10 @@ """ This module contains C{L{OpenIDStore}} implementations that use various SQL databases to back them. + +Example of how to initialize a store database:: + + python -c 'from openid.store import sqlstore; import pysqlite2.dbapi2; sqlstore.SQLiteStore(pysqlite2.dbapi2.connect("cstore.db")).createTables()' """ import re import time
[project @ store.sqlstore: add example to docstring of a one-liner for store creation] This should really probably be a script and/or incorporated into the install documentation.
openid_python-openid
train
py
347931e9bf082b7c49c0529a01db3f91b25090fa
diff --git a/src/main/java/org/dasein/cloud/openstack/nova/os/NovaLocationServices.java b/src/main/java/org/dasein/cloud/openstack/nova/os/NovaLocationServices.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dasein/cloud/openstack/nova/os/NovaLocationServices.java +++ b/src/main/java/org/dasein/cloud/openstack/nova/os/NovaLocationServices.java @@ -166,7 +166,7 @@ public class NovaLocationServices implements DataCenterServices { if( region == null ) { throw new CloudException("No such region: " + providerRegionId); } - // if host aggregates is not configured, let's look in the hosts + // let's look in the hosts for( String hostZone : getDCNamesFromHosts() ) { dataCenters.add(constructDataCenter(hostZone, providerRegionId)); }
Removed zone look-up in host aggregate
dasein-cloud_dasein-cloud-openstack
train
java
357a50ee41397834cb3816cd42094a6425dec881
diff --git a/bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js b/bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js +++ b/bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js @@ -54,7 +54,7 @@ eclipse.GitCommitNavigator = (function() { dojo.place(b, progress, "last"); dojo.place(document.createTextNode("..."), progress, "last"); - self = this; + var self = this; eclipse.gitCommandUtils.updateNavTools(this.registry, this, this.toolbarId, this.selectionToolsId, treeRoot); @@ -104,7 +104,7 @@ eclipse.FileRenderer = (function() { var incomingCommit = false; - if (this.scopedCommits) + if (this.scopedCommits != null && this.scopedCommits.length > 0) this.scopedCommits.forEach(function(commit){ if (item.Name === commit.Name){ incomingCommit = true;
Log UI for Remote does not disaply commits [fixed]
eclipse_orion.client
train
js
edfb6d65d67074a62da60c6a7d252c61564d1b03
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -219,7 +219,9 @@ $.powerTip = { * @return {jQuery|Element} The original jQuery object or DOM Element. */ show: function apiShowTip(element, event) { - if (event) { + // if we were supplied an event with a pageX property then it is a mouse + // event with the information necessary to do hover intent testing + if (event && typeof event.pageX === 'number') { trackMouse(event); session.previousX = event.pageX; session.previousY = event.pageY;
Added mouse event checking to API show() method. This will prevent this function from throwing an error if it receives a non-mouse event.
stevenbenner_jquery-powertip
train
js
eebd46d662410bea9fa6af038ec857c9cbaca8a3
diff --git a/vendor/assets/javascripts/bootstrap.js b/vendor/assets/javascripts/bootstrap.js index <HASH>..<HASH> 100644 --- a/vendor/assets/javascripts/bootstrap.js +++ b/vendor/assets/javascripts/bootstrap.js @@ -2022,4 +2022,6 @@ }) -}(window.jQuery); \ No newline at end of file +}(window.jQuery); + +$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
Quick'n'dirty patch to address touchscreen issues The code taken from here: <URL>
huginn_huginn
train
js
cbdb6bc064e02225b37071efe65a9fa32d6fbd0b
diff --git a/mbed/mbed.py b/mbed/mbed.py index <HASH>..<HASH> 100644 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -1196,10 +1196,10 @@ class Program(object): paths = [] mbed_os_path = self.get_os_dir() if mbed_os_path: + paths.append([mbed_os_path, 'tools']) paths.append([mbed_os_path]) - paths.append([mbed_os_path, 'core']) # mbed-os not identified but tools found under cwd/tools - paths.append([self.path, 'core']) + paths.append([self.path, 'tools']) # mbed Classic deployed tools paths.append([self.path, '.temp', 'tools']) # current dir
Support requirements.txt under the tools directory
ARMmbed_mbed-cli
train
py
15ecbccbd3ec36fa96ea69d76bf4965705710290
diff --git a/src/Providers/RouteServiceProvider.php b/src/Providers/RouteServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Providers/RouteServiceProvider.php +++ b/src/Providers/RouteServiceProvider.php @@ -5,6 +5,7 @@ namespace TypiCMS\Modules\Users\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Routing\Router; use Illuminate\Support\Facades\Route; +use TypiCMS\Modules\Core\Http\Middleware\SetLocale; class RouteServiceProvider extends ServiceProvider { @@ -28,7 +29,7 @@ class RouteServiceProvider extends ServiceProvider /* * Front office routes */ - $router->middleware('web')->group(function (Router $router) { + $router->middleware('web', SetLocale::class)->group(function (Router $router) { foreach (locales() as $lang) { if (config('typicms.register')) { // Registration
SetLocale middleware added.
TypiCMS_Users
train
php
d5fba7906dfb2ed02d3d3c88e63594fc69eefed7
diff --git a/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiver.java b/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiver.java index <HASH>..<HASH> 100644 --- a/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiver.java +++ b/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiver.java @@ -406,7 +406,7 @@ public final class PartitionReceiver extends ClientEntity implements IReceiverSe totalMilliSeconds = Long.MAX_VALUE; if (TRACE_LOGGER.isWarnEnabled()) { TRACE_LOGGER.warn( - String.format("receiverPath[%s], action[createReceiveLink], warning[starting receiver from epoch+Long.Max]", this.internalReceiver.getReceivePath())); + "receiver not yet created, action[createReceiveLink], warning[starting receiver from epoch+Long.Max]"); } }
Modifying traces in PartitionReceiver to avoid NPE (#<I>)
Azure_azure-sdk-for-java
train
java
d616529afc6477226f2941ff03f8da9e91e5ec4d
diff --git a/category.go b/category.go index <HASH>..<HASH> 100644 --- a/category.go +++ b/category.go @@ -39,9 +39,9 @@ func (c *commandCategories) AddCommand(category string, command *Command) { } func (c *commandCategories) Categories() []CommandCategory { - ret := []CommandCategory{} - for _, cat := range *c { - ret = append(ret, cat) + ret := make([]CommandCategory, len(*c)) + for i, cat := range *c { + ret[i] = cat } return ret }
Use make once instead of a loop with append
urfave_cli
train
go
a9cf5f952e18e528dc977bc7938b22a8ed5a2c90
diff --git a/tests/json-fixtures/test_transactions.py b/tests/json-fixtures/test_transactions.py index <HASH>..<HASH> 100644 --- a/tests/json-fixtures/test_transactions.py +++ b/tests/json-fixtures/test_transactions.py @@ -34,6 +34,9 @@ from eth.vm.forks.constantinople.transactions import ( from eth.vm.forks.petersburg.transactions import ( PetersburgTransaction ) +from eth.vm.forks.istanbul.transactions import ( + IstanbulTransaction +) from eth_typing.enums import ( ForkName @@ -101,6 +104,8 @@ def fixture_transaction_class(fixture_data): return ConstantinopleTransaction elif fork_name == "Petersburg": return PetersburgTransaction + elif fork_name == ForkName.Istanbul: + return IstanbulTransaction elif fork_name == ForkName.Metropolis: pytest.skip("Metropolis Transaction class has not been implemented") else:
test: Add IstanbulTransaction to json tests
ethereum_py-evm
train
py
06e4c28ba5c1af63c192d3e4740c217541d91139
diff --git a/src/org/joml/Math.java b/src/org/joml/Math.java index <HASH>..<HASH> 100644 --- a/src/org/joml/Math.java +++ b/src/org/joml/Math.java @@ -243,7 +243,23 @@ public class Math { return java.lang.Math.acos(r); } + /** + * https://math.stackexchange.com/questions/1098487/atan2-faster-approximation/1105038#answer-1105038 + */ + private static double fastAtan2(double y, double x) { + double ax = x >= 0.0 ? x : -x, ay = y >= 0.0 ? y : -y; + double a = min(ax, ay) / max(ax, ay); + double s = a * a; + double r = ((-0.0464964749 * s + 0.15931422) * s - 0.327622764) * s * a + a; + if (ay > ax) + r = 1.57079637 - r; + if (x < 0.0) + r = 3.14159274 - r; + return y >= 0 ? r : -r; + } public static double atan2(double y, double x) { + if (Options.FASTMATH) + return fastAtan2(y, x); return java.lang.Math.atan2(y, x); }
Add Math.atan2() approximation
JOML-CI_JOML
train
java
4e847ce02075d621b16478da892a2c7b4ef357dd
diff --git a/util/pkg/vfs/s3context.go b/util/pkg/vfs/s3context.go index <HASH>..<HASH> 100644 --- a/util/pkg/vfs/s3context.go +++ b/util/pkg/vfs/s3context.go @@ -130,7 +130,9 @@ func (s *S3Context) getRegionForBucket(bucket string) (string, error) { var response *s3.GetBucketLocationOutput s3Client, err := s.getClient(awsRegion) - + if err != nil { + return "", fmt.Errorf("error connecting to S3: %s", err) + } // Attempt one GetBucketLocation call the "normal" way (i.e. as the bucket owner) response, err = s3Client.GetBucketLocation(request)
Fix swallowed err variable in vfs package
kubernetes_kops
train
go
864f14344ea05d133149102a0ccd5ebba33b07e5
diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -583,16 +583,50 @@ class Page return $this->content; } + /** + * Get the contentMeta array and initialize content first if it's not already + * + * @return mixed + */ + public function contentMeta() + { + if ($this->content === null) { + $this->content(); + } + return $this->getContentMeta(); + } + + /** + * Add an entry to the page's contentMeta array + * + * @param $name + * @param $value + */ public function addContentMeta($name, $value) { $this->content_meta[$name] = $value; } + /** + * Return the whole contentMeta array as it currently stands + * + * @return mixed + */ public function getContentMeta() { return $this->content_meta; } + /** + * Sets the whole content meta array in one shot + * + * @param $content_meta + * @return mixed + */ + public function setContentMeta($content_meta) + { + return $this->content_meta = $content_meta; + } /** * Process the Markdown content. Uses Parsedown or Parsedown Extra depending on configuration
Add method to get contentMeta and initialize content if needed
getgrav_grav
train
php
155f1afe7a2c9a8e6863736f4ec793bb359bc075
diff --git a/bin/extras/users/public-routes.js b/bin/extras/users/public-routes.js index <HASH>..<HASH> 100644 --- a/bin/extras/users/public-routes.js +++ b/bin/extras/users/public-routes.js @@ -331,6 +331,10 @@ module.exports = function(model, app, express, models) { //we email our user, notifying them that their password has been changed if (models.emails) { + + //bringing our new password into our user + user.password = password; + models.emails.send({ to: user.email, template: 'resetPassword',
corrected mail merge error with showing hashed password and not exposed password
haseebnqureshi_apiworks
train
js
7b8519f50ec842cd2ece4058259fc034ea3da0c9
diff --git a/libs/canvas.py b/libs/canvas.py index <HASH>..<HASH> 100644 --- a/libs/canvas.py +++ b/libs/canvas.py @@ -283,14 +283,12 @@ class Canvas(QWidget): if self.selectedVertex(): # A vertex is marked for selection. index, shape = self.hVertex, self.hShape shape.highlightVertex(index, shape.MOVE_VERTEX) + self.selectShape(shape) return for shape in reversed(self.shapes): if self.isVisible(shape) and shape.containsPoint(point): - shape.selected = True - self.selectedShape = shape + self.selectShape(shape) self.calculateOffsets(shape, point) - self.setHiding() - self.selectionChanged.emit(True) return def calculateOffsets(self, shape, point):
fix a bug to select a small bounding box
tzutalin_labelImg
train
py
3a3d57c6ba906fc544edea132d3286616ed3d167
diff --git a/scripts/convert5.3.php b/scripts/convert5.3.php index <HASH>..<HASH> 100755 --- a/scripts/convert5.3.php +++ b/scripts/convert5.3.php @@ -40,6 +40,10 @@ function convertCustom($filepath, &$file) array( 'if ($this->isFilter($tokenId))', 'if ($_this->isFilter($tokenId))' + ), + array( + 'protected function isFilter($tokenId)', + 'public function isFilter($tokenId)' ) ), 'FilterProcessingTest.php' => array(
Play nicer with PHP <I>
s9e_TextFormatter
train
php
8b9d3e7547c4832f4506251c56e70b650611b7bb
diff --git a/retrieval/scrape.go b/retrieval/scrape.go index <HASH>..<HASH> 100644 --- a/retrieval/scrape.go +++ b/retrieval/scrape.go @@ -505,7 +505,7 @@ mainLoop: // The append failed, probably due to a parse error. // Call sl.append again with an empty scrape to trigger stale markers. if _, _, err = sl.append([]byte{}, start); err != nil { - log.With("err", err).Error("failure append failed") + log.With("err", err).Error("append failed") } } @@ -524,6 +524,10 @@ mainLoop: close(sl.stopped) + sl.endOfRunStaleness(last, ticker, interval) +} + +func (sl *scrapeLoop) endOfRunStaleness(last time.Time, ticker *time.Ticker, interval time.Duration) { // Scraping has stopped. We want to write stale markers but // the target may be recreated, so we wait just over 2 scrape intervals // before creating them.
Put end of run staleness handler in seperate function. Improve log message.
prometheus_prometheus
train
go
ec9731bfaf0026c038e48b2596206413b98f8ab2
diff --git a/openid/message.py b/openid/message.py index <HASH>..<HASH> 100644 --- a/openid/message.py +++ b/openid/message.py @@ -369,8 +369,9 @@ class Message(object): namespace = self._fixNS(namespace) del self.args[(namespace, key)] -#XXX: testme! class NamespaceMap(object): + """Maintains a bijective map between namespace uris and aliases. + """ # namespaces that should use a certain alias (for # backwards-compatibility or beauty). If a URI in this dictionary # is added to the namespace map without an explicit desired name, @@ -388,9 +389,11 @@ class NamespaceMap(object): return self.alias_to_namespace.get(alias) def iterNamespaceURIs(self): + """Return an iterator over the namespace URIs""" return iter(self.namespace_to_alias) def iterAliases(self): + """Return an iterator over the aliases""" return iter(self.alias_to_namespace) def iteritems(self):
[project @ Add a couple doc strings.]
openid_python-openid
train
py
95dc9a58bf658326a21bdccd292d5e44e376dce3
diff --git a/src/Object/BaseApiResource.php b/src/Object/BaseApiResource.php index <HASH>..<HASH> 100644 --- a/src/Object/BaseApiResource.php +++ b/src/Object/BaseApiResource.php @@ -54,6 +54,18 @@ abstract class BaseApiResource extends BaseApiObject } /** + * @param array + * @return $this + */ + public function setData(array $data) + { + foreach ($data as $key => $value) { + $this->{$key} = $value; + } + return $this; + } + + /** * @return bool */ public function exists() diff --git a/src/Object/BaseObject.php b/src/Object/BaseObject.php index <HASH>..<HASH> 100644 --- a/src/Object/BaseObject.php +++ b/src/Object/BaseObject.php @@ -66,9 +66,7 @@ abstract class BaseObject */ public function setData(array $data) { - foreach ($data as $key => $value) { - $this->{$key} = $value; - } + $this->data = $data; return $this; }
S<I> Move setData with tracking to BaseApiResource object
ExpandOnline_klipfolio-api-php
train
php,php
c60f992c518853bd1f145fad8bd0f4f2ffa2581d
diff --git a/config/initializers/field_with_error_fix.rb b/config/initializers/field_with_error_fix.rb index <HASH>..<HASH> 100644 --- a/config/initializers/field_with_error_fix.rb +++ b/config/initializers/field_with_error_fix.rb @@ -1,3 +1,3 @@ ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| - "<span class=\"fieldWithErrors\">#{html_tag}</span>" + "<span class=\"fieldWithErrors\">#{html_tag}</span>".html_safe end
fix encoding on field with errors
refinery_refinerycms
train
rb
e88ec9eff09fae15b5bfb30392c826f0311608db
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -516,8 +516,11 @@ lib.watch = function(path) { if (!h) { // console.log('unknown changed file "'+p+'"') } else { - // console.log('Changed file "'+p+'"') - onChangedPath(h) + if (!statPath(p)) { + // File removed. Ignore. FIXME: Unload code ? + } else { + onChangedPath(h) + } } }) WATCHED_PATHS[filename] = watcher
Fixed bug: do not reload removed file.
lucidogen_lucy-live
train
js
cff48e65e2fbccde8ee9fef0707c70adcd1505dd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ install_requires = ['enum-compat'] setup( name='i3ipc', - version='1.3.0', + version='1.4.0', description='An improved Python library for i3wm extensions', long_description=long_description, url='https://github.com/acrisci/i3ipc-python',
Bump to version <I> Version <I> adds the following bugfixes and features: * Add container property 'floating' * Add container property 'focus' (the focus stack) * Add container info for window gaps * Use native byte order everywhere * Add descendents iterator to Con * Add `Con.find_instanced()` * Add documentation and tests * List descendents BFS * Allow usage from external event loops * bug: return command result in `Con.command()`
acrisci_i3ipc-python
train
py
9b7482afc5f5618e2cfc8c983ec556fff7a28094
diff --git a/controllers/ThemeController.php b/controllers/ThemeController.php index <HASH>..<HASH> 100644 --- a/controllers/ThemeController.php +++ b/controllers/ThemeController.php @@ -74,7 +74,7 @@ class ThemeController extends ApiController if ($return) return false; - throw new CHttpException(404, Yii::t('Api.Theme', 'Theme is not installed')); + return $this->returnError(200, Yii::t('Api.main', 'Theme is not installed'), false); } /**
Themes isInstalled now returns <I> instead of <I> when a theme is not installed
ciims_ciims-modules-api
train
php
af24410360b3a836ff2e7ef91333cb15e2e4f2e2
diff --git a/honcho/process.py b/honcho/process.py index <HASH>..<HASH> 100644 --- a/honcho/process.py +++ b/honcho/process.py @@ -210,8 +210,8 @@ class ProcessManager(object): def _enqueue_output(proc, queue): - if not proc.quiet: - for line in iter(proc.stdout.readline, b''): + for line in iter(proc.stdout.readline, b''): + if not proc.quiet: try: line = line.decode('utf-8') except UnicodeDecodeError as e: @@ -220,4 +220,4 @@ def _enqueue_output(proc, queue): if not line.endswith('\n'): line += '\n' queue.put((proc, line)) - proc.stdout.close() + proc.stdout.close()
process: Read stdout from "quiet" processes It seems that simply not reading data from the STDOUT of quiet processes could lead to all kinds of buffering problems. All we really need to achieve is silent output, so this commit moves the conditional inwards -- output is read, just not relayed by Honcho.
nickstenning_honcho
train
py
df8f23da21f25459ee3bfcf74a20f81591b3a418
diff --git a/spyder/widgets/variableexplorer/dataframeeditor.py b/spyder/widgets/variableexplorer/dataframeeditor.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/variableexplorer/dataframeeditor.py +++ b/spyder/widgets/variableexplorer/dataframeeditor.py @@ -14,7 +14,6 @@ Pandas DataFrame Editor Dialog """ # Third party imports -from pandas import DataFrame, DatetimeIndex, Series from qtpy import API from qtpy.compat import from_qvariant, to_qvariant from qtpy.QtCore import QAbstractTableModel, QModelIndex, Qt, Signal, Slot @@ -23,6 +22,8 @@ from qtpy.QtWidgets import (QApplication, QCheckBox, QDialogButtonBox, QDialog, QGridLayout, QHBoxLayout, QInputDialog, QLineEdit, QMenu, QMessageBox, QPushButton, QTableView, QHeaderView) + +from pandas import DataFrame, DatetimeIndex, Series import numpy as np # Local imports @@ -808,9 +809,7 @@ def test(): out = test_edit(df1.iloc[0]) assert_series_equal(result, out) - # Sorting large DataFrame takes time df1 = DataFrame(np.random.rand(100100, 10)) - df1.sort(columns=[0, 1], inplace=True) out = test_edit(df1) assert_frame_equal(out, df1)
Testing: Fix a couple of errors after Pandas <I> was released
spyder-ide_spyder
train
py
1bc8560a7dc11b11b8d3edf0828a21748f534d91
diff --git a/src/command.js b/src/command.js index <HASH>..<HASH> 100644 --- a/src/command.js +++ b/src/command.js @@ -50,7 +50,7 @@ var command = function(name, opts, cb) { if(matchedCommand) { var commandResult = matchedCommand.getValue(_.drop(cliArgs, 1), cliOpts, parsedOptions.success, parentName + ' ' + name, parentOptions.concat(flags)); if(utils.isError(commandResult)) { - console.log(matchedCommand.helpText(parentName + ' ' + name, parentOptions)); + console.log(matchedCommand.helpText(parentName + ' ' + name, parentOptions.concat(flags))); } } else { var parsedArgs = argument.parseArgs(args, cliArgs);
Subcommand usage: fix parent options passing
CleverCloud_cliparse-node
train
js
a2d3cdc82d4cce6ea8d701d9ea9addac2a7226fc
diff --git a/src/phpDocumentor/Descriptor/Cache/ProjectDescriptorMapper.php b/src/phpDocumentor/Descriptor/Cache/ProjectDescriptorMapper.php index <HASH>..<HASH> 100644 --- a/src/phpDocumentor/Descriptor/Cache/ProjectDescriptorMapper.php +++ b/src/phpDocumentor/Descriptor/Cache/ProjectDescriptorMapper.php @@ -70,7 +70,7 @@ class ProjectDescriptorMapper $settings = $this->igBinaryCompatibleCacheClear(self::KEY_SETTINGS, $e); } - if ($settings) { + if ($settings instanceof Settings) { $projectDescriptor->setSettings($settings); }
Make Settings import from Cache more resilient Sometimes the import of the cache fails and the settings will actually cause a fatal crash in the application. I have added a fix for this by making the check for settings more strict by verifying if the received object is actually a settings object instead of whether it is non-null
phpDocumentor_phpDocumentor2
train
php
63085b6ccd12953d210adcaef5b607b5fa21a5b6
diff --git a/backbone.js b/backbone.js index <HASH>..<HASH> 100644 --- a/backbone.js +++ b/backbone.js @@ -121,6 +121,7 @@ this.cid = _.uniqueId('c'); this.set(attributes || {}, {silent : true}); this._previousAttributes = _.clone(this.attributes); + if (this.initialize) this.initialize(attributes); }; // Attach all inheritable methods to the Model prototype. @@ -306,7 +307,8 @@ } this._boundOnModelEvent = _.bind(this._onModelEvent, this); this._reset(); - if (models) this.refresh(models,true); + if (models) this.refresh(models, {silent: true}); + if (this.initialize) this.initialize(models, options); }; // Define the Collection's inheritable methods. @@ -492,7 +494,7 @@ if (this.className) attrs.className = this.className; this.el = this.make(this.tagName, attrs); } - return this; + if (this.initialize) this.initialize(options); }; // jQuery lookup, scoped to DOM elements within the current view.
Calling 'initialize', if it is defined.
jashkenas_backbone
train
js
234fd8793b0582715e1b238e8ee354202d81dd3a
diff --git a/lib/simple_oauth/header.rb b/lib/simple_oauth/header.rb index <HASH>..<HASH> 100644 --- a/lib/simple_oauth/header.rb +++ b/lib/simple_oauth/header.rb @@ -6,6 +6,9 @@ require 'cgi' module SimpleOAuth class Header ATTRIBUTE_KEYS = [:callback, :consumer_key, :nonce, :signature_method, :timestamp, :token, :verifier, :version] unless defined? ::SimpleOAuth::Header::ATTRIBUTE_KEYS + + IGNORED_KEYS = [:consumer_secret, :token_secret] unless defined? ::SimpleOAuth::Header::IGNORED_KEYS + attr_reader :method, :params, :options class << self @@ -82,6 +85,7 @@ module SimpleOAuth def attributes matching_keys, extra_keys = options.keys.partition { |key| ATTRIBUTE_KEYS.include?(key) } + extra_keys -= IGNORED_KEYS if options[:ignore_extra_keys] || extra_keys.empty? Hash[options.select { |key, _value| matching_keys.include?(key) }.collect { |key, value| [:"oauth_#{key}", value] }] else
add IGNORED_KEYS for options used in signature calculations
laserlemon_simple_oauth
train
rb
01c8a7c2e3b1dfc3fa5bb679f03d9fd9e5b5ad7e
diff --git a/test/samples/stats/unparsable_example.rb b/test/samples/stats/unparsable_example.rb index <HASH>..<HASH> 100644 --- a/test/samples/stats/unparsable_example.rb +++ b/test/samples/stats/unparsable_example.rb @@ -1,2 +1 @@ -factory :<%= singular_name %> do -end +unparsable :<%=
Simplify file sample used for some tests
whitesmith_rubycritic
train
rb
dbaec2e0c55023b687a9f9fb710c884167e57233
diff --git a/nodeconductor/structure/executors.py b/nodeconductor/structure/executors.py index <HASH>..<HASH> 100644 --- a/nodeconductor/structure/executors.py +++ b/nodeconductor/structure/executors.py @@ -125,7 +125,7 @@ class SynchronizableUpdateExecutor(SynchronizableExecutorMixin, ErrorExecutorMix """ @classmethod - def pre_apply(cls, instance, async=True, **kwargs): + def pre_apply(cls, instance, **kwargs): instance.schedule_syncing() instance.save(update_fields=['state']) @@ -139,6 +139,6 @@ class SynchronizableDeleteExecutor(DeleteExecutorMixin, ErrorExecutorMixin, Base """ @classmethod - def pre_apply(cls, instance, async=True, **kwargs): + def pre_apply(cls, instance, **kwargs): instance.schedule_syncing() instance.save(update_fields=['state'])
Remove async kwarg from pre apply methods - nc-<I>
opennode_waldur-core
train
py
f288dc547568b1a0d391430131f2d63dedae5ac5
diff --git a/src/ClassMemberNode.php b/src/ClassMemberNode.php index <HASH>..<HASH> 100644 --- a/src/ClassMemberNode.php +++ b/src/ClassMemberNode.php @@ -15,6 +15,22 @@ class ClassMemberNode extends ParentNode { */ protected $value; + /** + * Creates a new class member. + * + * @param string $name + * The name of the member, with or without the leading $. + * @param \Pharborist\ExpressionNode $value + * The default value of the member, if any. + * @param string $visibility + * The member's visibility. Can be public, private, or protected. Defaults to + * public. + * + * @return ClassMemberListNode + * + * @todo Not all expressions can be default values, but I forget what sorts of + * expressions are valid for this. Will need better sanity checking here. + */ public static function create($name, ExpressionNode $value = NULL, $visibility = 'public') { $code = $visibility . ' $' . ltrim($name, '$'); if ($value instanceof ExpressionNode) {
Doc'd ClassMemberNode::create().
grom358_pharborist
train
php
7d95866919197a224303e104aa0ee7b69bbded74
diff --git a/src/includes/functions/.build.in-base-dir.php b/src/includes/functions/.build.in-base-dir.php index <HASH>..<HASH> 100644 --- a/src/includes/functions/.build.in-base-dir.php +++ b/src/includes/functions/.build.in-base-dir.php @@ -1,4 +1,10 @@ <?php +/** + * Functions. + * + * @author @jaswsinc + * @copyright WebSharks™ + */ // @codingStandardsIgnoreFile declare (strict_types = 1);
Enhancing docBlocks.
wpsharks_core
train
php
0d782dd82fbab7784a5a1d0dafd19768df8c1768
diff --git a/glfw.py b/glfw.py index <HASH>..<HASH> 100644 --- a/glfw.py +++ b/glfw.py @@ -163,6 +163,7 @@ else: ['', '/usr/lib64', '/usr/local/lib64', '/usr/lib', '/usr/local/lib', + '/run/current-system/sw/lib', '/usr/lib/x86_64-linux-gnu/'], _glfw_get_version) if _glfw is None:
Added a library search path for NixOS
FlorianRhiem_pyGLFW
train
py
2acb85006a6d44c815b603803678a53825913d39
diff --git a/src/python/grpcio_tests/tests/unit/_logging_test.py b/src/python/grpcio_tests/tests/unit/_logging_test.py index <HASH>..<HASH> 100644 --- a/src/python/grpcio_tests/tests/unit/_logging_test.py +++ b/src/python/grpcio_tests/tests/unit/_logging_test.py @@ -15,15 +15,28 @@ import unittest import six -import grpc +from six.moves import reload_module import logging - +import grpc +import functools +import sys class LoggingTest(unittest.TestCase): def test_logger_not_occupied(self): self.assertEqual(0, len(logging.getLogger().handlers)) + def test_handler_found(self): + old_stderr = sys.stderr + sys.stderr = six.StringIO() + try: + reload_module(logging) + logging.basicConfig() + reload_module(grpc) + self.assertFalse("No handlers could be found" in sys.stderr.getvalue()) + finally: + sys.stderr = old_stderr + reload_module(logging) if __name__ == '__main__': unittest.main(verbosity=2)
Add test for 'No handlers could be found' problem
grpc_grpc
train
py
5621e9af2718015def5d926d52253909e1bb5b96
diff --git a/tests/utils/helpers.py b/tests/utils/helpers.py index <HASH>..<HASH> 100644 --- a/tests/utils/helpers.py +++ b/tests/utils/helpers.py @@ -194,7 +194,7 @@ def run_job(config_file, params=None, check_output=False): If the return code of the subprocess call is not 0, a :exception:`subprocess.CalledProcessError` is raised. """ - args = ["bin/openquake", "--config-file=" + config_file] + args = ["bin/openquake", "--force-inputs", "--config-file=" + config_file] if not params is None: args.extend(params) if check_output:
Also, use --force-inputs by default when running jobs in a test environment. (Makes for a cleaner test setup.)
gem_oq-engine
train
py
1a0e55bf595b5f00eddc67c5d3684af31a1ae785
diff --git a/Lib/fontParts/objects/abstract/contour.py b/Lib/fontParts/objects/abstract/contour.py index <HASH>..<HASH> 100644 --- a/Lib/fontParts/objects/abstract/contour.py +++ b/Lib/fontParts/objects/abstract/contour.py @@ -29,13 +29,11 @@ class BaseContour(BaseObject): """ Draw the contour with the given Pen. """ - self.raiseNotImplementedError() def drawPoints(self, pen): """ Draw the contour with the given PointPen. """ - self.raiseNotImplementedError() # ------------------ # Data normalization
These can be implemented by the base class.
robotools_fontParts
train
py
3bd2c6714d75effea8c0c10ea929a69d497d96ea
diff --git a/tests/features/session/test_session.py b/tests/features/session/test_session.py index <HASH>..<HASH> 100644 --- a/tests/features/session/test_session.py +++ b/tests/features/session/test_session.py @@ -5,7 +5,7 @@ from tests import TestCase class TestSession(TestCase): def test_default_sessiondriver(self): session = self.application.make("session") - session.start() + session.start("cookie") driver = session.get_driver() self.assertIsInstance(driver, CookieDriver)
Dont rely on “default” driver as it may change
MasoniteFramework_masonite
train
py
920dc25531373f00c0748face7f8e4f8ac3f1645
diff --git a/cmd/kubeadm/app/constants/constants.go b/cmd/kubeadm/app/constants/constants.go index <HASH>..<HASH> 100644 --- a/cmd/kubeadm/app/constants/constants.go +++ b/cmd/kubeadm/app/constants/constants.go @@ -469,7 +469,7 @@ var ( 16: "3.3.17-0", 17: "3.4.3-0", 18: "3.4.3-0", - 19: "3.4.9-1", + 19: "3.4.13-0", 20: "3.4.13-0", 21: "3.4.13-0", }
etcd version for <I> is <I> for cve fixes
kubernetes_kubernetes
train
go
5d14555f878edcc3f1dd18e70706c47baedb74c8
diff --git a/src/libtrash/tests/__init__.py b/src/libtrash/tests/__init__.py index <HASH>..<HASH> 100755 --- a/src/libtrash/tests/__init__.py +++ b/src/libtrash/tests/__init__.py @@ -207,13 +207,15 @@ class TestTrashDirectory(unittest.TestCase) : self.assertEqual(File("/"), td.volume) def test_trash(self) : #instance - instance=TrashDirectory(File("sandbox/.local/sharetestTrashDirectory"), Volume(File("/"))) + instance=TrashDirectory( + File("sandbox/trash-directory"), + File("sandbox").volume) # test - filename = "sandbox/dummy.txt" - open(filename, "w").close() + file_to_trash=File("sandbox/dummy.txt") + file_to_trash.touch() instance._path_for_trashinfo = lambda fileToTrash : File("/dummy.txt") - result = instance.trash(File(filename)) + result = instance.trash(file_to_trash) self.assertTrue(isinstance(result,TrashedFile)) self.assertEquals(File("/dummy.txt"), result.path) self.assertTrue(result.getDeletionTime() is not None)
Fixed TestTrashDirectory.test_trash, now works even if the volume of 'sandbox' is not '/'.
andreafrancia_trash-cli
train
py
129f084609bc16a4bf2aff2bf059a77624b553f4
diff --git a/platform/bb/rhodes/src/rhomobile/PushListeningThread.java b/platform/bb/rhodes/src/rhomobile/PushListeningThread.java index <HASH>..<HASH> 100644 --- a/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +++ b/platform/bb/rhodes/src/rhomobile/PushListeningThread.java @@ -59,7 +59,7 @@ public class PushListeningThread extends Thread { public static boolean isPushServiceEnabled() { if ( !RhoConf.getInstance().isExist("push_options") ) - return true; + return false; String strOptions = RhoConf.getInstance().getString("push_options");
run only mds push by default
rhomobile_rhodes
train
java
79f73d62e5082ee8d6b86a2487fd6267c1495fcd
diff --git a/transport/http2_server.go b/transport/http2_server.go index <HASH>..<HASH> 100644 --- a/transport/http2_server.go +++ b/transport/http2_server.go @@ -342,7 +342,10 @@ func (t *http2Server) HandleStreams(handle func(*Stream), traceCtx func(context. // Check the validity of client preface. preface := make([]byte, len(clientPreface)) if _, err := io.ReadFull(t.conn, preface); err != nil { - grpclog.Printf("transport: http2Server.HandleStreams failed to receive the preface from client: %v", err) + // Only log if it isn't a simple tcp accept check (ie: tcp balancer doing open/close socket) + if err != io.EOF { + grpclog.Printf("transport: http2Server.HandleStreams failed to receive the preface from client: %v", err) + } t.Close() return }
Suppress server log message when EOF without receiving data for preface (#<I>)
grpc_grpc-go
train
go
ebbde95ae93928dddeed35a745ba6a005f6499be
diff --git a/lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb b/lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb index <HASH>..<HASH> 100644 --- a/lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb +++ b/lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb @@ -1,4 +1,4 @@ -require 'multi_json' + require 'multi_json' require 'hashie' module ActiveMerchant @@ -7,12 +7,16 @@ module ActiveMerchant SUCCESS = 'Success'.freeze - attr_reader :json + attr_reader :json, :request, :action, :response_rash, :xml_request alias :raw :json + alias :raw_request :xml_request - def initialize(json) + def initialize(json, xml_request = nil, action = nil) @json = json @response_rash = Hashie::Rash.new(MultiJson.decode(json)) + @xml_request = xml_request + @request = Hash.from_xml(xml_request) + @action = action end def method_missing(method, *args, &block)
Expose raw and request objects for easier logging / debugging
jpablobr_active_paypal_adaptive_payment
train
rb
3fefc607534d5da9c1831bd81eecaa7e588a0619
diff --git a/heroku_connect/db/models/fields.py b/heroku_connect/db/models/fields.py index <HASH>..<HASH> 100644 --- a/heroku_connect/db/models/fields.py +++ b/heroku_connect/db/models/fields.py @@ -15,9 +15,9 @@ from django.db import models from django.utils import timezone __all__ = ( - 'HerokuConnectFieldMixin', 'AnyType', 'ID', 'Checkbox', 'Currency', - 'Date', 'DateTime', 'Email', 'EncryptedString', 'Number', 'Percent', - 'Phone', 'Picklist', 'Text', 'TextArea', 'Time', 'URL', 'ExternalID', + 'HerokuConnectFieldMixin', 'AnyType', 'ID', 'ExternalID', 'Checkbox', 'Number', 'Currency', + 'Date', 'DateTime', 'Email', 'EncryptedString', 'Percent', + 'Phone', 'Picklist', 'Text', 'TextArea', 'TextAreaLong', 'Time', 'URL', )
Add TextAreaLong to __all__ along with the other classes (#<I>) That should fix #<I>
Thermondo_django-heroku-connect
train
py
021e0c5edc88dd2789866013a60bb9bfb0c4b3f1
diff --git a/spec/dummy_test_app/config/application.rb b/spec/dummy_test_app/config/application.rb index <HASH>..<HASH> 100644 --- a/spec/dummy_test_app/config/application.rb +++ b/spec/dummy_test_app/config/application.rb @@ -7,8 +7,9 @@ require "browse_everything" module Dummy class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 5.1 + # ~Initialize configuration defaults for originally generated Rails version.~ + # Changed to: For currently running Rails version, eg 5.2 or 7.0: + config.load_defaults Rails::VERSION::STRING.to_f # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers
test with defaults for currently running Rails version
samvera_browse-everything
train
rb
f6bdd064dd7f4a33434aed39075e84ed9f0eb289
diff --git a/grimoire_elk/enriched/enrich.py b/grimoire_elk/enriched/enrich.py index <HASH>..<HASH> 100644 --- a/grimoire_elk/enriched/enrich.py +++ b/grimoire_elk/enriched/enrich.py @@ -862,6 +862,12 @@ class Enrich(ElasticItems): # Find the uuid for a given id. id = utils.uuid(backend_name, email=iden['email'], name=iden['name'], username=iden['username']) + + if not id: + logger.warning("Id not found in SortingHat for name: %s, email: %s and username: %s in %s", + str(iden['name']), str(iden['email']), str(iden['username']), backend_name) + return sh_ids + with self.sh_db.connect() as session: identity_found = api.find_identity(session, id) sh_ids['id'] = identity_found.id
[enrich] Prevent find identities for none ids This code prevents to query SortingHat when the ids returned by the utils.uuid is none. A warning message is added to the log.
chaoss_grimoirelab-elk
train
py
2439c8396e8ad89041081473a114e9a61039dab5
diff --git a/timestreamdb.js b/timestreamdb.js index <HASH>..<HASH> 100644 --- a/timestreamdb.js +++ b/timestreamdb.js @@ -36,10 +36,14 @@ function TimestreamDB(instance, options) { var db = Version(instance, options) - db.ts = function (key) { - return ts(db.versionStream(key, {reverse: true}).pipe(toTimestream())) + db.ts = function (key, options) { + var opts = {reverse: true} + + if (options.start) opts.minVersion = options.start + if (options.until) opts.maxVersion = options.until + return ts(db.versionStream(key, opts).pipe(toTimestream())) } db.timeStream = db.ts return db -} \ No newline at end of file +}
Add support for start and end ranges at query time
brycebaril_timestreamdb
train
js
8e47cd571d4f934476679bc8a78332baba2982cf
diff --git a/liquibase-core/src/main/java/liquibase/command/core/SnapshotCommand.java b/liquibase-core/src/main/java/liquibase/command/core/SnapshotCommand.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/command/core/SnapshotCommand.java +++ b/liquibase-core/src/main/java/liquibase/command/core/SnapshotCommand.java @@ -10,6 +10,7 @@ import liquibase.database.ObjectQuotingStrategy; import liquibase.database.core.*; import liquibase.exception.LiquibaseException; import liquibase.license.LicenseServiceUtils; +import liquibase.logging.LogType; import liquibase.serializer.SnapshotSerializerFactory; import liquibase.snapshot.DatabaseSnapshot; import liquibase.snapshot.SnapshotControl; @@ -156,7 +157,7 @@ public class SnapshotCommand extends AbstractCommand<SnapshotCommand.SnapshotCom if (LicenseServiceUtils.checkForValidLicense("Liquibase Pro")) { if (!(database instanceof MSSQLDatabase || database instanceof OracleDatabase)) { - Scope.getCurrentScope().getLog(callingClass).info("This command does not yet capture Liquibase Pro additional object types on " + database.getShortName()); + Scope.getCurrentScope().getLog(callingClass).info(LogType.USER_MESSAGE, "INFO This command might not yet capture Liquibase Pro additional object types on " + database.getShortName()); } } }
Log info message when doing a snapshot-related command on a non-Liquibase Pro supported platform DAT-<I>
liquibase_liquibase
train
java
1a5a2f76948ee345bcb91d409ede03e2563d1c33
diff --git a/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java b/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java +++ b/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java @@ -239,8 +239,8 @@ public class OTransactionOptimistic extends OTransactionRealAbstract { ORecordCallback<ORecordVersion> iRecordUpdatedCallback) { if (iRecord == null) return null; - final byte operation = iForceCreate ? ORecordOperation.CREATED : iRecord.getIdentity().isPersistent() ? ORecordOperation.UPDATED - : ORecordOperation.CREATED; + final byte operation = iForceCreate ? ORecordOperation.CREATED + : iRecord.getIdentity().isValid() ? ORecordOperation.UPDATED : ORecordOperation.CREATED; addRecord(iRecord, operation, iClusterName); return iRecord; } @@ -391,6 +391,7 @@ public class OTransactionOptimistic extends OTransactionRealAbstract { switch (iStatus) { case ORecordOperation.DELETED: recordEntries.remove(rid); +// txEntry.type = ORecordOperation.DELETED; break; } break;
Reverted commit caused issues (found by CI)
orientechnologies_orientdb
train
java
b86d3d692aa1a5417c2890f3fef78cc2dcfa6577
diff --git a/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java b/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java index <HASH>..<HASH> 100644 --- a/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java @@ -331,7 +331,7 @@ public abstract class AbstractByteBuf implements ByteBuf { if (endianness == null) { throw new NullPointerException("endianness"); } - if (endianness == order() || capacity() == 0) { + if (endianness == order()) { return this; }
Fix a bug where AbstractByteBuf.order() doesn't return a swapped buffer if capacity is 0. - Fixes #<I>
netty_netty
train
java
d81b3dd2bfb36abe23aaaf326744a97f3d000d90
diff --git a/api/v1/api.go b/api/v1/api.go index <HASH>..<HASH> 100644 --- a/api/v1/api.go +++ b/api/v1/api.go @@ -219,8 +219,14 @@ func (a *Api) setSinks(req *restful.Request, resp *restful.Response) { func (a *Api) getSinks(req *restful.Request, resp *restful.Response) { sinkUris := a.manager.SinkUris() + var strs []string if sinkUris == nil { - sinkUris = make(manager.Uris, 0) + strs = make([]string, 0) + } else { + strs = make([]string, 0, len(sinkUris)) + for _, u := range sinkUris { + strs = append(strs, u.String()) + } } - resp.WriteEntity(sinkUris) + resp.WriteEntity(strs) }
Fix bug introduced in <I>cc2d0c<I>b6 When introducing the new Uris type, I forgot to make the API endpoint return the string representations of the type, and not the type itself. This fixes the sinks endpoint integration tests.
kubernetes-retired_heapster
train
go
7daac56de7b34bfd47f844f7d6cc64facded628b
diff --git a/source/rafcon/mvc/controllers/state_machine_tree.py b/source/rafcon/mvc/controllers/state_machine_tree.py index <HASH>..<HASH> 100644 --- a/source/rafcon/mvc/controllers/state_machine_tree.py +++ b/source/rafcon/mvc/controllers/state_machine_tree.py @@ -100,7 +100,9 @@ class StateMachineTreeController(ExtendedController): "add_outcome", "remove_outcome", "add_data_flow", "remove_data_flow", "add_transition", "remove_transition", "parent", - "state_execution_status", "script_text", # ContainerState + "input_data_ports", "output_data_ports", "outcomes", + "scoped_variables", "data_flows", "transitions", # ContainerState + "state_execution_status", "script_text", 'library_name', 'library_path', 'version', 'state_copy', # LibraryState 'input_data_port_runtime_values', 'output_data_port_runtime_values', 'use_runtime_value_input_data_ports', 'use_runtime_value_output_data_ports',
update method-ignore-list for notifications observed by state-machine-tree-widget
DLR-RM_RAFCON
train
py
46051dad9cdf8889a6d854a0d84c6bd9d301e914
diff --git a/bin/inline_forms_installer_core.rb b/bin/inline_forms_installer_core.rb index <HASH>..<HASH> 100755 --- a/bin/inline_forms_installer_core.rb +++ b/bin/inline_forms_installer_core.rb @@ -9,7 +9,7 @@ gem 'rake' gem 'jquery-rails' gem 'jquery-ui-sass-rails' gem 'capistrano' -gem 'will_paginate', git: 'https://github.com/acesuares/will_paginate.git' +gem 'will_paginate' #, git: 'https://github.com/acesuares/will_paginate.git' gem 'tabs_on_rails', git: 'https://github.com/acesuares/tabs_on_rails.git', :branch => 'update_remote' gem 'ckeditor' gem 'cancan', git: 'https://github.com/acesuares/cancan.git', :branch => '2.0' diff --git a/lib/inline_forms/version.rb b/lib/inline_forms/version.rb index <HASH>..<HASH> 100644 --- a/lib/inline_forms/version.rb +++ b/lib/inline_forms/version.rb @@ -1,4 +1,4 @@ # -*- encoding : utf-8 -*- module InlineForms - VERSION = "5.0.2" + VERSION = "5.0.3" end
will_paginate gave error; removed my branch and see if it still works with remote
acesuares_inline_forms
train
rb,rb
f25893e31a1c38d9ff3d61f5083e40978ac0ac0d
diff --git a/net/interface.go b/net/interface.go index <HASH>..<HASH> 100644 --- a/net/interface.go +++ b/net/interface.go @@ -27,7 +27,7 @@ type Network interface { ClosePeer(peer.Peer) error // IsConnected returns whether a connection to given peer exists. - IsConnected(peer.Peer) (bool, error) + IsConnected(peer.Peer) bool // GetProtocols returns the protocols registered in the network. GetProtocols() *mux.ProtocolMap diff --git a/net/net.go b/net/net.go index <HASH>..<HASH> 100644 --- a/net/net.go +++ b/net/net.go @@ -75,8 +75,8 @@ func (n *IpfsNetwork) ClosePeer(p peer.Peer) error { } // IsConnected returns whether a connection to given peer exists. -func (n *IpfsNetwork) IsConnected(p peer.Peer) (bool, error) { - return n.swarm.GetConnection(p.ID()) != nil, nil +func (n *IpfsNetwork) IsConnected(p peer.Peer) bool { + return n.swarm.GetConnection(p.ID()) != nil } // GetProtocols returns the protocols registered in the network.
style(net) rm unused error having an error return value makes the interface a bit confusing to use. Just ponder... What would an error returned from a predicate function mean? License: MIT
ipfs_go-ipfs
train
go,go
7e4fc94601d4f3545b1d221a8152842441183961
diff --git a/flask_security/datastore.py b/flask_security/datastore.py index <HASH>..<HASH> 100644 --- a/flask_security/datastore.py +++ b/flask_security/datastore.py @@ -195,7 +195,7 @@ class SQLAlchemyUserDatastore(SQLAlchemyDatastore, UserDatastore): def _is_numeric(self, value): try: int(value) - except ValueError: + except (TypeError, ValueError): return False return True
Fail silently for get_user(None) get_user(identifier) checks if the identifier is a number by trying to convert it to int. This works for strings, but in a particular case, when identifier is None, it fails. Checking for both TypeError and ValueError fixes it.
mattupstate_flask-security
train
py
0a2ad1311f4c81f1923035d381909a55ddabf4f0
diff --git a/test/optimizer/level-1/optimize-test.js b/test/optimizer/level-1/optimize-test.js index <HASH>..<HASH> 100644 --- a/test/optimizer/level-1/optimize-test.js +++ b/test/optimizer/level-1/optimize-test.js @@ -412,6 +412,10 @@ vows.describe('level 1 optimizations') '8-value hex': [ '.block{color:#00ff0080}', '.block{color:#00ff0080}' + ], + 'hsla with variables': [ + '.block{color: hsl(0, 0%, calc((var(--button_color_l) - 65) * -100%))}', + '.block{color:hsl(0,0%,calc((var(--button_color_l) - 65) * -100%))}' ] }, { level: 1 }) )
See #<I> - adds test for HSL color with variables. This has been fixed by level-1 optimizations rewrite.
jakubpawlowicz_clean-css
train
js
feca4152ca00238a4c1ee26af907c79b558c8641
diff --git a/src/Translator.php b/src/Translator.php index <HASH>..<HASH> 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -16,8 +16,8 @@ class Translator implements \Nette\Localization\ITranslator { /** @var Loader */ protected $loader; - function __construct() { - $this->loader = new Loader; + function __construct(Loader $loader = NULL) { + $this->loader = (is_null($loader))? new Loader: $loader; } /**
allowed manually setting loader for translator (via constructor)
nexendrie_translation
train
php
0c49788b068efce246c97510aafb0de8f65a1803
diff --git a/app/controllers/kuroko2/job_instances_controller.rb b/app/controllers/kuroko2/job_instances_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/kuroko2/job_instances_controller.rb +++ b/app/controllers/kuroko2/job_instances_controller.rb @@ -65,7 +65,7 @@ class Kuroko2::JobInstancesController < Kuroko2::ApplicationController end def working - @instances = Kuroko2::JobInstance.working.order(id: :desc) + @instances = Kuroko2::JobInstance.working.order(id: :desc).joins(job_definition: :admins).includes(job_definition: :admins) end private
Fix N<I> query in /instances/working
cookpad_kuroko2
train
rb
65b1d7603bcb1fca06b1bb250897ff0247745f63
diff --git a/stancache/stancache.py b/stancache/stancache.py index <HASH>..<HASH> 100644 --- a/stancache/stancache.py +++ b/stancache/stancache.py @@ -50,10 +50,7 @@ def _make_digest_dict(k, prefix=''): s = _make_digest(item, prefix=key+'-') result.update({pre_key: _digest(s.encode())}) elif isinstance(item, pd.DataFrame): - index = tuple(item.index) - columns = tuple(item.columns) - values = tuple(tuple(x) for x in item.values) - s = _pickle_dumps_digest(tuple([index, columns, values])) + s = hash(str(item)) result.update({pre_key: s}) else: s = _pickle_dumps_digest(item)
use hash for pandas DataFrame instead of pickled tuple
hammerlab_stancache
train
py
14e8a283775e9cecf626599de1166684f5cc99c9
diff --git a/openquake/baselib/tests/config_test.py b/openquake/baselib/tests/config_test.py index <HASH>..<HASH> 100644 --- a/openquake/baselib/tests/config_test.py +++ b/openquake/baselib/tests/config_test.py @@ -17,6 +17,7 @@ # along with OpenQuake. If not, see <http://www.gnu.org/licenses/>. import os +import logging import unittest from openquake.baselib import config @@ -26,9 +27,11 @@ class ConfigPathsTestCase(unittest.TestCase): def test_venv(self): venv = os.environ.get('VIRTUAL_ENV') - self.assertTrue(venv, 'You cannot run the tests, you must use a ' - 'development installation with a virtualenv!') - self.assertIn(os.path.join(venv, 'openquake.cfg'), config.paths) + if venv: + self.assertIn(os.path.join(venv, 'openquake.cfg'), config.paths) + else: + logging.warn('To run the tests, you should use a ' + 'development installation with a virtualenv') def test_config_file(self): cfgfile = os.environ.get('OQ_CONFIG_FILE')
Removed an assertion in ConfigPathsTestCase
gem_oq-engine
train
py
08ab426e1edc5cffd4efbcb06196ddd9467e1c84
diff --git a/spec/factories/notifications_client.rb b/spec/factories/notifications_client.rb index <HASH>..<HASH> 100644 --- a/spec/factories/notifications_client.rb +++ b/spec/factories/notifications_client.rb @@ -2,8 +2,8 @@ FactoryGirl.define do factory :notifications_client, class: Notifications::Client do base_url { nil } - jwt_service "0af431f4-0336-4cae-5e68-968cb0af431f" - jwt_secret "b646da86-2648-a663-ce2b-f26489a663cce2b" + jwt_service "fa80e418-ff49-445c-a29b-92c04a181207" + jwt_secret "7aaec57c-2dc9-4d31-8f5c-7225fe79516a" initialize_with do new(jwt_service, jwt_secret, base_url)
Use <I> char UUIDs This makes it a more realistic test
alphagov_notifications-ruby-client
train
rb
7ba229247886f3fedb98f887f68fcba1e344d9f2
diff --git a/graylog2-server/src/main/java/org/graylog2/security/RestPermissions.java b/graylog2-server/src/main/java/org/graylog2/security/RestPermissions.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog2/security/RestPermissions.java +++ b/graylog2-server/src/main/java/org/graylog2/security/RestPermissions.java @@ -123,6 +123,7 @@ public class RestPermissions { FIELDNAMES_READ, INDEXERCLUSTER_READ, INPUTS_READ, + JOURNAL_READ, JVMSTATS_READ, MESSAGECOUNT_READ, MESSAGES_READ,
Add JOURNAL_READ to reader base permissions. This allows reader users to see the journal status and does not show a misleading message about a disabled journal. Fixes #<I>.
Graylog2_graylog2-server
train
java
fbaef9bbb6266a427acd6fd3beedc0bd0c41e0fb
diff --git a/parsers/parser.class.php b/parsers/parser.class.php index <HASH>..<HASH> 100644 --- a/parsers/parser.class.php +++ b/parsers/parser.class.php @@ -344,9 +344,15 @@ abstract class kintParser extends kintVariableData { // copy the object as an array - $array = (array)$variable; - $hash = spl_object_hash( $variable ); - + $array = (array) $variable; + if ( function_exists( 'spl_object_hash' ) ) { + $hash = spl_object_hash( $variable ); + } else { + ob_start(); + var_dump( $variable ); + preg_match( '[#(\d+)]', ob_get_clean(), $match ); + $hash = $match[1]; + } $variableData->type = 'object'; $variableData->subtype = get_class( $variable );
spl_object_hash implementation for <<I> PHP versions
kint-php_kint
train
php
4c14b302f612b4da5acce69baf0a2071d1db1deb
diff --git a/patroni/utils.py b/patroni/utils.py index <HASH>..<HASH> 100644 --- a/patroni/utils.py +++ b/patroni/utils.py @@ -362,7 +362,7 @@ def polling_loop(timeout, interval=1): def split_host_port(value, default_port): t = value.rsplit(':', 1) if ':' in t[0]: - t[0] = t[0].strip('[]') + t[0] = ','.join([h.strip().strip('[]') for h in t[0].split(',')]) t.append(default_port) return t[0], int(t[1])
Remove [] characters from IPv6 hosts when splitting to host and port (#<I>) Close #<I>
zalando_patroni
train
py
ee227809fd2e115cf48c1dff1d2efd4a29d7d89c
diff --git a/lib/pxproxy.js b/lib/pxproxy.js index <HASH>..<HASH> 100644 --- a/lib/pxproxy.js +++ b/lib/pxproxy.js @@ -252,11 +252,15 @@ function parseBody(req) { } else { if (typeof(req.body) === "object") { - let result = []; - for (key in req.body) { - result.push(`${key}=${req.body[key]}`); + if (req.headers['content-type'] === 'application/json') { + req.rawBody = JSON.stringify(req.body); + } else { + let result = []; + for (key in req.body) { + result.push(`${key}=${req.body[key]}`); + } + req.rawBody = result.join('&'); } - req.rawBody = result.join('&'); resolve(); } else { req.rawBody = req.body;
added check for content type in parseBody (#<I>)
PerimeterX_perimeterx-node-core
train
js
942074b6b51725046371eb62ed70399400d7f8eb
diff --git a/lib/preen.js b/lib/preen.js index <HASH>..<HASH> 100644 --- a/lib/preen.js +++ b/lib/preen.js @@ -14,7 +14,8 @@ function preen(options, callback) { bowerJSON = require(process.cwd()+'/'+bower.config.json); } catch(err) { - console.error('\u001b[31m'+'Did not find '+bower.config.json+'\u001b[0m'); + console.error('\u001b[31m'+'Error trying to read '+bower.config.json+':\n\u001b[0m'); + console.error('\t\u001b[31m'+err+'\u001b[0m'); return; } @@ -191,4 +192,4 @@ function removeDir(path) { fs.rmrf(path, function (err) { if (err) console.error(err); }); -} \ No newline at end of file +}
Log out the error when reading bower.json fails Also changed the wording in the error message to be more generic. After a few minutes of trying to figure out why Preen couldn't find the bower.json file in the directory I was running it in, I put in the error logging and saw the problem was actually a a JSON formatting error in my bower.json file.
BradDenver_Preen
train
js
6d933518f2689760bfc7b8aebab5c3b624a6946f
diff --git a/jOOX/src/main/java/org/joox/Match.java b/jOOX/src/main/java/org/joox/Match.java index <HASH>..<HASH> 100644 --- a/jOOX/src/main/java/org/joox/Match.java +++ b/jOOX/src/main/java/org/joox/Match.java @@ -1677,12 +1677,14 @@ public interface Match extends Iterable<Element> { Match empty(); /** - * Removes all elements in the set of matched elements. + * Removes all elements from their parent nodes in the set of matched + * elements. */ Match remove(); /** - * Removes all elements in the set of matched elements, matching a selector + * Removes all elements from their parent nodes in the set of matched + * elements, matching a selector * <p> * The selector provided to this method supports the following features: * <ul> @@ -1706,7 +1708,8 @@ public interface Match extends Iterable<Element> { Match remove(String selector); /** - * Removes all elements in the set of matched elements, matching a filter + * Removes all elements from their parent nodes in the set of matched + * elements, matching a filter * <p> * The callback {@link Context} is populated like this: * <ul> @@ -1718,7 +1721,8 @@ public interface Match extends Iterable<Element> { Match remove(Filter filter); /** - * Wrap all elements in the set of matched elements in a new parent element + * Wrap all elements from their parent nodes in the set of matched elements + * in a new parent element * <p> * The resulting set of matched elements contains the newly wrapped elements *
[#<I>] Improve Javadoc on the Match.remove() method
jOOQ_jOOX
train
java
0b76100da08c67de00eebea2e4cbfe5c3413f1fe
diff --git a/command/init.go b/command/init.go index <HASH>..<HASH> 100644 --- a/command/init.go +++ b/command/init.go @@ -165,7 +165,7 @@ func (c *InitCommand) Run(args []string) int { // error suggesting the user upgrade their config manually or with // Terraform v0.12 c.Ui.Error(strings.TrimSpace(errInitConfigErrorMaybeLegacySyntax)) - c.showDiagnostics(earlyConfDiags) + c.showDiagnostics(confDiags) return 1 }
init: return proper config errors (#<I>) Fixed a bug where we were returning earlyConfDiags instead of confDiags.
hashicorp_terraform
train
go