sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Destructured union of tuples with non-uniform length results in diagnostic when narrowing
Labels: Suggestion,Experience Enhancement

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

tuple type union destructuring narrowing control flow analysis non-uniform length varying length

### 🕗 Version & Regression Information
- This appeared in TS 4.6 when the feature was introduced.

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.7.2#code/CYUwxgNghgTiAEYD2A7AzgF3gbSgGngCMCwBdALhwCIoqCUBXAW0JBlPgB9rC75GWbAoSRIIIKClIBuALAAoBQEsAZvAAUUeAF5d8GlQCU8AN4L4F+AHor8AJJqMACyVp4EJSgSvESJkxAUDBBgAmcEYCUoAHMUJEwlMHgfOKxnGCQAdxRzSzA5eQBfeBAINAQzeUtEAsKFevkgA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
declare const [a, b, c]: ["a", number] | ["b", number, boolean];
if (a === "a") {
    // If this line is commented, the diagnostic is not thrown
    c;
} else {
    c;
}
```

### 🙁 Actual behavior

When `c` is accessed in the branch for `["a", number]`, it throws a diagnostic on the original declaration for `c` since the control flow analysis tries to access `narrowedType[2]` which does not exist on `["a", number]`

### 🙂 Expected behavior

There should be no diagnostic thrown and `c` should simply be `undefined` (like it already is) or the diagnostic should be thrown where `c` is accessed rather than defined.
Repository: pytorch
Issue: when forward use **kwargs，how to construct the example_ Inputs parameter in jit.trace?
Labels: oncall: jit

### 🐛 Describe the bug

import torch

class Model(nn.Module):
    def forward(self, **kwargs):
         # kwargs contains more than dozens of tensors
         pass

model = Model()
trace_model = torch.jit.trace(model, example_inputs=??)

### Versions

PyTorch version: 1.6.0+cu101
Is debug build: False
CUDA used to build PyTorch: 10.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.3 LTS (x86_64)
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Clang version: Could not collect
CMake version: version 3.10.2
Libc version: glibc-2.26

Python version: 3.7.5 (default, Nov  7 2019, 10:50:52)  [GCC 8.3.0] (64-bit runtime)
Python platform: Linux-3.10.0-1.3.2.el7.x86_64-x86_64-with-Ubuntu-18.04-bionic
Is CUDA available: True
CUDA runtime version: 10.1.243
GPU models and configuration: 
GPU 0: GeForce RTX 2080 Ti
GPU 1: GeForce RTX 2080 Ti

Nvidia driver version: 440.44
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.18.5
[pip3] torch==1.6.0+cu101
[pip3] torchvision==0.7.0+cu101
[conda] blas                      1.0                         mkl  
[conda] mkl                       2021.2.0           h06a4308_296  
[conda] mkl-service               2.3.0            py38h27cfd23_1  
[conda] mkl_fft                   1.3.0            py38h42c9631_2  
[conda] mkl_random                1.2.1            py38ha9443f7_2  
[conda] numpy                     1.20.1           py38h93e21f0_0  
[conda] numpy-base                1.20.1           py38h7d8b39e_0  
[conda] numpydoc                  1.1.0              pyhd3eb1b0_1
Repository: pytorch
Issue: static builds are broken by MKL_DNN
Labels: module: build,triaged,module: regression,module: third_party

### 🐛 Describe the bug

Building with BUILD_SHARED_LIBRARIES=OFF  will fail if MKL / MKL DNN is enabled. 

```shell
USE_CUDA=OFF BUILD_SHARED_LIBS=OFF USE_TENSORPIPE=OFF python setup.py install
```
Tensor pipe has another issue with static builds here: https://github.com/pytorch/tensorpipe/issues/449

Errors out like
```
CMake Error:
  Running

   '/usr/bin/ninja' '-C' '/home/anush/github/pytorch/build' '-t' 'recompact'

  failed with:

   ninja: error: build.ninja:63037: bad $-escape (literal $ must be written as $$)

```

This is because when MKL is enabled and it is a static build it generates wrong targets in the Ninja file:

```
 $<TARGET_FILE:dnnl_graph>  
