api authentication

Created a new api endpoint for add articles with API key authentication.

on the routes.py file, in add_articles function I have removed line "if addarticlesform.submit.data:" which was causing issues to  add articles to database through API call.
removing the if condition does not make the data validation through web page

 if request.method == 'POST':
            -if addarticlesform.submit.data:-
                  article = Articles(addarticlesform.url.data,addarticlesform.....)
                  db.session.add(article)

Here are my observations on removing if addarticlesform.submit.data condition
https://docs.google.com/spreadsheets/d/1GquosS2pAEJbSZfOn279y4Yhe88RenRLnNVz_YWPedA/edit?usp=sharing


Staff chat hide command isnt working properly

Tried hiding my admin chat, it wasnt hiding it from my chat.

I'm going to need more information than that such as screenshots of you using the command etc.

Paper Version 1.20.4 496
Also using essentialsx and essentialsxchat (not sure if that has any relevance)

Alright thanks, i'll look into this

@IasonKalaitzakis Alright i found the cause of this issue will be fixed in 4.3.0.
What happened is i switched the way i was sending staff chat messages to a broadcast system that didn't support the hide command i have decided to revert this change so it should work in 4.3.0 when it is released.

Gotcha thanks for the quick fix!


Callback docs with autosummary

What does this PR do?

Fixes #2034
Before submitting

[x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
[x] Did you read the contributor guideline, Pull Request section?
[x] Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
[x] Did you make sure to update the documentation with your changes?
[ ] Did you write any new necessary tests?
[ ] Did you verify new and existing tests pass locally with your changes?
[ ] If you made a notable change (that affects users), did you update the CHANGELOG?

PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃
@williamFalcon @Borda @awaelchli @edenlightning

Shall we allow private methods?

Changes here: https://61555-178626720-gh.circle-artifacts.com/0/html/callbacks.html#built-in-callbacks
In ModelCheckpoint or some other like, referencing to other classes, class's params will not show the link as the referencing link for those isn't include in this PR as api docs deleted and to keep PR reviewable.
Created Trainer docs with autosummary locally and referencing works as before.
In the latest docs, those ref links point to api docs.

very nice :]
@ydcjeff mind check if we can with this new plugin export methods to be visible/listed on the right side?
basically, it means that the method has to be some kind of heading...

@ydcjeff regarding your this docs update, is this is relevant? #3503
because now I see that links to source work fine...

very nice :]
@ydcjeff mind check if we can with this new plugin export methods to be visible/listed on the right side?
basically, it means that the method has to be some kind of heading...

Unfortunately, autosummary exports the class with autoclass, function with autofunction
So, appending heading is kinda hard.
I initially thought abt this, but couldn't figure out how to do. will find a way.

@ydcjeff regarding your this docs update, is this is relevant? #3503
because now I see that links to source work fine...

What the PR does linking the source code to the docs from _modules folder.
For methods like training_step in LightningModule docs can be solved with automethod.
It can be said that PR is relevant or not relevant.
The core team needs to decide source will link to github or link to _modules folder.


Different user accounts have the same file storage

Hi,
Does each user get their own private storage or does all the user have the same storage? I tried creating a test user, but i can see what I uploaded on the other account.

Hi @ragrets
What you're seeing is correct. That is how this software works, all uploads go into shared storage, and viewable by everyone, that is intended.
I've put in a Feature Request to have per-user shares, see it Here: https://github.com/silverwind/droppy/issues/417


Victor VosMottor: Watch chidiyaa.com

Victor VosMottor requests the watch of the watch_keyword chidiyaa\.com. See the MS search here and the Stack Exchange search in text, in URLs, and in code.

chidiyaa\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Approved by tripleee in Charcoal HQ


Cannot resolve module 'json'

Hi, I am trying this, I am confident my paths are correct
var Page = require('json!./json/foo.json');
and get this error
ERROR in ../mocks/mockApi.js
Module not found: Error: Cannot resolve module 'json' in /Users/me/ui/src/components/native/mocks
 @ ../mocks/mockApi.js 1:31-83

Webpack:
  {test: /\.json$/, loader: 'json-loader'}

specifying the loader as 'json' (without the '-loader') worked for me.
{test: /\.json$/, loader: "json"}

thanks but still no luck:
module.exports = {
  context: __dirname,
  entry: {
    main: [
      "./index"
    ]
  },
  output: {
    path: __dirname + "/dist",
    filename: "components.js"
  },
  devtool: "inline-source-map",
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        query: {
          presets: ['es2015']
        },
        include: [__dirname + '../', __dirname],
        exclude: [__dirname + '/node_modules', __dirname + '/dist']

      },
      {test: /\.json$/, loader: "json"}

    ]
  },
  resolve: {
    // you can now require('file') instead of require('file.js')
    extensions: ['', '.js', '.json']
  }
}

{
  "name": "__Demo__",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "webpack --watch --watch-polling"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel-core": "^6.4.5",
    "babel-loader": "^6.2.1",
    "babel-preset-es2015": "^6.3.13",
    "css-loader": "^0.23.1",
    "json-loader": "^0.5.4",
    "style-loader": "^0.13.0",
    "stylus-loader": "^1.5.1",
    "webpack": "^1.12.12"
  }
}

I'm experiencing the same problem, path is definitely correct

I solved the problem by adding a include key in the loader object.
{test: /\.json$/, loader: "json", include: "path/to/your/sources"}

weirdly... I was just having this issue and after running an npm install --save again it started resolving shrug

Had the same problem but then recognized that the json-loader was not installed (and not in package.json). Shouldn't webpack complain in this case? Seems like a bug in webpack.

it worked when i use the "var Page = require('json!./json/foo.json');",but not worked in "webpack.config.js"

Same issue. Fixed by adding include in webpack.config.js and using var foo = require('json!./path/to/foo.json') instead of var foo = require('./path/to/foo').

I think the most case of this issue is just because you didn't add the dev dependency for css-loader. since most of docs about css-loader just mention how to use that in js file.

This is still an issue as of Webpack 2.1.0-beta25. Using that json! syntax has never once worked with require() for me, no matter which path I give it.

I could solve similiar error(not in mock) with npm install json-loader --save. I didn't installed it.

I've got the same problem - json load directly works by webpack does not.
works: import config from "!json!../../cfg/config.json" (I need to have !json! istead of json!)
does not: import config from "../../cfg/config.json and either in webpack.config { loader: 'json-loader', test: /.json$/ } or { loader: 'json', test: /.json$/ } or with include option - all does not work
versions:
"babel-core": "^6.18.2",
"babel-loader": "^6.2.7",
"json-loader": "^0.5.4",
"webpack": "^1.13.3"

I have absolutely  installed all packages,but I also met this problem.When I do 'npm install json-loader --save' like JWplanet above ,it worked.I hoped that it would help you.

In webpack:
{    test: /\.json$/,    include: helpers.root('public', 'data'),    loader: 'raw' },
In main.js:
json        = require("json-loader!./conteudo.json"),
in mains.js example:
`carregaIdiomaPadrao: function () {
    $.i18n().load(json);
    if(minhasessionlang === null){
        carregaIdiomas.alteraIdioma('br');
    }else{
        carregaIdiomas.alteraIdioma(minhasessionlang);
    }
},	`

"webpack": "^1.13.1",
"json-loader": "^0.5.4",

My solution:

