sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: [JIT] Rough edges found while exploring expressions supported by TorchScript
Labels: oncall: jit

- [ ] `del` statement with slicing as target in which primary is an object of a user-defined type parses correctly, but only the first item from the slice list is taken (e.g. `del obj[1, 2, 3]`)
- [ ] subscription/slicings of user-defined types cannot use multidimensional indexing or slice objects by defining __getitem__
- [ ] result of `**` is a `float`, even if the operands are both integers (probably due to overflow?)
- [x] raising 0 to a negative power returns `inf`, and does not throw an error
- [ ] raising a negative number to a fractional power returns `nan` instead of a complex number or error
- [ ] TorchScript does not allow repeated/chained unary operators
- [ ] TorchScript does not support unary `+` operator
- [ ] negative repetition factor for `*` operator with lists yields empty list in Python but does not work in TorchScript
- [ ] division (`/`) by 0 does not throw `RuntimeError` and produces `nan`
- [ ] modulus (`%`) by 0 causes a crash due to floating point exception
- [ ] Python provides a default implementation for `==` and `!=` that default to using is and not is but TorchScript does not
- [ ] For classes that do not define `__contains__` but do define `__iter__` or `__getitem__`, Python implements `__contains__` using the latter two
- [ ] Python compares even objects considered to be “primitive” types in JIT by `id` to compute the result of `x is y`
- [x] Python automatically interprets numeric zero of all types, empty strings and empty containers as `False` when used in control flow predicate contexts
- [ ] Python automatically converts values not of `bool` type to `bool` if they are used as an operand to a boolean operation
- [ ] Python distinguishes between the boolean interpretation of a comparison and its actual value. The return value of the expression `7 and []` in Python is `[]`; `7` is evaluated first and is interpreted as `True` because it is not zero, and then `[]` is evaluated and interpreted as `False` because it is empty, and then `[]`, is the value of the whole expression

cc @gmagogsfm
Repository: pytorch
Issue: [Feature Request] Support tensor creation from objects that implement the __array__ interface
Labels: triaged,module: numpy,needs design,function request

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->
It would be great for `torch.tensor(obj)`, `torch.from_numpy(obj)`, and other tensor-creation functions to check `obj.__array__()` before raising an error that `obj` is of the wrong type.

I'd be happy to give this a shot.

## Motivation

<!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->