```


### Versions

Top of main

cc @malfet @seemethere
Repository: PowerToys
Issue: TouchPad gestures cause unexpected key events
Labels: Issue-Bug,Product-Keyboard Shortcut Manager,Priority-2

### Microsoft PowerToys version

0.59.1

### Running as admin

- [ ] Yes

### Area(s) with issue?

Keyboard Manager

### Steps to reproduce

I'm using a Lenovo Thinkbook 14 G4+ IAP running Windows11 Home Chinese Edition.
I use PowerToys to swap the Left Ctrl and CapsLock keys.
After doing that, there are some unexpected behaviors when I tap the touchpad with three or four fingers or press fn+m to turn off the touchpad.
I found that this is caused by my specific settings: I map the Left Ctrl to CapsLock.

[PowerToysReport_2022-06-22-13-33-40.zip](https://github.com/microsoft/PowerToys/files/8954786/PowerToysReport_2022-06-22-13-33-40.zip)



### ✔️ Expected Behavior

the touchpad gestures work as expected

When I press fn+m:

https://user-images.githubusercontent.com/107602397/174954463-c90aceda-90ad-4be0-95a1-451197577fc4.mp4




### ❌ Actual Behavior

three fingers tap become win+p function and CapsLock function

four fingers tap become CapsLock function

When I press fn+m, it toggles CapsLock twice and creates a screenshot in C:\Users\MyUserName\Pictures\Screenshots\:

https://user-images.githubusercontent.com/107602397/174954874-c088729b-07b9-4e07-9fb6-33b9ee0aee28.mp4
Repository: tauri
Issue: [feat] disable hardware acceleration 
Labels: type: feature request,status: upstream

### Describe the problem

I need disable hardware acceleration. In electron,  I can use code "app.disableHardwareAcceleration()". I hope tauri has the same functional.

### Describe the solution you'd like

use js code like electron, or set in tauri.conf.json

### Alternatives considered

_No response_

### Additional context

_No response_
Repository: electron
Issue: [Feature Request]: desktopCapturer.getSources returned the related pid, appName of windows
Labels: enhancement :sparkles:,component/desktopcapturer

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/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.

### Problem Description

I want to category all windows by process name, now `DesktopCapturerSource` only has it's appIcon, no appName.

### Proposed Solution

returned the appName and pid info in `DesktopCapturerSource`.

### Alternatives Considered

exposed some api in the result.

### Additional Information

_No response_
Repository: ant-design
Issue: 当Layout的Sider首次折叠后并点击的2级菜单，再展开后不同步展开2级菜单
Labels: Inactive

### Reproduction link

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/antd-reproduction-template-forked-6z4hdv?file=/index.js)

### Steps to reproduce

1.刷新页面
2.折叠左侧Sider
3.点击第2个2级菜单项
4.展开左侧Sider

### What is expected?

第2个2级菜单项默认打开

### What is actually happening?

第2个2级菜单项默认收缩

| Environment | Info |
| --- | --- |
| antd | 4.21.3 |
| React | 18.2.0 |
| System | Windows 11 |
| Browser | Firefox 101.0.1 |

---
但在第2步前先点击第2个2级菜单项，再折叠左侧Sider，就不会出现上述情况
![menu2](https://user-images.githubusercontent.com/2436252/174986171-e41f48e1-d047-41f7-97fe-44694696a6de.gif)


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: fastapi
Issue: Normalize names of translations in the docs
Labels: feature,reviewed

### First Check

- [X] I added a very descriptive title to this issue.
- [X] I used the GitHub search to find a similar issue and didn't find it.
- [X] I searched the FastAPI documentation, with the integrated search.
- [X] I already searched in Google "How to X in FastAPI" and didn't find any information.
- [X] I already read and followed all the tutorial in the docs and didn't find an answer.
- [X] I already checked if it is not related to FastAPI but to [Pydantic](https://github.com/samuelcolvin/pydantic).
- [X] I already checked if it is not related to FastAPI but to [Swagger UI](https://github.com/swagger-api/swagger-ui).
- [X] I already checked if it is not related to FastAPI but to [ReDoc](https://github.com/Redocly/redoc).

### Commit to Help

- [X] I commit to help with one of those options 👆

### Example Code

```python
`mkdocs.yml`:


  alternate:
  - link: /
    name: en - English
  - link: /az/
    name: az
  - link: /de/
    name: de
  - link: /es/
    name: es - español
  - link: /fa/
    name: fa
  - link: /fr/
    name: fr - français
  - link: /id/
    name: id
  - link: /it/
    name: it - italiano
  - link: /ja/
    name: ja - 日本語
  - link: /ko/
    name: ko - 한국어
  - link: /nl/
    name: nl
  - link: /pl/
    name: pl
  - link: /pt/
    name: pt - português
  - link: /ru/
    name: ru - русский язык
  - link: /sq/
    name: sq - shqip
  - link: /tr/
    name: tr - Türkçe
  - link: /uk/
    name: uk - українська мова
  - link: /zh/
    name: zh - 汉语
