sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: GraphModule.to_folder generates code with syntax error (imports in the middle of a class) [torch.fx]
Labels: triaged,module: fx

## 🐛 Bug

The Python code generated by `torch.fx.GraphModule` does not parse. This is because it inserts an `import torch` statement in the middle of the generated module class, between the `__init__` and the `forward` methods.

## To Reproduce

```python
import torch
from torch import fx


class MyModule(torch.nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, x):
        return torch.matmul(x, x)


gm = fx.symbolic_trace(MyModule())
gm.to_folder("testfx")
```

The generated `testfx/module.py` is:
```python
import torch
from torch.nn import *
class FxModule(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.load_state_dict(torch.load(r'testfx/state_dict.pt'))
import torch
    def forward(self, x):
        matmul_1 = torch.matmul(x, x);  x = None
        return matmul_1
```

Which results in the error:
```
File "testfx/module.py", line 9
    def forward(self, x):
    ^
IndentationError: unexpected indent
```

## Expected behavior

I expect the import to be at the top of the file, so that the module can be loaded correctly.

## Environment

PyTorch version: 1.8.1+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.3 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
CMake version: version 3.18.4

Python version: 3.8 (64-bit runtime)
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.4
[pip3] torch==1.8.1
[conda] Could not collect



cc @ezyang @SherlockNoMad
Repository: flutter
Issue: LogicalKeyboardKey does not always match PhysicalKeyboardKey on Desktop(Windows)
Labels: a: text input,engine,platform-windows,a: desktop,has reproducible steps,P2,found in release: 2.0,found in release: 2.1,team-windows,triaged-windows

<img width="941" alt="flutterRawKBL" src="https://user-images.githubusercontent.com/3886001/114159357-619a9c80-992e-11eb-9fa6-faaa6ebf576b.png">

Trying to grab scanner input, but key.logicalKey.keyLabel sometimes mismatch with physical, as if it still thinks the shift has been pressed. Sometimes there are % insted of 5, and randomly other presented numbers.

So that forced me to use code like this, with substring physical key, instead simple key.logicalKey.keyLabel getter.
```void _keyEvent(RawKeyEvent key) {
    if (key.runtimeType.toString() == 'RawKeyDownEvent' &&
        key.physicalKey.debugName != null) {
      (_keyTime.isRunning) ? _keyTime.reset() : _keyTime.start();
      if (_keyTime.elapsedMilliseconds < _barTime) {
        var keyname = key.physicalKey.debugName ?? '0';
        _barCode += keyname.substring(keyname.length - 1);
        if (_barTimer == null) {
          _barTimer = Timer(
              Duration(milliseconds: _barTime), () => _barProcessor(_barCode));
        } else {
          _barTimer!.cancel();
          _barTimer = Timer(
              Duration(milliseconds: _barTime), () => _barProcessor(_barCode));
        }
      }
    }
  }

  void _barProcessor(String barcode) {
    var userId = RegExp(r'\d{5,}').firstMatch(barcode)?.group(0) ?? '';
    if (userId.isNotEmpty) {
      print("userId=$userId");
      // ...
    }
    _keyTime.stop();
    _barCode = '';
  }
Repository: flutter
Issue: Proposal to obscure All Text in TextFormField on mobile while typing. Web and Desktop obscures text while typing.
Labels: a: text input,c: new feature,framework,f: material design,a: typography,c: proposal,team-design,triaged-design

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our2 documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Use case
The use case is when a user is typing in private information. An example can be a password field in an app. This would be for mobile apps but also for web and desktop apps as it  makes more sense there.
<!--
     Please tell us the problem you are running into that led to you wanting
     a new feature.

     Is your feature request related to a problem? Please give a clear and
     concise description of what the problem is.

     Describe the alternative solutions you've considered. Is there a package
     on pub.dev/flutter that already solves this?
-->

## Proposal
The obscureText parameter in the TextFormField obscures the text when set to true. However, it shows the last typed character for a short amount of time before hiding it or until another character is typed. I would like to have the option to obscure all text, even the character that I just typed. Usually on mobile devices you would want to show the last typed character as the keyboard is small so they would need to see what they are typing, however, there are occasions where I would like to hide all characters. Another example is now that flutter is on the web and that desktop support is in alpha, I think that having the option to hide all characters, especially on desktop, would be a great addition to the TextFormField. I haven't tested Flutter Web or Desktop yet so I don't know if this is the default behavior or not but I would imagine that flutter's widgets are the same everywhere.
<!--
     Briefly but precisely describe what you would like Flutter to be able to do.

     Consider attaching images showing what you are imagining.

     Does this have to be provided by Flutter directly, or can it be provided
     by a package on pub.dev/flutter? If so, maybe consider implementing and
     publishing such a package rather than filing a bug.
-->
Repository: TypeScript
Issue: Completions broken in setup function return object literal for vue
Labels: Suggestion,Domain: Completion Lists,Experience Enhancement,Experimentation Needed

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->

completions return 'object literal shorthands'

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->
- This changed between versions 4.2.0 and 4.2.3

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?jsx=0&ts=4.3.0-beta#code/JYWwDg9gTgLgBAbzgEwKYDNgDtUGELgQ5bwC+c6UBcA5AAIBuArqgPRRMmioC0AxtFQ0AUMNQAPSLBQYAhkwA28NJhz5CxGAAoEwuHCyyQqAFy0AgmDA0ANHrgBnVDCZg4WgJSJ7+gVgfwAO6ywDDYAOYAYtDmTDAQAuAKzqhwALxwMByoANyi+r5EAXCy6d4FBcGhcKyscOHOcAAGVWFYUTFxCQRgyTCoTT5wpPkFUM5MUFjlFXCtNXXIRDTwDfCyWACecIm9zsBEQyP6I6QewkA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
import { defineComponent } from '@vue/runtime-core'

export default defineComponent({
  name: 'App',
  setup () {
    const waitingForAutocomplete = true;

    const a = {
      wait // get `waitingForAutocomplete`
    }

    return {
      wait // don't get any completion
    }
  }
})
```

