sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: electron
Issue: [Bug]: Hiding a window doesn't restore focus to the main window
Labels: platform/windows,bug :beetle:,component/BrowserWindow,10-x-y,has-repro-gist,11-x-y,12-x-y

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

12.0.1

### What operating system are you using?

Windows

### Operating System Version

Windows 10 1909

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

I expect that when I hide a secondary window (perhaps the last visible secondary window), focus returns to the main window.

### Actual Behavior

Focus does not return to the main window

### Testcase Gist URL

_No response_

1. start main.js
2. in the devtools, open a window (`window.open("https://google.com", "a")`)
3. when the window hides in 2 seconds, observe that focus doesn't return to the main window

Affects both windows that are owned by the main window, and regular, standalone windows.

This is a continuation of [this](https://github.com/electron/electron/issues/10023) closed issue.

main.js:
```
const { app, BrowserWindow } = require('electron')

async function createWindow() {
  const mainWindow = new BrowserWindow({ webPreferences: { nativeWindowOpen: true } });

  await mainWindow.loadURL("https://google.com");

  mainWindow.webContents.on("new-window", async (e, url, frameNAme, disp, opts) => {
    opts.parent = mainWindow;
  });

  app.on("browser-window-created", (e, win) => {
    setTimeout(() => {
      win.hide();
    }, 2000);
  });
  mainWindow.webContents.openDevTools();
}

app.whenReady().then(createWindow)

app.on('window-all-closed', function () {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})
```
Repository: pytorch
Issue: [TensorExpr] Provide a safe API to request the N-th loop for a given Buf.
Labels: module: bootcamp,triaged,NNC

## Feature Request
Currently we have a `LoopNest::getLoopStmtsFor` API for querying loops for a given `Buf`:
https://github.com/pytorch/pytorch/blob/5b448cf21ae8f9fa28db02d80475c95faffcd35c/torch/csrc/jit/tensorexpr/loopnest.h#L45-L47

A frequent use of this API looks like the following (speaking based on our tests):
```
  auto loops = loopnest.getLoopStmtsFor(b);
  loopnest.vectorize(loops[2]);
```
If for some reason there are less than 3 elements in `loops`, we'll be getting a segfault here. A safer API would be 
```
  For *loop = loopnest.getLoopStmtFor(b, 2);
  loopnest.vectorize(loop);
```
This API could raise an appropriate exception if loop 2 is unavailable.
Repository: flutter
Issue: Add Platform.isWeb
Labels: c: new feature,framework,platform-web,c: proposal,P3,team-web,triaged-web

The [kIsWeb](https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/foundation/constants.dart#L77) constant is the only way to check if the app is running on the web. It would be great if we could recommend something like `Platform.isWeb` (alongside `isLinux`, `isIOS`, etc.)

 If it's not possible to achieve in the framework due to [#39998](https://github.com/flutter/flutter/issues/39998) we could consider adding it to [`package:platform`](https://pub.dev/packages/platform)

Related issues:
- https://github.com/flutter/flutter/issues/39998
- https://github.com/flutter/flutter/issues/41311
- https://github.com/google/platform.dart/issues/31
Repository: TypeScript
Issue: ES5 class rewriting incompatible with frozen intrinsics
Labels: Suggestion,In Discussion,Needs Investigation

# Bug Report

When TSC targets ES5, classes that extend other classes generate JS that throws a `Cannot assign to read only property 'constructor' of object` TypeError when the intrinsics, particularly the `Function.prototype`, are frozen. This affects programs that are freezing their intrinsics to protect against supply chain attacks, particularly using SES.

### 🔎 Search Terms

* constructor
* frozen

### 🕗 Version & Regression Information

I identified this issue in the published code of `external-editor` 3.1.0, which is using TypeScript 3.5.2 https://github.com/mrkmg/node-external-editor/blob/e1070a8295b8ebbafa7b29802ae0e2da0fad47c0/tsconfig.json

In the playground, the output is consistent for the very oldest and very newest versions of TypeScript when targeting ES5.

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?target=1&ts=4.2.3#code/PIIwVgpgxgLgdAMwE4QgLwgCgGIFcB2sAlgPb4CUA3AFCiSyIrpZ6Eyn5wAOSJMfATy4Qq1KABsAhgGdpAAmwkScgN7U5GuVDLSYSXLBJJM5Ves0BfalYkz5AIUlI5EAB4wI+ACbzFytZpaOnoG-MamAZbWQA)

### 💻 Code

```ts
Object.freeze(Function);
Object.freeze(Function.prototype);
class Foo {
    constructor() {
    }
}
class Bar extends Foo {
    constructor() {
    }
}
```

### 🙁 Actual behavior

This code throws an exception like:

`TypeError: Cannot assign to read only property 'constructor' of object ''`

### 🙂 Expected behavior

This should not throw an exception. This can be achieved by using `Object.defineProperty(prototype, 'constructor', {value: constructor})` instead of `prototype.constructor = constructor`. This is a symptom of the so-called property override mistake, in the design of ES5.
Repository: transformers
Issue: Add GPT Neo models to Write With Transformer
Labels: Feature request

# 🚀 Feature request
Would it be possible to get the newly-added GPT Neo models usable on Write With Transformer?

## Motivation
It would be helpful to use the new models in the Write With Transformer app since it supports newlines.

CC @LysandreJik
Repository: flutter
Issue: [Text Selection] `TextSelectionDelegate` should not expose direct access to `TextEditingController`'s `TextEditingValue`
Labels: a: text input,framework,c: proposal,P3,team-framework,triaged-framework

Instead, it should operate on the text/selection from the previous frame as it is what the user sees.

Things that may prevent this from happening:
- Currently in the `TextSelectionControls` implementation we sometimes do a side-effect and try to observe it immediately: For instance, in response to certain gestures we first select a word and the text selection menu should show up with the "cut" and "copy" options.
Repository: storybook
Issue: 6.2.0 doubling story list for title prefix `/`
Labels: bug,ui,has workaround

**Describe the bug**
Updated to 6.2.0 from 6.1.21

And am getting my story list doubled:
![Screenshot from 2021-03-31 13-59-34](https://user-images.githubusercontent.com/56898601/113084288-6a51eb00-9229-11eb-8047-d02d616ddbb8.png)

You can see that one is straight on the root level and another is with an empty header

It could be that I'm doing something weird by naming my stories starting with `/`, like 

```
title: '/Atoms/Plant Image Skeleton',
```

**To Reproduce**

**Expected behavior**
This is a screenshot with sb 6.1.21:
![Screenshot from 2021-03-31 14-05-54](https://user-images.githubusercontent.com/56898601/113084690-3cb97180-922a-11eb-9728-8660c611ebfa.png)

**Screenshots**
Embeded up

**Code snippets**
As mentioned before this is my title that could be "weird"/edge case/..

```
title: '/Atoms/Plant Image Skeleton',
```

**System**

```
$ npx sb@next info

Environment Info:

  System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
  Binaries:
    Node: 15.12.0 - /usr/bin/node
    Yarn: 1.22.5 - /snap/bin/yarn
    npm: 7.5.3 - /usr/local/bin/npm
  Browsers:
    Firefox: 87.0
  npmPackages:
    @storybook/addon-actions: ^6.1.21 => 6.1.21 
    @storybook/addon-essentials: ^6.1.21 => 6.1.21 
    @storybook/addon-links: ^6.1.21 => 6.1.21 
    @storybook/addons: ^5.2.6 => 5.3.21 
    @storybook/svelte: ^6.1.21 => 6.1.21 
```

**Additional context**



┆Issue is synchronized with this [Asana task](https://app.asana.com/0/1199622255231368/1200139843724746) by [Unito](https://www.unito.io)
Repository: flutter
Issue: Windows: Windows resizing uses Angle surface resize capability
Labels: engine,platform-windows,a: desktop,P2,team-windows,triaged-windows

Previous attempt at optimizing resizing on windows to eliminate unnecessary surface destroy / create https://github.com/flutter/engine/pull/24428 caused https://github.com/flutter/flutter/issues/76465 and hence was backed out.  This issue tracks taking the PoC from https://github.com/clarkezone/angle/tree/resizeswapchaintest, landing it and then hooking up `AngleSurfaceManager` to it.

Will unblock:
https://github.com/flutter/flutter/issues/76789
Repository: godot
Issue: It's possible to open unexpected file types in Project Settings
Labels: enhancement,topic:editor,usability

<!-- 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. -->
3.2.3, 3.3rc

**OS/device including version:**
<!-- Specify GPU model, drivers, and the backend (GLES2, GLES3, Vulkan) if graphics-related. -->
Linux

**Issue description:**
<!-- What happened, and what was expected. -->
Recently I mistakenly set `ttf` `custom font` in `ProjectSettings` and I had no errors/warnings.

https://user-images.githubusercontent.com/16458555/113101795-96b03c00-9216-11eb-9c69-d0d8a0fee1f0.mp4


I see no reason to allow the user to do this, moreover this can be dangerous.
If there are reasons to do this, a warning could appear at least.

**Steps to reproduce:**
In ProjectSettings, set a custom font with some unexpected/unrecognized file type for example `ttf`.

**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->
Repository: pytorch
Issue: Add Minimal Gated Unit (MGU)
Labels: module: nn,triaged,enhancement

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->

Add [Minimal Gated Unit](https://en.wikipedia.org/wiki/Gated_recurrent_unit#Minimal_gated_unit) (MGU).

## 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 -->

From [*Minimal gated unit for recurrent neural networks*](https://arxiv.org/abs/1603.09420) (171 citations):
> We propose a gated unit for RNN, named as Minimal Gated Unit (MGU), since it only contains one gate, which is a minimal design among all gated hidden units. The design of MGU benefits from evaluation results on LSTM and GRU in the literature. Experiments on various sequence data show that MGU has comparable accuracy with GRU, but has a simpler structure, fewer parameters, and faster training. Hence, MGU is suitable in RNN's applications. Its simple architecture also means that it is easier to evaluate and tune, and in principle it is easier to study MGU's properties theoretically and empirically. 

## Pitch
<!-- A clear and concise description of what you want to happen. -->

Add
* `torch.nn.MGU` along the lines of [`torch.nn.GRU`](https://pytorch.org/docs/stable/generated/torch.nn.GRU.html)
* `torch.nn.MGUCell` along the lines of [`torch.nn.GRUCell`](https://pytorch.org/docs/stable/generated/torch.nn.GRUCell.html)

cc @albanD @mruberry @jbschlosser
Repository: bitcoin
Issue: mempool decreases to zero on nodes with a small maxmempool
Labels: Brainstorming,TX fees and policy,P2P

![image](https://user-images.githubusercontent.com/1530283/113121345-24a31b80-9245-11eb-876b-7197fe803861.png)
I've been testing a node with a maxmempool of 50MB, as as you can see, at around 6:40am the mempool reduces to zero due to continuing to filter out the lower fee transactions.
I think the feefilter reduction needs to therefore take into account the maxmempool setting and decrease faster for nodes with a small maxmempool.
Repository: pytorch
Issue: 16 bit accumulation for Convolution
Labels: module: convolution,triaged,enhancement

## 🚀 Feature
Support for 16 bit accumulation(16 bit accumulator rather than 32 bit accumulator) in convolution layer module, which supports running module from gpu as well

## Motivation

As for when weights and inputs are taken in 8 bit but accumulation happens in 32 bit which is reverted back to 16 bit, but doesnt exactly happen in 16 bit while accumulating

## Pitch

16 bit accumulation for convolution layer module, which can be run even module or model with same module is converted to gpu

## Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->

## Additional context

<!-- Add any other context or screenshots about the feature request here. -->
Repository: go
Issue: x/tools/gopls: enable semantic tokens by default
Labels: gopls,Tools

Is there any concern or prerequisite to meet before turning on the feature by default?

cc @pjweinb @stamblerre
Repository: vscode
Issue: SCM - Add filter to Source Control tab to view only modified repos
Labels: feature-request,scm

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
I have a project which has 100s of repos, only a few of which are modified at any given point. I would like the Source Control panel to offer a filter to only show repos with modifications. That's all I really need, but perhaps it'd also be useful to filter on other statuses, such as "has staged files", etc.
Repository: pytorch
Issue: [FR] Safe softmax
Labels: module: nn,triaged,enhancement

## 🚀 Feature
Expand softmax to support "safe softmax" behavior (i.e. output 0 instead of NaN when called with all `-inf` inputs).

## Motivation
When softmax is called with all `-inf` inputs, the output is NaN due to computation of `exp(-inf) = 0` leading to 0/0. In certain cases, an output of 0 may be preferred instead.

For example, due to masking in MHA, a batch may include a sentence that is "masked out" / consists entirely of padding (masked out by setting to `-inf`). This can happen as a result of utilizing `attn_mask` and `key_padding_mask`. While this case will currently result in NaNs, leading to training divergence, it is often preferred to effectively ignore these cases so training can continue. See https://github.com/pytorch/pytorch/issues/41508 and https://github.com/pytorch/pytorch/issues/40932 for more info.

## Pitch
Add a new, optional `eps` parameter with default `None` to the various softmax forms:

```python
from torch import nn
from torch.nn import functional as F

m = nn.Softmax(dim=-1, eps=1e-5)
x = torch.ones(5) * float('-inf')
assert torch.all(m(x) == 0) and torch.all(F.softmax(x, eps=1e-5) == 0)
```

If specified, `eps` will be included in the denominator of the softmax computation, resulting in `0/(0+eps) = 0` instead of `0/0 = NaN` for the all `-inf` input case. See https://github.com/pytorch/pytorch/issues/41508#issuecomment-775030992.

## Alternatives
Leave as-is; calling softmax with all `-inf` inputs will unconditionally result in NaNs. It is left to users to ensure this doesn't happen if it's undesired, and failure to handle this correctly will still be considered "user error".

For the MHA problem of NaNs resulting from padded-out inputs, a [workaround](https://github.com/pytorch/pytorch/issues/41508#issuecomment-775030992) that has been employed requires hacking MHA internals to apply `masked_fill()`. Additionally, explicitly checking for the padded-out input case (e.g. to warn) can be expensive.

cc @albanD @mruberry @jbschlosser
Repository: godot
Issue: Reparenting AnimationPlayer at same time or after animated mesh/sprite breaks the animation paths.
Labels: bug,topic:editor,confirmed

<!-- 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. -->
3.3 RC7 custom build 5fdb8b02e (happened in 2017 with older version too, according to a report. see description below)

**OS/device including version:**
<!-- Specify GPU model, drivers, and the backend (GLES2, GLES3, Vulkan) if graphics-related. -->
Windows 10

**Issue description:**
<!-- What happened, and what was expected. -->
Moving the AnimationPlayer in a basic scene imported from gltf, together with the armature and mesh to a new parent breaks all animation paths. This only happens if you select everything together and move them, or move things first and only then the player. Moving everything out of that parent doesn't fix the issue, the paths stay wrong. I tested this with a 3D model only, but same thing can happen with sprites [given this Q&A from 2017](https://godotengine.org/qa/20364/animation-breaks-when-i-change-hierarchy-how-can-resolve-it).

I also tried just moving the AnimationPlayer alone. While it stops playing animations, the paths stay the same, and moving the player out of the new parent node fixes this. On the other hand, if the player is moved last, the paths get changed and stay broken.

**Steps to reproduce:**
* Make simple model in another program with armature animations. (I used Blender.)
* Save as gltf (format might not matter).
* Import. It becomes a read-only scene.
* Open the scene as-is (no inheritance or anything.) Save as tscn.
* Check and see that there is an armature, a skeleton and a mesh. AnimationPlayer in the root plays animations as expected.
* Create new Spatial node (though I think type doesn't matter,)
* Select the armature with skeleton and meshes inside. Also select AnimationPlayer.
* Move the whole selection together into the new Spatial node.
* Paths get changed and playback breaks.

**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->
[testproject.zip](https://github.com/godotengine/godot/files/6237720/testproject.zip)
Repository: node
Issue: fs.statSync is much faster than fs.promises.stat
Labels: fs,performance

* **Version**: v14.11.0
* **Platform**: Darwin fabiomac.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
* **Subsystem**: fs (?)

### What steps will reproduce the bug?

I don't have a complete minimal repro to share, but essentially I'm trying to fetch stats data about files as fast as possible, and I discovered that this synchronous way of fetching stats data:

```js
function faststat (path) {
  return binding.stat(toNamespacedPath(path), true, undefined, {path});
}
```

Is consistently about 2x faster on my system than the ~equivalent asynchronous version:

```js
function faststat (path) {
  return binding.stat(toNamespacedPath(path), true, kUsePromises);
}
```

The synchronous version takes almost always 40ms ±2ms on my system for 10000 files, while the asynchronous version takes almost always 95ms ± 5ms for the same 10000 files.

The synchronous version is benchmarked like this:

```js
  const list = new Array ( 10000 ).fill ( null );
  console.time('bench');
  list.map ( ( _, index ) => {
    const filePath = `/Users/fabio/Desktop/test_50k/notes/temp_${index}.md`;
    return faststat( filePath );
  });
  console.timeEnd('bench');
```

And the asynchronous version is benchmarked like this:

```js
  const list = new Array ( 10000 ).fill ( null );
  console.time('bench');
  await Promise.all ( list.map ( ( _, index ) => {
    const filePath = `/Users/fabio/Desktop/test_50k/notes/temp_${index}.md`;
    return faststat( filePath );
  }));
  console.timeEnd('bench');
```

The undeclared variables in the snippets come from this:

```js
const binding = process.binding('fs');
const {stat, open, close, fstat} = binding;
const {FSReqCallback} = binding;
const {toNamespacedPath} = require('path');
const {kUsePromises} = binding;
```

Also benchmarking the promise-part of this basically it just takes ~7ms on my system to run the following:

```js
(async () => {
  const list = new Array ( 10000 ).fill ( null );
  console.time('bench');
  await Promise.all ( list.map ( () => {
    new Promise ( resolve => resolve ([]) );
  }));
  console.timeEnd('bench');
})()
```

So basically the issue is: the async low-level version to fetch stats data is more than 2x slower than the sync version, and that kind of code is used in the higher-level functions like fs.promises.stat and fs.statSync. 

How is this possible when just the overhead for promises seems to account for ~7ms of the ~50ms of overhead **and** the sync version blocks the thread at each call which the async version doesn't do? Is there some sloppy code handling the async version of that on the native side or am I missing something?

### How often does it reproduce? Is there a required condition?

Always.

### What is the expected behavior?

The async version shouldn't be 2x slower than the sync version.

### What do you see instead?

The opposite.
Repository: electron
Issue: [Bug]: DevTools "Device Toolbar" doesn't work when DevTools is in an undocked window
Labels: component/devtools,bug :beetle:,status/confirmed,has-repro-comment

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

12.0.0

### What operating system are you using?

macOS

### Operating System Version

10.15.7

### What arch are you using?

x64

### Last Known Working Electron version

N/A

### Expected Behavior

The "Device Toolbar", triggered using this icon:

![Screen Shot 2021-03-31 at 10 13 36 AM](https://user-images.githubusercontent.com/172800/113184267-d3c20180-9209-11eb-8cdc-cb8a66ccb9fb.png)

should cause the page to show the device toolbar, regardless of whether the DevTools is popped out in a separate window or docked to the BrowserWindow

![image](https://user-images.githubusercontent.com/172800/113184407-fbb16500-9209-11eb-8034-eb6e440b94f1.png)


### Actual Behavior

When DevTools is docked, the button works normally. When devtools is undocked:

![image](https://user-images.githubusercontent.com/172800/113184526-213e6e80-920a-11eb-8d50-967fa3b30fdd.png)

clicking the Device Toolbar button has no effect.

### Testcase Gist URL

_No response_

This behavior is observable in any Electron app, including the default Electron Fiddle app.

This is a re-opening of #738 with additional information.