sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: angular
Issue: incorrect component passed to canDeactivate guard 
Labels: type: bug/fix,freq1: low,area: router,state: confirmed,router: guards/resolvers,P3

<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅

Oh hi there! 😄

To expedite issue processing please search open and closed issues before submitting a new one.
Existing issues often contain information about workarounds, resolution, or progress updates.

🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->


# 🐞 bug report

### Affected Package
<!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->
<!-- ✍️edit: --> The issue is caused by package @angular/router


### Description

For some reason CanDeactivate guard gets called with an incorrect component instance.
In this case it should get called with a component that is mounted in a named outlet, but gets called with one from primary outlet. See example in stackblitz.

I'd expect that with configuration like below:
![image](https://user-images.githubusercontent.com/1985429/71674645-0b7a9900-2d7c-11ea-96d6-671a8b7aeb89.png)
The guard should only be called when `AdminHeaderComponent` is being deactivated and only with this component instance.

One notable thing is that the `currentRoute` param is correct!
![image](https://user-images.githubusercontent.com/1985429/71675799-e8051d80-2d7e-11ea-8259-64dbe9015af0.png)


EDIT: found a workaround:
```
canDeactivate(component: HasComponentPendingChanges, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot) {
    if (currentRoute.outlet === OVERLAY_OUTLET && this.router['rootContexts'] && this.router['rootContexts'].getContext) {
        const context: OutletContext = this.router['rootContexts'].getContext(OVERLAY_OUTLET);
        if (context && context.outlet && context.outlet.isActivated && context.outlet['activated'].instance) {
            component = context.outlet['activated'].instance;
        }
    }
```

## 🔬 Minimal Reproduction
<!--
Please create and share minimal reproduction of the issue starting with this template: https://stackblitz.com/fork/angular-issue-repro2
-->

https://stackblitz.com/edit/angular-named-outlet-yfgsip?file=app%2Fadmin%2Fadmin.module.ts


- Open the link
- Open the console
- Click on `admin` link
- Click on `create user` link
- Observe that following message is printed:
```
deactivating UsersListComponent {}
```
- Now click on `hide navbar` link
![image](https://user-images.githubusercontent.com/1985429/71674811-9065b280-2d7c-11ea-8e51-1b345075419d.png)

- Observe that following messages are printed:
```
deactivating CreateUserComponent {}
deactivating AdminHeaderComponent {}
```
^ all good
- Now the fun begins, click on `admin` and `create user` links again
- Click on `Component 2`
- Observe that following messages are printed:
```
deactivating UsersListComponent {}
deactivating CreateUserComponent {}
deactivating CreateUserComponent {}
```
I'd argue that the last message should state `AdminHeaderComponent`

## 🌍  Your Environment

**Angular Version:**
<pre><code>
8.2.14
</code></pre>
Repository: opencv
Issue: TypeError: Not a cmessage converting tensorflow model from .pb to .pbtxt
Labels: category: dnn

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

Please:

* Read the documentation to test with the latest developer build.
* Check if other person has already created the same issue to avoid duplicates. You can comment on it if there already is an issue.
* Try to be as detailed as possible in your report.
* Report only one problem per created issue.


This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
- OpenCV => 4.2.0
- Operating System / Platform => Ubuntu 18.04 64 bits
- Compiler => cmake

##### Detailed description

I am trying to generate a .pbtxt from a tensorflow frozen_inference_graph.pb file. I'm using a custom model based on ssd_resnet_50_fpn_coco tensorflow model.
When I run the [text_graph_ssd.py](https://github.com/opencv/opencv/blob/master/samples/dnn/tf_text_graph_ssd.py) on a ssd_inception_v2_coco custom model it generates the .pbtxt file without issues.

However when tried on the resnet model, at first got the output mentioned in #11560, then aplied the fix mentioned there.

Now, I have a new error:

```
Traceback (most recent call last):
  File "tf_text_graph_ssd.py", line 377, in <module>
    createSSDGraph(args.input, args.config, args.output)
  File "tf_text_graph_ssd.py", line 261, in createSSDGraph
    addConstNode('concat/axis_flatten', [-1], graph_def)
  File "/home/blue/tensorflow/scripts/postprocessing/tf_text_graph_common.py", line 114, in addConstNode
    graph_def.node.extend([node])
TypeError: Not a cmessage

```

I tried with the fix mentioned in #15176, but it didn't work.

##### Steps to reproduce
1. Download my .pb file from [here](https://gofile.io/?c=ymew4E)
2. Download the text_graph_ssd.py that I'm using [here](https://pastebin.com/FHmicfk3) and run the script. (Be sure to have the text_graph_common.py in the same directory).
Repository: rust
Issue: UdpSocket is missing the dissolve method
Labels: T-libs-api,C-feature-request

According to [connect](http://man7.org/linux/man-pages/man2/connect.2.html)

> `UdpSocket` can dissolve the association by connecting to an address with the `sa_family` member of `sockaddr` set to `AF_UNSPEC` (supported on Linux since kernel 2.2).

`FreeBSD` supports as well.
> Datagram sockets may dissolve the association by connecting to an invalid address, such as a null address.
Repository: pytorch
Issue: Documentation for `scatter` incorrectly states that index values must be unique
Labels: module: bc-breaking,module: docs,triaged,module: scatter & gather ops

## 📚 Documentation
 
Documentation for `scatter_` and `scatter_add_` incorrectly states that "Moreover, as for gather(), the values of index must be between 0 and self.size(dim) - 1 inclusive, and all values in a row along the specified dimension dim must be unique."
https://pytorch.org/docs/stable/tensors.html?highlight=scatter_add#torch.Tensor.scatter_
There is no requirement for elements to be unique in either of 3 functions (`scatter_`, `scatter_add_`, `gather`), and `gather` documentation correctly does not mention that requirement.
In case of `scatter_`, there is no guarantees of which value from the source with the same indices ends up being written to `self`, in case of `scatter_add_` values from the source with the same indices are accumulated. 
There is a broader issue aside from the documentation here, because depending on whether indices are unique or repeating, parallel implementation for `scatter_add_` can be different (`scatter` is fine although can be non-deterministic). Maybe we should allow users to indicate if their indices are unique, so that we can choose more efficient implementation. The implementation variants are
1) indices are guaranteed to be unique - any naive implementation writing values from src to self will work, parallelization is easy
2) non-unique indices, but we are fine with non-deterministic behavior - we can use atomic accumulation in this case, and still do efficient parallelization
3) non-unique indices, and we want deterministic results - some more sophisticated algorithms required, handling accumulation for repeating indices (e.g. pre-sorting indices)
Currently we have 2) for cuda implementation and no parallelization for CPU, afaikt.
Setting "triage review" label to discuss desired behavior.
cc @jlin27 @mruberry @ezyang @gchanan @SsnL @nikitaved
Repository: create-react-app
Issue: Extracting "scripts/test.js" so it's usable by other non-react projects
Labels: issue: proposal,needs triage

### Is your proposal related to a problem?

<!--
  Provide a clear and concise description of what the problem is.
  For example, "I'm always frustrated when..."
-->

I'm always frustrated when I have to configure Jest for projects that do not use CRA (Babel, TS, CSS/images imports, ...) as the CRA setup is really nice and works perfectly with pretty much all projects.

### Describe the solution you'd like

<!--
  Provide a clear and concise description of what you want to happen.
-->

Could we export the "/scripts/test.js" into a different package that CRA would just be using?

### Describe alternatives you've considered

<!--
  Let us know about other solutions you've tried or researched.
-->

I tried keeping one npm package myself: https://www.npmjs.com/package/jest-run
But it's hard to keep it up to date and as it's pretty much dupplicated code from CRA, it would make more sense to use the same resource

### Additional context

<!--
  Is there anything else you can add about the proposal?
  You might want to link to related issues here, if you haven't already.
-->

Nothing
Repository: pytorch
Issue: torch.poisson returns floating point tensor
Labels: module: distributions,triaged

## 🐛 Bug

The Poisson distribution is a discrete distribution. As is the case with all other discrete distributions: `bernoulli` and `multinomial`, `torch.poisson` should also return a tensor with dtype `long` instead of `float`.

## To Reproduce

```python
import torch
torch.poisson(torch.rand(10))  # returns a float tensor
```

## Expected behavior

```python
import torch
torch.poisson(torch.rand(10)) # returns a long tensor
```

cc @vincentqb @fritzo @neerajprad @alicanb @vishwakftw
Repository: TypeScript
Issue: No error for undeclared #private property in `.js` files
Labels: Bug,Help Wanted,Effort: Moderate,Domain: JavaScript

```js
class Thing {
    /**
     * @param prop {string}
     */
    constructor(prop) {
        this.#prop = prop;
    }
}
```

This class assigns to  `#prop`, but it's an error to use `#prop` without declaring it.

This is reported as a `SyntaxError`, so this should report an error even outside of `checkJs`.
Repository: go
Issue: flag: improve clarity of "flag provided but not defined" error message
Labels: NeedsInvestigation

Version: go1.13.5

I have a code snippet with a series of flags:

```
var (
    flag1 string
    flag2 string
)

func init() {
    flag.StringVar(&flag1, "flag1", "", "value for flag 1")
    flag.StringVar(&flag2, "flag2", "", "value for flag 2")
}

func main () {
    ...
}
```

After building, if this is executed in a bash shell:
`
./script "-flag1 value1" "-flag2 value2" 
`
the output I see is this:
```
flag provided but not defined: -flag1 value1
Usage of ./script:
  -flag1 string
        value for flag1
  -flag2 string
        value for flag2
```

Now, this code doesn't work because of the quotes in the bash command and removing the quotes makes this work exactly as expected. This took me a while to debug as I wasn't able to initially interpret from `flag provided but not defined: -flag1 value1` that the program was interpreting `-flag1 value1` as the literal flag, as opposed to the flag and the value. 

I might suggest one of two fixes:

1. Slightly modify the error message from 
`flag provided but not defined: FLAG` 
to 
`flag "FLAG" provided but not defined`

2. Add logic to detect common potential mistakes such as:
```
flag provided but not defined: FLAG
Did you mean to include <detected mistake such as space / equals sign etc>?
```
Repository: TypeScript
Issue: Array rest of readonly tuple type incorrectly preserves readonly modifier
Labels: Suggestion,In Discussion

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
**TypeScript Version:**  3.8.0-dev.20200101

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** readonly tuple rest

**Code**

```ts
declare const tuple: readonly [number, ...number[]];

const [a, ...rest] = tuple;
rest[0] = 1;
rest.push(2);
```

**Expected behavior:**

`rest: number[]`
I should be able to modify the resulting array.

**Actual behavior:**

`rest: readonly number[]`
Not able to modify the array (even though it is a mutable clone at runtime).

**Playground Link:** https://www.typescriptlang.org/play/?ts=3.8.0-dev.20200101&ssl=1&ssc=1&pln=5&pc=14#code/CYUwxgNghgTiAEYD2A7AzgF3hgrgBwhAC544phUIBPeAbRRwFsAjEGAGngDoeGW3aAXUEBuAFBjk6LLSiceXOJkHwAvNnyFxSjLQAMK9QEZtITFzw40ACwAUAJgCUIoA
Repository: go
Issue: runtime: clean up async preemption loose ends
Labels: NeedsFix,compiler/runtime

Go 1.14 introduces asynchronous preemption so that tight loops can be preempted (#10958). However, there are still several loose ends to tie up. This is a general bug to keep track of remaining work:

- [ ] Support on all possible platforms (js/wasm is not currently possible)
  - [x] windows/arm ([CL 207961](https://golang.org/cl/207961))
  - [x] windows/arm64
  - [ ] ~darwin/arm~ (no longer supported)
  - [ ] plan9/* ([CL 228893](https://golang.org/cl/228893))
- [x] Redo unsafe-point representation so we can eliminate register maps ([CL 230544](https://golang.org/cl/230544))
- [x] Remove register maps and extra stack maps (after redesigning debug call injection) ([CL 230544](https://golang.org/cl/230544))
- [x] Possibly incorporate @cherrymui's sequence restarting ([CL 208126](https://golang.org/cl/208126))
- [ ] Attach unsafety/restartability to Progs and generate the stream post-assembly like spadj ([comment](https://go-review.googlesource.com/c/go/+/208126/4/src/cmd/internal/obj/plist.go#281))
- [ ] Make large pointer-free memmoves/memclrs preemptible (#31222)
- [ ] Make large pointer-full memmoves/memclrs preemptible (this is a little harder)
- [x] Make large allocations preemptible (closely related to the above two, [partly done](https://golang.org/cl/270943))
- [ ] Fix various annoying spins in the scheduler
- [ ] Make more of the runtime preemptible
Repository: electron
Issue: Feature request: safe-area-inset-* variables 
Labels: enhancement :sparkles:

### Problem Description
<!-- Is your feature request related to a problem? Please add a clear and concise description of what the problem is. -->
Sometimes webapp needs to have an extra padding on the sides of the screen. For example, when using `titleBarStyle=hiddenInset` on Mac OS: the window control buttons will overlap the app content unless you add a padding to the top.

### Proposed Solution
<!-- Describe the solution you'd like in a clear and concise manner -->
Define css env`safe-area-inset-*` variables in renderer to make life easier.

### Additional Information
- [About env() and safe-area-inset](https://developer.mozilla.org/en-US/docs/Web/CSS/env)
Repository: flutter
Issue: All Gradle tests should also run the AAR build mode
Labels: a: tests,team,platform-android,tool,t: gradle,P2,team-android,triaged-android

The AAR build mode may behave differently than the regular Android build mode.
We've been burned by this in #46898 where newly introduced build logic did not apply to the AAR build workflow.

We should have all relevant tests in dev/devicelab/bin/tasks/gradle_* run both the regular build mode and the aar build mode.

@blasten
Repository: godot
Issue: Mono - Cannot instance script because the project assembly is not loaded (When using --path)
Labels: bug,topic:dotnet

**Godot version:**
3.2 beta 4 Mono

**OS/device including version:**
Windows 10

**Issue description:**
When the project is run directly using `--path` It cannot load any c# scripts

**Steps to reproduce:**
Run the project using a command like
`.\GodotMono.exe --path C:\Users\You\Documents\Test\ -v`

Log:
```
Godot Engine v3.2.beta4.mono.official - https://godotengine.org
Using GLES3 video driver
OpenGL ES 3.0 Renderer: AMD Radeon R7 200 Series
WASAPI: wFormatTag = 65534
WASAPI: nChannels = 2
WASAPI: nSamplesPerSec = 48000
WASAPI: nAvgBytesPerSec = 384000
WASAPI: nBlockAlign = 8
WASAPI: wBitsPerSample = 32
WASAPI: cbSize = 22
WASAPI: detected 2 channels
WASAPI: audio buffer frames: 1962 calculated latency: 44ms

Mono: Initializing module...
Mono JIT compiler version 6.6.0 (explicit/bef1e633581)
Mono: Logfile is: C:\Users\Franke\AppData\Roaming/Godot/mono/mono_logs/2020_01_02 13.52.39 (9868).txt
Mono: Runtime initialized
Mono: Loading assembly mscorlib...
Mono: Assembly mscorlib loaded from path: C:\Program Files\Godot/GodotSharp/Mono/lib/mono/4.5/mscorlib.dll
Mono: Loading scripts domain...
Mono: Creating domain 'GodotEngine.Domain.Scripts'...
Mono: Debugger wait timeout
Mono: INITIALIZED
Mono: Loading assembly GodotSharp...
Mono: Assembly GodotSharp loaded from path: res://.mono/assemblies/Debug/GodotSharp.dll
Mono: Loading assembly GodotSharpEditor...
Mono: Assembly GodotSharpEditor loaded from path: res://.mono/assemblies/Debug/GodotSharpEditor.dll
Mono: Loading assembly GodotTools...
Mono: Assembly GodotTools loaded from path: C:\Program Files\Godot/GodotSharp/Tools/GodotTools.dll
Mono: Loading assembly GodotTools.ProjectEditor...
Mono: Assembly GodotTools.ProjectEditor loaded from path: C:\Program Files\Godot/GodotSharp/Tools/GodotTools.ProjectEditor.dll
Mono: Loading assembly Test...
Mono: Failed to load project assembly
CORE API HASH: 1133556406507282606
EDITOR API HASH: 9577969821152247287
Loading resource: res://default_env.tres
Loaded builtin certs
Loading resource: res://Space.tscn
Loading resource: res://Star.tscn
Loading resource: res://Star.gd
Loading resource: res://CelestialBody.gd
Loading resource: res://Spaceyy.cs
ERROR: Cannot instance script because the project assembly is not loaded. Script: 'res://Spaceyy.cs'.
   At: modules/mono/csharp_script.cpp:2774
Mono: Unloading scripts domain...
Mono: Runtime cleanup...
debugger-agent: Unable to listen on 5900
Mono: Finalized
```

**Minimal reproduction project:**
[Test.zip](https://github.com/godotengine/godot/files/4017485/Test.zip)
Repository: pytorch
Issue: Inaccurate ValueError reporting in nn/functional.py
Labels: module: nn,triaged

## 🐛 Bug

Lines 1854-1855 in functional.py report the wrong tensor sizes when raising a ValueError. The target size is reported as the output size, and the output size is reported as the target size. 

## Environment
Collecting environment information...
PyTorch version: 1.3.1
Is debug build: No
CUDA used to build PyTorch: None

OS: Microsoft Windows 10 Enterprise
GCC version: Could not collect
CMake version: Could not collect

Python version: 3.6
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip] numpy==1.17.3
[pip] torch==1.3.1
[pip] torchvision==0.4.2
[conda] Could not collect
Repository: flutter
Issue: Add functions for showing alerts with less ceremony
Labels: c: new feature,framework,f: material design,would be a good package,P3,team-design,triaged-design

Other platforms make showing a dialog that just shows a text string much easier. We could do the same by having functions such as the following in our framework:
```dart
Future<void> showMessage(BuildContext context, String message) {
  return showDialog(
    context: context,
    builder: (BuildContext context) => AlertDialog(
      content: Text(message),
    ),
  );
}
```
Repository: godot
Issue: Textures missing on iOS in HTML5 export
Labels: bug,platform:web,platform:ios,topic:rendering,confirmed

**Godot version:** 3.1.2.stable on macOS 14.6

**OS/device including version:** iOS 13.3 (iPhone XR, iPad 2018). Also reported on Android, but I have no details there.

**Issue description:** A MeshInstance with a SpatialMaterial and an albedo texture renders fine in desktop browsers, but with a missing texture on iOS Safari.

**Steps to reproduce:** Create a MeshInstance with a texture, add a light and a camera. Export as HTML5. Test on iOS. Or look at the demo: https://combatwombat.github.io/godot-texture-test/

**Minimal reproduction project:** https://github.com/combatwombat/godot-texture-test
Repository: pytorch
Issue: ImportError: /home/xx/anaconda3/lib/python3.7/site-packages/torch/lib/libtorch_python.so: undefined symbol: _ZNK5torch3jit5Graph8toStringE
Labels: oncall: jit,triaged

Hi,I am newer to pytorch, i faced such problem when i import torch after i have installed the pytorch1.3.1 by pip.My environment is ubuntu16.04 pytorch1.3.1 cuda10.1 python3.7.3.Does anyone can help me?tkx.

cc @suo
Repository: pytorch
Issue: How to distinguish different layers in hook？
Labels: module: nn,triaged

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->
A way to distinguish different layers in each module itself

## 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 -->
I'd like to store some intermedia data such as output data of all conv layers, and I want to use hook. It is easy to judge which class the module is in hook function like " if isinstance(module, nn.Conv2d):", but if I want to store the data, I need a name which can be got in hook function to be the file name so that data from different layers will be saved in different files. e.g. "save(filename, output)" How can I get this name?

Even if I collect all output data in a list and save it outside the hook function, I still don't know to which layer each data belongs. 

## Pitch

<!-- A clear and concise description of what you want to happen. -->
There is no way to identify each layer now, a unique name or id.
```
def hook(moudle, input, output):
    name = get_unique_name(module)
    save(name+'.h5', output)

for n,m in model.named_module():
    m.register_forward_hook(hook)
```

## Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered if any. -->
Because we can only get names from parent modules using"named_module", it will also work if I can pass arguments to hook function.
```
def hook(moudle, input, output, n):     
    save(n+'.h5', output)  

for n,m in model.named_module():     
    m.register_forward_hook(hook, n)
```

## Additional context

<!-- Add any other context or screenshots about the feature request here. -->
Repository: rust
Issue: rust compiler bug on borrow/ownership?
Labels: T-compiler,A-NLL,C-bug,NLL-complete,NLL-polonius

```rust
struct Node {
    child: [Option<Box<Node>>; 3]
}

fn main() {
    let mut root: [Option<Box<Node>>; 3] = Default::default();
    let mut tree = &mut root;
    for _ in 0..3 {
        let opt = &mut tree[0]; // line 9
        match opt {
            None => {
                //break;  // ok if uncomment this line of code
                // if true { break; } // even error with code like this 
            }
            Some(b) => {
                tree = &mut b.as_mut().child;
            }
        }
    }
}
```
```
error[E0499]: cannot borrow `tree[_]` as mutable more than once at a time
 --> t.rs:9:19
  |
9 |         let opt = &mut tree[0];
  |                   ^^^^^^^^^^^^ mutable borrow starts here in previous iteration of loop
```
however, compile ok if add a break statement in the None block