### 🙁 Actual behavior

<!-- What happened, and why it was wrong -->
We can't get any completion for object literal shorthand in setup return.

### 🙂 Expected behavior

<!-- What you expected to happen instead, and why -->
Like common object literal shorthand.

Ref: https://github.com/microsoft/TypeScript/issues/41259 https://github.com/microsoft/TypeScript/pull/41539
From: https://github.com/vuejs/vetur/issues/2544
Repository: godot
Issue: Godot 2D Sprite resolution change freezes (5 seconds)
Labels: bug,topic:editor,confirmed

Godot version:
3.2.3
3.3 RC 7
3.3 RC 8

OS/device including version:
Win 10 x64
GTX 1070 8GB
Driver: Nvidia Studio 461.92 (also happened before with Game Ready Driver)
GLES3
GLES2

Issue description:
Godot freezes for ~5 seconds while changing the resolution of a 2D Sprite.
Somehow if you set the x resolution to e.g. 512 and press tab you are still in the x resolution (instead of changing to the y resolution) and if you type in 512 again and press enter Godot freezes.
Sometimes it can happen that after a freezes the y resolution is e.g. 256 but if you click on it it's 512.
I think this is related to the scale of the Sprite but not sure.


Steps to reproduce:
1) Create a new Project
2) Add a 2D Node and a Sprite
3) Change Sprite Scale to x:1.3 and y:0.9
4) Under Texture, add (create) a new ImageTexture
5) Now set the x resolution to e.g. 256, press tab and set the y resolution also to 256 and press enter
6) Do step 5 again but with 512 instead of 256
7) If nothing happened try it again with first e.g. 128 and then 512.
Repository: vscode
Issue: The scroll bar  is not accessible through keyboard key present on the error pop-up
Labels: bug,accessibility,editor-scrollbar

1. have a file with an error
2. press shift+ F8
3. Tab into the error message popup and try using key left to move the scroll bar 