```


### Description

The language menu in the docs contains the names of the language only for some of the available languages, while the rest only have the language code. This looks a little weird, and some developers might not even know what language code their language of choice has. Having the name specified for all languages would be much clearer.

![names](https://user-images.githubusercontent.com/51365552/174988793-ec0f5dec-6f3d-4a81-8fb7-4f63654b18c8.png)


### Wanted Solution

1. The `mkdocs.yml` files should be updated to include the name of every available language.
2. The command that generates a new language (e.g. `python ./scripts/docs.py new-lang sv`) should include a second parameter where a name can be specified (`python ./scripts/docs.py new-lang sv svenska`), **or** the instructions for adding a new translation (https://fastapi.tiangolo.com/contributing/#new-language) should at least describe how to add a name manually.

### Wanted Code

```python
- link: /
    name: en - English
  - link: /az/
    name: az - Azərbaycanca
  - link: /de/
    name: de - Deutsch


etc.
```


### Alternatives

_No response_

### Operating System

Linux

### Operating System Details

_No response_

### FastAPI Version

0.78.0

### Python Version

3.10.4

### Additional Context

_No response_
Repository: material-ui
Issue: MUI [Checkbox] component - attribute 'checked' is displayed all time in HTML if element is checked or not.
Labels: bug 🐛,component: checkbox

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Current behavior 😯

For Controlled CheckBox, after component is rendered, in <input> attribute 'checked' is displayed if component is checked or not.

### Expected behavior 🤔

When CheckBox is not checked - in <input> attribute 'checked' should not be displayed.

### Steps to reproduce 🕹

Steps:
Add following component :
`<Checkbox
  checked={checked}
  onChange={handleChange}
  inputProps={{ 'aria-label': 'controlled' }}
/>`
1. If CheckBox is checked - in <input> element you can see attribute 'checked'.
![Screenshot checked](https://user-images.githubusercontent.com/38115916/174997258-aac8f774-40eb-42e1-82e2-c5a7d49c2540.png)

2. If CheckBox is not checked - in <input> you can see attribute 'checked'.
![Screenshot not-checked](https://user-images.githubusercontent.com/38115916/174997268-3dc4d914-a1fb-460c-bf50-c2502e87dd70.png)

Note: screens are taken from https://mui.com/material-ui/react-checkbox/#controlled 


### Context 🔦

If you have automation tests - you can't identify if CheckBox component is checked or not.

### Your environment 🌎

<details>
  <summary><code>npx @mui/envinfo</code></summary>

```
  System:                                                          
    OS: Windows 10 10.0.19043                                      
  Binaries:                                                        
    Node: 16.13.1 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE
    Yarn: 1.22.10 - ~\scoop\apps\nodejs\current\bin\yarn.CMD       
    npm: 8.9.0 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD    
  Browsers:                                                                                                  
    Edge: Spartan (44.19041.1266.0), Chromium (102.0.1245.44)
```
</details>
Repository: godot
Issue: Assigning a bool to modulate.a (color alpha) works in debug if declared but not in release.
Labels: bug,topic:gdscript,topic:export

### Godot version

3.4.4.stable.official

### System information

Windows 10

### Issue description

The title pretty much explains it.

This works is debug but not in release:

 ```gdscript
extends Node2D

onready var icon = $Icon as Sprite

func _ready() -> void:
     icon.modulate.a = false
 ``` 

However if you don't declare and simply assign it, you do get the error of assign type bool to an alpha color.

 ```gdscript
extends Node2D