NumPy provides [a standard way](https://numpy.org/devdocs/user/basics.dispatch.html) for a class to expose a `numpy.ndarray` so that NumPy functions like `asarray` can know how to cast it to an array. This standard is for the class to implement an `__array__()` method that returns a standard `numpy.ndarray` .

This standard makes it really convenient for non-ndarray classes to nonetheless interface nicely with NumPy, xarray, and other array-based libraries.

```python
import numpy as np
import xarray as xr
import torch as tr

class MyData:
    # This is just a silly toy example
    def __array__(self, dtype=None):
        return np.array([1., 2.], dtype=np.float32)

my_data = MyData()
```

We can make a ndarray out of `my_data`...

```python
>>> np.asarray(my_data)
array([1., 2.], dtype=float32)
```

`my_data` can even take the form of an xarray-DataArray

```python
>>> xr.DataArray(my_data)
<xarray.DataArray (dim_0: 2)>
array([1., 2.], dtype=float32)
Dimensions without coordinates: dim_0
```

But `my_data` cannot easily be made a tensor!

```python
>>> tr.tensor(my_data)
RuntimeError: Could not infer dtype of MyData

>>> tr.from_numpy(my_data)
TypeError: expected np.ndarray (got MyData)

>>> tr.as_tensor(my_data)
RuntimeError: Could not infer dtype of MyData
```


## Pitch

<!-- A clear and concise description of what you want to happen. -->
I would be happy to take a swing at this as long as this feature can be implemented without leaving the pure-Python side of things.


cc @mruberry @rgommers @heitorschueroff
Repository: TypeScript
Issue: Named import for 'any'-typed module doesn't work
Labels: Suggestion,In Discussion

# Bug Report

### 🔎 Search Terms

any module export assignment named import

### 🕗 Version & Regression Information

TypeScript v4.1.2

### 💻 Code

*mock.d.ts*

```ts
declare const _: any;
export = _;
```

*example.ts*

```ts
import { a } from "./mock";

import * as b from "./mock";
const { c } = b;

const { d } = await import("./mock");

console.log(a, c, d);
```

*tsconfig.json*

```json
{
  "compilerOptions": {
    "module": "ESNext",
    "strict": true,
    "target": "ESNext",
  },
  "include": [
    "./**/*.ts"
  ]
}
```

### 🙁 Actual behavior

The first import returns the diagnostic:

```
error TS2305: Module '"./mock"' has no exported member 'a'.
```

While `c` and `d` do not error.

### 🙂 Expected behavior

With an export being effectively `any`, I would expect default, namespace, dynamic and named imports to all behave as if the module was `any`.  I cannot find any other way to declare a module in a fashion where the compiler treats any import from that module as `any` and does not issue diagnostics.

As implied in the above, there are certain situations where there is a need to "mock" a module where its shape cannot be statically determined at compile time.
Repository: vscode
Issue: openExternalUri as a middleware
Labels: feature-request,opener

Testing #114962

I had a thought that an extension might wanna track when users opt to open an external Uri over.. say.. some UI experience in VS Code. I could see an implementation of this that just sets up a `registerExternalUriOpener` that acts as a middleware:

```ts
        context.subscriptions.push(vscode.window.registerExternalUriOpener(openerId, {
		canOpenExternalUri(uri: vscode.Uri) {
                         // Important logic goes here
			return vscode.ExternalUriOpenerPriority.Preferred;
		},
		async openExternalUri(resolveUri: vscode.Uri) {
                         // log to magic telemetry service
			telemetryService.log(`ended up going here: ${resolveUri.toString()}`);
                         // open Uri as planned
			await vscode.env.openExternal(resolveUri);
		}
	}, {
		schemes: ['https'],
		label: 'Do the thing'
	}));
```

the only problem with this idea is that you get this dialog twice, which is bad:

![image](https://user-images.githubusercontent.com/2644648/105926254-84d3d200-5ff6-11eb-83b0-51c26410a869.png)

maybe there can be some mechanism for passing the `Uri` to the next `ExternalUriOpener` or maybe just the default implementation (opening in the user's browser.

This could either be done in a separate function (`interceptExternalUri` bad, but you get the idea) or allow `openExternalUri` to take in a second paramter called `next` that is a function that will pass the `resolveUri` to the next middleware or default implementation.

This is similar to how expressjs does middleware: http://expressjs.com/en/guide/using-middleware.html

I suggest this since the ExternalUriOpener is more-or-less a router.
Repository: go
Issue: proposal: testing: structured output for test attributes
Labels: Proposal

Test2json, more particularly `go test -json`, has been quite a pleasant discovery. It allows for programs to analyze go tests and create their own formatted output. 

For example, using GitHub Actions' [formatting capabilities](https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions), I was able to better format go tests to look more user friendly when running in the UI: 


Before:

<img width="680" alt="Screen Shot 2021-01-26 at 5 22 08 PM" src="https://user-images.githubusercontent.com/16294261/105926721-8ca07000-6010-11eb-9fa7-eba9c62aa4ae.png">

After: 

<img width="720" alt="Screen Shot 2021-01-26 at 5 21 58 PM" src="https://user-images.githubusercontent.com/16294261/105926739-9629d800-6010-11eb-9fa6-a56b660dacff.png">

With that said, there are still some missing features that would allow programs to better understand the JSON output of a test. 

### Proposal

It would be great if Go Tests can attach metadata to be included in the JSON output of a test2json run. 

Something along these lines: 

```golang
func TestFoo(t *testing.T) {
  t.Log("Foo")
  // outputs: {"action": "output", "output": "foo_test.go:12 Foo\n"}
  t.WithMetadata(map[string]string{"requestID": "123"}).Errorf("Foo failed")
  // outputs: {"action": "output", "output": "Foo failed", "metadata": {"requestID": "123"}}
}
```

### Benefits: 

This allows for a few highly beneficial use cases: 

1. If a test fails, then the program that's analyzing the failed test's json can receive metadata about why it failed: such as requestID, userID etc and then provide the user helpful links to logs and queries. 
2. A test can provide source-code information about where things failed. Because right now `test2json` cannot distinguish between when a user called `t.Fatal(...)` or `t.Log(...)` which makes sense as `t.Fatal` just calls `t.Log` -- but the user can include metadata so we know exactly where the error occurred and use CI capabilities such as [Actions' error](https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message) command to set the file and line number to be displayed in the UI. 

### Alternative solutions: 

Include directives in the output string that the json-parsing program can analyze to see if there's metadata. But this solution is very fragile and prone to error. 

Thanks!
Repository: TypeScript
Issue: Error when spreading a union of tuples in a call
Labels: Bug,Fix Available,Rescheduled

# Bug Report

### 🔎 Search Terms

destructure array typescript union

### 🕗 Version & Regression Information

I used the playground to test different versions and it looks like this has always occured.

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about "Type Systems behavior", "Type Guards", "Functions". 
 
### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.2.0-dev.20210126#code/MYewdgzgLgBLC8MDaAWANAJgAwF0YEMIZRIoAoE6ODGRVNGbBgZlwKMvM7mduQEYsDQXkLIwAVwC2AIwCmAJwaTZivAB9x0+Upgqdy7WrJkA9KZgB1EAoDWEMmDkB3GABF8UOQAoAlADoIOSgACRAJBQhvfxioX0cXd08fAKDQ8Mjo2Ix4k3MYAFEADwAHOWAvABMYfgBaFAIFAHNpOTAoCAYZCVgmkFgsGBsYKRs5fwTXDy8-QOCwiKiY-yhmXyA
)

### 💻 Code

```ts
const t = [4,20] as const
const t2 = [4, 20, 30] as const
const t3 = [10, 10] as [number, number] | [number, number, number]

// Works
new Date().setHours(...t)
new Date().setHours(...t2)

// Error: Expected 1-4 arguments, but got 0 or more.
new Date().setHours(...t3)
```

### 🙁 Actual behavior

Error: Expected 1-4 arguments, but got 0 or more.

The array type passed as a length of 2 or 3 so the message "got 0 arguments" is wrong.

### 🙂 Expected behavior

I expect the compiler should be able to recognize that the array type can only have length 2 or 3 and would not throw an error.
Repository: go
Issue: x/tools/gopls: detect unsupported build systems and improve error messages/performance
Labels: NeedsInvestigation,gopls,Tools

I recently ran into issues caused by https://github.com/bazelbuild/rules_go/issues/512, but the error message displayed by gopls seemed unrelated. Within my editor (VS Code) I just see `Error loading workspace: go [-e -json -compiled=true -test=true -export=false -deps=false -- builtin <redacted>: exit status 2: warning: ignoring symlink ...`.

I spoke with @stamblerre to diagnose the issue and it came down to the fact that gopls doesn’t know about generated files due to the Bazel Go rules issue linked above. It’s even stated in the [README](https://github.com/golang/tools/tree/master/gopls#supported-go-versions-and-build-systems):

> gopls currently only supports the go command, so if you are using a different build system, gopls will not work well. Bazel support is currently blocked on bazelbuild/rules_go#512.

I was curious of whether it would be possible to detect a `WORKSPACE` file at the directory root and display a more helpful error or warning. One could even disable certain features or bail early from long-running commands that repeatedly fail.

ccing @jayconrod for any insight into detecting an unsupported build system like Bazel.

Thanks, all!
Repository: godot
Issue: Sprite pivot point scrolls with texture offset
Labels: bug,topic:core,topic:rendering

**Godot 3.2.1**


**Windows 10, Intel HD 4000 Chipset**


I'm using a mirrored texture and its region to scroll it along its Y axis infinitely. The problem comes when trying to rotate the scrolling texture. It seems that its pivot point scrolls along with the texture. As such it gives the impression while testing that the rotation gets faster over time, but this is only the result of the pivot being continuously offset more and more, messing up the math. 

As a workaround, I've tried making the sprite itself the child of a position 2d node and rotate that instead, but for a reason I don't quite understand, the problem is still occurring. Next, I tried scrolling the texture with a shader instead, to see if that would produce different results. It did not. 

After posting on multiple help forums, I finally got a moderator on the godot Q&A forum to test out my project and see if he could fix it. His conclusion was that the problem was probably occurring due to an engine bug.

**Here is a screenshot of the scene tree and the relevant script:**

https://godotforums.org/uploads/editor/2b/z4afqzo940eo.png
![image](https://user-images.githubusercontent.com/8281454/105940650-2282dc00-609f-11eb-9bcb-11db51052005.png)

https://godotforums.org/uploads/editor/20/dzblywwu0zp8.png
![image](https://user-images.githubusercontent.com/8281454/105940656-257dcc80-609f-11eb-8e67-7b33cccd977d.png)


**Steps to reproduce:**

- Use a sprite, add a seamless texture imported with mirrored option enabled
- Enable and configure the sprite's texture region according to the texture used
- Through script, scroll the texture region on the y axis and have the scrolling move relative to texture rotation 
-  Through script, rotate the sprite

**Original Project:**
[Shmup_Project.zip](https://github.com/godotengine/godot/files/5877615/Shmup_Project.zip)

**Sample Project**
[Pivot Issue.zip](https://github.com/godotengine/godot/files/5884399/Pivot.Issue.zip)



**Note:** Use Q and E keys to rotate while testing.
Repository: go
Issue: os: Getwd returns wrong path format in MinGW
Labels: OS-Windows,NeedsInvestigation

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go1.15.7 windows/amd64
</pre>

### Does this issue reproduce with the latest release?
Yes


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\guest\AppData\Local\go-build
set GOENV=C:\Users\guest\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\guest\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\guest\go
set GOPRIVATE=
set GOPROXY=
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\guest\AppData\Local\Temp\go-build066057222=/tmp/go-build -gno-record-gcc-switches
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

run `exec.Command(filepath.Join(os.Getwd(), 'app')` under:
```
~ $ uname -a
MINGW64_NT-10.0-17763 dell 3.1.7-340.x86_64 2020-10-23 13:08 UTC x86_64 Msys
~ $ pwd
/c/Users/guest
```
### What did you expect to see?
app output


### What did you see instead?
`exec: "C:\\Users\\guest\\app": file does not exist`
Repository: TypeScript
Issue: JS replace symbol creates invalid syntax for object string keys
Labels: Bug,Domain: Refactorings

*TS Template added by @mjbvz*

**TypeScript Version**: 4.2.0-dev.20210126

**Search Terms**
- rename
- accessor
- bracket / dot
- 
---

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.52.1
- OS Version: macOS 10.15.7

Steps to Reproduce:

1. Create an object with a property (eg, `var foo = {blah: 123}`)
2. Create a reference to the property (eg, `console.log(foo.blah)`)
3. Right-click property and click Rename Symbol
4. Enter a new symbol name with quotes (eg, `"must-quote-this"`)
5. The references will be incorrectly replaced (eg, `console.log(foo."must-quote-this")`)

Does this issue occur when all extensions are disabled?: Yes (all external extensions)
Repository: ant-design
Issue: Image组件的滚轮事件绑定能否修改为根据配置传参可选关闭
Labels: 💡 Feature Request,Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### What problem does this feature solve?
我在开发一套Drawer搭配Image组件，默认开启preview功能充当一个图片展示的组件，但是产品要求去除滚轮事件，仅仅使用按钮来放大和缩小，我在使用了stopImmediatePropagation函数之后发现chrome的确能拦截掉滚轮的放大缩小，但是IE浏览器将会连滚轮触发滚动条滚动的事件都拦截掉，我找不到足够好的办法，希望能提供一个参数取消preview时滚轮滚动放大缩小的功能。

### What does the proposed API look like?
preview={{
  wheel: false
}}


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: pytorch
Issue: [docs] use `versionadded`, `versionchanged` and `deprecated` directive
Labels: module: docs,feature,triaged

## 🚀 Feature
Use `.. versionadded::`, `.. versionchanged::` and `.. deprecated::` directive, so that user knows which features are added / changed / deprecated in which version and they can navigate the docs easily without changing the docs from version to version.

Ref: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-versionadded

I know PyTorch takes a lot of care for documentation, GitHub Release notes.
Most of use read github release notes, too.
But, for those who are not quite get in touch with github release notes, I think it's better to provide those directives so that even if we are in the latest docs, we can know which version to use if we just need a certain feature of pytorch (but, yes we normally use latest version, I think it might help a bit for production use cases.)

After all, this is a suggestion, let me know what pytorch devs think.
Thank you!

cc @jlin27 @mruberry
Repository: PowerToys
Issue: [Bug report tool] Improve the UX 
Labels: Help Wanted,Area-User Interface,Area-Bug Report Tool

In 0.31 we added the sys tray icon context menu item to run the bug report tool, that creates the .zip file on the desktop, but the user is left there without providing instructions on how to report the bug.
We should add a dialog box to allow the user to click on a button to open a new github issue.
We should also investigate if it is possible to auto-upload the .zip file to the new issue.
Repository: pytorch
Issue: [numpy] torch.ceil and torch.floor don't support integer inputs while Numpy does
Labels: triaged,module: numpy

```python
>>> import torch
>>> import numpy as np
>>> torch.__version__
'1.8.0a0+1935880'
>>> t = torch.randint(1, (3,))
>>> np.floor(t.numpy())
array([0., 0., 0.])
>>> np.ceil(t.numpy())
array([0., 0., 0.])
>>> torch.floor(t)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: "floor" "_vml_cpu" not implemented for 'Long'
>>> torch.ceil(t)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: "ceil" "_vml_cpu" not implemented for 'Long'
```

cc @mruberry @rgommers @heitorschueroff
Repository: flutter
Issue: [TabBar] Add ability to to control padding of SingleChildScrollView which is inside TabBar
Labels: c: new feature,framework,f: material design,a: quality,c: proposal,team-design,triaged-design

## Use case
Problem arise when I need to have a horizontal padding on the TabBar as follow.
![Screenshot 2021-01-27 at 6 05 12 PM](https://user-images.githubusercontent.com/23042145/105975738-47407900-60ca-11eb-9289-380c17998351.png)

## Proposal
Just by adding an additional parameter as follow.
![image](https://user-images.githubusercontent.com/23042145/105976432-20367700-60cb-11eb-9f8f-fc6b1236511c.png)
Repository: vscode
Issue: `context.secrets.onDidChange` fires without change
Labels: bug,secret-storage

Testing #115160

* use the code snippet below
* you get two change events even tho there the second change isn't a change

```ts
let disposable = vscode.commands.registerCommand('extension.helloWorld', async () => {

	context.secrets.onDidChange(e => {
		console.log('change', e);
	})

	//
	await context.secrets.store('jjjsecret', '9999');
	await context.secrets.store('jjjsecret', '9999');

	console.log(await context.secrets.get('jjjsecret'));
	console.log(await context.secrets.get('jjJsecret'));
});
```
Repository: pytorch
Issue: Initialize NCCL backend with MPI
Labels: oncall: distributed,triaged,module: mpi,enhancement,module: nccl

## 🚀 Feature
After intilizing `torch.distributed` with MPI backend, another NCCL comm group may be established based on `MPI_Bcast`, without any other shared KV store or TCP connection, which is in the example of NCCL.

## Motivation

I am writing a program which requires both MPI for CPU and NCCL for GPU communications. I found it hard to use them simutaneously in PyTorch.

## Alternatives

Using cuda-aware MPI now, but it does not support FP16. 



cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @agolynski @SciPioneer @H-Huang @mrzzd @cbalioglu