![image](https://user-images.githubusercontent.com/24580570/114171351-cadfd700-9951-11eb-8f02-b1b1129ee060.png)
Repository: go
Issue: io/fs: document how hard and symbolic links in a fs.FS should work
Labels: Documentation,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
go version go1.16.3 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What did you do?

Write code to present a TAR archive as a `fs.FS`. TAR archives support hard and symbolic links, but nothing in this issue is specific to TAR.

### What did you expect to see?

Documentation on how an `fs.FS` should behave when hard and symbolic links exist. `testing/fstest.TestFS` checks some of these behaviours, but it's not clear exactly how this should work.

#### Hard links

Given a filesystem:

<pre>
/a    (hard link to /b)
/b
</pre>

It seems reasonable to assume that any `fs.FS` APIs called with the path `"a"` would return the answers for `"b"`, but with the name `"a"`. That is:

- Calling `fs.Stat(fsys, "a")` would return a `fs.FileInfo` where calling `Name()` would return `"a"`, but its other methods would return the details from `"b"`
- Calling `fs.ReadFile(fsys, "a")` would return the contents from `"b"`
- Calling `fs.ReadDir(fsys, ".")` would return two `fs.DirEntry`s, with the names `"a"` and `"b"` but otherwise identical details.

Is this assumption correct? Could it be documented?

#### Symbolic links

Symbolics are a bit more tricky, because the link nature is less hidden than with hard links. Presumably, some APIs should return the details of the link, rather than the details of the file the link points to. `fs.FS` doesn't separate `Stat` and `Lstat`. Does that mean `fs.Stat(fsys, "some/path")` should behave like `os.Stat`, returning only the details for the link target? Which file name should be returned? Likewise, how should `fs.ReadDir` behave? Should the details in a `fs.DirEntry` representing a symbolic link include the details of the link or the target? What about the `fs.FileInfo` returned from the directory entry's `FileInfo` method?

All of this is hard to guess. I'm not particularly concerned which approach is taken, whether symbolic links behave the same as hard links, or whether links are just ignored entirely, but it would be really useful for the behaviour to be documented somewhere, ideally in the docs for `fs.FS`.

I know this is a tricky and tedious question, so I really appreciate your help.
Repository: godot
Issue: GDNative terminate too early if the same shared library been loaded multiple times
Labels: bug,topic:gdextension,crash

**Godot version:**
3.0 ~ master

**OS/device including version:**
OS and device independent


**Issue description:**
When a shared library is loaded multiple times, and `load_once = true`, godot will crash at first terminate call.


**Steps to reproduce:**
1. create a gdnative library
2. create a `.gdnlib`
3. create a `.gdns`, and attach to a node
4. create a `.gd` and attach to a node. in `_init`, load, initialize and terminate gdnative library
5. run the project

godot will be crashed by the terminate call in `.gd`.

**Minimal reproduction project:**
[simple.zip](https://github.com/godotengine/godot/files/6285672/simple.zip)

**The fix**
this issue is caused by these lines
```
// modules/gdnative/gdnative.cpp
bool GDNative::initialize() {
...
        if (library->should_load_once()) {
                if (GDNativeLibrary::loaded_libraries->has(lib_path)) {
                        // already loaded. Don't load again.
                        // copy some of the stuff instead
                        this->native_handle = (*GDNativeLibrary::loaded_libraries)[lib_path][0]->native_handle;
                        initialized = true;
                        return true;
                }
        }
...
}
```

Add one line to fix this problem
```
                        this->native_handle = (*GDNativeLibrary::loaded_libraries)[lib_path][0]->native_handle;
                        initialized = true;
                        GDNativeLibrary::loaded_libraries[lib_path].push_back(Ref<GDNative>(this));
                        return true;
```
Repository: youtube-dl
Issue: Hotstar.com IPL livestream
Labels: question

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions
- Search the bugtracker for similar questions: http://yt-dl.org/search-issues
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm asking a question
- [x] I've looked through the README and FAQ for similar questions
- [x] I've searched the bugtracker for similar questions including closed ones


## Question

<!--
Ask your question in an arbitrary form. Please make sure it's worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient.
-->

The ipl live stream on hotstar.com does not look to be using DRM and I want to stream it using mpv using my account.

I've tried passing cookies but I get `ERROR: This video is only available for registered users. Use --username and --password or --netrc to provide account credentials.`. But hotstar doesn't use a userid , password combo. It uses phone number + otp(one time password). Any help?

Thanks.
Repository: flutter
Issue: Package for MacOS standard controls (like Cupertino for iOS)
Labels: c: new feature,framework,platform-mac,c: proposal,a: desktop,P3,team-macos,triaged-macos

Developing native-feeling MacOS apps with Flutter should use standard controls for items such as:

- Alert dialogs (wrapper for NSAlert)
- Buttons
- Edit boxes
- Selectors

https://developer.apple.com/design/human-interface-guidelines/macos/overview/themes/

Menus are already available as a third party control in pub.dev but incorporating this into the official project given the importance of menus in any desktop app would be really useful.

As desktop is now officially supported, it would be a real boost to the platform if an equivalent of Cupertino was available for MacOS (and Windows too).
Repository: godot
Issue: [Tool] type created via code does not have correct script in script property
Labels: bug,topic:editor,topic:dotnet

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
<!-- Specify commit hash if using non-official build. -->
v3.2.3.stable.mono.official

**OS/device including version:**
<!-- Specify GPU model, drivers, and the backend (GLES2, GLES3, Vulkan) if graphics-related. -->
Windows 10 20H2
1030 GT, latest drivers as of 03/04/2021
GLES3 backend

**Issue description:**
<!-- What happened, and what was expected. -->
When a [Tool] annotated script creates another [Tool] annotated script when being initialised in the editor, the children do not have the correct scripts assigned. In fact, they sometimes have the scene they are currently in assigned to their script slot, or the tooltip and editor show no script present, but the script icon is present next to the node in the scene tree view.

Here's what I mean:
![image](https://user-images.githubusercontent.com/1487089/114191791-b34e2180-9944-11eb-834b-d91e80746141.png)
![image](https://user-images.githubusercontent.com/1487089/114193079-15f3ed00-9946-11eb-9ad3-c8c2a8ca051c.png)
![image](https://user-images.githubusercontent.com/1487089/114191824-ba752f80-9944-11eb-8bfa-5dd3d5326ed8.png)

**Steps to reproduce:**
Open the project attached, and check out the Test and Test 2 scenes.
They both add Nodes to themselves, if they don't have them, and give some clues in the console as to whether they didn't find anything, found the node but it's of the wrong type, or if they found the correct node.
If you need to, delete the children of the root node, save it, and open the scene again.

**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->
[Tool Test.zip](https://github.com/godotengine/godot/files/6286275/Tool.Test.zip)
Repository: godot
Issue: (C# only) `VisualServer.CanvasItemAddTriangleArray` throws null RID error unless valid texture and normal map RID is passed
Labels: bug,topic:dotnet

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
<!-- Specify commit hash if using non-official build. -->
v3.3.rc8.mono.official

**OS/device including version:**
<!-- Specify GPU model, drivers, and the backend (GLES2, GLES3, Vulkan) if graphics-related. -->
Windows 10, GLES3 (tested with GLES2).

**Issue description:**
<!-- What happened, and what was expected. -->
Using `VisualServer.CanvasItemAddTriangleArray` throws an error when `texture` or `normalmap` argument is null, it throws this error:
```
E 0:00:05.748   IntPtr Godot.RID.GetPtr(Godot.RID ): System.NullReferenceException: The instance of type RID is null.
  <C++ Error>   Unhandled exception
  <C++ Source>  /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/RID.cs:15 @ IntPtr Godot.RID.GetPtr(Godot.RID )()
  <Stack Trace> RID.cs:15 @ IntPtr Godot.RID.GetPtr(Godot.RID )()
                VisualServer.cs:4861 @ void Godot.VisualServer.CanvasItemAddTriangleArray(Godot.RID , System.Int32[] , Godot.Vector2[] , Godot.Color[] , Godot.Vector2[] , System.Int32[] , System.Single[] , Godot.RID , Int32 , Godot.RID , Boolean , Boolean )()
                Script.cs:23 @ void Script._Draw()()
```
It seens that GDScript don't have this issue.

**Steps to reproduce:**
1. In a CSharp script, add a draw function;
2. Create Vector2 and Color arrays, populating then with a valid polygon data that can be triangulated;
3. Call `Geometry.TriangulatePolygon` to generate the indices automatically;
4. Call `VisualServer.CanvasItemAddTriangleArray` with the canvas item RID, the generated indices, points and colors;
5. Try to run the scene.

**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->
[Issue.zip](https://github.com/godotengine/godot/files/6286421/Issue.zip)
Repository: go
Issue: cmd/go: precompile dependencies for docker image cache
Labels: Documentation,NeedsInvestigation,GoCommand

This issue may reveal some fundamental misunderstanding I have about golang/compilers, but here goes:

Some of the dependencies for a monolithic golang program on our backend are quite large. Several of them use code generation as a generics workaround and are large enough to force us to use internal gitlab runners because of OOM errors. Currently we use `go mod download` as a build step in containerizing it, so that downloading those dependencies is cached. However, as far as I can tell, there's no way to run the equivalent of `go get` for just a go.mod and go.sum file; we can download, but not compile these dependencies that mostly stay the same from build to build. 

This means that every time we build our backend golang program we have to recompile all of the libraries that that program uses from scratch, instead of caching that as a build step and _only_ recompiling when we change our go.mod/go.sum files.

I'd like a go command (if it doesn't exist already, and doesn't admit some fundamental misunderstanding of how libraries get compiled) to get much of this work done before we `COPY` our source code into the docker image. Maybe this would just be a modification of go get that ignored the fact that there was no source code in the working directory when a go.mod file exists specifying all of the libraries used for a package. Such a command would shave a lot of build time in our CI.