add !json! to import path:
import { version } from '!json!../../config/version.json';
add loader to WebPack preloaders:
```
module: {
preLoaders: [
{
test: /.json$/,
loader: 'json-loader',
include: '../../config/version.json',
},
]
}

Thanks @oleg-am
Adding !json! to import path solved this for me

Any update on this issue ?

@vieillecam I'm not 💯 on this but if you're on webpack v2 I think json-loaderis obsolete (Core Integration) could you try without any JSON specific setup?
I need to wait for reply on the webpack slack regarding this, in case it shouldn't be solved 😛

See #44 &&  https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore.

Thanks for you reply, it's already what I tried also without success. I'm not loading the loader explicitly and still receive special characters before the json loaded by webpack, as it was loaded already by something that put theses strange characters.

I've seen this issue before with a json file having the diammond ? character. Some text editors could pick it up and some didn't. From memory sublime text did but atom didn't. Either try open the json in a different text editor and you should see it or copy the contents into a notepad and save that as the json.

unsubscribing from my own thread, doesn't bother me anymore with WP2

@es6Test 👍

@vieillecam See @Pizdetss comment and if you still got regressions either open a new issue and a test repo for reproduction would be appreciated also 😛 , e.g does it happen with every JSON file or with specific ones generated somewhere etc...

@Pizdetss Thanks for you comment, that was exactly my problem, I was doing my Json file only with Visual Studio Code and Sublime text and both of them were adding these extra ranges characters... Editing it with notepad++ resolve the issue. Thanks !

"Module not found: Error: Can't resolve 'foo.json"
'use strict';
const webpack = require("webpack");
const path = require('path');
module.exports = {
entry: {
app: './build/aws.js',
libraries: ['./src/libraries.js']
},
resolve: {
modules: [
'node_modules',
path.resolve('./build'),
path.resolve('.'),
path.resolve('../../../lib')
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'libraries',
filename: 'lib.bundle.js'
})
],
output: {
path: './dist',
filename: 'bundle.js'
},
rules: [
{
test: /.json$/,
use: 'json-loader'
}
],
loaders:[
 { test: /vendor\/.+\.(jsx|js)$/,
     loader: 'imports?jQuery=jquery,$=jquery,this=>window',
 },

]
};
AWS.JSX
import foo from 'foo.json'

I got the same problem.
"json-loader": "^0.5.4",
"webpack": "^1.13.3",
import text from './titles.json'
solved by adding './' before filename as per below
import text from './titles.json'

I'd suggest you play a little bit with the paths like ./../../temp/sample.json for example, depending where your request comes from it doesn't resolve ./ as a root.


[release/1.3 backport] Bump Golang 1.13.15

Backports of:

https://github.com/containerd/containerd/pull/3944 ci: set pipefail in zuul script

fixes https://github.com/containerd/containerd/issues/3943 openlab ci is broken

https://github.com/containerd/containerd/pull/4199 .zuul: update go version to 1.13.10

only the first commit; skipped the second commit

https://github.com/containerd/containerd/pull/4375 Bump Go 1.13.13
https://github.com/containerd/containerd/pull/4398 Bump Golang 1.13.14
https://github.com/containerd/containerd/pull/4462 Bump Golang 1.13.15

LGTM +1


Media

Also replaces handlebars with Liquid for tokens.

While you are reviewing, I am working on the image alteration middleware. Or you can just hit Merge ;)

I tried this Media branch, starting from a fresh site.
Problem: The images I upload are not displayed. Ex of url: http://localhost:2918/media/myfile.png.

@agriffard I had that at some point too, I thought it was fixed, some kind of hell to manage these urls.

@agriffard where are they not displayed? In the media manager, on the front end? repro ?

They are not displayed anywhere (admin or front page with the liquid syntax token) or opening the url itself.
I just uploaded an image in the media manager.

I did like 5 demos yesterday ;) with live preview ... I'll try again.

@agriffard  I added the Media Field and fixed the url issues.

I retrieved the latest version :
The url of a media is still not displayed.
When I want to see the media library, the page loads, I see the admin page during 0.5 s and then it blinks and the content of the page becomes blank, only the menu stays.

Fixed the visibility of the picker. For the other bugs, clean your packages folder, and CTRL+F5 when in the media manager. I tried a new setup, and everything worked.
Also I am confused when you mention "The url of a media is still not displayed." but you can't even see the media manager, so I don't see what you mean by it.

When the image Middleware tries to process a media, there is an error:
fail: ImageSharp.Web.Middleware.ImageSharpMiddleware[1]
      The image 'http://localhost:5000/media/media.jpg?width=240&height=240' could not be processed
System.ArgumentNullException: Value cannot be null.
Parameter name: path1
   at System.IO.Path.Combine(String path1, String path2)
   at ImageSharp.Web.Caching.PhysicalFileSystemCache.<SetAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ImageSharp.Web.Middleware.ImageSharpMiddleware.<Invoke>d__9.MoveNext()

@agriffard Repro steps?

I have never been able to display a media.
That kind of url http://localhost:2918/media/myfile.png doesn't return the image, only a blank page and the error message occurs in the console.
I started from the ground, with a git clean, removing packages and bin folders.

@agriffard  OMG ;) Doesn't sound good at all ...
Can someone else try it? Maybe there is an issue I am not seeing because of different nuget packages, or envrionment.

Fixed, it needed the wwwroot folder for the file cache.

The search doesn't seem to work. It is not plugged to any method?
So if you are in a subfolder, it goes to the root and if you are in a media picker modal, it reloads the page.

Create an new content type. Ex: Article
Add a media Field. Ex: Image
Create a new article and add a media.
Edit the article => The media modal is displayed when you load the page.

There is no search, I will remove the textbox.

When I try to add | resize_url: 100, 200 to the liquid syntax after adding a media in the body of a page, the image is not rendered anymore with this error:
Invalid character: '&'. at line:0, col:44

| resize_url: '100', '200'  works.
Syntax to change in Orchard.Media\README.md

The Media admin page needs a title.

If I switch the active theme to TheTheme, the home page returns this error:
/Packages/Orchard.Markdown/Views/MarkdownPart.Summary.cshtml

There is no argument given that corresponds to the required formal parameter 'encoder' of 'ILiquidTemplateManager.RenderAsync(string, TextWriter, TextEncoder, TemplateContext)'
12.    var rendered = await TemplateManager.RenderAsync(html, templateContext);

MarkdownField.cshtml still has a tokenizer injected:
@inject Orchard.Tokens.Services.ITokenizer Tokenizer

resize_url: 100, 200
I think the issue is that we see this but the html contains some   which then breaks the liquid tag. We need to find a way to write these tags without having some HTML injected. Maybe some options in turbowyg.

Updated

The resize_url syntax works now that the Body is not encoded.

I created a tenant with sqlite.
When I upload an image in the media admin, the file is created in Orchard.Cms.Web\App_Data\Sites\sqlite\Media but the corresponding url cannot be displayed:
http://localhost:2918/sqlite/media/myfile.png

Fixed

OK, tenant media url works and search is removed.
Last issue remaining is that the content of the modal popup is shown in the page when you create or edit a content item with a body part or a media field.
What is supposed to prevent this: script or css?

Fixed, and also implemented Required/Multiple constraints.

OK, the media editor visibility is fixed.

Conflicts to resolve on csproj.

Can be closed, as #889 has been merged and contained it?


Postman Challenge Points Not Counting

Description
My PostMan Challenge pr is merged but my points are not getting reflected in leaderboard
https://github.com/GSSoC24/Postman-Challenge/pull/116
Fixes # (issue)
Type of change

[ ] Added a new machine learning frameworks, libraries or software.
[ ] Documentation update

Checklist:

[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] My changes generate no new warnings

It is Fixed Now So Closing issue Thanks


Use a stable sort when sorting Edits

There was a conversation on how to insert multiple text changes that all have the same starting position over in https://github.com/Microsoft/TypeScript/pull/14441. To specify the order explicitly, we thought the ordering of edits in a change should work as a tiebreakers (ie: use a stable sort when ordering the edits).
Can the vscode side respect this property when applying changes? After a bit of debugging, it looks like the necessary change would be to replace https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/services/bulkEdit.ts#L98 with a stable sort.
I would put up a PR except that I was unable to find an existing stable sort and I'm unsure if there's some pattern you'd prefer to use for an implementation.
If it helps, I'll later edit this with an explicit repro (the case I'm running into is currently dependent on a change I've yet to merge into https://github.com/Microsoft/TypeScript).

Alternatively we can collapse such edits into one textchange on our side - this way editors won't have to add any special handling to this pretty ambiguous case

We will be merging edits starting at the same position for codefixes as a result of work in https://github.com/Microsoft/TypeScript/pull/14709, so this issue is non-essential for us now.

Edits are already sorted before being applied. Ambiguous edits (i.e. inserting at the same exact position) will be executed in the order that they come in.
https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/model/editableTextModel.ts#L258
	private static _sortOpsAscending(a: IValidatedEditOperation, b: IValidatedEditOperation): number {
		let r = Range.compareRangesUsingEnds(a.range, b.range);
		if (r === 0) {
			return a.sortIndex - b.sortIndex;
		}
		return r;
	}

We observed that if we have a number of ambiguous insertions in an edit, the ordering get's mixed up by the unstable sort at https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/services/bulkEdit.ts#L98
That said, we solved the issue by collapsing multiple TextChange's down to one TextChange, per https://github.com/Microsoft/TypeScript/blob/master/src/services/codefixes/helpers.ts#L19.
So, we don't depend on the aforementioned sort being stable.

Thanks for the explanation, wasn't aware of that sort or I forgot about it :) Will look together with @jrieken into it...

Fix looks good, could not reproduce the original issue in 1.11.2, still marking verified.


json_encode never returns an empty string

… at least I don't think it can:
https://3v4l.org/8G6ln

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 99.014%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
4216

Relevant Lines:
4258

💛  - Coveralls

Sorry, not sure how the docs work. I've amended the referenced line number for encode but it's still red.

Seems valid indeed:
https://psalm.dev/r/2106809556
Thanks for adding.
The documentation is auto-generated and can be altered by the command: make docs-generate

Thanks!


spiderpool-init pod with lots of duplicated error logs

Spiderpool Version
latest
Bug Type
IPAM
Main CNI
/
What happened?
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
{"level":"ERROR","ts":"2024-01-19T07:39:12.132Z","caller":"cmd/client.go:192","msg":"failed to get spiderAgent pods: client rate limiter Wait returned an error: context deadline exceeded, retrying..."}
What did you expect to happen?
/
How to reproduce it (as minimally and precisely as possible)
One user report that they upgrade their spiderpool from v0.7 to v0.9 and found the spiderpool-init pod has lots of same logs
Additional Context
No response

the init-pod complains that it can't get the spiderpool-agent pod and keeps trying. You need to check the status of spiderpool-agent in the cluster to see if something else is preventing it from starting.


Add basic import map support

/cc @matthewp @thepassel
Quick PR to add an automatically generated an import map for all installed deps. Would love any feedback since this is something I'm only just starting to experiment with.
Example
Given this package.json config:
  "@pika/web": {
    "webDependencies": [
      "csz",
      "preact/hooks"
    ]
  },

@pika/web installs your dependencies with a new import-map.json file:

With the contents:
{
  "imports": {
    "csz": "./csz.js",
    "preact/hooks": "./preact/hooks.js"
  }
}

Looks great! Should paths be relative to the import map or the baseURI? I suppose relative to the import map would make sense...

Yea that was the thinking, since we don't actually know where you deploy your web_modules/ directory to. Thanks for taking a look!

Hey, I missed this (my github handle is @thepassle instead of @thepassel 🙈), but this looks great! I'll play with this a bit and add it to the blog :)

doh!


replicated orchestrator: Delete tasks on scale down

When scaling down, we don't want to preserve task history for the slots
that are being removed.
Make the orchestrator delete these tasks instead of simply shutting them
down.
Always do this for slots that have no runnable tasks on service
reconcilation, so this isn't limited to scale-down operations. This
should properly clean up tasks that were left over by earlier versions.
Fixes #1372
cc @aluzzardi @dongluochen

Current coverage is 54.11% (diff: 80.00%)

Merging #1574 into master will decrease coverage by 0.03%

@@             master      #1574   diff @@
==========================================
  Files            83         83
  Lines         13623      13635    +12
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
+ Hits           7377       7379     +2
- Misses         5250       5260    +10
  Partials        996        996

Powered by Codecov. Last update 362531c...05c22ed

LGTM

LGTM


Specifying both --html and --name .html gives confusing results, if  is not 'license'

I've just run the following:
license-reporter --unified-list --ignore-version-range --all --silent --html --file licenses.html

I was confused to see that the newly created licenses.html contained xml content rather than html content. Looking more closely, the following 3 files were created:
license.html
licenses.css
licenses.html

license.html had the html content, and licenses.html had the xml content.

@grdryn thanks for report it!
Not related but, if you do not need an external file for unified list, you can omit the --unified-list argument. Since we removed black/white lists the unified-list is the default now.

...newly created licenses.html contained xml content...

yah
  if (options.file) {
    fs.writeFileSync(options.file, createdXml);
  }

options.file is the --file, and we are using this for the generated file name with XMl content, that's why you have licenses.html with xml content.
We can cut the name from extension and add the fixed .xml later, so when the user run this :
license-reporter --file fooBar.cpp will get a fooBar.xml
About the:
licenses.css
licenses.html

Both are hard-coded :
fs.writeFileSync('license.html', output); and .pipe(fs.createWriteStream(path.join(options.directory, 'licenses.css')));
I'm going to close this and open a new one to separate the name from extension and keep .xml hard coded.


Stat name change

Acceptance Criteria
Stat names should read as follows:

HP
Attack
Defense
Sp. Atk
Sp. Def
Speed

Alright, I got it covered!

Updated the name of the stats.


Needs update for averaging order.

When BTO alerted multiple times, the alert is ignored by alerts_trader.py :
Repeated BTO
Also some warnings:
alerts_tracker.py:130: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '1.47/1.27' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
self.portfolio.loc[open_trade, "Prices"] = f"{old_price}/{order['price']}"
alerts_tracker.py:135: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '1.47/1.28' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
self.portfolio.loc[open_trade, "Prices-actual"] = avgs_prices_al

The deployed version now has a config option to accept averaging down orders.
I will fix future warnings in the future :) Thanks


[SPARK-11981][SQL] Move implementations of methods back to DataFrame from Queryable

Also added show methods to Dataset.

Test build #46675 has started for PR 9964 at commit 4a1ca72.

Test build #46675 has finished for PR 9964 at commit 4a1ca72.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/46675/
Test PASSed.

Merged build finished. Test PASSed.


🐛 [Crashlytics] CocoaPods could not find compatible versions for pod Firebase/Crashlytics

Bug report
Describe the bug
Running pod install - - repo-update on mac fails with version error.
CocoaPods could not find compatible versions for pod Firebase/Crashlytics

In Snapshot (Podfile. lock):
FirebaseCrashlytics = 10.12.0

In Podfile:
 firebase_crashlytics was resolved to 3.3.6, which depends on Firebase/Crashlytics =10.15.0

Steps to reproduce
Run  pod install - - repo-update on macOs
Expected behavior
No error

My bad, managed to fix it by clearing the pub-cache and removing the podfile.lock


Configure travis tests

See .gitlab-ci.yml for the configuration and test running method

@yakky assign it to me please

@jefftriplett could you invite "simobasso" to the "DjangoConEurope2017" team?

@jefftriplett disregard my message, I can do that myself!

@simobasso Travis is curently not active. Keep this on hold until I activate it

@yakky 👍

@jefftriplett have you received the request to allow travis access to the organization? Thanks

I just approved it. Sorry, didn't see it previously.

@jefftriplett thanks! :bow:

@simobasso Everything should be ready on travis. Thanks both!


Add main layout with larger cover image

It'd be nice if there were an alternate (default?) main layout where the cover image filled the window horizontally, with much less space devoted to the playlist. Tapping on the cover image could toggle between the two layouts.
The server currently serves WebP images at 256x256 and 512x512, and the Android app downloads the 512x512 versions. Pixel phone displays look like they're usually 1080 pixels wide, so I'm not sure if the existing images will look okay or if I'd need to add 1024x1024 (or larger) images.

I like how this looks enough that I didn't bother struggling to add support for switching back to the old layout, although maybe I'll need to revisit that if I spend more of the vertical space on a progress bar (#44). The 512x512 images look okay to me.
I should think a bit more about what to do when there's no song loaded, and perhaps also when there's a song without a cover image. I'm currently using a blue 1x1 bitmap in both cases, but it looks weird, especially in the no-song case where there's no text on top of it.

If I decide that I want a way to toggle the playlist to be bigger at some point, it'd probably be easiest to just hide the cover image (and playback buttons?). I'd still need to decide what to use for toggling back to the original layout, though -- maybe a shade that you can drag down from the top of the view?


Fixed the unit test build

Currently if NGRAPH_TOOLS_ENABLE is set to NO but NGRAPH_UNIT_TEST_ENABLE is set to YES then that results in broken build.
This fix should be applied to v0.14 release also.

@avijit-nervana FYI #2420 Has the same fix bit not merge yet

@silee2 should we close this one in favor of @2420?


Add Kimai service

See PR https://github.com/coollabsio/coolify/pull/3435 and discussion https://github.com/coollabsio/coolify/discussions/2245
Thanks for Coolify 👍
@nizetic thanks for adding the Kimai image, just found out about it 😄

Thanks for your PR 💜.


Tapping on "Guest - tap to sign in" sends you to /u/guest instead of the Reddit sign in page

iPhone SE 10.2.1
Slide 1.2 (20)
https://streamable.com/9rk6p

Cannot repeoduce

How I reproduced:
Go into Slide
Log into an account
Close the app
Reopen the app and you should be logged into an account
Switch to Guest
Tap on the "tap to sign in"

Yeah doing that just opens the account chooser for me. Strange.
On Tue, Jul 3, 2018 at 12:50 PM incIined<EMAIL_ADDRESS>wrote:

How I reproduced:
Go into Slide
Log into an account
Close the app
Reopen the app and you should be logged into an account
Switch to Guest
Tap on the "tap to sign in"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ccrama/Slide-iOS/issues/272#issuecomment-402240845,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADpJRHWMRuI2Nz8AHU47NzeO4gNiO0kbks5uC67igaJpZM4VBW6c
.

Either way, made that button open the switcher if it's guest and switched so it should work now either way


Fix small dialyzer errors

mix dialyzer still returns a couple of errors. Fixing this should be easy.
It's up for grabs, please to feel contribute and get started with the project!

Hi @burntcarrot, I just found this project and am looking to contribute!
This will be my first time using Elixir, but I am interested in learning the language and notifiex seems like a good project for doing that.
Steps I have done so far:

Forked & cloned the repo
Installed the project dependencies using mix deps.get
Compiled the project using mix compile
Verified tests passed using mix test
Ran mix dialyzer to generate these errors:

I will look into what these errors mean and research how to fix them. :smiley:

Thanks for your interest! @djanda97
I'll assign this issue to you - please feel free to contribute! 😄


RFC: De-Couple data access from EF

Problem
Currently, the controller leans on IEntityRepository directly which is tightly coupled to IQueryable. However, this doesn't make much sense for ORMs, like Dapper, that do not use IQueryable. Also, it is entirely possible that resources may be retrieved from non SQL storage solutions, such as another HTTP API or RPC.
Tightly Coupled Areas:

JsonApiController
ContextGraph
ContextGraphBuilder
IServiceCollectionExtensions

Proposed Solution

Extract controller logic into IResourceService. Reduces controller methods to something like the following. Would allow any intermediate service to perform the data access.

public class JsonApiController<T, TId>
    : JsonApiControllerMixin where T : class, IIdentifiable<TId>
{
    private readonly IResourceService<T, TId> _service;

    public JsonApiController(IResourceService<T, TId> resourceService)
    {
        _service = resourceService;
    }

    [HttpGet]
    public virtual async Task<IActionResult> GetAsync()
    {
        var entities = await _service.GetAsync();
        return Ok(entities);
    }
}

Refactor the context graph:

Rename ContextGraphBuilder to EntityContextGraphBuilder, since it uses the EF DbContext.
Can ContextGraph be used without the DbContext generic? If not, perform rename Entity...
Define API to either inject custom IContextGraph implementations or an API to build a generalized context graph

Refactor service extensions or add methods for using the new APIs defined by (2)

Considerations

Need to take a closer look at json:api operations and how this would fit in.

https://github.com/json-api/json-api/issues/795

Since this may introduce a variety of breaking changes, perhaps we should consider further de-coupling from the MVC middleware in this solution as well (see discussion in #71)?

Been getting familiar with the project and that's one of the first things that came to mind. Can I use this with a custom business/data layer? That would be really nice.

@donniefitz2 currently, there are 2 approaches for implementing custom business logic:

overriding controller methods
injecting resource specific services that implement IEntityRepository
In both cases, you would want to still call into the base implementations when possible.

However, this may be a little convoluted for non-EF DALs. The hope with the proposed changes is to lean on a IResourceService<T> for the first level of data access. This will let you create a custom implementation that might look like:
public class TodoItemService : IResourceService<TodoItem> {
  public async Task<List<TodoItem>> GetAsync() {
    return new TodoItem[] { new TodoItem() };
  }

  public async Task<TodoItem> GetAsync() {
    return new TodoItem();
  }

  // ...
}

The new layer scheme would be:
controller -> IResourceService --> IEntityRepository

I like the idea of the resource interface. That keeps the controllers clean and allows the BL/DAL stuff to exist in a separate layer.

@jaredcnance I really like that idea! Actually I am currently exactly at a point where I want to expose data that is in the backend fetched from another REST service. IQueryable is here a real show stopper. That needs to be reworked first. I like the idea of the IResourceService.
After that, further decoupling of the ContextGraph and ContextGraphBuilder can be done. However, I hope that this can be done without breaking changes, so decoupling of MVC should be considered in a separate action.
Maybe I'll try a first draft in my example project next week.

@JanMattner thanks for the feedback! It is greatly appreciated.
I'm not sure how to implement in a non-breaking this without adding significant surface area to the code, such as a new JsonApiServiceBasedController (or something) or adding a constructor overload to JsonApiController that takes the service and perform conditionals in every method. We could go that route first and deprecate the existing constructor overload, removing it in a later release? What do you think?
The problem with the ContextGraph is it looks at the DbContext to construct a map of all the entities. If an entity is not on the DbContext it won't have any knowledge of it. So, I believe, this must be addressed in the same PR. I think this can be addressed in a non-breaking way. The thought is to add an API to identify resources not included in a DbContext. Something like:
services.AddJsonApi<AppDbContext>(opt => {
  opt.BuildContextGraph(builder => {
     builder.WithResource<MyResource>("my-resources");
  });
});

Sounds good. In order to decouple it completely, we must get rid of the DbContext generic type. So rather something like:
services.AddJsonApi(opt => {
  opt.BuildContextGraph(builder => {
     builder.WithDbContext<AppDbContext>();
     builder.WithResource<MyResource>("my-resources");
  });
});

=> Everything inside the DbContext can be added and further more custom ressource not bound to any DbContext. For backwards compatibility, we can still leave the currently public methods as is and call this builder internally.

Yeah, I like that and agree that we shouldn't require a DbContext


Add portList to PAI mode configurations

What would you like to be added: Add an optional field portList to configurations when using PAI mode.
Why is this needed: I want to use see my tensorboard on PAI. Currently I follow the practice below: launch a tensorboard in the script submitted to PAI in the background, then launch my training. However, I cannot access my tensorboard without a open port. PAI has provided an option, so that I can access the port using something like $PAI_PORT_LIST_main_0_tensorboard, but this option is not accessible from the interface that NNI has provided.
Without this feature, how does current nni work: Indeed we can find a workaround like downloading the event files and view it locally; but I can imagine adding this feature will provide great convenience for not only tensorboard, but also visdom and other web-dashboard-based tools.
Components that may involve changes: trainingServices logic, configuration settings.
Brief description of your proposal if any:

Merged


Add ability to query supported timezones

Hey was looking to originally create a similar plugin but noticed you had created one already. This is to help solve the problem I've currently got in the local notifications plugin when scheduling notifications. I'm looking to see if a method could be added to query the list of supported timezones. Should be possible and was going to look at trying to submit a PR. However, when I use Android Studio to open the example Android app, it's not able to resolve the paths such that it can also show the plugin code in the IDE. Perhaps the plugin needs to be recreated to resolve the issue. Is this something you're able to look into?

This has been added too.  Thanks!


Problem reading subfolders

I have this task:
gulp.task('webserver', function() {
  gulp.src(config.publicDir)
    .pipe(webserver({
      livereload: true,
      directoryListing: true,
      open: 'index.html'
    }));
});

but I can't see some folders inside my public directory and I have many, admin, assets, css, js, fonts
I just see 2 folders, "css" and "js"
any idea why?

Can you make a small project that reproduces the issue?


Throw Invalid tile coordinates z=1,x=0,y=2 error with esri map

Hi I am tryin to load esri map using flutter-vector-map-tiles, I am using the same example code as well. But map is not rendering at all in application. It just show blank screen. Could you tell me what was the issue here.
Code:
import 'package:flutter/material.dart' as material;
import 'package:flutter/widgets.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
import 'package:vector_map_tiles/vector_map_tiles.dart';
import 'package:vector_tile_renderer/vector_tile_renderer.dart';
import 'api_key.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({material.Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return material.MaterialApp(
      title: 'vector_map_tiles Example',
      theme: material.ThemeData.light(),
      home: const MyHomePage(title: 'vector_map_tiles Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return material.Scaffold(
        appBar: material.AppBar(
          title: Text(widget.title),
        ),
        body: SafeArea(
            child: Column(children: [
          Flexible(
              child: FlutterMap(
            options: MapOptions(
                center: LatLng(12.925007, 77.593803),
                zoom: 2,
                maxZoom: 18,
                interactiveFlags: InteractiveFlag.drag |
                    InteractiveFlag.flingAnimation |
                    InteractiveFlag.pinchMove |
                    InteractiveFlag.pinchZoom |
                    InteractiveFlag.doubleTapZoom,
                plugins: [VectorMapTilesPlugin()]),
            layers: <LayerOptions>[
              // normally you would see TileLayerOptions which provides raster tiles
              // instead this vector tile layer replaces the standard tile layer
              VectorTileLayerOptions(
                  theme: _mapTheme(),
                  backgroundTheme: _backgroundTheme(),
                  // tileOffset: TileOffset.mapbox, enable with mapbox
                  tileProviders: TileProviders(
                      // Name must match name under "sources" in theme
                      {'esri': _cachingTileProvider(_urlTemplate())})),
            ],
          ))
        ])));
  }

  VectorTileProvider _cachingTileProvider(String urlTemplate) {
    return NetworkVectorTileProvider(
        urlTemplate: urlTemplate,
        // this is the maximum zoom of the provider, not the
        // maximum of the map. vector tiles are rendered
        // to larger sizes to support higher zoom levels
        maximumZoom: 18);
  }

  Theme _mapTheme() {
    // maps are rendered using themes
    // to provide a dark theme do something like this:
    // if (MediaQuery.of(context).platformBrightness == Brightness.dark) return myDarkTheme();
    return ProvidedThemes.lightTheme();
  }

  _backgroundTheme() {
    return _mapTheme()
        .copyWith(types: {ThemeLayerType.background, ThemeLayerType.fill});
  }

  String _urlTemplate() {
    // IMPORTANT: See readme about matching tile provider with theme

    // Stadia Maps source https://docs.stadiamaps.com/vector/
    return 'https://basemaps.arcgis.com/arcgis/rest/services/OpenStreetMap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf?token=$apiKey';

    // Mapbox source https://docs.mapbox.com/api/maps/vector-tiles/#example-request-retrieve-vector-tiles
    // return 'https://api.mapbox.com/v4/mapbox.mapbox-streets-v8/{z}/{x}/{y}.mvt?access_token=$mapboxApiKey',
  }
}

Output:
Blank screen with log:
E/flutter (16275): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Invalid tile coordinates z=1,x=0,y=2
E/flutter (16275): #0      NetworkVectorTileProvider.provide (package:vector_map_tiles/src/vector_tile_provider.dart:42:7)
E/flutter (16275): #1      VectorTileLoadingCache._loadBytes (package:vector_map_tiles/src/cache/vector_tile_loading_cache.dart:85:44)
E/flutter (16275): <asynchronous suspension>
E/flutter (16275): #2      VectorTileLoadingCache._loadTile (package:vector_map_tiles/src/cache/vector_tile_loading_cache.dart:65:15)

The default TileProviders theme does not work with Esri VectorTileLayerOptions. In order to render Esri maps, you need to provide a custom theme such as:
Theme mapTheme(Map<String, dynamic> style, Set<ThemeLayerType>? mapTypes) {
    return ThemeReader(logger: null).read(style).copyWith(types: mapTypes);
  }

and inside the style parameter, you need to add the style.json file as a Map<String, dynamic>
This is the base arcgis / esri style json : https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/styles/root.json
You can either get this as a response from a get request or create a .json file containing your whole styles JSON.

Thanks @husbycodereis, I was able to make it with your hints, here you can see the repo: https://github.com/hhkaos/flutter_arcgis_basemaps
@tashi146 I hope that helps.
@greensopinion do you want me to do a PR to this project to add another Tiles provider to the list?

Great to hear that you got it working!

@greensopinion do you want me to do a PR to this project to add another Tiles provider to the list?

Sure, that would be great.

Great @greensopinion I will asap,
While I was refactoring the repo I noticed some issues displaying some map styles and labels. I guess I should fix at least the labels thing before doing the PR.
Any hint would be appreciated. Thanks!! 😄

@hhkaos When I've seen issues like this before, it's usually because there are expressions in the theme that aren't supported by this library.
To troubleshoot the theme, consider adding a logger to the theme, e.g. ThemeReader(Logger.console()).read(theme)
You'll see warnings output to the console. If that's the case to fix it you'll either need to change your theme to only use supported expressions, or add support for the expressions you need to the renderer library (something like this commit)

Awesome @greensopinion thanks! That's more than enough.
I will check the stiles and try to add support for the expression to the renderer library 😄


4.48.0 - amplify api gql-compile now requires credentials

Before opening, please confirm:
I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
I have searched for duplicate or closed issues.
I have read the guide for submitting bug reports.
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
How did you install the Amplify CLI?
npm i -g @aws-amplify/cli
If applicable, what version of Node.js are you using?
14.15
Amplify CLI Version
4.48.0-
What operating system are you using?
Ubuntu
Amplify Categories
auth, storage, function, api
Amplify Commands
Not applicable
Describe the bug
Previous to 4.48, the amplify api gql-compile did not require credentials. Now it does. This eliminates using it easily from a CI/CD CodePipeline/CodeBuild step to produce CloudFormation and VTL template.
Expected behavior
Don't require credentials for a command that doesn't require them.
Reproduction steps
git clone https://some-repo.git
From a shell script:
# ------------------------------------------------------------------------------
#  Create files needed for CI/CD so that the amplify CLI thinks there is a
#  configured project. Don't overwrite them if they exist when run locally.
if [ ! -f amplify/team-provider-info.json ]
then
    echo "{}" > amplify/team-provider-info.json
fi

# Not sure if the envName below affects anything. Setting it to something weird
# so generated code can be searched for it.
if [ ! -f amplify/.config/local-env-info.json ]
then
    echo "{ \"projectPath\": \"$(pwd)\", \"envName\": \"maynotmatter\"}" > amplify/.config/local-env-info.json
fi

amplify api gql-compile

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line
amplify api gql-compile --yes
? Select the authentication method you want to use: (Use arrow keys)
❯ AWS profile
  AWS access keys

Additional information
No response

Hi @kjones, thanks for filing the issue! I was able to reproduce when credentials are not automatically resolved.

@kjones can you share the contents of /amplify/.config/local-aws-info.json?

In this CI/CD case there is none. I can create a fake one if that gets gql-compile to continue on.

@kjones for now the easiest workaround would be to pin the previous version of the CLI 4.47.1 in CI/CD until we release a fix.


Introduce common package for proxima.

The common package does the heavy lifting for proxima.

Done. I moved implementation code out of api.go, but I left the one liner methods in api.go alone.


Error when profiling

Hi,
First, thanks for providing numba--it's a wonderful tool. However, when I went to profile an application using numba, the profiler actually dies. Here is a minimal example:
from numba import jit, float64
import numpy as np

@jit(float64(float64[:], float64[:]), nopython=True, nogil=True)
def get_dot(a, b):
    dot = np.dot(a, b)
    return dot

def run_numba():
    a = np.array([2.0,3.8,4.2])
    b = np.array([4.4, 2.4, 2.5])
    dot = get_dot(a, b)
    print(dot)

if __name__=="__main__":
    run_numba()

If I save this to numba_profiling.py and run it, I get exactly what I expected. However, if I run
python -m cProfile -o numbaprof.prof numba_profiling.py, I receive this error:
Fatal Python error: BLAS wrapper returned with an error
KeyError: '__builtins__'

Current thread 0x00007fff7cbfa300 (most recent call first):
  File "numba_profiling.py", line 4 in get_dot
  File "numba_profiling.py", line 13 in run_numba
  File "numba_profiling.py", line 18 in <module>
  File "/Users/grinawap/anaconda/envs/openeye-works/lib/python3.4/cProfile.py", line 100 in runctx
  File "/Users/grinawap/anaconda/envs/openeye-works/lib/python3.4/profile.py", line 64 in runctx
  File "/Users/grinawap/anaconda/envs/openeye-works/lib/python3.4/cProfile.py", line 20 in runctx
  File "/Users/grinawap/anaconda/envs/openeye-works/lib/python3.4/cProfile.py", line 153 in main
  File "/Users/grinawap/anaconda/envs/openeye-works/lib/python3.4/cProfile.py", line 160 in <module>
  File "/Users/grinawap/anaconda/envs/openeye-works/lib/python3.4/runpy.py", line 85 in _run_code
  File "/Users/grinawap/anaconda/envs/openeye-works/lib/python3.4/runpy.py", line 170 in _run_module_as_main
Abort trap: 6

I looked around a bit, and could not find anything about this error.
I understand that the Python profiler can't see inside compiled functions, but I would imagine that it should not be yielding this error. If you've seen this and it's a problem with BLAS on my side, my apologies for the bother. If you need any more information, please let me know.
Thanks again for a wonderful product, and sorry to bother if this is something trivial!

Thanks for reporting this. This is a real bug and we are going to fix it soon.

Thanks!


Integrating pytorch XLA when using multiple GPUs

Description & Motivation
I've experienced with pytorch XLA using multitple NVIDIA A100 GPU and I observed that in most cases training is faster. So it would be really nice to have the option to use XLA for training in pytorch lightning.
The main advantage is faster training.
Additional context
Here is a code link : https://github.com/Dhouib-med/Test-XLA/blob/17e5b6bd6c77fffa67818462856277a57877ff3b/test_xla.py to train a simple CNN on the MNIST dataset using XLA (on 2 GPUS). The main parts where taken from https://github.com/pytorch/xla.
This wheel needs to be installed along with adequate pytorch and torchvision versions (1.11 and 0.14) https://storage.googleapis.com/tpu-pytorch/wheels/cuda/112/torch_xla-1.13-cp37-cp37m-linux_x86_64.whl
@justusschock
cc @borda @justusschock @awaelchli @carmocca @JackCaoG @steventk-g @Liyang90

Let's do it! To be clear, this would be enabled with: Trainer(accelerator='cuda'|'gpu', strategy='xla')

@carmocca I assume we could reuse a lot of our current xla-strategy for tpus.

That's would be part of the goal

I like it, and I think it won't even be that hard! The abstraction of strategy and accelerator are already in place and are meant to support exactly this kind of relationship between a communication layer (xla) and accelerator (gpu/tpu).
The first step towards this will be to simply rename our TPUSpawnStrategy to XLAStrategy (which is what we already planned to do and have done so already in lightning_lite).

This is great! :rabbit:

Hello，this is very wonderful work! I want to know when we can finish it that Trainer(accelerator='cuda'|'gpu', strategy='xla') can work normally.

@qipengh We haven't started working on it. The feature is up for grabs if you or anyone from the community has interest in contributing and testing it out.

This should become very easy once we add support for XLA's PJRT runtime: https://github.com/pytorch/xla/blob/master/docs/pjrt.md#gpu

FYI @Liyang90 has a pr to add PJRT support in https://github.com/Lightning-AI/lightning/pull/17352

In addition, we need to land

CI setup on CPU and/or CUDA workflows
Connector support for the combination
Docs

Is there an example model on how to use XLA with (a single) CUDA GPU? The link above now 404s since it was posted, I am struggling to find one anywhere; currently everything I come across is for TPUs only.
Roughly how much work do folks think is still needed in order to implement this FR?

@carmocca Can you tell why https://github.com/Lightning-AI/pytorch-lightning/pull/17519 was closed?

Because it wasn't finished and I am no longer a core maintainer. The changes are mostly still relevant and could be revived by another core maintainer. There's a lot of CI work involved so I don't think it could come from an open-source contributor.
Hope that helps


Load behaviour is not consistent with documentation

Hi,
just a minor issue, but I wanted to point out, that in documentation you state, that when load(key) function does not find any corresponding value it will return undefined.
In reality it will throw a DocumentNotFoundError though.

Thanks! I'll update the docs.


Add status to EventSubChannelPollEndEvent

Type: Improvement

Fixes: Issue discussed on Discord.

Thanks for your contribution 😄


multiple background control use problem

I am trying to use background control multiple times like border controls but i am not able to do that. I am using this code and fonts are working properly but i am not able to use background multiple times ?
$advanced_fields['fonts']['content'] = array(
'label' => esc_html__( 'Content', 'mydivi-mydivi' ),
'css' => array(
'main' => "%%order_class%% .flipbox-content p",
),
'toggle_slug' => 'fboxstyle',
);
$advanced_fields['fonts']['bbox'] = array(
'label'    => esc_html__( 'Title', 'mydivi-mydivi' ),
'css'      => array(
'main' => "%%order_class%% .front-icon-title",
),
'toggle_slug' => 'bboxstyle',
);
$advanced_fields['background'] = array(
'css' => array(
'main' => "%%order_class%% .mycontent",
),
'options' => array(
'background_color' => array(
'default' => et_builder_accent_color(),
),
),
'settings' => array(
'tab_slug' => 'advanced',
'toggle_slug' => 'fboxstyle'
)
);
$advanced_fields['background']['bbox'] = array(
'css' => array(
'main' => "%%order_class%% .mycontent1",
),
'options' => array(
'background_color' => array(
'default' => et_builder_accent_color(),
),
),
'settings' => array(
'tab_slug' => 'advanced',
'toggle_slug' => 'fboxstyle'
)
);

QA Checklist
Reporter

[ ] Helpful title used

Helpful title format: Scope(s) :: One Sentence To Describe The Issue
Example: VB :: Floating Toolbar :: Jumps To Top Of Page

[ ] Detailed description

Description should usually be 150+ characters.

[ ] Steps to reproduce included
[ ] Support Ticket URL included
[ ] Image and/or gif

Developer

[ ] Steps to reproduce proven solved
[ ] Test included and coverage acceptable and all Tests passing?
[ ] PR description has layman's description of problem and solution and "Areas Affected" listed/explained?
[ ] PR branch includes latest commits from master branch (at the time of checking)?
[ ] Estimated points on issue
[ ] Proper code documentation and conventions?
[ ] Proper RTL appearance
[ ] i18n used if applicable
[ ] Ajax/Form used? Nonce used? Perms checked? All user input sanitized and validated? Intentional unsanitized/unescaped functions used?
[ ] Database saved/updated? Data sanitized and validated?
[ ] Variable output properly escaped and validated?

Peer Review

[ ] PR branch includes latest commits from master branch (at the time of checking)?
[ ] Steps to reproduce proven solved
[ ] Affected areas are tested and ok
[ ] Proper code documentation and conventions
[ ] Proper RTL appearance
[ ] i18n used if applicable
[ ] Test(s) included and coverage acceptable
[ ] Ajax/Form used? Nonce used? Perms checked? All user input sanitized and validated? Intentional unsanitized/unescaped functions used?
[ ] Database saved/updated? Data sanitized and validated?
[ ] Variable output properly escaped and validated?

Quality Assurance

[ ] All tests passed on CircleCI.
[ ] Steps to reproduce passed, the fix works.
[ ] No errors in console or output
[ ] Affected areas are tested and ok
[ ] The fix does not change a customer's website in any surprising or unintended way

[ ] If Divi's design is adjusted, settings are migrated gracefully and invisibly

Design Review

[ ] UI is to spec
[ ] UX is to spec
[ ] Design is to spec
[ ] No surprising visual changes to a customer's website will be experienced after updating

[ ] Any/all visual changes are migrated gracefully

Dev Review

[ ] Test(s) included and coverage acceptable
[ ] Ajax/Form used? Nonce used? Perms checked? All user input sanitized and validated? Intentional unsanitized/unescaped functions used?
[ ] Database saved/updated? Data sanitized and validated?
[ ] Variable output properly escaped and validated?
[ ] i18n used if applicable
[ ] Implementation acceptable, DRY, Scaleable, future safe
[ ] Best practices used, cleverness and grokage, ES6 use, etc.

I'm afraid the background control doesn't currently support multiple instances like most of the other advanced fields do. This is something we can improve in the future though.

any news on this @lots0logs ? Multiple instances of advanced fields of same type and also 'sub_toggle' support for them would be great.


Eval CoreOS vs Talos

Context
The control plane needs an OS that would be supported initially.
Description
In order for the control plane to bootstrap new nodes, it needs to have a way to do this easilyt.
There are two contenders for this so far CoreOS and Talos.
Both provide an API to provision k8s.
Acceptance Criteria
Draw some conclusions, pros and cons and create a list.
This should be decisive in what to use for the first version of the control plane.
/triage
/assign
/label enhancement infra

/retitle Eval CoreOS vs Talos

/milestone v0.1.0

/milestone v0.1.0


Invalid binding in XAML compiles, FreshTinyIoC gives vague error at app start

In a ContentPage named ThingListPage consisting of a Xaml file and code-behind, containing a ListView.  For testing, I made an array of strings in the ContentPage's local ResourceDictionary and set it as the ListView's ItemsSource.  Like this:
<ListViem ItemsSource="{Binding Source={StaticResource TestData}}">
Everything is fine.  Later, I commented out the ResourceDictionary and its contents without changing the ListView's ItemSource.  Xamarin continued to build and deploy without errors or warnings.  Incidentally, the assembly-level attribute for Xaml compilation was enabled:
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
Upon running the app, it gave a super-vague error on both iOS and Android emulators:
FreshTinyIoC.TinyIoCResolutionException: Unable to resolve type: MyApp.Pages.ThingListPage
I couldn't decipher anything from debugging in VS.  It was only through trial-and-error that I found the problem came from the invalid binding statement.
Sorry for a less-than-definitive report, but I thought it better to report my notes thus far than to lose them to the great Notepad.exe in the sky.

I've had similar issues. The app would run but when I'd navigate to the page with the XAML (via button-click, etc.) it just wouldn't show. I'm not sure if this is due to FreshTinyIoC or Xamarin in general though.

Happened to me too.

Was anyone able to resolve this?  Turning off xaml compilation fixes the issue ([assembly: XamlCompilation(XamlCompilationOptions.Compile)]) but defeats the purpose of running with optimization.

Well, I find out later that was one of my pages (view) was using illegal parameters in a xaml component, actually was in a binding.

The most recent version of FreshMvvm solves this issue in that it always bubbles Xaml errors to the top.

I am facing similar kind of issue.
I have tried with update packages to resolve this issue but unfortunately unable to resolve
** Exception:** FreshTinyIoC.TinyIoCResolutionException: Resolve failed: LoginComponent - Reason: Resolve failed: Int32
InnerException:
at FreshTinyIoC.FreshTinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) [0x0005f] in <518460ffbfc5451e9dec2c932b3d8010>:0
at FreshTinyIoC.FreshTinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) [0x00000] in <518460ffbfc5451e9dec2c932b3d8010>:0
at FreshTinyIoC.FreshTinyIoCContainer.ResolveInternal (FreshTinyIoC.FreshTinyIoCContainer+TypeRegistration registration, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) [0x001ba] in <518460ffbfc5451e9dec2c932b3d8010>:0
at FreshTinyIoC.FreshTinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) [0x000a3] in <518460ffbfc5451e9dec2c932b3d8010>:0


Add line numbers to xml validation error messages

Proposed solution

Currently XMLSchemaValidationError exceptions raised by xmlschema library do not include specific line numbers of the error occurrence in the XML file. Including the line number in the error reason could be useful information for users and ParseError exceptions already include the position in the detail.reason that gets returned upon validation error.
@otahontas mentioned in #88 that one way to do this would be:
import lxml.etree as etree
root = etree.parse("XPTO.XML").getroot()
errors = [e for e in schema.iter_errors(root)]

DoD (Definition of Done)

detail.reason generated in xml validation method includes line number for any error case.
As an example, validating SRP000539_invalid6.xml could return:
Unexpected child with tag 'BAD_ELEMENT' at position 2, line 34.
Testing

Unit tests

might be fixed with: https://github.com/sissaschool/xmlschema/issues/164


Write a visual design / frontend style guide for Zulip

Zulip has a growing set of conventions for how things are done visually, and it'd be good to have these written down in some form (e.g. how we do error messages, how we do realm-specific settings, etc.).  I don't think this needs to be super long as a first version; once we have a thing, we can start adding new things as we go along.

Hello Tim, I'm a participante of the Outreachy Program and I would like to contribute. Can you please guide me?

Cool.  A good place to start might be finishing the subscriptions page CSS split work that's partially done here: https://github.com/zulip/zulip/pull/1187.

I'm resurrecting this one as it's related and I would say quite a blocker for #10881. We can start working on some parts but this will be needed.
@zulipbot claim

@zulipbot abandon

I'm going to focus on the actual frontend code, so if anyone wants to lead this one, I'll still be happy to help :)

I don't think we need this issue to track the idea of somehow documenting our design patterns.


[cloud-firestore] Transactions fail with PlatformException

Hi,
Searched every where... and seen a lot of bugs with Transactions in Firestore pkg... but this one is new.

Im running it on stable channel(Android Studio)
Ive  got the same error on device and emulator (Both Androids)
All my other CRUD operations work perfectly.

CODE:
DocumentReference myDocRef = collectionRef.document("Uuid");
    Firestore.instance.runTransaction((Transaction tx) async {
      print("000000");
      DocumentSnapshot docSnap = await tx.get(myDocRef);
      int x= docSnap.data['age'];
      x++;print("Age ++: $x");
      await tx.update(myDocRef, <String, dynamic>{'age': x})
          .catchError((e) {print("ERROR= $e");})
          .whenComplete(() {print("Transaction DONE!!!");});
    });

the above Document has only 2 fields: name & age. Im trying to read age... and then increment it by +1... and then update the document with the new age.
the above code fails even before it can print "000000".
> ERROR:
> PlatformException(Error performing transaction, Attempt to invoke virtual method 'void android.app.Activity.runOnUiThread(java.lang.Runnable)' on a null object reference, null)

> FULL ERROR:
> E/flutter (22677): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(Error performing transaction, Attempt to invoke virtual method 'void android.app.Activity.runOnUiThread(java.lang.Runnable)' on a null object reference, null)
> E/flutter (22677): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
> E/flutter (22677): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
> E/flutter (22677): <asynchronous suspension>
> E/flutter (22677): #2      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:349:48)
> E/flutter (22677): #3      MethodChannelFirestore.runTransaction (package:cloud_firestore_platform_interface/src/method_channel/method_channel_firestore.dart:123:10)
> E/flutter (22677): #4      Firestore.runTransaction (package:cloud_firestore/src/firestore.dart:85:22)
> E/flutter (22677): #5      _MyHomePageState.UpdateTransactionRW (package:firestorecrud/main.dart:229:24)
> E/flutter (22677): #6      _MyHomePageState.build.<anonymous closure> (package:firestorecrud/main.dart:90:19)
> E/flutter (22677): #7      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
> E/flutter (22677): #8      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:789:36)
> E/flutter (22677): #9      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
> E/flutter (22677): #10     TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
> E/flutter (22677): #11     BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
> E/flutter (22677): #12     BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:199:7)
> E/flutter (22677): #13     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:467:9)
> E/flutter (22677): #14     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
> E/flutter (22677): #15     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:117:9)
> E/flutter (22677): #16     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
> E/flutter (22677): #17     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:115:18)
> E/flutter (22677): #18     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:7)
> E/flutter (22677): #19     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
> E/flutter (22677): #20     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
> E/flutter (22677): #21     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
> E/flutter (22677): #22     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
> E/flutter (22677): #23     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
> E/flutter (22677): #24     _rootRunUnary (dart:async/zone.dart:1138:13)
> E/flutter (22677): #25     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
> E/flutter (22677): #26     _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
> E/flutter (22677): #27     _invoke1 (dart:ui/hooks.dart:273:10)
> E/flutter (22677): #28     _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)

====================
flutter doctor -v
[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.720], locale en-US)
    • Flutter version 1.12.13+hotfix.9 at C:\flutterio\flutter
    • Framework revision f139b11009 (4 days ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\Yo\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[!] IntelliJ IDEA Community Edition (version 2019.2)
    • IntelliJ at D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.3
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.43.0)
    • VS Code at C:\Users\Yo\AppData\Local\Programs\Microsoft VS Code
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (1 available)
    • AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

! Doctor found issues in 2 categories.

Hey, as part of our on-going work for #2582, this has been resolved in our Firebase Firestore rework (#2913) - which has now been merged into master. We'll look at publishing some prereleases in the next few days. Thank you


Consider distinguishing between conditional breakpoints and regular breakpoints in the breakpoints pane

We might need a way to identify conditional breakpoints in the breakpoint panel as without hovering over the breakpoints, there is no way to tell which have conditions attached to them. A few thoughts off the top of my head

We group the list of breakpoints into two groups, regular and conditional.
We draw a label ‘conditional’ next to the breakpoint
We draw as much of the expression as can fit in next to the breakpoint (this has problems due to the lack of available screen real estate)

Option 3 will not work for breakpoints that have long paths inside a workspace – we show the path in the breakpoint widget and there will be no place in the breakpoint pane
We experiment with first two ideas. More ideas are welcome


Darkmode state[FEATURE]

Darkmode to be able to change state whenever it is true or false without hot reload to see the effect

Please check out the Notes in the README for a way to do this without hot reload.
Because we use a webview, the theming cannot change state automatically so the solution in the README is required unfortunately :(


Remove unnecessary xlrd requirement from xlsx_to_strio()

Codecov Report

Merging #23 (7efcd7e) into master (a0f0801) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
- Coverage   87.20%   87.20%   -0.01%
==========================================
  Files          38       38
  Lines        3080     3079       -1
  Branches      307      307
==========================================
- Hits         2686     2685       -1
  Misses        333      333
  Partials       61       61

Impacted Files
Coverage Δ

blazeutils/spreadsheets.py
68.47% <ø> (-0.11%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0f0801...7efcd7e. Read the comment docs.

Codecov Report

Merging #23 (7efcd7e) into master (a0f0801) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
- Coverage   87.20%   87.20%   -0.01%
==========================================
  Files          38       38
  Lines        3080     3079       -1
  Branches      307      307
==========================================
- Hits         2686     2685       -1
  Misses        333      333
  Partials       61       61

Impacted Files
Coverage Δ

blazeutils/spreadsheets.py
68.47% <ø> (-0.11%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0f0801...7efcd7e. Read the comment docs.


Fix for no-internal-module rule

Fix proposal for issue #600
Personal note: I think the better approach to fixing this issue is to have the nodes representing the nested sub-paths in the namespace have the correct flag type ts.NodeFlags.Namespace instead of having to recurse for their parent which has it. Currently they have ts.NodeFlags.Export as their flags property's value. However, I wanted to limit the fix to the rule's definition file, and think this is the best solution without having to tamper into the node walker internals.

Thanks for the PR @vmmitev. I agree with you that, ideally, the ts.NodeFlags.Namespace flag should be set for the nested namespace, so I mentioned that issue to the Typescript team.
Your method is a decent workaround, however it doesn't handle one of the possible cases:
namespace A {
    module B {
    }
}

In this case, the rule won't catch the error. I think we have two options here:

Wait for the Typescript team to fix the bug
In the error case I posted, ModuleDeclaration B is a child of a ModuleBlock. Whereas when you have namespace A.B { }, ModuleDeclaration B is a child of a ModuleDeclaration.

I think for the second option, we could change:
for (; node.parent; node = node.parent)

to
for (; node.parent != null && node.parent.kind === ts.SyntaxKind.ModuleDeclaration; node = node.parent)

And of course, we'd also want a test for this case.

Thanks for noticing, @JKillian. I did realize shortly after creating the PR that the node information is supplied by the compiler and that, indeed, it has to be fixed on Typescript's side.
I didn't want to give up on the second option just yet. After debugging the newly introduced erronous case it would seem that we can depend that nested namespaces are a node with 'flags' property set to '1' and nested modules have it set to '0'. Therefore, the solution I came up with is to treat nodes with zero values as nested module declarations. That kind of dependency can be problematic in the long run but I've pushed it regardless so that you can review and weigh in your opinion.
Maybe we can improve the check in such a way that when the compiler reports the correct values the rule won't need to be updated again?

I agree that we can probably get this working correctly on the end of tslint for now. I don't think your flags idea will work though, because of what the flag value of 1 means. If you check out the NodeFlags type, you can see that they use that to indicate that it is exported.
So when you do namespace A.B {}, B is automatically exported. What that means is that you'll have the same flag values if you do this:
namspace C {
    export module D {
    }
}

and if we're just checking based on the flag value, the rule would say that that is okay.
I think my previous suggestion (the modification of the for loop) should work though - feel free to give it a try and let me know if you encounter any problems.

Your approach was the first thing I tried. However, that check wasn't sufficient to differentiate the namespace and module keywords declarations (all nodes return a kind property with value ts.SyntaxKind.ModuleDeclaration = 206.
Using the flags === 0 check is horrible but it was the first thing I found that passed the tests as I'm trying to guess my way around the API.
I'm going to continue looking for a definite solution and update the PR once found.

In the end it seems the most reliable way to determine if a ModuleDeclaration node is not nested is to check whether its text starts with module or namespace. However if we invert this statement then a nested module will have to begin with its node.name.text value. This replaces the node.flags === 0 check and works well:
private isNestedDeclaration(node: ts.ModuleDeclaration): boolean {
    // top level declarations begin with "module" or "namespace", nested ones - with their names
    return node.name != null &&
        node.getText().indexOf(node.name.text) === 0;
}

Moreover, if we apply this check to the if block where we insert the actual failure, then we'll no longer report multiple errors for blocks like:
module foo.bar.baz {
}

This should help reduce the number of warnings that developers will get when activating this option on their code that depends on internal module declarations to one per module declaration block.

thanks @vmmitev! just need some small tweaks to get this merged. looks like your tests are passing; appveyor just had connectivity problems with Github. It should work fine on your next commit

@vmmitev I still think your old method is simpler and will work with a tweak or two: :smiley:
class NoInternalModuleWalker extends Lint.RuleWalker {
    public visitModuleDeclaration(node: ts.ModuleDeclaration) {
        if (this.isNamespaceFlagSetRecurseParents(node)) {
            // ok namespace
        } else if (node.name.kind === ts.SyntaxKind.Identifier) {
            // for external modules, node.name will be a LiteralExpression instead of Identifier
            this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING));
        }
        super.visitModuleDeclaration(node);
    }

    private isNamespaceFlagSetRecurseParents(node: ts.Node): boolean {
        for (; node != null && node.kind === ts.SyntaxKind.ModuleDeclaration; node = node.parent) {
            if (Lint.isNodeFlagSet(node, ts.NodeFlags.Namespace)) {
                return true;
            }
        }
        return false;
    }
}

(I had a few unnecessary .parent's last time.) A nested ModuleDeclaration's parent will only be a ModuleDeclaration if it is declared with the namespace A.B syntax and not with the namespace A { namespace B {} } syntax. So if its parent isn't a ModuleDeclaration, we can just stop traversing the parent chain and return false.

I'm not a fan of the for-loop syntax to traverse parent nodes. I like the readability of the current PR. If there are simplifications to be made, please suggest them on the current implementation.

@adidahiya Just the syntax of using a for loop, or the whole concept? If just the syntax, a while loop can be used nearly identically.
@vmmitev Check out this test case :wink:
namespace foo {
    module mod {
    }
}

@JKillian that was a low blow. I'll work on ironing this out as well as the review comments.

@vmmitev I know, definitely a cheapshot :grinning:. Thanks for all the effort on this issue!

I think this is it. Once the compiler issue is closed and TSLint targets a version containing the fix I'll make sure to come back and create a PR that removes the need to recurse parent nodes.
You can tell by some of the new test cases that my battle with the faulty isNestedDeclaration logic got pretty messy. It was going fairly well until I realised getText() also returns the body of the whole module declaration. That's where I drew the line and started from scratch trying to find anything that's not text and can be resolved down to the desired result. Then it hit me! I had written it in the method's comment all along. All I had to do is to switch to checking the pos properties of the node and its node.name. I also figured that there will never be a case where this method is called on nodes that are not a ts.ModuleDeclaration (even when recursing and making a type-cast). That's why it no longer checks if the name property exists.
The new test cases are a bit redundant for the current state of the code, but since they are valid declarations with interesting properties (duplicating or partial keywords, and malformed whitespace) let's leave them just in case.

Quick update. I just reviewed the discussion at TS4436 and it turns out they only add flags to nodes that contain the actual keyword. Correct me if I'm wrong. This can mean 2 things:

We can actually depend on cases where flags === 0 to determine nesting. However, my observations were that nodes nested in a namespace have flags === 1 which contradicts their statement (nodes nested in an internal module declaration exhibited the correct? zero value). Maybe we should bring this up for clarification on their side?
dasda

the compiler bug has been fixed upstream and this is no longer an issue in the latest tslint. can you please update this PR to only add tests (revert your changes to src/ files)? thanks!

Sure thing. Would you prefer to keep the current history and do a revert commit or shall I just rebase the HEAD?

thanks for asking. I'd prefer a cleaner history, so please rebase on master and try to make this just 1 commit. you can start a new PR if that's easier for you

I know you asked for just the tests but as they were, without ignoring nested dot-syntax declarations, 21 errors were produced instead of the expected 9 (only from nodes directly following the module keyword). I can rebase again and add assertions for the additional cases if you prefer the more verbose behaviour.

Sorry, I forgot to mention -- can you make a new PR targeting the next branch? That's where we have the latest TS compiler with the fix for the namespace flag. And TS 1.6 is going to release soon so I don't want to maintain this new code (your adjustments to NoInternalModuleWalker) on master if it'll be fixed automatically with the latest compiler when the 1.6 beta is out.


why set "seq_length = min(args.generate_num, 256)"

I notice you have three pretrained models, include seqlen256_v1.ckpt and seqlen512_v1.ckpt. And you say "Only difference is the sequence length used during training. The 512 model uses double the number of tokens as the 256 one for computing the attention but half the batch size (to prevent OOM)." so why in generate.py you set seq_length = min(args.generate_num, 256)?
If I used seqlen512_v1.ckpt model, should I set seq_length = min(args.generate_num, 512)?

Hi @luweishuang,
Not a developer, but I encountered the exact same issue with training.
You will have to change the value to 512 if training on the seqlen512_v1.ckpt model. I have modified this on the version I'm currently using to a function argument inputted at the time of cmd line entry so I would strongly recommend doing this.
All the best
Thursday


Go over the Info.plist and figure out ALL of what needs to be modified

And then write docs on how to, or a script to do it for you.
Really, I just need to make the script do it.

Everything seems fine except for icons.
Will fix when I get a Macbook to test with.


Calling python3 runbook from another runbook in azure automation

Feedback: Please add instructions with illustrations on python parent and child runbooks.
One of the use case from a customer:
Customer have a function (named download_file()) which is in a python3 runbook named get_secret.py. They need to use it in an another python3 runbook called register.py.
All these runbooks are created under one of the automation accounts in Azure.
They would like to know how to call/invoke/import the function/script (get_secret.py) from register.py
Tried as per the usual method given below, but it didn't work.
In register.py
! /usr/bin/env python3
import get_secret
get_secret.download_file()
Also, imported the get_secret.py script into "Python packages" under Shared Resources in Automation Account, that too also not worked out.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 23c183d0-5012-e2e1-5562-69135b3f6509
Version Independent ID: 7f36ff87-e24a-7442-8d42-f621f5391814
Content: Create modular runbooks in Azure Automation
Content Source: articles/automation/automation-child-runbooks.md
Service: automation
Sub-service: process-automation
GitHub Login: @MGoedtel
Microsoft Alias: magoedte

@KrishanG-MSFT - I've brought this to the PG's attention and have outlined a plan to improve the guidance related to working with Python-based runbooks so there is close parity between "how you do something" with PowerShell and Python runbooks. This work will likely be done in preparation for GA of Python 3 support, early next year.
In the meantime, I believe an approach that would work is to use the native sub process module to call a child Python runbook.
#reassign: @JYOTHIRMAISURI

Thanks for your dedication to our documentation. Unfortunately, at this time we have been unable to review your issue in a timely manner and we sincerely apologize for the delayed response. The requested updates have not been made since the creation of this issue, and the timeline for resolution may vary based on resourcing, so we've created an internal work item to incorporate your suggestions. We are closing this issue for now, but feel free to comment here as necessary. #please-close

#reassign: @SnehaSudhirG


Configure Kong OAuth2 plugin for Blue Button integration

Configure the Kong OAuth2 plugin for the Blue Button Kong service.
Remove existing Blue Button OAuth2 methods from Connect.

https://docs.konghq.com/hub/kong-inc/oauth2/

Ultimately, the function we needed to do this is in Kong Enterprise edition, not the community edition.  For now, leaving The Blue Button routes as implemented & we cam circle back on this later.


Update Findings to 1.3-3009

Thank you for the contribution. It was merged directly as b07dfc814b20669806fc2d4d000272d8e27366f2 to keep commit history cleaner. Your contribution is still credited to you.