func _ready() -> void:
     $Icon.modulate.a = false
 ``` 

I don't know what is intended, if this should fail or not, but it should at least be consistent in both debug and release.

### Steps to reproduce

1. Drop the icon.png into a 2D scene
2. Assign a script to the scene and declare the icon
3. In _ready set the icon's modulate alpha to false
4. Export a release build and compare

I have attached a simple project .zip with a windows release build in its project folder.

### Minimal reproduction project

![modulate_alpha_with_bool](https://user-images.githubusercontent.com/14341036/175003434-0b50beb2-b721-4c06-a6a9-670e59860df8.png)

[ModulateAlphaWithBool.zip](https://github.com/godotengine/godot/files/8956594/ModulateAlphaWithBool.zip)
Repository: rust
Issue: Suggest powershell syntax for setting RUST_BACKTRACE in the panic result on Windows
Labels: C-enhancement

Currently on Windows when a program panics and the default panic handler is run one of the lines it prints is: ``note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace``.

The problem is this **is not** the syntax that powershell (which I think is the default and largest shell used on Windows) uses to set environment variables. 

I think ``note: `RUST_BACKTRACE=1` (or PowerShell `$env:RUST_BACKTRACE=1`) environment variable to display a backtrace`` would be more correct and better for beginners.

Should be pretty simple change adding a different `cfg!` branch for following code https://github.com/rust-lang/rust/blob/352e621368c31d7b4a6362e081586cdb931ba020/library/std/src/sys_common/backtrace.rs#L104-L110

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"gimbles"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: rust
Issue: Implementation of FnOnce is not general enough for `Flatten` iterator of futures outliving an .await point
Labels: A-lifetimes,A-trait-system,T-compiler,C-bug,A-async-await,AsyncAwait-Triaged,WG-async,T-types

I tried this code:

```rust
let _: &(dyn Future<Output = ()> + Send) = &async {
    let _drop_after_await = std::iter::empty()
        .map(|_: &()| [async {}])
        .flatten();

    async {}.await;
};
```

[Playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=49a1932759f91c650caa21b770e5acaf)

I expected that the code should compile without errors.

However, it produces a compile error:

```
error: implementation of `FnOnce` is not general enough
  --> src/main.rs:4:48
   |
4  |       let _: &(dyn Future<Output = ()> + Send) = &async {
   |  ________________________________________________^
5  | |         let _drop_after_await = std::iter::empty()
6  | |             .map(|_: &()| [async {}])
7  | |             .flatten();
8  | |
9  | |         async {}.await;
10 | |     };
   | |_____^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'0 ()) -> [impl Future<Output = ()>; 1]` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
   = note: ...but it actually implements `FnOnce<(&(),)>`
```

The bug doesn't reproduce if we remove the `Send` requirement or `.flatten()` combinator 🤔.

### Meta

`rustc -V`:
```
rustc 1.61.0 (fe5b13d68 2022-05-18)
```
Repository: TypeScript
Issue: Discriminate the type of a value that is dynamically accessed, based on a type guard
Labels: Suggestion,Awaiting More Feedback

# Suggestion

<!--
  Please fill in each section completely. Thank you!
-->

## 🔍 Search Terms

<!--
  💡 Did you know? TypeScript has over 2,000 open suggestions!
  🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.
  The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests

  Replace the text below:
-->

type modifier, infer optional property

## ✅ Viability Checklist

<!--
   Suggestions that don't meet all these criteria are very, very unlikely to be accepted.
   We always recommend reviewing the TypeScript design goals before investing time writing
   a proposal for ideas outside the scope of the project.
-->
My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).


## ⭐ Suggestion

In the case of a type that is either `T` or `T | undefined`, typescript should be able to select the type when a type guard is applied instead of enforcing `T`.

## 📃 Motivating Example

<!--
  If you were announcing this feature in a blog post, what's a short explanation that shows
  a developer why this feature improves the language?
-->

A more complex scenario can be explored in the [playground](https://tsplay.dev/m04zGm).

```ts
type SomeType = {
  a: string;
  b?: string;
  c?: number;
}

type StringsOfSomeType = "a" | "b"; // typically this is dynamically defined

const obj: SomeType = { a: "foo" };
const props: Array<StringsOfSomeType> = ["a", "b"];
const p = props[1];

