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
51828f5d31d19645d4bb0df272ae40dc3be41150
diff --git a/tests/calculators/hazard/event_based/core_next_test.py b/tests/calculators/hazard/event_based/core_next_test.py index <HASH>..<HASH> 100644 --- a/tests/calculators/hazard/event_based/core_next_test.py +++ b/tests/calculators/hazard/event_based/core_next_test.py @@ -185,7 +185,6 @@ class EventBasedHazardCalculatorTestCase(unittest.TestCase): self.job.save() hc = self.job.hazard_calculation - num_sites = len(hc.points_to_compute()) rlz1, rlz2 = models.LtRealization.objects.filter( hazard_calculation=hc.id)
tests/calcs/hazard/event_based/core_next_test: pyflakes
gem_oq-engine
train
py
cb0b49ecd6a62745341f61f3689386498851b217
diff --git a/lib/runtime.js b/lib/runtime.js index <HASH>..<HASH> 100644 --- a/lib/runtime.js +++ b/lib/runtime.js @@ -679,8 +679,14 @@ yr.selectNametest = function selectNametest(step, context, result) { if (!data || typeof data !== 'object') { return result; } if (step === '*') { - for (step in data) { - yr.selectNametest(step, context, result); + if (data instanceof Array) { + for (var i = 0, l = data.length; i < l; i++) { + yr.selectNametest(i, context, result); + } + } else { + for (step in data) { + yr.selectNametest(step, context, result); + } } return result; }
monkey-patching `for .*` enumeration for nested arrays arrays now enumerated using for (;;) instead of for-in
pasaran_yate
train
js
eb2f5bab8eddc664809245f63fbc2a4e15c736c8
diff --git a/packages/Todos/src/site/components/com_todos/views/todo/html/todo.php b/packages/Todos/src/site/components/com_todos/views/todo/html/todo.php index <HASH>..<HASH> 100644 --- a/packages/Todos/src/site/components/com_todos/views/todo/html/todo.php +++ b/packages/Todos/src/site/components/com_todos/views/todo/html/todo.php @@ -19,7 +19,7 @@ <?php if($todo->description): ?> <div class="entity-description"> - <?= @content($todo->description); ?> + <?= @content( nl2br($todo->description) ); ?> </div> <?php endif; ?>
added nl2br to display body
anahitasocial_anahita
train
php
9cadeb8af2986f00134a5107e368f32b876aef91
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php @@ -51,7 +51,7 @@ class IniFileLoaderTest extends TestCase public function testTypeConversionsWithNativePhp($key, $value, $supported) { if (defined('HHVM_VERSION_ID')) { - return $this->markTestSkipped(); + $this->markTestSkipped(); } if (!$supported) {
Don't use return on Assert::markTestSkipped.
symfony_symfony
train
php
4e0c71326eca6bd1ba9b80caf53dbc82d0e191f4
diff --git a/salt/modules/smtp.py b/salt/modules/smtp.py index <HASH>..<HASH> 100644 --- a/salt/modules/smtp.py +++ b/salt/modules/smtp.py @@ -39,7 +39,6 @@ Module for Sending Messages via SMTP ''' import logging import socket -import sys log = logging.getLogger(__name__) diff --git a/salt/states/smtp.py b/salt/states/smtp.py index <HASH>..<HASH> 100644 --- a/salt/states/smtp.py +++ b/salt/states/smtp.py @@ -25,7 +25,7 @@ def __virtual__(): return 'smtp' if 'smtp.send_msg' in __salt__ else False -def send_msg(name, recipient, subject, sender, use_ssl='True', profile): +def send_msg(name, recipient, subject, sender, profile, use_ssl='True'): ''' Send a message via SMTP
fixing some pylint issues.
saltstack_salt
train
py,py
e31558f29dc356ec529b1c9c605daef4306603c0
diff --git a/src/Handler/DateHandler.php b/src/Handler/DateHandler.php index <HASH>..<HASH> 100644 --- a/src/Handler/DateHandler.php +++ b/src/Handler/DateHandler.php @@ -35,12 +35,12 @@ class DateHandler implements SubscribingHandlerInterface public static function getSubscribingMethods() { $methods = array(); - $deserialisationTypes = array('DateTime', 'DateTimeImmutable', 'DateInterval'); + $deserializationTypes = array('DateTime', 'DateTimeImmutable', 'DateInterval'); $serialisationTypes = array('DateTime', 'DateTimeImmutable', 'DateInterval'); foreach (array('json', 'xml', 'yml') as $format) { - foreach ($deserialisationTypes as $type) { + foreach ($deserializationTypes as $type) { $methods[] = [ 'type' => $type, 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
Rename "deserialisation" variable
schmittjoh_serializer
train
php
7b35a505ae628fccaaeff237844bd6a40164a14c
diff --git a/lib/xcode/install.rb b/lib/xcode/install.rb index <HASH>..<HASH> 100644 --- a/lib/xcode/install.rb +++ b/lib/xcode/install.rb @@ -92,7 +92,8 @@ module XcodeInstall `hdiutil mount -nobrowse -noverify #{dmgPath}` puts 'Please authenticate for Xcode installation...' - `sudo ditto "/Volumes/Xcode/Xcode.app" "#{xcode_path}"` + source = Dir.glob('/Volumes/Xcode/Xcode*.app').first + `sudo ditto "#{source}" "#{xcode_path}"` `umount "/Volumes/Xcode"` `sudo xcode-select -s #{xcode_path}`
Actually support installing beta versions of Xcode
xcpretty_xcode-install
train
rb
edee13bfe843421fc26617887ef93d9268462b30
diff --git a/lang/en/moodle.php b/lang/en/moodle.php index <HASH>..<HASH> 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -788,6 +788,8 @@ $string['passwordsenttext'] = ' <P>An email has been sent to your address at $ <P><B>Please check your email for your new password</B> <P>The new password was automatically generated, so you might like to <A HREF=$a->link>change it to something easier to remember</A>.'; +$string['pathnotexists'] = 'Path doesn\'t exist in your server!'; +$string['pathslasherror'] = 'Path can\'t end with a slash!!'; $string['paymentinstant'] = 'Use the button below to pay and be enrolled within minutes!'; $string['paymentrequired'] = 'This course requires a payment for entry.'; $string['paymentsorry'] = 'Thank you for your payment! Unfortunately your payment has not yet been fully processed, and you are not yet registered to enter the course \"$a->fullname\". Please try continuing to the course in a few seconds, but if you continue to have trouble then please alert the $a->teacher or the site administrator';
Added two old missing strings for scheduled backups.
moodle_moodle
train
php
8a4473bc2e6223c950b1f20f6b626de9829ea098
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ var multiline = require('multiline'); var template = _.template(multiline(function() { /* - <a href="<%= url %>" title="<%= title %>" target="_self" class="fancybox"> + <a href="<%= url %>" rel="grouped" title="<%= title %>" target="_self" class="fancybox"> <img src="<%= url %>" alt="<%= title %>"></img> </a> */
added rel property to group images on the page into a gallery
ly-tools_gitbook-plugin-fancybox
train
js
afea2efb53a55cda36e3f6a17f8de5f28261534f
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -7,6 +7,8 @@ import ( "fmt" "io" "net/http" + + "golang.org/x/net/http2" ) const ( @@ -25,9 +27,8 @@ func NewClient(certificate tls.Certificate) *Client { Certificates: []tls.Certificate{certificate}, } tlsConfig.BuildNameToCertificate() - transport := &http.Transport{ - TLSClientConfig: tlsConfig, - MaxIdleConnsPerHost: 100, + transport := &http2.Transport{ + TLSClientConfig: tlsConfig, } return &Client{ HttpClient: &http.Client{Transport: transport},
Support older go until <I> is out of beta
sideshow_apns2
train
go
3d5a6db694af576f5ddfbb64ee9a2caefcc9ec6c
diff --git a/tests/unit/test_dependency_register.py b/tests/unit/test_dependency_register.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_dependency_register.py +++ b/tests/unit/test_dependency_register.py @@ -160,7 +160,7 @@ class Test_DependencyRegister_register: def test__giving_resource_name_and_dependent__should_only_call_expected_methods( self, dep_reg, mock_dep_reg, fake_resource_name, fake_dependent): - def give_unexpected_calls(method_calls, expected_method_names): + def give_unexpected_calls(method_calls, expected_methods_names): return [call for call in method_calls if call[0] not in expected_methods_names]
tests: Fixes bug in previous commit: typo in function arg name. The inner function give_unexpected_calls() had an argument 'expected_method_names' which should have been 'expected_methods_names'.
ncraike_fang
train
py
1fdf734e18210e61de7036cb7d3e4b1070ac3bdb
diff --git a/examples/async_method_with_class.rb b/examples/async_method_with_class.rb index <HASH>..<HASH> 100644 --- a/examples/async_method_with_class.rb +++ b/examples/async_method_with_class.rb @@ -5,10 +5,16 @@ include Eldritch::DSL class BabysFirstClass async def foo(arg) puts "Hey I got: #{arg}" + sleep(1) + puts 'foo done' end end obj = BabysFirstClass.new + +puts 'calling foo' obj.foo('stuff') -sleep(1) -puts 'done' \ No newline at end of file +puts 'doing something else' + +# waiting for everyone to stop +Thread.list.reject{|t| t == Thread.current}.each &:join \ No newline at end of file
did the same simplification to class thread example
dotboris_eldritch
train
rb
c705370d2d432cb8bb9298527f8cf6a53edf8930
diff --git a/spec/bblib_spec.rb b/spec/bblib_spec.rb index <HASH>..<HASH> 100644 --- a/spec/bblib_spec.rb +++ b/spec/bblib_spec.rb @@ -16,4 +16,22 @@ describe BBLib do expect(thash.hash_path('test.path')).to eq ['here'] end + it 'squishes hash' do + expect(thash.squish).to eq ({"a"=>1, "b"=>2, "c.d[0]"=>3, "c.d[1]"=>4, "c.d[2]"=>5, "c.d[3].e"=>6, "c.f"=>7, "g"=>8, "test.path"=>"here", "e"=>5}) + end + + squished = thash.squish + + it 'expands hash' do + expect(squished.expand).to eq thash.keys_to_sym + end + + it 'converts keys to strings' do + expect(thash.keys_to_s).to eq ({"a"=>1, "b"=>2, "c"=>{"d"=>[3, 4, 5, {"e"=>6}], "f"=>7}, "g"=>8, "test"=>{"path"=>"here"}, "e"=>5}) + end + + it 'converts keys to symbols' do + expect(thash.keys_to_sym).to eq ({:a=>1, :b=>2, :c=>{:d=>[3, 4, 5, {:e=>6}], :f=>7}, :g=>8, :test=>{:path=>"here"}, :e=>5}) + end + end
Added more tests for hash path.
bblack16_bblib-ruby
train
rb
75144354b58fdf7753c6edd3a73ff1fd37c62a92
diff --git a/spec/public/associations_spec.rb b/spec/public/associations_spec.rb index <HASH>..<HASH> 100644 --- a/spec/public/associations_spec.rb +++ b/spec/public/associations_spec.rb @@ -28,6 +28,14 @@ describe DataMapper::Associations do end describe "#has" do + before do + class Car + def self.warn + # silence warnings + end + end + end + def n Car.n end
Added Car.warn() method to silence warnings from has() in spec output
datamapper_dm-core
train
rb
49d7f90ef4991bddea392ce1294bc952fc0e0b93
diff --git a/seaworthy/stream/_timeout.py b/seaworthy/stream/_timeout.py index <HASH>..<HASH> 100644 --- a/seaworthy/stream/_timeout.py +++ b/seaworthy/stream/_timeout.py @@ -33,5 +33,9 @@ def stream_timeout(stream, timeout, timeout_msg=None): timer.cancel() # Close the stream's underlying response object (if it has one) to # avoid potential socket leaks. + # This method seems to have more success at preventing ResourceWarnings + # than just stream.close() (should this be improved upstream?) + # FIXME: Potential race condition if Timer thread closes the stream at + # the same time we do here, but hopefully not with serious side effects if hasattr(stream, '_response'): stream._response.close()
Add a comment about closing the stream
praekeltfoundation_seaworthy
train
py
a3cdf0b97cb3460c087c83533525df72d19f28a2
diff --git a/tsdb/engine/bz1/bz1.go b/tsdb/engine/bz1/bz1.go index <HASH>..<HASH> 100644 --- a/tsdb/engine/bz1/bz1.go +++ b/tsdb/engine/bz1/bz1.go @@ -170,9 +170,18 @@ func (e *Engine) LoadMetadataIndex(index *tsdb.DatabaseIndex, measurementFields if err != nil { return err } - for k, series := range series { - series.InitializeShards() - index.CreateSeriesIndexIfNotExists(tsdb.MeasurementFromSeriesKey(string(k)), series) + + // Load the series into the in-memory index in sorted order to ensure + // it's always consistent for testing purposes + a := make([]string, 0, len(series)) + for k, _ := range series { + a = append(a, k) + } + sort.Strings(a) + for _, key := range a { + s := series[key] + s.InitializeShards() + index.CreateSeriesIndexIfNotExists(tsdb.MeasurementFromSeriesKey(string(key)), s) } return nil }); err != nil {
Ensure that metadata is always loaded out of the index in sorted order
influxdata_influxdb
train
go
0c6ced115a834607f961046afbcbef75bea589f1
diff --git a/src/RbacService.php b/src/RbacService.php index <HASH>..<HASH> 100644 --- a/src/RbacService.php +++ b/src/RbacService.php @@ -105,7 +105,7 @@ class RbacService implements RbacServiceContract { $assignment = $this->overseer->getAssignment($subject->getSubjectId(), $subject->getSubjectName()); - if ($assignment !== null) { + if ($assignment instanceof Assignment) { $assignment->changeRoles($roles); } else { $assignment = $this->createAssignment($subject, $roles); @@ -122,7 +122,9 @@ class RbacService implements RbacServiceContract { $assignment = $this->overseer->getAssignment($subject->getSubjectId(), $subject->getSubjectName()); - $this->overseer->deleteAssignment($assignment); + if ($assignment instanceof Assignment) { + $this->overseer->deleteAssignment($assignment); + } }
Add not null check before deleting assignment
digiaonline_lumen-rbac
train
php
26bd3e8b11dd9ef9a8226341ed04cbc8a58776cc
diff --git a/api/client/container/exec.go b/api/client/container/exec.go index <HASH>..<HASH> 100644 --- a/api/client/container/exec.go +++ b/api/client/container/exec.go @@ -28,7 +28,7 @@ func NewExecCommand(dockerCli *client.DockerCli) *cobra.Command { var opts execOptions cmd := &cobra.Command{ - Use: "exec CONTAINER COMMAND [ARG...]", + Use: "exec [OPTIONS] CONTAINER COMMAND [ARG...]", Short: "Run a command in a running container", Args: cli.RequiresMinArgs(2), RunE: func(cmd *cobra.Command, args []string) error {
Modify usage of docker exec command in exec.md
moby_moby
train
go
0c81f294eff900523363a55498c24e9598b55436
diff --git a/injector/wtf-injector-chrome/debugger.js b/injector/wtf-injector-chrome/debugger.js index <HASH>..<HASH> 100644 --- a/injector/wtf-injector-chrome/debugger.js +++ b/injector/wtf-injector-chrome/debugger.js @@ -152,7 +152,7 @@ Debugger.prototype.beginListening_ = function() { chrome.debugger.sendCommand(this.debugee_, 'Timeline.start', { // Limit call stack depth to keep messages small - if we ever need this // data this can be increased. - 'maxCallStackDepth': 1 + 'maxCallStackDepth': 0 }); }
Making the timeline not record stack traces. I feel like this didn't work previously, but it seems to now (back to <I>).
google_tracing-framework
train
js
7901f5d1dc1ead04438f59042ebbe05ade95578a
diff --git a/talon/quotations.py b/talon/quotations.py index <HASH>..<HASH> 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -280,10 +280,15 @@ def preprocess(msg_body, delimiter, content_type='text/plain'): Replaces link brackets so that they couldn't be taken for quotation marker. Splits line in two if splitter pattern preceded by some text on the same line (done only for 'On <date> <person> wrote:' pattern). + + Converts msg_body into a unicode. """ # normalize links i.e. replace '<', '>' wrapping the link with some symbols # so that '>' closing the link couldn't be mistakenly taken for quotation # marker. + if isinstance(msg_body, bytes): + msg_body = msg_body.decode('utf8') + def link_wrapper(link): newline_index = msg_body[:link.start()].rfind("\n") if msg_body[newline_index + 1] == ">":
Convert msg_body into unicode in preprocess.
mailgun_talon
train
py
b194175f3e01b692ca1e66645b0af8d45ef0439f
diff --git a/aiohttp_json_rpc/client.py b/aiohttp_json_rpc/client.py index <HASH>..<HASH> 100644 --- a/aiohttp_json_rpc/client.py +++ b/aiohttp_json_rpc/client.py @@ -99,6 +99,9 @@ class JsonRpcClient: decode_error(msg) ) + except asyncio.CancelledError: + raise + except Exception as e: self._logger.error(e, exc_info=True)
client: _message_worker: properly handle asyncio.CancelledError
pengutronix_aiohttp-json-rpc
train
py
5f5ea7b549d11cedfb4a3fe779eb7807ba298460
diff --git a/salt/utils/serializers/json.py b/salt/utils/serializers/json.py index <HASH>..<HASH> 100644 --- a/salt/utils/serializers/json.py +++ b/salt/utils/serializers/json.py @@ -15,7 +15,7 @@ try: except ImportError: import json -from six import string_types +from salt.utils.six import string_types from salt.utils.serializers import DeserializationError, SerializationError __all__ = ['deserialize', 'serialize', 'available']
Replaced module six in file /salt/utils/serializers/json.py
saltstack_salt
train
py
076afcb14e8be635439e1689d8c3af2ffcfbce85
diff --git a/addon/edit/closetag.js b/addon/edit/closetag.js index <HASH>..<HASH> 100644 --- a/addon/edit/closetag.js +++ b/addon/edit/closetag.js @@ -131,7 +131,7 @@ function autoCloseSlash(cm) { if (cm.getOption("disableInput")) return CodeMirror.Pass; - autoCloseCurrent(cm, true); + return autoCloseCurrent(cm, true); } CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
[closetag addon] Properly pass through return value for / key handler So that the CodeMirror.Pass it will return actually ends up in the editor.
codemirror_CodeMirror
train
js
a59ad0ec065777336a515ef847becadd53f135fe
diff --git a/ocpp/v15-soap/src/main/java/io/motown/ocpp/v15/soap/centralsystem/MotownCentralSystemService.java b/ocpp/v15-soap/src/main/java/io/motown/ocpp/v15/soap/centralsystem/MotownCentralSystemService.java index <HASH>..<HASH> 100644 --- a/ocpp/v15-soap/src/main/java/io/motown/ocpp/v15/soap/centralsystem/MotownCentralSystemService.java +++ b/ocpp/v15-soap/src/main/java/io/motown/ocpp/v15/soap/centralsystem/MotownCentralSystemService.java @@ -83,6 +83,8 @@ public class MotownCentralSystemService implements io.motown.ocpp.v15.soap.centr ComponentStatus componentStatus = getComponentStatusFromChargePointStatus(request.getStatus()); String errorCode = request.getErrorCode() != null ? request.getErrorCode().value() : null; + //TODO timestamp is not mandatory in the WSDL, however it's mandatory in the statusNotification command! - Mark van den Bergh, Februari 21st 2014 + domainService.statusNotification(chargingStationId, evseId, errorCode, componentStatus, request.getInfo(), request.getTimestamp(), request.getVendorId(), request.getVendorErrorCode()); return new StatusNotificationResponse(); }
Added TODO in statusNotification mandatory field
motown-io_motown
train
java
d5a3d085aa4529257e78a2c7defb430880086a75
diff --git a/lib/middleware.js b/lib/middleware.js index <HASH>..<HASH> 100644 --- a/lib/middleware.js +++ b/lib/middleware.js @@ -175,7 +175,10 @@ module.exports.log = function(req, res, next) { }; const log = function() { - let message = '@{status}, user: @{user}, req: \'@{request.method} @{request.url}\''; + let forwardedFor = req.headers['x-forwarded-for']; + let remoteAddress = req.connection.remoteAddress; + let remoteIP = forwardedFor ? `${forwardedFor} via ${remoteAddress}` : remoteAddress; + let message = '@{status}, user: @{user}(@{remoteIP}), req: \'@{request.method} @{request.url}\''; if (res._verdaccio_error) { message += ', error: @{!error}'; } else { @@ -187,6 +190,7 @@ module.exports.log = function(req, res, next) { request: {method: req.method, url: req.url}, level: 35, // http user: req.remote_user && req.remote_user.name, + remoteIP, status: res.statusCode, error: res._verdaccio_error, bytes: {
add remote ip to request log
verdaccio_verdaccio
train
js
8c06fff99609e9b70beca1779503c92e432fb3a3
diff --git a/Manager/WishlistManager.php b/Manager/WishlistManager.php index <HASH>..<HASH> 100755 --- a/Manager/WishlistManager.php +++ b/Manager/WishlistManager.php @@ -12,7 +12,7 @@ namespace WellCommerce\Bundle\WishlistBundle\Manager; -use WellCommerce\Bundle\CoreBundle\Manager\AbstractManager; +use WellCommerce\Bundle\DoctrineBundle\Manager\AbstractManager; /** * Class WishlistManager diff --git a/Tests/Manager/WishlistManagerTest.php b/Tests/Manager/WishlistManagerTest.php index <HASH>..<HASH> 100755 --- a/Tests/Manager/WishlistManagerTest.php +++ b/Tests/Manager/WishlistManagerTest.php @@ -12,7 +12,7 @@ namespace WellCommerce\Bundle\WishlistBundle\Tests\Manager; -use WellCommerce\Bundle\CoreBundle\Manager\ManagerInterface; +use WellCommerce\Bundle\DoctrineBundle\Manager\ManagerInterface; use WellCommerce\Bundle\CoreBundle\Test\Manager\AbstractManagerTestCase; use WellCommerce\Bundle\WishlistBundle\Entity\Wishlist;
Moved manager to DoctrineBundle
WellCommerce_WishlistBundle
train
php,php
5068d624730c0f2c675f1bf06a8c889e2670c375
diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index <HASH>..<HASH> 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -812,7 +812,7 @@ class Controller extends Object { */ public function render($action = null, $layout = null, $file = null) { $this->beforeRender(); - $this->Component->triggerCallback('beforeRender', $this); + $this->Components->triggerCallback('beforeRender', $this); $viewClass = $this->view; if ($this->view != 'View') {
Fixing issue that came up in rebasing.
cakephp_cakephp
train
php
226930a90638696f924d8fd13b4be558ef233ff4
diff --git a/src/Connection.php b/src/Connection.php index <HASH>..<HASH> 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -86,8 +86,7 @@ class Connection extends \hiqdev\hiart\rest\Connection implements ConnectionInte } /** - * Prepares authorization data. - * If user is not authorized redirects to authorization. + * Gets auth data from user. * @return array */ public function getAuth() @@ -96,24 +95,6 @@ class Connection extends \hiqdev\hiart\rest\Connection implements ConnectionInte return []; } - $user = Yii::$app->user; - - $identity = $user->identity; - if ($identity === null) { - Yii::$app->response->redirect('/site/login'); - Yii::$app->end(); - } - - $token = $identity->getAccessToken(); - if (empty($token)) { - /// this is very important line - /// without this line - redirect loop - Yii::$app->user->logout(); - - Yii::$app->response->redirect('/site/login'); - Yii::$app->end(); - } - - return ['access_token' => $token]; + return $this->app->user->getAuthData(); } }
moved getting auth data to User component in hipanel-core
hiqdev_hipanel-hiart
train
php
822dc71eee7ec14a7b70ff204fcdfdb159737376
diff --git a/tests/test_output_format.py b/tests/test_output_format.py index <HASH>..<HASH> 100644 --- a/tests/test_output_format.py +++ b/tests/test_output_format.py @@ -153,3 +153,18 @@ def test_video(): return 'test' assert hug.output_format.avi_video(FakeVideoWithSave()) == 'test' + +def test_on_content_type(): + '''Ensure that it's possible to route the output type format by the requested content-type''' + formatter = hug.output_format.on_content_type({'application/json': hug.output_format.json, + 'text/plain': hug.output_format.text}) + class FakeRequest(object): + content_type = 'application/json' + + request = FakeRequest() + response = FakeRequest() + converted = hug.input_format.json(formatter(BytesIO(hug.output_format.json({'name': 'name'})), request, response)) + assert converted == {'name': 'name'} + + request.content_type = 'text/plain' + assert formatter('hi', request, response) == b'hi'
Add test for multiple output formats based on content type
hugapi_hug
train
py
2a86c0007f4c2fe8b7cbc26993904fd16fc05f86
diff --git a/grimoire/elk/git.py b/grimoire/elk/git.py index <HASH>..<HASH> 100644 --- a/grimoire/elk/git.py +++ b/grimoire/elk/git.py @@ -222,11 +222,15 @@ class GitEnrich(Enrich): # Other enrichment eitem["repo_name"] = item["origin"] # Number of files touched - eitem["files"] = len(commit["files"]) + eitem["files"] = 0 # Number of lines added and removed lines_added = 0 lines_removed = 0 for cfile in commit["files"]: + if 'action' not in cfile: + # merges are not counted + continue + eitem["files"] += 1 if 'added' in cfile and 'removed' in cfile: try: lines_added += int(cfile["added"])
[enrich][git] Don't count files and lines in clean merges
chaoss_grimoirelab-elk
train
py
4c4472147540c8fe1635d11f4bbbbfaed6e44be6
diff --git a/great_expectations/render/renderer/notebook_renderer.py b/great_expectations/render/renderer/notebook_renderer.py index <HASH>..<HASH> 100755 --- a/great_expectations/render/renderer/notebook_renderer.py +++ b/great_expectations/render/renderer/notebook_renderer.py @@ -1,6 +1,9 @@ import os -import autopep8 +# FIXME : Abe 2020/02/04 : this line is breaking my environment in weird ways. +# Temporarily suppressing in order to move forward. +# DO NOT MERGE without reinstating. +# import autopep8 import nbformat from great_expectations.core import ExpectationSuite
Shamefacedly suppress autopep8
great-expectations_great_expectations
train
py
ffdcc30a18e5934825f8ec75e5370e3fe8f067d4
diff --git a/lib/developmentTeam.js b/lib/developmentTeam.js index <HASH>..<HASH> 100644 --- a/lib/developmentTeam.js +++ b/lib/developmentTeam.js @@ -60,8 +60,13 @@ function getFromSearch() { "name": "basedir", "message": "Where should I search for your existing XCode projects?", "default": homedir, - "validate": (answer)=>{return answer && fs.existsSync(answer);} + "validate": (answer)=>{ + if(!answer) return false; + answer = answer.replace("~", process.env.HOME); + return fs.existsSync(answer); + } }]).then((answers)=>{ + const basedir = answers.basedir.replace("~", process.env.HOME); const command = "find " + answers.basedir + " | grep -m500 \"project\\.pbxproj\" | xargs -L1 -JABC grep \"evelopmentTeam\" \"ABC\" 2>/dev/null | sort | uniq"; console.log("\nLooking for development teams...") cpp.exec(command, {encoding: "utf8"}).then((out)=>{
Fixing up validate to properly handle the tilde for home directory.
rhdeck_react-native-runios-withdevteam
train
js
525b4536c8417a829c9c7a48f20a892ff01cac5d
diff --git a/base/edf/thread_test.go b/base/edf/thread_test.go index <HASH>..<HASH> 100644 --- a/base/edf/thread_test.go +++ b/base/edf/thread_test.go @@ -55,5 +55,6 @@ func TestThreadFindAndWrite(T *testing.T) { }) }) }) + os.Remove("hello.db") }) -} \ No newline at end of file +}
Delete tmpfile after edf test
sjwhitworth_golearn
train
go
bac69cc2b02af95046ab78f034107018f45fa074
diff --git a/src-modules/org/opencms/workplace/tools/modules/CmsCloneModule.java b/src-modules/org/opencms/workplace/tools/modules/CmsCloneModule.java index <HASH>..<HASH> 100644 --- a/src-modules/org/opencms/workplace/tools/modules/CmsCloneModule.java +++ b/src-modules/org/opencms/workplace/tools/modules/CmsCloneModule.java @@ -280,8 +280,12 @@ public class CmsCloneModule extends CmsJspActionElement { adjustModuleResources(sourceModule, targetModule, sourcePathPart, targetPathPart, iconPaths); // search and replace the localization keys - List<CmsResource> props = getCmsObject().readResources(targetClassesPath, CmsResourceFilter.DEFAULT_FILES); - replacesMessages(descKeys, props); + if (getCmsObject().existsResource(targetClassesPath)) { + List<CmsResource> props = getCmsObject().readResources( + targetClassesPath, + CmsResourceFilter.DEFAULT_FILES); + replacesMessages(descKeys, props); + } int type = OpenCms.getResourceManager().getResourceType(CmsVfsBundleManager.TYPE_XML_BUNDLE).getTypeId(); CmsResourceFilter filter = CmsResourceFilter.requireType(type);
Improved stability of the module clone process.
alkacon_opencms-core
train
java
81db1b20b7df301bc90c1a375644af5453fa541f
diff --git a/src/Orchestra/Control/Validation/Role.php b/src/Orchestra/Control/Validation/Role.php index <HASH>..<HASH> 100644 --- a/src/Orchestra/Control/Validation/Role.php +++ b/src/Orchestra/Control/Validation/Role.php @@ -16,7 +16,6 @@ class Role extends Validator /** * On create validations. * - * @access public * @return void */ protected function onCreate() @@ -27,7 +26,6 @@ class Role extends Validator /** * On update validations. * - * @access public * @return void */ protected function onUpdate()
remove some unrelevant docblock.
orchestral_control
train
php
a16be1103863ed5afc38e152ee2229c7026f4c9c
diff --git a/core/server/api/authentication.js b/core/server/api/authentication.js index <HASH>..<HASH> 100644 --- a/core/server/api/authentication.js +++ b/core/server/api/authentication.js @@ -287,6 +287,25 @@ authentication = { }).then(function (result) { return Promise.resolve({users: [result]}); }); + }, + + revoke: function (object) { + var token; + + if (object.token_type_hint && object.token_type_hint === 'access_token') { + token = dataProvider.Accesstoken; + } else if (object.token_type_hint && object.token_type_hint === 'refresh_token') { + token = dataProvider.Refreshtoken; + } else { + return errors.BadRequestError('Invalid token_type_hint given.'); + } + + return token.destroyByToken({token: object.token}).then(function () { + return Promise.resolve({token: object.token}); + }, function () { + // On error we still want a 200. See https://tools.ietf.org/html/rfc7009#page-5 + return Promise.resolve({token: object.token, error: 'Invalid token provided'}); + }); } };
re-added revoke method to authentication api closes #<I> - adds revoke api method back into code base
TryGhost_Ghost
train
js
a8cdecd565e00b3de7da8539ef3d7b700b171631
diff --git a/args4j/src/org/kohsuke/args4j/CmdLineParser.java b/args4j/src/org/kohsuke/args4j/CmdLineParser.java index <HASH>..<HASH> 100644 --- a/args4j/src/org/kohsuke/args4j/CmdLineParser.java +++ b/args4j/src/org/kohsuke/args4j/CmdLineParser.java @@ -23,7 +23,6 @@ import java.util.ResourceBundle; import java.util.Set; import java.util.TreeMap; import java.util.logging.Logger; - import org.kohsuke.args4j.spi.BooleanOptionHandler; import org.kohsuke.args4j.spi.ByteOptionHandler; import org.kohsuke.args4j.spi.CharOptionHandler; @@ -380,7 +379,7 @@ public class CmdLineParser { int lineLength; String candidate = restOfLine.substring(0, maxLength); int sp=candidate.lastIndexOf(' '); - if(sp>maxLength*3/4) lineLength=sp; + if(sp>maxLength*3/5) lineLength=sp; else lineLength=maxLength; rv.add(restOfLine.substring(0, lineLength)); restOfLine = restOfLine.substring(lineLength).trim();
a bit more graceful line breaking in usage printer
kohsuke_args4j
train
java
b79cc8970e47b000f09dd916b7e2d7de9b87d15a
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/Finally.java b/core/src/main/java/com/google/errorprone/bugpatterns/Finally.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/Finally.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/Finally.java @@ -61,12 +61,11 @@ import com.sun.tools.javac.util.Name; * @author cushon@google.com (Liam Miller-Cushon) */ @BugPattern(name = "Finally", altNames = "finally", - summary = "Finally clause cannot complete normally", - explanation = "Transferring control from a finally block (via break, continue, return, or " - + "throw) has unintuitive behavior. Please restructure your code so that you " - + "don't have to transfer control flow from a finally block.\n\n" - + "Please see the positive cases below for examples and explanations of why this is " - + "dangerous.", + summary = "Finally block may not complete normally", + explanation = "Terminating a finally block abruptly preempts the outcome of the try block, " + + "and will cause the result of any previously executed return or throw statements to " + + "be ignored. This is considered extremely confusing. Please refactor this code to ensure " + + "that the finally block will always complete normally.", category = JDK, severity = ERROR, maturity = EXPERIMENTAL) public class Finally extends BugChecker implements ContinueTreeMatcher, ThrowTreeMatcher, BreakTreeMatcher, ReturnTreeMatcher {
Improve description for Finally check. ------------- Created by MOE: <URL>
google_error-prone
train
java
e5ccc551dcd66cf5ca23cc5c5dc8b7643e02d584
diff --git a/client/driver/exec_linux.go b/client/driver/exec_linux.go index <HASH>..<HASH> 100644 --- a/client/driver/exec_linux.go +++ b/client/driver/exec_linux.go @@ -13,6 +13,9 @@ const ( ) func (d *ExecDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstructs.FingerprintResponse) error { + // The exec driver will be detected in every case + resp.Detected = true + // Only enable if cgroups are available and we are root if !cgroupsMounted(req.Node) { if d.fingerprintSuccess == nil || *d.fingerprintSuccess { @@ -35,6 +38,5 @@ func (d *ExecDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstruct } resp.AddAttribute(execDriverAttr, "1") d.fingerprintSuccess = helper.BoolToPtr(true) - resp.Detected = true return nil } diff --git a/client/driver/java.go b/client/driver/java.go index <HASH>..<HASH> 100644 --- a/client/driver/java.go +++ b/client/driver/java.go @@ -119,6 +119,7 @@ func (d *JavaDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstruct } d.fingerprintSuccess = helper.BoolToPtr(false) resp.RemoveAttribute(javaDriverAttr) + resp.Detected = true return nil }
add detected to more drivers where the driver is found but unusable
hashicorp_nomad
train
go,go
ffca5556f5ada8e7ac626b2665723235ff95fe28
diff --git a/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java b/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java +++ b/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java @@ -30,6 +30,14 @@ public class InMemoryJavaCompiler { } /** + * @return the class loader used internally by the compiler + */ + public ClassLoader getClassloader() + { + return classLoader; + } + + /** * Options used by the compiler, e.g. '-Xlint:unchecked'. * @param options * @return
Added getter for classloader
trung_InMemoryJavaCompiler
train
java
205cfe33cbd89dba8afc0c9be5f37bdbcc69ec70
diff --git a/django_db_geventpool/utils.py b/django_db_geventpool/utils.py index <HASH>..<HASH> 100644 --- a/django_db_geventpool/utils.py +++ b/django_db_geventpool/utils.py @@ -8,7 +8,8 @@ from django.core.signals import request_finished def close_connection(f): @wraps(f) def wrapper(*args, **kwargs): - result = f(*args, **kwargs) - request_finished.send(sender='greenlet') - return result + try: + return f(*args, **kwargs) + finally: + request_finished.send(sender='greenlet') return wrapper
ensuring that connection is closed, even if error is raised
jneight_django-db-geventpool
train
py
49df9e56887e7050da1c3488b189147c1ceb0369
diff --git a/lib/archiving/archive_table.rb b/lib/archiving/archive_table.rb index <HASH>..<HASH> 100644 --- a/lib/archiving/archive_table.rb +++ b/lib/archiving/archive_table.rb @@ -104,10 +104,11 @@ module Archiving def archive! transaction do archived_instance = self.class.archive.new - attributes.each do |name, value| - archived_instance.send("#{name}=", value) + attributes.keys.each do |name| + archived_instance.send(:write_attribute, name, read_attribute(name)) end - archived_instance.save(validate: false) + raise "Unarchivable attributes" if archived_instance.attributes != attributes + archived_instance.save!(validate: false) self.class.archive_associations.each do |assoc_name| assoc = send(assoc_name) if assoc && assoc.respond_to?(:archive!)
Use attr. read and writer. Added an attr. safety check and fail on failed save()
firmafon_archiving
train
rb
cb5f17c4b5c2a0fbe91aff13b2acd724930a54b7
diff --git a/self_out_request.js b/self_out_request.js index <HASH>..<HASH> 100644 --- a/self_out_request.js +++ b/self_out_request.js @@ -64,14 +64,18 @@ function makeInreq(id, options) { self.inreq.headers = self.headers; function onError(err) { - if (called) return; + if (called) { + return; + } called = true; self.conn.ops.popOutReq(id); self.errorEvent.emit(self, err); } function onResponse(res) { - if (called) return; + if (called) { + return; + } called = true; self.conn.ops.popOutReq(id); self.emitResponse(res); @@ -85,7 +89,9 @@ SelfStreamingOutRequest.prototype._sendCallRequestCont = function passRequestParts(args, isLast ) { var self = this; self.inreq.handleFrame(args, isLast); - if (!self.closing) self.conn.ops.lastTimeoutTime = 0; + if (!self.closing) { + self.conn.ops.lastTimeoutTime = 0; + } }; module.exports.OutRequest = SelfOutRequest;
linting: [self_out_request] comply with curly rule
uber_tchannel-node
train
js
e33d3be488e97e7d1ef4c7ae701b0b0d61073c35
diff --git a/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php b/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php +++ b/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php @@ -504,6 +504,7 @@ class VersionTest extends MigrationTestCase 'doctrine_param' => [[[1,2,3,4,5]], [Connection::PARAM_INT_ARRAY], '[1, 2, 3, 4, 5]'], 'doctrine_param_grouped' => [[[1,2],[3,4,5]], [Connection::PARAM_INT_ARRAY, Connection::PARAM_INT_ARRAY], '[1, 2], [3, 4, 5]'], 'boolean' => [[true], [''], '[true]'], + 'object' => [[new \stdClass('test')], [''], '[?]'], ]; }
Add a test for the object case
doctrine_migrations
train
php
3b7a3c24f2749188edc4e7c86f15f2f60c250925
diff --git a/generators/client/index.js b/generators/client/index.js index <HASH>..<HASH> 100644 --- a/generators/client/index.js +++ b/generators/client/index.js @@ -150,6 +150,7 @@ module.exports = JhipsterClientGenerator.extend({ this.enableTranslation = this.config.get('enableTranslation'); // this is enabled by default to avoid conflicts for existing applications this.nativeLanguage = this.config.get('nativeLanguage'); this.languages = this.config.get('languages'); + this.messageBroker = this.config.get('messageBroker'); this.packagejs = packagejs; var baseName = this.config.get('baseName'); if (baseName) {
set messageBroker when generating just the client
jhipster_generator-jhipster
train
js
e11b02e63e83cf4ccdcbee4799868c1ec02906e3
diff --git a/lib/inherited_resources/base_helpers.rb b/lib/inherited_resources/base_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/inherited_resources/base_helpers.rb +++ b/lib/inherited_resources/base_helpers.rb @@ -231,6 +231,9 @@ module InheritedResources # given and returns it. Otherwise returns nil. # def respond_with_dual_blocks(object, options, &block) #:nodoc: + + options[:location] = collection_url unless self.respond_to?(:show) + args = (with_chain(object) << options) case block.try(:arity)
Redirect to index action in show not defined
activeadmin_inherited_resources
train
rb
7bef5b911e4f38bc66e5e2ad52ec5f3156d55d84
diff --git a/armet/connectors/sqlalchemy/resources.py b/armet/connectors/sqlalchemy/resources.py index <HASH>..<HASH> 100644 --- a/armet/connectors/sqlalchemy/resources.py +++ b/armet/connectors/sqlalchemy/resources.py @@ -174,6 +174,9 @@ class ModelResource(object): self.session.add(target) self.session.flush() + # Refresh the target object to avoid inconsistencies with storage. + self.session.expire(target) + # Return the target. return target
Refresh the target object to avoid inconsistencies with storage (In create)
armet_python-armet
train
py
8b563b8a8609daaac81bd0402f678e867a9d0942
diff --git a/executionserver/engine_lsf.js b/executionserver/engine_lsf.js index <HASH>..<HASH> 100644 --- a/executionserver/engine_lsf.js +++ b/executionserver/engine_lsf.js @@ -9,7 +9,7 @@ module.exports = function (conf) { var Joi = require('joi'); var executionmethods = require('./executionserver.methods')(conf); - var joijob = require('./joi.job')(); + var joijob = require('./joi.job')(Joi); var handler = {}; diff --git a/executionserver/engine_unix.js b/executionserver/engine_unix.js index <HASH>..<HASH> 100644 --- a/executionserver/engine_unix.js +++ b/executionserver/engine_unix.js @@ -9,7 +9,7 @@ module.exports = function (conf) { var Joi = require('joi'); var executionmethods = require('./executionserver.methods')(conf); - var joijob = require('./joi.job')(); + var joijob = require('./joi.job')(Joi); var handler = {};
BUG: Add joi dependency as a parameter In the execution server Joi is not installed for the server plugin
juanprietob_clusterpost
train
js,js
5ef41e75ab45a078f583a735f2be786bad5b9e88
diff --git a/src/geotiff.js b/src/geotiff.js index <HASH>..<HASH> 100644 --- a/src/geotiff.js +++ b/src/geotiff.js @@ -212,8 +212,8 @@ GeoTIFF.prototype = { this.dataView.getUint16(nextIFDByteOffset, this.littleEndian); var fileDirectory = {}; - - for (var i = byteOffset + (this.bigTiff ? 8 : 2), entryCount = 0; entryCount < numDirEntries; i += (this.bigTiff ? 20 : 12), ++entryCount) { + var i = nextIFDByteOffset + (this.bigTiff ? 8 : 2) + for (var entryCount = 0; entryCount < numDirEntries; i += (this.bigTiff ? 20 : 12), ++entryCount) { var fieldTag = this.dataView.getUint16(i, this.littleEndian); var fieldType = this.dataView.getUint16(i + 2, this.littleEndian); var typeCount = this.bigTiff ?
Fixing wrong base offset, only the first IFD offset was used.
geotiffjs_geotiff.js
train
js
90fcca29df390de244e2b16ef0279fd373482981
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb index <HASH>..<HASH> 100644 --- a/lib/axlsx/util/validators.rb +++ b/lib/axlsx/util/validators.rb @@ -297,4 +297,10 @@ module Axlsx def self.validate_display_blanks_as(v) RestrictionValidator.validate :display_blanks_as, [:gap, :span, :zero], v end + + # Requires that the value is one of :visible, :hidden, :very_hidden + def self.validate_view_visibility(v) + RestrictionValidator.validate :visibility, [:visible, :hidden, :very_hidden], v + end + end
add validation for Worksheet#state and WorkbookView#visibility
randym_axlsx
train
rb
c1593b26377f34a3f3d7baa02a5b7356f5cf1c1d
diff --git a/tests/functional/CreateCept.php b/tests/functional/CreateCept.php index <HASH>..<HASH> 100644 --- a/tests/functional/CreateCept.php +++ b/tests/functional/CreateCept.php @@ -7,7 +7,8 @@ $I = new TestGuy($scenario); $I->wantTo('ensure that user creation works'); $loginPage = LoginPage::openBy($I); -$loginPage->login('user@example.com', 'qwerty'); +$user = $I->getFixture('user')->getModel('user'); +$loginPage->login($user->email, 'qwerty'); $page = CreatePage::openBy($I); diff --git a/tests/functional/UpdateCept.php b/tests/functional/UpdateCept.php index <HASH>..<HASH> 100644 --- a/tests/functional/UpdateCept.php +++ b/tests/functional/UpdateCept.php @@ -7,7 +7,8 @@ $I = new TestGuy($scenario); $I->wantTo('ensure that user update works'); $loginPage = LoginPage::openBy($I); -$loginPage->login('user@example.com', 'qwerty'); +$user = $I->getFixture('user')->getModel('user'); +$loginPage->login($user->email, 'qwerty'); $page = UpdatePage::openBy($I, ['id' => 2]);
refactored admin cepts
dektrium_yii2-user
train
php,php
36ea8bd206778852afb375f109800ca557600b01
diff --git a/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java b/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java index <HASH>..<HASH> 100644 --- a/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java +++ b/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java @@ -295,7 +295,9 @@ public abstract class JdbcExtractor extends QueryBasedExtractor<JsonArray, JsonE public void extractMetadata(String schema, String entity, WorkUnit workUnit) throws SchemaException, IOException { this.log.info("Extract metadata using JDBC"); String inputQuery = workUnitState.getProp(ConfigurationKeys.SOURCE_QUERYBASED_QUERY); - if (hasJoinOperation(inputQuery)) { + if (workUnitState.getPropAsBoolean(ConfigurationKeys.SOURCE_QUERYBASED_IS_METADATA_COLUMN_CHECK_ENABLED, + Boolean.valueOf(ConfigurationKeys.DEFAULT_SOURCE_QUERYBASED_IS_METADATA_COLUMN_CHECK_ENABLED)) && + hasJoinOperation(inputQuery)) { throw new RuntimeException("Query across multiple tables not supported"); }
[GOBBLIN-<I>] Allow join operations if metadata check is disabled Closes #<I> from jack-moseley/mysql-join-check
apache_incubator-gobblin
train
java
bb61f23692b3781bad7df7ba838a61305b5a8e5f
diff --git a/pandas/tseries/period.py b/pandas/tseries/period.py index <HASH>..<HASH> 100644 --- a/pandas/tseries/period.py +++ b/pandas/tseries/period.py @@ -50,7 +50,8 @@ class Period(PandasObject): value : Period or compat.string_types, default None The time period represented (e.g., '4Q2005') freq : str, default None - e.g., 'B' for businessday. Must be a singlular rule-code (e.g. 5T is not allowed). + e.g., 'B' for businessday. Must be a singular rule-code (e.g. 5T is not + allowed). year : int, default None month : int, default 1 quarter : int, default None
CLN: tiny typo from GH<I>: Period() docstring
pandas-dev_pandas
train
py
fcc981d25fe0a87f70f7b4e6a53974dc8cd69464
diff --git a/src/org/zaproxy/zap/model/Context.java b/src/org/zaproxy/zap/model/Context.java index <HASH>..<HASH> 100644 --- a/src/org/zaproxy/zap/model/Context.java +++ b/src/org/zaproxy/zap/model/Context.java @@ -35,6 +35,7 @@ import org.parosproxy.paros.model.Session; import org.parosproxy.paros.model.SiteMap; import org.parosproxy.paros.model.SiteNode; import org.parosproxy.paros.network.HttpRequestHeader; +import org.parosproxy.paros.view.View; import org.zaproxy.zap.authentication.AuthenticationMethod; import org.zaproxy.zap.authentication.ManualAuthenticationMethodType.ManualAuthenticationMethod; import org.zaproxy.zap.extension.authorization.AuthorizationDetectionMethod; @@ -556,7 +557,7 @@ public class Context { } public void restructureSiteTree() { - if (EventQueue.isDispatchThread()) { + if (!View.isInitialised() || EventQueue.isDispatchThread()) { restructureSiteTreeEventHandler(); } else { try {
Do not access EDT in daemon mode in Context class Change Context class to not access the EDT if the view is not initialised, when restructuring the sites tree.
zaproxy_zaproxy
train
java
f4e178155daa57482c653c62daba1f630d70eba5
diff --git a/lib/ardes/resources_controller.rb b/lib/ardes/resources_controller.rb index <HASH>..<HASH> 100644 --- a/lib/ardes/resources_controller.rb +++ b/lib/ardes/resources_controller.rb @@ -824,6 +824,10 @@ module Ardes#:nodoc: resource_specification.find ? resource_specification.find_custom(controller) : super end + def new(*args, &block) + service.new(*args, &block) + end + def respond_to?(method) super || service.respond_to?(method) end
Adding explicit call to service.new, because of recent change in rails (see <URL>)
ianwhite_resources_controller
train
rb
1d63519f6bbbcaeff7c6772799a7b96b864f34bd
diff --git a/config_test.go b/config_test.go index <HASH>..<HASH> 100644 --- a/config_test.go +++ b/config_test.go @@ -62,6 +62,18 @@ var _ = Describe("JWTAuth Config", func() { path /path1 path /path2 }`, true, nil}, + {`jwt { + path / + except /login + except /test + allowroot + }`, false, []Rule{ + Rule{ + Path: "/", + ExceptedPaths: []string{"/login", "/test"}, + AllowRoot: true, + }, + }}, } for _, test := range tests { c := caddy.NewTestController("http", test.input) @@ -76,6 +88,8 @@ var _ = Describe("JWTAuth Config", func() { Expect(rule.Path).To(Equal(actualRule.Path)) Expect(rule.Redirect).To(Equal(actualRule.Redirect)) Expect(rule.AccessRules).To(Equal(actualRule.AccessRules)) + Expect(rule.ExceptedPaths).To(Equal(actualRule.ExceptedPaths)) + Expect(rule.AllowRoot).To(Equal(actualRule.AllowRoot)) } }
add test for new config block directives
BTBurke_caddy-jwt
train
go
9414ce4c5b429ecc05fcd3539f2c58a26bbfd4bd
diff --git a/polymodels/tests/test_managers.py b/polymodels/tests/test_managers.py index <HASH>..<HASH> 100644 --- a/polymodels/tests/test_managers.py +++ b/polymodels/tests/test_managers.py @@ -52,7 +52,10 @@ class PolymorphicQuerySetTest(TestCase): if django.VERSION < (1, 6): animal_mammals_expected_num_queries += Monkey.objects.count() animal_mammals_expected_query_select_related['mammal'] = {} - self.assertEquals(animal_mammals.query.select_related, animal_mammals_expected_query_select_related) + self.assertEqual( + animal_mammals.query.select_related, + animal_mammals_expected_query_select_related + ) with self.assertNumQueries(animal_mammals_expected_num_queries): self.assertQuerysetEqual(animal_mammals.all(), ['<Mammal: mammal>',
Use asserEqual instead of assertEquals
charettes_django-polymodels
train
py
6b3533df001b81a3657f7374c7123ca392e93276
diff --git a/solvebio/resource/manifest.py b/solvebio/resource/manifest.py index <HASH>..<HASH> 100644 --- a/solvebio/resource/manifest.py +++ b/solvebio/resource/manifest.py @@ -62,6 +62,8 @@ class Manifest(object): return bool(p.scheme) for path in args: + path = os.path.expandpath(path) + if _is_url(path): self.add_url(path) elif os.path.isfile(path): @@ -74,7 +76,6 @@ class Manifest(object): self.add_file(f) else: raise ValueError( - 'Paths in manifest must be valid URL ' - '(starting with http:// or https://) or ' - 'a valid local filename, directory, ' - 'or glob (such as: *.vcf)') + 'Manifest paths must be files, directories, or URLs. ' + 'The following extensions are supported: ' + '.vcf .vcf.gz .json .json.gz')
expanduser prior to checking ispath or isdir in manifest (fixes #<I>)
solvebio_solvebio-python
train
py
7682b53d77b617c168e2f482c7f7c75c3c748fb1
diff --git a/lib/engine_ws.js b/lib/engine_ws.js index <HASH>..<HASH> 100644 --- a/lib/engine_ws.js +++ b/lib/engine_ws.js @@ -26,6 +26,10 @@ WSEngine.prototype.step = function (requestSpec, ee) { return engineUtil.createLoopWithCount(requestSpec.count || -1, steps); } + if (requestSpec.think) { + return engineUtil.createThink(requestSpec); + } + let f = function(context, callback) { ee.emit('request'); let startedAt = process.hrtime();
Enable 'think' in ws engine
artilleryio_artillery
train
js
aa6b05f4b14b0144beb7f63b30593aaaaa23609c
diff --git a/config/webpack.config.js b/config/webpack.config.js index <HASH>..<HASH> 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -1,4 +1,8 @@ var path = require('path'); +var webpack = require('webpack'); + + + // for prod builds, we have already done AoT and AoT writes to disk // so read the JS file from disk @@ -12,8 +16,20 @@ function getEntryPoint() { return '{{TMP}}/app/main.dev.js'; } +function getPlugins() { + if (process.env.IONIC_ENV === 'prod') { + return [ + // This helps ensure the builds are consistent if source hasn't changed: + new webpack.optimize.OccurrenceOrderPlugin(), + // Try to dedupe duplicated modules, if any: + // Add this back in when Angular fixes the issue: https://github.com/angular/angular-cli/issues/1587 + //new DedupePlugin() + ]; + } + return []; +} + module.exports = { - devtool: 'source-map', entry: getEntryPoint(), output: { path: '{{BUILD}}', @@ -31,5 +47,15 @@ module.exports = { loader: 'json' } ] + }, + + plugins: getPlugins(), + + // Some libraries import Node modules but don't use them in the browser. + // Tell Webpack to provide empty mocks for them so importing them works. + node: { + fs: 'empty', + net: 'empty', + tls: 'empty' } }; \ No newline at end of file
chore(webpack): add optimize plugins
ionic-team_ionic-app-scripts
train
js
639a65989a3136c8f24dd1242f79b2ecdf402a15
diff --git a/cheroot/server.py b/cheroot/server.py index <HASH>..<HASH> 100644 --- a/cheroot/server.py +++ b/cheroot/server.py @@ -1162,7 +1162,8 @@ class HTTPRequest: # Override the decision to not close the connection if the connection # manager doesn't have space for it. if not self.close_connection: - can_keep = self.server.connections.can_add_keepalive_connection + can_keep = self.ready \ + and self.server.connections.can_add_keepalive_connection self.close_connection = not can_keep if b'connection' not in hkeys:
server: don't use connections after it's closed
cherrypy_cheroot
train
py
71fd9cee02df42b9e7a2827d295e1a1a4c413afb
diff --git a/lib/health-data-standards/models/svs/value_set.rb b/lib/health-data-standards/models/svs/value_set.rb index <HASH>..<HASH> 100644 --- a/lib/health-data-standards/models/svs/value_set.rb +++ b/lib/health-data-standards/models/svs/value_set.rb @@ -11,7 +11,7 @@ module HealthDataStandards scope :by_oid, ->(oid){where(:oid => oid)} def self.load_from_xml(doc) - doc.root.add_namespace_uri("vs","urn:ihe:iti:svs:2008") + doc.root.add_namespace_definition("vs","urn:ihe:iti:svs:2008") vs_element = doc.at_xpath("/vs:RetrieveValueSetResponse/vs:ValueSet") if vs_element vs = ValueSet.new(oid: vs_element["ID"], display_name: vs_element["displayName"], version: vs_element["version"]) @@ -21,7 +21,6 @@ module HealthDataStandards code_system_version: con["code_system_version"], display_name: con["displayName"]) end - vs.save return vs end end
changing bad method call to correct one to add namespace to document
projectcypress_health-data-standards
train
rb
b5ccdc24adcd197bf8b071e0a1039ad7919ae64e
diff --git a/src/main/java/com/aoindustries/util/i18n/EditableResourceBundle.java b/src/main/java/com/aoindustries/util/i18n/EditableResourceBundle.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/aoindustries/util/i18n/EditableResourceBundle.java +++ b/src/main/java/com/aoindustries/util/i18n/EditableResourceBundle.java @@ -1,6 +1,6 @@ /* * aocode-public - Reusable Java library of general tools with minimal external dependencies. - * Copyright (C) 2009, 2010, 2011, 2013, 2015, 2016, 2018, 2019 AO Industries, Inc. + * Copyright (C) 2009, 2010, 2011, 2013, 2015, 2016, 2018, 2019, 2020 AO Industries, Inc. * support@aoindustries.com * 7262 Bull Pen Cir * Mobile, AL 36695 @@ -213,6 +213,7 @@ abstract public class EditableResourceBundle extends ModifiablePropertiesResourc * @see BundleLookupThreadContext * </p> * TODO: Add language resources to properties files (but do not make it an editable properties file to avoid possible infinite recursion?) + * TODO: Decouple from aocode-public and use ao-fluent-html */ public static void printEditableResourceBundleLookups( Encoder textInJavaScriptEncoder,
TODO: Decouple from aocode-public and use ao-fluent-html
aoindustries_aocode-public
train
java
8acfa7fddfa01f4dec83fe51f4960969469826ef
diff --git a/lib/patternEmitter.js b/lib/patternEmitter.js index <HASH>..<HASH> 100644 --- a/lib/patternEmitter.js +++ b/lib/patternEmitter.js @@ -258,20 +258,20 @@ PatternEmitter.prototype._getMatching = function(type) { continue; } - if (regex.test(type)) { - if (!matching) { - matching = this._patternEvents[pattern]; - } else { - listeners = this._patternEvents[pattern]; - if (!(listeners instanceof Array)) { - listeners = [listeners]; - } - - if (!(matching instanceof Array)) { - matching = [matching]; - } - matching = matching.concat(listeners); + if (!regex.test(type)) continue; + + if (!matching) { + matching = this._patternEvents[pattern]; + } else { + listeners = this._patternEvents[pattern]; + if (!(listeners instanceof Array)) { + listeners = [listeners]; } + + if (!(matching instanceof Array)) { + matching = [matching]; + } + matching = matching.concat(listeners); } }
Small style fix in _getMatching
danielstjules_pattern-emitter
train
js
71283ca9bdeecc921a3aa1ddf457a88e51e7b3a7
diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -5,7 +5,6 @@ namespace Freyo\Flysystem\QcloudCOSv4; use Freyo\Flysystem\QcloudCOSv4\Plugins\GetUrl; use Freyo\Flysystem\QcloudCOSv4\Plugins\PutRemoteFile; use Freyo\Flysystem\QcloudCOSv4\Plugins\PutRemoteFileAs; -use Illuminate\Foundation\Application as LaravelApplication; use Illuminate\Support\ServiceProvider as LaravelServiceProvider; use Laravel\Lumen\Application as LumenApplication; use League\Flysystem\Filesystem; @@ -29,11 +28,11 @@ class ServiceProvider extends LaravelServiceProvider $this->app->make('filesystem') ->extend('cosv4', function ($app, $config) { $flysystem = new Filesystem(new Adapter($config)); - + $flysystem->addPlugin(new PutRemoteFile()); $flysystem->addPlugin(new PutRemoteFileAs()); $flysystem->addPlugin(new GetUrl()); - + return $flysystem; }); }
Apply fixes from StyleCI (#<I>)
freyo_flysystem-qcloud-cos-v4
train
php
2f7e2ac5d12e2acb5aa88d226b0741ecd497eac2
diff --git a/nyawc/Options.py b/nyawc/Options.py index <HASH>..<HASH> 100644 --- a/nyawc/Options.py +++ b/nyawc/Options.py @@ -22,6 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +import os import requests from nyawc.CrawlerActions import CrawlerActions @@ -190,7 +191,10 @@ class OptionsIdentity: def __init__(self): """Constructs an OptionsIdentity instance.""" - semver = open(".semver", "r") + file = os.path.realpath(__file__) + folder = os.path.dirname(file) + + semver = open(folder + "/../.semver", "r") self.auth = None self.cookies = requests.cookies.RequestsCookieJar()
Fixed reference to .semver file.
tijme_not-your-average-web-crawler
train
py
0d195286c1a9db3105bcb1041cbaea4415bfadc2
diff --git a/server/api.php b/server/api.php index <HASH>..<HASH> 100755 --- a/server/api.php +++ b/server/api.php @@ -127,6 +127,14 @@ class api $compiled = default_addons($phoxy_loading_module); $this->default_addons = array_merge_recursive($compiled, $this->addons); + + $this->default_addons = + $this->override_addons_on_init($this->default_addons); + } + + public function override_addons_on_init($addons) + { + return $addons; } public function APICall( $name, $arguments )
Allow module override its own addons
phoxy_phoxy
train
php
67e79a4251a32ef900eb5344677642ffefc030f7
diff --git a/graphite_api/utils.py b/graphite_api/utils.py index <HASH>..<HASH> 100644 --- a/graphite_api/utils.py +++ b/graphite_api/utils.py @@ -30,9 +30,9 @@ class RequestParams(object): if request.json and key in request.json: return request.json[key] if key in request.form: - return request.form[key] + return request.form.getlist(key)[-1] if key in request.args: - return request.args[key] + return request.args.getlist(key)[-1] raise KeyError def __contains__(self, key):
Switch request.GET and request.POST to last-provided wins to match Django's request handling Refs #<I>
brutasse_graphite-api
train
py
26cdf63231fd1dd806199b0ab902100da8d5c406
diff --git a/tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py b/tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py index <HASH>..<HASH> 100644 --- a/tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py +++ b/tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py @@ -64,7 +64,7 @@ TD = 4 REG_DELAY = 10 NETWORK_ID_TIMEOUT = 120 -WAIT_TIME_ALLOWANCE = 30 +WAIT_TIME_ALLOWANCE = 60 class MATN_15_ChangeOfPrimaryBBRTriggersRegistration(thread_cert.TestCase): @@ -140,8 +140,6 @@ class MATN_15_ChangeOfPrimaryBBRTriggersRegistration(thread_cert.TestCase): # Make sure that BR_2 becomes the primary BBR self.assertEqual('disabled', br1.get_state()) - self.assertEqual('leader', br2.get_state()) - self.assertEqual('router', router1.get_state()) self.assertFalse(br1.is_primary_backbone_router) self.assertTrue(br2.is_primary_backbone_router)
[github-actions] fix MATN_<I>_ChangeOfPrimaryBBRTriggersRegistration (#<I>)
openthread_openthread
train
py
38894dc469bbdc8e382dcb9529390c0694c14adb
diff --git a/test/test_buffer.py b/test/test_buffer.py index <HASH>..<HASH> 100644 --- a/test/test_buffer.py +++ b/test/test_buffer.py @@ -101,10 +101,10 @@ def test_number(): def test_name(): vim.command('new') eq(vim.current.buffer.name, '') - new_name = vim.eval('tempname()') + new_name = vim.eval('resolve(tempname())') vim.current.buffer.name = new_name eq(vim.current.buffer.name, new_name) - vim.command('w!') + vim.command('silent w!') ok(os.path.isfile(new_name)) os.unlink(new_name)
Resolve file name and silent write. This fixes symlink issues on OS X for /var and /private/var It also stops vim.command('w!') from blocking.
neovim_pynvim
train
py
961a1c019ea700cbbc692686979b20fd2f489b0b
diff --git a/shared/simplestreams/simplestreams.go b/shared/simplestreams/simplestreams.go index <HASH>..<HASH> 100644 --- a/shared/simplestreams/simplestreams.go +++ b/shared/simplestreams/simplestreams.go @@ -148,7 +148,7 @@ func (s *SimpleStreams) parseStream() (*Stream, error) { return s.cachedStream, nil } - body, err := s.cachedDownload("/streams/v1/index.json") + body, err := s.cachedDownload("streams/v1/index.json") if err != nil { return nil, err }
shared/simplestreams: Fix stream's index download url Since commit aef8f<I> ("shared/simplestreams: Implement caching support") the index url contains double '/' between the host part and the path part, so the resulting url looks like: <URL>, by removing the prepended '/' passed to s.cachedDownload().
lxc_lxd
train
go
e3dd2483bb78f3d4b80db6de5475ceb163155b80
diff --git a/datasette/app.py b/datasette/app.py index <HASH>..<HASH> 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -442,7 +442,7 @@ class RowTableShared(BaseView): '<a href="/{database}-{database_hash}/{table}/{id}">{label}</a>&nbsp;<em>{id}</em>'.format( database=database, database_hash=database_hash, - table=escape_sqlite_table_name(other_table), + table=urllib.parse.quote_plus(other_table), id=value, label=label, )
Fixed quoting on foreign-key links to tables with spaces in name
simonw_datasette
train
py
73bba437d35b6e15a67870e6d5f6c58d98ba0a04
diff --git a/spec/unit/pdk/cli/util/command_redirector_spec.rb b/spec/unit/pdk/cli/util/command_redirector_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/pdk/cli/util/command_redirector_spec.rb +++ b/spec/unit/pdk/cli/util/command_redirector_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' +require 'pdk/cli/util/command_redirector' describe PDK::CLI::Util::CommandRedirector do subject(:command_redirector) do
(maint) Ensure pdk/cli/util/command_redirector works standalone
puppetlabs_pdk
train
rb
ddc1a4d66fcb670bcab9e019e77a6b8ed9ed0d2b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ def readme(): return f.read() setup(name='pyTelegramBotAPI', - version='1.4.1', + version='1.4.2', description='Python Telegram bot api. ', long_description=readme(), author='eternnoir',
Version Update. Change log: - Add disable_notification parameter. - Added setters for message/inline/chosen-inline handlers.
eternnoir_pyTelegramBotAPI
train
py
76a964d0c7b8dc17641e258358da8a91adb6d92f
diff --git a/init.js b/init.js index <HASH>..<HASH> 100644 --- a/init.js +++ b/init.js @@ -10,7 +10,7 @@ var S_loadSyncScript=function(path){ }; //http://kangax.github.io/es5-compat-table/ //http://kangax.github.io/es5-compat-table/es6/ Promise: FF >= 30, Chrome >= 33 -if (!Object.keys || !(typeof Promise !== 'undefined' && typeof Promise.all === 'function')) { +if (!Object.keys || !(typeof Promise !== 'undefined' && typeof Promise.all === 'function') || !String.prototype.startsWith) { Object.keys || S_loadSyncScript('dist/es5-compat.js'); S_loadSyncScript('dist/es6-compat.js'); -} \ No newline at end of file +}
<I> Update init.js In Chromium <I> Promise is defined but String.prototype.startsWith is still not
christophehurpeau_springbokjs-shim
train
js
9282b51c246db8654e8b08e1c3bb5744a9affede
diff --git a/search_queries_query_string.go b/search_queries_query_string.go index <HASH>..<HASH> 100644 --- a/search_queries_query_string.go +++ b/search_queries_query_string.go @@ -201,6 +201,10 @@ func (q QueryStringQuery) Source() interface{} { query["tie_breaker"] = *q.tieBreaker } + if q.useDisMax != nil { + query["use_dis_max"] = *q.useDisMax + } + if q.defaultOper != "" { query["default_operator"] = q.defaultOper }
Forgot that use_dis_max
olivere_elastic
train
go
0cd3a12569b0d64adfe31baccd1b2b33d181523c
diff --git a/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsAwareTraitInjectionOperation.java b/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsAwareTraitInjectionOperation.java index <HASH>..<HASH> 100644 --- a/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsAwareTraitInjectionOperation.java +++ b/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsAwareTraitInjectionOperation.java @@ -92,7 +92,7 @@ public class GrailsAwareTraitInjectionOperation extends boolean implementsTrait = false; boolean traitNotLoaded = false; try { - implementsTrait = classNode.implementsInterface(traitClassNode); + implementsTrait = classNode.declaresInterface(traitClassNode); } catch (Throwable e) { // if we reach this point, the trait injector could not be loaded due to missing dependencies (for example missing servlet-api). This is ok, as we want to be able to compile against non-servlet environments. traitNotLoaded = true;
Use declaresInterface instead of implementsInterface This allows subclasses to implement the same trait as their super classes which allows them to get their own copies of static methods. grails-data-mapping needs this.
grails_grails-core
train
java
1bbb339e7e0321042cb57f794d646067269f6937
diff --git a/go/vt/sqlparser/token.go b/go/vt/sqlparser/token.go index <HASH>..<HASH> 100644 --- a/go/vt/sqlparser/token.go +++ b/go/vt/sqlparser/token.go @@ -257,6 +257,7 @@ var keywords = map[string]int{ "lines": LINES, "linestring": LINESTRING, "load": LOAD, + "local": LOCAL, "localtime": LOCALTIME, "localtimestamp": LOCALTIMESTAMP, "lock": LOCK, @@ -264,7 +265,7 @@ var keywords = map[string]int{ "longblob": LONGBLOB, "longtext": LONGTEXT, "loop": UNUSED, - "low_priority": UNUSED, + "low_priority": LOW_PRIORITY, "manifest": MANIFEST, "master_bind": UNUSED, "match": MATCH,
Added tokens LOW_PRIORITY and LOCAL
vitessio_vitess
train
go
d96e0aa61e4d658e28a458b04e907155f2504f64
diff --git a/pullv/repo/base.py b/pullv/repo/base.py index <HASH>..<HASH> 100644 --- a/pullv/repo/base.py +++ b/pullv/repo/base.py @@ -47,7 +47,7 @@ class BaseRepo(collections.MutableMapping, RepoLoggingAdapter): """Base class for repositories. Extends :py:class:`collections.MutableMapping` and - :py:class`logging.LoggerAdapter`. + :py:class:`logging.LoggerAdapter`. """
Typo in intersphinx link to logging.LoggerAdapter.
vcs-python_vcspull
train
py
e14905bfaab9cf0afd27972ef772f6652e50b0ed
diff --git a/rst2ansi/ansi.py b/rst2ansi/ansi.py index <HASH>..<HASH> 100644 --- a/rst2ansi/ansi.py +++ b/rst2ansi/ansi.py @@ -208,7 +208,7 @@ class ANSITranslator(nodes.NodeVisitor): def visit_document(self, node): self.push_ctx() - def depart_document(self, node): + def _print_references(self): self.push_style(styles = ['bold']) self.append('References:') self.pop_style() @@ -225,6 +225,8 @@ class ANSITranslator(nodes.NodeVisitor): self.references = [] self.pop_ctx() + def depart_document(self, node): + self._print_references() self.depart_section(node) self.pop_ctx()
Refactored reference list into its own function
Snaipe_python-rst2ansi
train
py
615acf60038a831f3b778622f067c699e36017bb
diff --git a/radiotool/algorithms/retarget.py b/radiotool/algorithms/retarget.py index <HASH>..<HASH> 100644 --- a/radiotool/algorithms/retarget.py +++ b/radiotool/algorithms/retarget.py @@ -258,8 +258,8 @@ def retarget(song, duration, music_labels=None, out_labels=None, out_penalty=Non first_pause = i break - max_beats = 200 - min_beats = 40 + max_beats = int(60. / song.analysis["avg_beat_duration"]) # ~ 1 minute + min_beats = int(30. / song.analysis["avg_beat_duration"]) # ~ 30 seconds max_beats = min(max_beats, penalty.shape[1]) tc2 = N.nan_to_num(trans_cost)
change defaults for max and min music beats
ucbvislab_radiotool
train
py
1f02553ead28676a59d22ce5629233d0ac3b43b0
diff --git a/tests/jenkins.py b/tests/jenkins.py index <HASH>..<HASH> 100644 --- a/tests/jenkins.py +++ b/tests/jenkins.py @@ -62,6 +62,9 @@ def run(platform, provider, commit, clean): sys.stdout.flush() sys.exit(proc.returncode) + print('VM Bootstrapped. Exit code: {0}'.format(proc.returncode)) + sys.stdout.flush() + # Run tests here cmd = 'salt -t 1800 {0} state.sls testrun pillar="{{git_commit: {1}}}" --no-color'.format( vm_name, @@ -78,6 +81,7 @@ def run(platform, provider, commit, clean): ) proc.poll_and_read_until_finish() stdout, stderr = proc.communicate() + if stderr: print(stderr) if stdout:
Some more information about the bootstrap process.
saltstack_salt
train
py
1e2d8ec9cfe9368b9311ab27dcbe957ad60d6521
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index <HASH>..<HASH> 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -1579,7 +1579,7 @@ class NDFrameGroupBy(GroupBy): if self.axis != 0: # pragma: no cover raise ValueError('Can only pass dict with axis=0') - obj = self._obj_with_exclusions + obj = self.obj if any(isinstance(x, (list, tuple, dict)) for x in arg.values()): new_arg = OrderedDict()
ENH: don't make unnecessary data copy in groupby
pandas-dev_pandas
train
py
6ada11ed98d74a2ce96bc4f0d96b51463fcfa348
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -2,6 +2,7 @@ process.env.ethTest = 'BasicTests' module.exports = function (config) { config.set({ + browserNoActivityTimeout: 60000, frameworks: ['browserify', 'detectBrowsers', 'tap'], files: [ './tests/genesis.js',
uped the browser timeout for travis
ethereumjs_ethereumjs-block
train
js
342b9abefaaa70c30ca9d996feb7d537ca8f193a
diff --git a/src/Sniffs/ForbiddenSuperGlobalSniff.php b/src/Sniffs/ForbiddenSuperGlobalSniff.php index <HASH>..<HASH> 100644 --- a/src/Sniffs/ForbiddenSuperGlobalSniff.php +++ b/src/Sniffs/ForbiddenSuperGlobalSniff.php @@ -16,7 +16,9 @@ final class ForbiddenSuperGlobalSniff implements Sniff /** * @var string[] */ - private $superglobalVariables = ['$_COOKIE', '$_GET', '$_FILES', '$_POST', '$_REQUEST', '$_SERVER']; + private $superglobalVariables = [ + '$_COOKIE', '$_GET', '$_FILES', '$_POST', '$_REQUEST', '$_SERVER', '$_SESSION', '$_ENV', '$GLOBALS', + ]; /** * @return int[]
ForbiddenSuperGlobalSniff - add few missing global vars
shopsys_coding-standards
train
php
4452f9c4ac87e99d74cc650e6af21b749f249b17
diff --git a/tests/Integration/WhereConstraints/WhereConstraintsDirectiveTest.php b/tests/Integration/WhereConstraints/WhereConstraintsDirectiveTest.php index <HASH>..<HASH> 100644 --- a/tests/Integration/WhereConstraints/WhereConstraintsDirectiveTest.php +++ b/tests/Integration/WhereConstraints/WhereConstraintsDirectiveTest.php @@ -204,7 +204,7 @@ class WhereConstraintsDirectiveTest extends DBTestCase 'name' => '', ]); - $this->query(' + $this->graphQL(' { users( where: {
Fix WhereConstraintsDirectiveTest.php
nuwave_lighthouse
train
php
639cc0222cf670df2355fb10332313e618738b7a
diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index <HASH>..<HASH> 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -874,7 +874,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; //get the uploaded file ID when this event triggers, signaling the upload has compeleted successfully editFieldIDs.push($(this).data('id')); }); - var uploadedFiles = $('.ss-uploadfield-files').children('.ss-uploadfield-item'); + var uploadedFiles = form.find('.ss-uploadfield-files').children('.ss-uploadfield-item'); uploadedFiles.each(function(){ var uploadedID = $(this).data('fileid'); if ($.inArray(uploadedID, editFieldIDs) == -1) {
BUG Fix insert media form inserting images from other UploadFields (fixes #<I>) The insert media form would pick up unwanted images from other UploadFields. Limiting where it is looking to only the closest form fixes this.
silverstripe_silverstripe-framework
train
js
9e10fd59d6a9c7f0abe7fb25e21b43346169481d
diff --git a/lib/demo.js b/lib/demo.js index <HASH>..<HASH> 100644 --- a/lib/demo.js +++ b/lib/demo.js @@ -15,6 +15,6 @@ export class Demo { this.template = template || path.resolve(__dirname, 'default-template.jade'); const specs = opt.specs && path.resolve(this.path, opt.specs); - this.specs = specs || path.resolve(this.path, 'specs/**/*.js'); + this.specs = specs || path.resolve(this.path, 'spec/**/*.js'); } }
rename default spec folder from specs to spec
lyweiwei_democase
train
js
01718b25f2c3aaa8be14a8c4c59f4cb3a7a21814
diff --git a/yelp_kafka_tool/kafka_consumer_manager/commands/offset_manager.py b/yelp_kafka_tool/kafka_consumer_manager/commands/offset_manager.py index <HASH>..<HASH> 100644 --- a/yelp_kafka_tool/kafka_consumer_manager/commands/offset_manager.py +++ b/yelp_kafka_tool/kafka_consumer_manager/commands/offset_manager.py @@ -55,6 +55,14 @@ class OffsetManagerBase(object): sys.exit(1) # Get all the topics that this consumer is subscribed to. + print( + "Getting all topics in cluster {cluster_name} " + "for consumer {groupid}".format( + cluster_name=cluster_config.name, + groupid=groupid, + ), + file=sys.stderr, + ) topics = cls.get_topics_from_consumer_group_id( cluster_config, groupid,
KAFKA-<I>: Add print out of cluster name before getting information about a topic.
Yelp_kafka-utils
train
py
d453a6ba142129e1b006c42e233485725bd883b1
diff --git a/packages/keyhub-vault-web/src/vault.js b/packages/keyhub-vault-web/src/vault.js index <HASH>..<HASH> 100644 --- a/packages/keyhub-vault-web/src/vault.js +++ b/packages/keyhub-vault-web/src/vault.js @@ -417,6 +417,7 @@ export default function loadVault(window, document, mainElement) { // callback to the parent window with result const run = () => callback(null, { + address, publicKey, signature, phoneNumber, @@ -470,6 +471,7 @@ export default function loadVault(window, document, mainElement) { // callback to the parent window with result const run = () => callback(null, { + address, publicKey, signature, })
return the address to main app on newKey action
BlockchainZoo_keyhub-vault
train
js
1ad907f262359c67c90ccf57db084a339fa9f1bd
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -244,8 +244,8 @@ class ClassicalCalculator(base.HazardCalculator): oq = self.oqparam N = len(self.sitecol) trt_sources = self.csm.get_trt_sources(optimize_dupl=True) - maxweight = min(self.csm.get_maxweight( - trt_sources, weight, oq.concurrent_tasks), 1E6) + maxweight = self.csm.get_maxweight( + trt_sources, weight, oq.concurrent_tasks) maxdist = int(max(oq.maximum_distance.values())) if oq.task_duration is None: # inferred # from 1 minute up to 1 day
Removed maxweight limit to 1E6 [skip CI]
gem_oq-engine
train
py
b6d58c3953088c96e36c0f40ad7c9c04befa468d
diff --git a/www/src/py_dom.js b/www/src/py_dom.js index <HASH>..<HASH> 100644 --- a/www/src/py_dom.js +++ b/www/src/py_dom.js @@ -284,7 +284,7 @@ DOMEvent.__new__ = function(cls, evt_name){ function dom2svg(svg_elt, coords){ // Used to compute the mouse position relatively to the upper left corner - // of an SVG element, based on the coordinates coords.x, coords.y that are + // of an SVG element, based on the coordinates coords.x, coords.y that are // relative to the browser screen. var pt = svg_elt.createSVGPoint() pt.x = coords.x @@ -337,7 +337,8 @@ DOMEvent.__getattribute__ = function(self, attr){ return res.apply(self, arguments) } func.$infos = { - __name__: res.toString().substr(9, res.toString().search("{")) + __name__: res.name, + __qualname__: res.name } return func }
Add attributes to DOMEvent attributes that are functions
brython-dev_brython
train
js
e930499a49396306921590f6c69cf2537e025a37
diff --git a/container/__init__.py b/container/__init__.py index <HASH>..<HASH> 100644 --- a/container/__init__.py +++ b/container/__init__.py @@ -5,4 +5,4 @@ import logging logger = logging.getLogger(__name__) -__version__ = '0.1.0' +__version__ = '0.2.0-pre'
Increment version to <I>-pre
ansible_ansible-container
train
py
a7018a7e2f1b1007271bf73741c2dd43c50095a4
diff --git a/gcalcli/argparsers.py b/gcalcli/argparsers.py index <HASH>..<HASH> 100644 --- a/gcalcli/argparsers.py +++ b/gcalcli/argparsers.py @@ -283,7 +283,7 @@ def get_argument_parser(): "time part of the --when will be ignored.") add.add_argument( "--noprompt", action="store_false", dest="prompt", default=True, - help="Prompt for missing data when adding events") + help="Don't prompt for missing data when adding events") _import = sub.add_parser("import", parents=[remind_parser]) _import.add_argument(
now the help message is correct for noprompt
insanum_gcalcli
train
py
a7dc666739d65fa0240ceb1898896bc190bf8115
diff --git a/src/ducks/registry/index.js b/src/ducks/registry/index.js index <HASH>..<HASH> 100644 --- a/src/ducks/registry/index.js +++ b/src/ducks/registry/index.js @@ -83,15 +83,25 @@ export const initializeRegistry = konnectors => { .then(context => { const konnectorsToExclude = !!context.attributes && context.attributes.exclude_konnectors + const filteredKonnectors = + context.attributes && context.attributes.debug + ? konnectors + : konnectors.filter( + k => !k.categories.includes('banking') && k.slug !== 'debug' + ) + if (konnectorsToExclude && konnectorsToExclude.length) { return dispatch({ type: FETCH_REGISTRY_KONNECTORS_SUCCESS, - konnectors: konnectors.filter( + konnectors: filteredKonnectors.filter( k => !konnectorsToExclude.includes(k.slug) ) }) } - return dispatch({ type: FETCH_REGISTRY_KONNECTORS_SUCCESS, konnectors }) + return dispatch({ + type: FETCH_REGISTRY_KONNECTORS_SUCCESS, + konnectors: filteredKonnectors + }) }) .catch(() => { dispatch({ type: FETCH_REGISTRY_KONNECTORS_ERROR, konnectors: [] })
feat: filter konnectors categories based on environment ✨
cozy_cozy-home
train
js
68bda62b30c90bf80cfc77c78f13ef55e9c7b593
diff --git a/lib/views/base-line-graph.js b/lib/views/base-line-graph.js index <HASH>..<HASH> 100644 --- a/lib/views/base-line-graph.js +++ b/lib/views/base-line-graph.js @@ -48,9 +48,7 @@ BaseLineGraph.prototype.setLayout = function (layoutConfig) { // Should be called by child's onEvent handler BaseLineGraph.prototype.update = function (value, highwater) { - if (this.values.length >= this.maxLimit) { - this.values.shift(); - } + this.values.shift(); this.values.push(value); this.series.y = this.values.slice(-1 * this.layoutConfig.limit);
remove n/a branch in base line graph values is always kept at length of maxLimit
FormidableLabs_nodejs-dashboard
train
js
43ffdd479925a3120ce44a6f2701db5294c74779
diff --git a/node_api_client.go b/node_api_client.go index <HASH>..<HASH> 100644 --- a/node_api_client.go +++ b/node_api_client.go @@ -262,6 +262,8 @@ type NodeInfoResponse struct { IsHealthy bool `json:"isHealthy"` // The human friendly name of the network ID on which the node operates on. NetworkID string `json:"networkId"` + // The minimum pow score of the network. + MinPowScore float64 `json:"minPowScore"` // The hex encoded ID of the latest known milestone. LatestMilestoneID string `json:"latestMilestoneId"` // The latest known milestone index. diff --git a/node_api_client_test.go b/node_api_client_test.go index <HASH>..<HASH> 100644 --- a/node_api_client_test.go +++ b/node_api_client_test.go @@ -44,6 +44,7 @@ func TestNodeAPI_Info(t *testing.T) { Version: "1.0.0", IsHealthy: true, NetworkID: "alphanet@1", + MinPowScore: 4000.0, LatestMilestoneID: "5e4a89c549456dbec74ce3a21bde719e9cd84e655f3b1c5a09058d0fbf9417fe", LatestMilestoneIndex: 1337, SolidMilestoneID: "598f7a3186bf7291b8199a3147bb2a81d19b89ac545788b4e5d8adbee7db0f13",
Add minPowScore to node info (#<I>)
iotaledger_iota.go
train
go,go
0bf712a20e02b35f56978c88181f8606f093e548
diff --git a/pyblish_qml/host.py b/pyblish_qml/host.py index <HASH>..<HASH> 100644 --- a/pyblish_qml/host.py +++ b/pyblish_qml/host.py @@ -677,7 +677,10 @@ def _install_blender(use_threaded_wrapper): wm = context.window_manager wm.event_timer_remove(self._timer) # Quit the Pyblish QML GUI, else it will be unresponsive - quit() + server = _state.get("currentServer") + if server: + proxy = ipc.server.Proxy(server) + proxy.quit() log.info("Registering Blender + Pyblish operator") bpy.utils.register_class(PyblishQMLOperator)
Explicitly call `proxy.quit()` to make clear the proxy needs to quit
pyblish_pyblish-qml
train
py
c64b5338cc2fe3ba311a19548ec432842dbdf91b
diff --git a/lib/janus_gateway/plugin/rtpbroadcast/mountpoint.rb b/lib/janus_gateway/plugin/rtpbroadcast/mountpoint.rb index <HASH>..<HASH> 100644 --- a/lib/janus_gateway/plugin/rtpbroadcast/mountpoint.rb +++ b/lib/janus_gateway/plugin/rtpbroadcast/mountpoint.rb @@ -6,10 +6,10 @@ module JanusGateway::Plugin # @param [JanusGateway::Plugin::Rtpbroadcast] plugin # @param [String] id # @param [Array] streams - def initialize(client, plugin, id, streams = nil, mountpoint_data = nil) + def initialize(client, plugin, id, streams = nil, channel_data = nil) @plugin = plugin @data = nil - @mountpoint_data = mountpoint_data + @channel_data = channel_data @streams = streams || [ { @@ -41,7 +41,7 @@ module JanusGateway::Plugin :description => id, :recorded => true, :streams => @streams, - :channel_data => @mountpoint_data + :channel_data => @channel_data } } ).then do |data|
Renamed mountpoint_data with channel_data
cargomedia_janus-gateway-ruby
train
rb
b73e574eb2989240cb871193ddf3a3c645065bbd
diff --git a/lib/3scale_toolbox/entities/service.rb b/lib/3scale_toolbox/entities/service.rb index <HASH>..<HASH> 100644 --- a/lib/3scale_toolbox/entities/service.rb +++ b/lib/3scale_toolbox/entities/service.rb @@ -220,7 +220,12 @@ module ThreeScaleToolbox end def policies - remote.show_policies id + policy_chain = remote.show_policies id + if policy_chain.respond_to?(:has_key?) && (errors = policy_chain['errors']) + raise ThreeScaleToolbox::ThreeScaleApiError.new('Service policies not read', errors) + end + + policy_chain end def update_policies(params) @@ -355,7 +360,8 @@ module ThreeScaleToolbox end, 'methods' => method_objects(hits_object).each_with_object({}) do |method, hash| hash[method.system_name] = method.to_crd - end + end, + 'policies' => policies } } end
product to_crd policy chain
3scale_3scale_toolbox
train
rb