sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: flutter
Issue: Up and down arrow keys miscalculate the cursor position in a TextField
Labels: a: text input,framework,engine,f: material design,platform-web,has reproducible steps,P2,found in release: 2.0,found in release: 2.1,team-web,triaged-web

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Run `flutter create bug`.

2. Update `main.dart` as follows:
```dart
import 'package:flutter/material.dart';

void main() async {
  runApp(MaterialApp(home: Material(child: TextFieldTest())));
}

class TextFieldTest extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    final TextStyle style = theme.textTheme.subtitle1;
    return const TextField(
      minLines: 1,
      maxLines: 12,
      style: TextStyle(fontSize: 40),
    );
  }
}
```

3.

* Run the app using chrome/canvaskit
* Type the following into the textfield `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`
* Select a character in the middle and use the up/down arrow keys

It seems to depend on the font size. For example, with the html renderer, setting the font size to something small like 14 seems to trigger the bug, while a fontSize of 40 on html works fine.


**Expected results:**
I expect the cursor to the character directly above or below. This behavior works perfectly in MacOS.

**Actual results:**
It ends up jumping to the left/right as well.

Here is a video of it in action:
https://user-images.githubusercontent.com/220686/112903776-95afcb00-90ad-11eb-8787-91da88fe675e.mov


cc @justinmc @mdebbar 

What was the original intention of having the engine side handle the text selection for Flutter web? I noticed that if I replace the web shortcuts with Mac ones, the bug goes away.

For example:
Like so:
```dart
 LogicalKeySet(LogicalKeyboardKey.arrowUp): const MoveSelectionUpTextIntent(),
    // const DoNothingAndStopPropagationTextIntent(),    
```

The code for `renderEditable.moveSelectionUp(...)` seems to properly calculate cursor positions on html/canvaskit.

<details>


```
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.1.0-13.0.pre.288, on Mac OS X 10.14.6 18G8022
    darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[!] Xcode - develop for iOS and macOS
    ✗ Xcode 11.3.1 out of date (12.0.1 is recommended).
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.4)
[✓] IntelliJ IDEA Community Edition (version 2020.1.4)
[✓] VS Code (version 1.54.3)
[✓] Connected device (2 available)
```

</details>
Repository: flutter
Issue: "Custom Engine Embedding in AOT Mode" wiki page references deprecated "flutter build aot"
Labels: tool,d: api docs,P2,team-tool,triaged-tool

@pigking12345 in https://github.com/flutter/flutter/issues/49562#issuecomment-806388409
> Please update this doc: https://github.com/flutter/flutter/wiki/Custom-Flutter-Engine-Embedding-in-AOT-Mode
`build aot` is still used in it.
Repository: flutter
Issue: Support deferred components on iOS
Labels: c: new feature,platform-ios,engine,P3,team-ios,triaged-ios

Deferred components was implemented for Android in https://github.com/flutter/flutter/issues/57617. We should support similar functionality on iOS.

Deferred components allows AOT dart code and assets to be downloaded and installed at runtime. See go/deferred-components-instructions

We can make use of App store's On-demand resources https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/On_Demand_Resources_Guide/index.html

This work would require supporting the engine platform view deferred components API in the iOS embedder and tooling to read and package the assets/.so files in an on-demand resource.

It would be interesting to find out of custom implementations are something that enterprise customers desire, as iOS is more closed than Android and all distribution occurs via the App store.
Repository: rust
Issue: Handle `fn` parameter type with named borrow missing a leading `'`
Labels: C-enhancement,A-diagnostics,A-parser,T-compiler,D-verbose

Appropriately handle encountering an `fn` parameter type that has a named borrow missing a leading `'`:

```rust
fn foo<'x>(_: &x i32) {}
```

[We currently spam multiple errors for this](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=18c695ded8bfa7f71b5f6b2a39da860f):