if (obj[p] === undefined) {
  obj[p] = undefined; // I suggest this should be possible because the condition allow us to determine that we are in a case where the value type is `string | undefined`
}
```


## 💻 Use Cases

<!--
  What do you want to use this for?
  What shortcomings exist with current approaches?
  What workarounds are you using in the meantime?
-->

Applying transformations in middleware functions.
Currently I have found no workaround.
Repository: vscode
Issue: Git - Seed proposed branch name from commit message
Labels: feature-request,git

When doing a bug fix I do the following steps:
* switch to `main` and pull latest
* fix things...
* stage the changed files
* write a commit message and press cmd+enter
* the lovely create branch popup shows up
* it would be nice if the suggested branch would be something like `alexd/issue-152840` because the commit message contains a reference to that issue

<img width="688" alt="image" src="https://user-images.githubusercontent.com/5047891/175012932-2b02c55c-b70e-45fc-b33b-6a677d8dced5.png">
Repository: flutter
Issue: [video_player] Feature request: allow video player to respect silent mode for iOS
Labels: c: new feature,platform-ios,p: video_player,package,c: proposal,P3,team-ios,triaged-ios

## Use case

Currently the video player for iOS is forcing the Playback category (`AVAudioSessionCategoryPlayback`) which doesn't respect the silent switch and it's not possible to switch this category after it's been set (AFAIK).
This means that the audio still plays when the user switches silent mode on.

## Proposal

Add an extra parameter to VideoOptions with either:

- `bool` parameter `respectSilentMode` that sets Ambient category instead of Playback when initializing the video.
- add the ability to set any `AVAudioSession` category so it is customizable.
Repository: deno
Issue: Invalid AES-GCM key length derived from ECDH 256
Labels: bug,ext/crypto

SubtleCrypto.deriveKey always returns a derived key with length of 256 (unlike chrome and firefox).
I'm deriving ECDH keys to generate a 128 bit AES-GCM key but the function always return a 256 bit key. I suppose this is not standard as firefox and chrome respect the given length.

`SubtleCrypto.deriveKey(ecdhKey, privateK, { name: "AES-GCM", length: 128 }, true, keyUsages)`
Repository: pytorch
Issue: `torch.special.gammainc` backward pass with respect to the first argument
Labels: module: distributions,module: autograd,triaged,actionable

### 🚀 The feature, motivation and pitch

The current implementation of [`torch.special.gammainc`](https://pytorch.org/docs/stable/special.html#torch.special.gammainc) only supports backward pass with respect to the second argument. The documentation notes that I should open a GitHub issue in case I'm interested in the gradient w.r.t. the first argument.

The `gammainc` function (and the related [`gammaincc`](https://pytorch.org/docs/stable/special.html#torch.special.gammaincc)) is used when computing the CDF and the survival function of the [Gamma](https://en.wikipedia.org/wiki/Gamma_distribution) and [Poisson](https://en.wikipedia.org/wiki/Poisson_distribution) distributions. These are some of the most commonly used distributions for modeling non-negative & count data in statistics.

One use case where we need to backpropagate w.r.t. both arguments of `gammainc` is when modeling time until an event (e.g., predicting time until death in survival analysis or time until an earthquake in temporal point processes). If we model time until the event with a Gamma distribution, computing the likelihood of a partially observed / censored sequence will involve computing the survival function of the Gamma distribution, which relies on `gammainc`. Since we cannot backpropagate, we cannot learn the first parameter of the Gamma distribution. 

Here is a minimal example that reproduces the problem.
```python
import torch

a = torch.tensor(2.0, requires_grad=True)
b = torch.tensor(0.5, requires_grad=True)
t = torch.tensor(1.0)

# Probability that the event hasn't occurred until time t
likelihood = torch.special.gammaincc(a, b * t)
likelihood.backward()  # raises NotImplementedError
```
This code would be equivalent to `likelihood = 1.0 - torch.distributions.Gamma(a, b).cdf(t)` if `torch.distributions.Gamma` implemented the `cdf` method.

### Alternatives

_No response_

### Additional context

This question has already been raised in #67763 but the issue was closed since the OP was actually interested in the derivative w.r.t. the second argument, which was already implemented.

cc @fritzo @neerajprad @alicanb @nikitaved @ezyang @albanD @zou3519 @gqchen @pearu @soulitzer @Lezcano @Varal7