```
error: expected one of `:`, `@`, or `|`, found `)`
 --> src/lib.rs:1:21
  |
1 | fn foo<'x>(_: &x i32) {}
  |                     ^ expected one of `:`, `@`, or `|`
  |
  = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: if this is a parameter name, give it a type
  |
1 | fn foo<'x>(_: &x i32: TypeName) {}
  |                  ^^^^^^^^^^^^^
help: if this is a type, explicitly ignore the parameter name
  |
1 | fn foo<'x>(_: &x _: i32) {}
  |                  ^^^^^^

error: expected one of `!`, `(`, `)`, `,`, `::`, or `<`, found `i32`
 --> src/lib.rs:1:18
  |
1 | fn foo<'x>(_: &x i32) {}
  |                 -^^^ expected one of `!`, `(`, `)`, `,`, `::`, or `<`
  |                 |
  |                 help: missing `,`

error[E0412]: cannot find type `x` in this scope
 --> src/lib.rs:1:16
  |
1 | fn foo<'x>(_: &x i32) {}
  |                ^ not found in this scope
```
Repository: electron
Issue: [Bug]: Electron propagates GDK_BACKEND=x11 to subprocesses, breaking shell.openExternal with Firefox on Wayland
Labels: platform/linux,bug :beetle:,14-x-y,15-x-y,16-x-y,wayland

### 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.9
13.0.1
14.1.0
15.1.1

### What operating system are you using?

Other Linux

### Operating System Version

NixOS 21.05

### What arch are you using?

x64

### Last Known Working Electron version

12.0.0-beta.20

### Expected Behavior

`shell.openExternal("https://electronjs.org/")` opens a browser tab at https://electronjs.org/. (My browser is Firefox on Wayland with `MOZ_ENABLE_WAYLAND=1`, and has other tabs already open.)

### Actual Behavior

Firefox shows this error and does not open a tab:

“Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile.”

### Testcase Gist URL

https://gist.github.com/31ec2165f4aa806536e11d7d99d1e26f

I bisected this to v12.0.0-beta.20...v12.0.0-beta.21 (9faf23509d054062def1332500c05c8ee7fb9bb7...5dbb6356effbfc0f6e0528583fae832290c14207).

The difference between v12.0.0-beta.20’s working invocation of `xdg-open` and v12.0.0-beta.21’s failing invocation is that the latter has `GDK_BACKEND=x11` in the environment. I confirmed that this is responsible for the failure with manual invocations of

```sh
xdg-open https://electronjs.org/  # works
env GDK_BACKEND=x11 xdg-open https://electronjs.org/  # fails
```

I don’t know if Electron or Chromium need to set `GDK_BACKEND=x11` for their own purposes, but it definitely should not be propagated to subprocesses such as `xdg-open`.
Repository: pytorch
Issue: [JIT] export fast-transformer to TorchScript
Labels: oncall: jit

## ❓ Questions and Help

Hi, I have a problem with exporting the pre-trained model from [fast-transformer](https://github.com/idiap/fast-transformers)

It seems that the major problem is the mask of transformer
```
RuntimeError:
Could not cast value of type None to bool:
softmax_temp = self.softmax_temp or 1./sqrt(E)
                       ~~~~~~~~~~~~~~~~~ <--- HERE
```
It works with rewriting to this form
```
if self.softmax_temp is None:
    softmax_temp = 1./sqrt(E)
else:
    softmax_temp = self.softmax_temp
```

But following runtime errors are:
```
RuntimeError:
Tried to access nonexistent attribute or method 'all_ones' of type 'Tensor (inferred)'.:
  File "/volume/xxx/xxx/xx_env/lib/python3.8/site-packages/fast_transformers/attention/full_attention.py", line 70
        # Compute the unnormalized attention and apply the masks
        QK = torch.einsum("nlhe,nshe->nhls", queries, keys)
        if not attn_mask.all_ones:
               ~~~~~~~~~~~~~~~~~~ <--- HERE
            QK = QK + attn_mask.additive_matrix
        QK = QK + key_lengths.additive_matrix[:, None, None]
```

I thought the forward (inference) part we might don't require the mask information, so I comment the mask-related code like
```
QK = torch.einsum("nlhe,nshe->nhls", queries, keys)
#if not attn_mask.all_ones:
#              ~~~~~~~~~~~~~~~~~~ <--- HERE
#            QK = QK + attn_mask.additive_matrix
#        QK = QK + key_lengths.additive_matrix[:, None, None]
```
But finally it has another issue
```
File "/volume/xxx/xxx/xx_env/lib/python3.8/ast.py", line 47, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 1
    def forward(self, queries, keys, values, attn_mask, query_lengths,
    ^
IndentationError: unexpected inden
```

cc @gmagogsfm
Repository: transformers
Issue: Returning Confidence Score For Extractive QA Task When Using Non-Pipeline Approach 
Labels: Feature request

# 🚀 Feature request

HF's Extract QA pipeline provides an excellent interface for start. It returns 4 values including a **probability score / confidence score**. Unfortunately same is not the case when using the non-pipeline approach i.e using model and tokenizer for question answering. 
[Both methods are mentioned here, The pipeline one and the other](https://huggingface.co/transformers/task_summary.html#extractive-question-answering)

## Motivation
The confidence score will help a lot in various tasks. For example when I am developing a complete pipeline for QA, consisting of recall, retriever and some other models for entity matching and etc. I need to calculate scores of each models and then rank the final list of documents based on the weighted sum of score from each model. I believe this is a very common practice among NLP practitioners and not just for QA task. The point is confidence scores are usually a pretty standard requirement for each model output because we have to take further actions based on its score.

## Your contribution
I want to. but unfortunately I am not at the level where I can understand the code. I have went through the code and I believe its the "decode" function in "QuestionAnsweringPipeline" class which has the code the which generates the probability scores. If you guys can just provide an interface for it or provide docs for how to calculate this score using the model and tokenizer approach then that would be great too. And if you do decide to do this then please also add this addition to docs in the link mentioned at the top.

Thanks.
Repository: godot
Issue: Raycast Not Detecting CollisionShape3D: ConvexPolygonShape3D Mouse Collision in v4.0
Labels: bug,topic:physics,regression

**Godot version:**
latest v4.0 build


**OS/device including version:**
MacOS, Big Sur, Vulkan


**Issue description:**
ConvexPolygonShape3D doesn't seem to register RayCast collision with mouse using KinematicBody3D -> CollisionShape3D -> MeshInstance. However, a CollisionShape3D with a BoxShape3D Shape as well as the CSGMesh detects mouse collisions just fine.


**Steps to reproduce:**
I've uploaded a minimal file demonstrating the issue. Hopefully I'm not just forgetting to do something but tested this same setup with V3.3 and it worked fine


**Minimal reproduction project:**
[12_mouseDetect_v4.0.zip](https://github.com/godotengine/godot/files/6226505/12_mouseDetect_v4.0.zip)
Repository: TypeScript
Issue: Spread Tuple Union In Function Errors
Labels: Bug

# Bug Report
When spreading a tuple union into a function, it thinks the length of the array could be zero, which seems to disregard the entire reason for the tuple type?
e.g.: Spreading a `[number] | [number, any[]]` type thinks that it could have a zero length?

### 🔎 Search Terms
- tuple
- spread
- union
- rest paramenters

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXwwAs4QBBGAcwGcAKKjGALnnpi1QoBp5VkBbZrz4AjEDG6wYAfmZRUATwDaAXQCUzAG44swANwAoMHnrxY1eAF54AWShEAdDDnAcfGqvgA+eAAZ7AVngpeEUfZVMqEKFRGHDmUO5FAHJEHBwk7iThWCTlcKhIxWixCQUVZQMiEnJqGiTCEAgIdO57NrMqVV0gA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
declare function threeArgs(str: string, num: number, arr?: any[]): void;
const wrapFn = (...args: ([number] | [number, any[]])) => {
    return threeArgs(...args);
};
// A spread argument must either have a tuple type or be passed to a rest parameter.(2556)
// (parameter) args: [number] | [number, any[]]
```

### 🙁 Actual behavior

Compiler Error:
```
A spread argument must either have a tuple type or be passed to a rest parameter.(2556)
```

### 🙂 Expected behavior

Function can be called with 2 or 3 arguments spread with a args type of a union of tuples.
Repository: pytorch
Issue: Results surprisingly differ on different backends
Labels: triaged,module: numerical-reproducibility

## 🐛 Bug
The inference results of Resnet18 on GPU and CPU are surprisingly inconsistent.
```
import torch
import torchvision.models as models

if __name__ == '__main__':
    net = models.resnet18().cuda()
    net_cpu = models.resnet18().cpu()

    with torch.no_grad():
        torch.backends.cudnn.enabled = False
        image = torch.rand(1, 3, 224, 224)
        output = net(image.cuda())

        output_cpu = net_cpu(image)
        print(output.mean())
        print(output_cpu.mean())
        assert torch.allclose(output_cpu, output.cpu()) == True
```
The output of the above script is
```
tensor(-0.0220, device='cuda:0')
tensor(0.0175)
Traceback (most recent call last):
    assert torch.allclose(output_cpu, output.cpu()) == True
AssertionError
```
Note that the `mean` of the two output tensors greatly differ, indicating that this is not simply a false alarm of `torch.allclose`.
## Expected behavior
The assertion should pass.

## Environment
PyTorch version: 1.8.1+cu111
Is debug build: False
CUDA used to build PyTorch: 11.1
ROCM used to build PyTorch: N/A

OS: CentOS Linux release 7.7.1908 (Core) (x86_64)
GCC version: (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Clang version: Could not collect
CMake version: version 2.8.12.2

Python version: 3.6 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration:
GPU 0: Tesla V100-PCIE-16GB

Nvidia driver version: 455.45.01
cuDNN version: Probably one of the following:
/usr/lib64/libcudnn.so.7.5.0
/usr/lib64/libcudnn.so.8.0.5
/usr/lib64/libcudnn_adv_infer.so.8.0.5
/usr/lib64/libcudnn_adv_train.so.8.0.5
/usr/lib64/libcudnn_cnn_infer.so.8.0.5
/usr/lib64/libcudnn_cnn_train.so.8.0.5
/usr/lib64/libcudnn_ops_infer.so.8.0.5
/usr/lib64/libcudnn_ops_train.so.8.0.5
/usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7.5.0
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.5
[pip3] torch==1.8.1+cu111
[pip3] torchaudio==0.8.1
[pip3] torchvision==0.9.1+cu111
[conda] Could not collect
Repository: go
Issue: x/pkgsite: Use visitor's GOOS when viewing documentation.
Labels: NeedsInvestigation,pkgsite

pkg.go.dev has the ability to show documentation for different `GOOS` by setting the variable in the URL or by using the dropdown. It does however not default to the host operating system like it did on godoc. This has lead to repeated confusion when people want to use a function, but find out it doesn't exist during compile time. 

An example of this is https://pkg.go.dev/github.com/creack/pty, which when viewed on a windows machine shows a function `Start`.  When changing the `GOOS` to windows it disappears.

I would propose defaulting to the visitor's operating system when possible.

edit: clarified which host
Repository: flutter
Issue: [A11y] VoiceOver cannot announce 'A to B of C' on ListView()
Labels: platform-ios,framework,a: accessibility,f: scrolling,has reproducible steps,P2,found in release: 2.1,team-ios,triaged-ios

TalkBack can announce 'A to B of C' on ListView().
But VoiceOver cannot do it.

```
ListView(
children: <widget>[
Text('item 1'),
Text('item 2'),
Text('item 3'),
// and more items ...
],
)
```
Repository: flutter
Issue: [A11y] VoiceOver cannot focus vertical Scrollbar
Labels: platform-ios,framework,a: accessibility,f: scrolling,has reproducible steps,P2,found in release: 2.1,team-ios,triaged-ios

TalkBack can announce 'A to B of C' on ListView() when I scrolled lists.
But VoiceOver cannot announce it and focus vertical a scrollbar.
Visual impaired users cannot understand how long they scroll lists.


```
Scrollbar(
child: ListView(
  children: <Widget>[
  Text('item 1'),
  Text('item 2'),
  Text('item 3'),
  // and more items ...
  ],
),
),
```
Repository: vscode
Issue: Debug: show welcome when while not debugging even if launch.json present
Labels: debug,under-discussion

While a user is not debugging we should consider showing a welcome view, instead of all the empty debug views even if he or she has a `launch.json`. The only debug view which makes sense when not debugging is the breakpoints view.

What I suggest:
* While a user is not debugging show the welcome view. If there is at least one breakpoint also show the breakpoints view

I think this will help new users, who get surprised when a `launch.json` gets created that the nice blue button is gone.
I know we had discussions about this before so let me know what you think @weinand @connor4312 
I would try this out in April if time permits.

fyi @tanhakabir for debugging in education
Repository: node
Issue: WebAssembly Debugging DWARF support ?
Labels: wasm


When I use wasm with dwarf debug info in nodejs, it seems that the callstack does not   supports c++ source code sourcemapping, which is inconvenient for wasm debugging.
![image](https://user-images.githubusercontent.com/8898718/112977944-44750980-9189-11eb-8207-296111387cee.png)

**Describe the solution you'd like**
Chrome devtools supports DWARF now, https://developers.google.com/web/updates/2019/12/webassembly, so maybe node could do the same thing.
**Describe alternatives you've considered**
Please describe alternative solutions or features you have considered.
Repository: go
Issue: runtime: support for system callbacks with float arguments on Windows
Labels: OS-Windows,NeedsFix

**Background**

The Windows APIs use certain callbacks with floating point arguments, for [example](https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessionevents-onsimplevolumechanged):
`HRESULT IAudioSessionEvents::OnSimpleVolumeChanged(
  float   NewVolume,
  BOOL    NewMute,
  LPCGUID EventContext
);`

To register those from Go code, the `syscall.NewCallback` is needed. This in turn runs `syscall.compileCallback` which is implemented for Windows, in [/runtime/syscall_windows.go](https://golang.org/src/runtime/syscall_windows.go). This function explicitly does not support floats as arguments and panics ([link](https://golang.org/src/runtime/syscall_windows.go#L125)) with message `compileCallback: float arguments not supported`.

This originated from a conversation [here ](https://groups.google.com/g/golang-nuts/c/E3pX30G10HQ) and some comments [in this issue](https://github.com/golang/go/issues/40724#issuecomment-807915298).

Since the Go calling convention is being reworked (#40724) entirely, this may be a good moment to (try) to address this.

**Proposal**

Would be nice to have the support for callbacks with floating point arguments. In this way would be possible to interact with the system using pure Go, without the need of CGo.

I don't know if there are other issues in interacting with Windows APIs, but ideally a full support for interacting with Windows would be great.

Maybe it is worth mentioning that there is a [project ](https://blogs.windows.com/windowsdeveloper/2021/01/21/making-win32-apis-more-accessible-to-more-languages/) lead by Microsoft that aims at making WinAPIs more accessible to other languages, by precisely describing them in a [metadata format](https://github.com/microsoft/win32metadata) that can be machine processed to get specific language implementations, called [projections](https://github.com/microsoft/win32metadata/blob/master/docs/projections.md). With full support of Windows syscall/callbacks, would be possible to make a projection for Go in order to have access to the complete Windows APIs. This is probably best to be discussed in another issue (or elsewhere), but I thought was important to mention here.

**Comments**

As far as I understand, as the comment in the code says, in order for this to work we need to "spill" the floating point registers in order to retrieve the values. This is done in the file [runtime/sys_windows_amd64.s](https://golang.org/src/runtime/sys_windows_amd64.s).

I am (very) far from being an expert so I don't understand if this is a relatively easy task or a complicated one.

Also I don't really understand why in the C code in Windows SDK headers, callbacks are flagged as `stdcall` but here they are treated as `fastcall` here. In the first case the values should be in the stack as per [documentation](https://docs.microsoft.com/en-us/cpp/cpp/argument-passing-and-naming-conventions?view=msvc-160), but surely I am missing something.

Any thoughts?
Repository: flutter
Issue: “A Hero widget cannot be the descendant of another Hero widget” issue when showing SnackBar() widget
Labels: c: crash,framework,f: material design,d: api docs,d: stackoverflow,a: error message,has reproducible steps,found in release: 2.0,found in release: 2.1,team-design,triaged-design

## Steps to Reproduce
```
1. Wrapped a Scaffold with a Hero
2. open a subpage out of an end drawer
3. showing a SnackBar() widget with the new ScaffoldMessager of the same context
```
`ScaffoldMessenger.of(context).showSnackBar(snackBar);`

Then I get the error:

> A Hero widget cannot be the descendant of another Hero widget.
> 'package:flutter/src/widgets/heroes.dart':
> Failed assertion: line 375 pos 7: 'context.findAncestorWidgetOfExactType<Hero>() == null'
> found a solution that fixed the issue temporary:

tried to fix it by adding a Global Key to the Scaffold with 

`final _scaffoldKey = GlobalKey<ScaffoldState>();`
`_scaffoldKey.currentState..showSnackBar(snackBar); //this is working but deprecated
`
```
and this works fine without the error
```
```
What I've also tried:
```
`ScaffoldMessenger.of(_scaffoldKey.currentContext).showSnackBar(snackBar); //also leads to the error with the Hero
`




```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.3, on Mac OS X 10.15.7 19H524 darwin-x64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.54.3)
[✓] Connected device (1 available)

• No issues found!
```

Duplication of stack overflow question:
https://stackoverflow.com/questions/66856064/a-hero-widget-cannot-be-the-descendant-of-another-hero-widget-issue-when-showi