sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: `==` expression with unsafe block on left-hand side fails to parse
Labels: A-parser,C-bug

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I tried this code ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=39b30dc00d04607f620b01220a3aaccb)):

```rust
unsafe fn foo() -> usize {
    0
}

fn foo_wrapper() -> bool {
    // Fails to compile
    unsafe { foo() } == 0
    
    // OK
    // unsafe { foo() }.eq(&0)
}

fn main() {
    let maybe = foo_wrapper();
    
    println!("{}", maybe);
}
```

I expected to see this happen: The result of `foo()` would return from the `unsafe` block and be compared to `0`.

Instead, this happened: Compilation failed because the parser wanted type `()` instead of the expected `usize` for comparison to `0`.
```
error: expected expression, found `==`
 --> src/main.rs:7:22
  |
7 |     unsafe { foo() } == 0
  |                      ^^ expected expression

error[E0308]: mismatched types
 --> src/main.rs:7:14
  |
7 |     unsafe { foo() } == 0
  |              ^^^^^- help: try adding a semicolon: `;`
  |              |
  |              expected `()`, found `usize`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
```

Incidentally, compilation is successful if the `unsafe` block is instead on the right-hand side:
```rust
0 == unsafe { foo() }
```

### Meta

`rustc --version --verbose`:
```
rustc 1.45.0 (5c1f21c3b 2020-07-13)
binary: rustc
commit-hash: 5c1f21c3b82297671ad3ae1e8c942d2ca92e84f2
commit-date: 2020-07-13
host: x86_64-unknown-linux-gnu
release: 1.45.0
LLVM version: 10.0
```
(the behavior is identical with `1.46.0-beta.2` and `1.47.0-nightly` compilers)
Repository: vscode
Issue: Support metered connections
Labels: feature-request

VS Code, as any Windows application, should respect system-wide settings of metered connections.
It's bad experience for people who are on the go and connected via mobile internet.

Proposed behavior:
1. VS Code doesn't attempt to update itself or extensions when on metered connection.
2. When user manually clicks to update, it should display popup dialog with confirmation to start update.
3. (optionally) Expose API to extensions.

Related:
https://github.com/microsoft/vscode/issues/75195
https://github.com/microsoft/vscode/issues/8540
Repository: rust
Issue: Inner attributes doesn't work well for clippy since 1.44.0
Labels: A-attributes,A-lints,C-bug

### Description

According to [The Rust Reference](https://doc.rust-lang.org/reference/attributes.html):
> Inner attributes, written with a bang (!) after the hash (#), apply to the item that the attribute is declared within.

So, I think if I added `#![...]` at the beginning of the `lib.rs` (or `main.rs`, `mod.rs`), all sub-modules in this file should be applied this attribute, too.

But only the first module which followed that declaration accepts the attribute.

### Reproduction

#### Demo to Reproduce

- `Cargo.toml`:
  ```toml
  [package]
  name = "demo"
  version = "0.1.0"
  edition = "2018"
  ```
- `src/bar.rs` is an empty file.
- `src/foo.rs`:
  ```rust
  pub fn f() {
      println!("Hello, {}!", "world");
  }
  ```
- `src/lib.rs`:
  ```rust
  #![allow(clippy::all)]
  mod bar;
  mod foo;
  pub use crate::foo::f;
  ```

#### Differences

- Build with `rust-toolchain <= 1.43.1` (`cargo +1.43.1 clippy`):
  ```
      Checking demo v0.1.0 (/tmp/demo)
      Finished dev [unoptimized + debuginfo] target(s) in 0.14s
  ```
  I only tested `1.35.0 <= rust-toolchain <=1.43.1`.

- Build with `rust-toolchain >= 1.44.0` (`cargo +1.44.0 clippy`):
  ```
      Checking demo v0.1.0 (/tmp/demo)
  warning: literal with an empty format string
   --> src/foo.rs:2:28
    |
  2 |     println!("Hello, {}!", "world");
    |                            ^^^^^^^
    |
    = note: `#[warn(clippy::print_literal)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal

  warning: 1 warning emitted

      Finished dev [unoptimized + debuginfo] target(s) in 0.13s
  ```
  `rustc 1.46.0-nightly (346aec9b0 2020-07-11)` has the same issue.
Repository: flutter
Issue: Allow keyboard to open DropdownButton and DropdownButtonFormField
Labels: c: new feature,framework,a: desktop,P2,team-design,triaged-design

Traditional text fields within a Flutter form can receive focus, then receive text input, and then move to the next field with a tab key. This allows users to complete forms exclusively using a keyboard. However, if a `DropdownButtonFormField` is in the form, once it receives focus, there doesn't appear to be any keyboard interaction that can open it. I'm forced to move the mouse to that position and click it.

I'd like to be able to open and select an item in a `DropdownButtonFormField` using the keyboard.

This situation is primarily relevant for web, though not exclusively.
Repository: PowerToys
Issue: [KBM] Add Xinput and/or DirectInput support
Labels: Idea-Enhancement,Product-Keyboard Shortcut Manager

## 📝 Xinput and/or DirectInput support for Keyboard Manager

_What is the expected behavior of the proposed feature?  What is the scenario this woudl be used?_

This is a feature present in the software [reWASD](https://www.rewasd.com/advanced-controller-mapping#advanced-mapping). What it does, it enables to use Xinput presses via pressing a keyboard bind. This is very useful using in conjunction with the [Steam Input configurator](https://partner.steamgames.com/doc/features/steam_controller) which allows gamepads like the Microsoft Xbox (360), Steam Controller, Sony DualShock to execute multiple extra tasks that can't be just achieved with the Steam Input software.

Considering that reWASD costs money, it could be great to have a FOSS alternative to it. 

There are many, many uses regarding accessiblity for disabled or handicapped people too, which can be potentially used with Steam Input + the [Microsoft Adaptive Controller](https://www.microsoft.com/en-us/store/collections/xboxadaptivecontrolleraccessories).

---

If you'd like to see this feature implemented, add a 👍 reaction to this post.
Repository: storybook
Issue: Option to change the language attribute
Labels: feature request,has workaround,core

**Is your feature request related to a problem? Please describe.**
I need to test some multilingual sites and always the site is rendered with `<html lang="en">`

**Describe the solution you'd like**
The storybook `.ejs` template should include a language variable instead of the harcoded option as is it right now.

**Describe alternatives you've considered**
Maybe create an addon and we can change the language in runtime but not all the features could respond to the runtime changes. I think is better change the storybook template in order to accept variables there in the lang attribute.

**Are you able to assist bring the feature to reality?**
Yes, I can make a try. But if anyone can help me, would be great 😄

**Additional context**
Could be very useful if then we can change the lang attribute in the preview panel and the server reloads the page.
Repository: opencv
Issue: G-API : how is serialize/deserialize supposed to be used properly ?
Labels: category: g-api / gapi

OpenCV 4.4.0, Visual Studio 2019, Windows 7 64b
I have no problems running the [G-API tutorial](https://docs.opencv.org/4.3.0/d3/d7a/tutorial_gapi_anisotropic_segmentation.html), but I can't save and reload the GComputation.

```
...// from https://docs.opencv.org/4.3.0/d3/d7a/tutorial_gapi_anisotropic_segmentation.html...
segm.apply(cv::gin(imgIn), cv::gout(imgOut, imgOutCoherency, imgOutOrientation));//OK until there

//trying to save/reload the GComputation
std::vector<char> v = cv::gapi::serialize(segm);
segm = cv::gapi::deserialize<cv::GComputation>(v);

//try to use the reloaded GComputation
segm.apply(cv::gin(imgIn), cv::gout(imgOut, imgOutCoherency, imgOutOrientation));//Assert raised
```

I guess that it is related to unsaved MetaArgs information, but I can't see how to inject them in the deserialized GComputation
Repository: pytorch
Issue: BusError memory-mapped tensor
Labels: module: internals,triaged

## 🐛 Bug

I am trying to create a memory-mapped tensor, backed by a file on disk. Creating a `Storage` instance and a `Tensor` on top work without problem as applying a simple operation. The actual write to disk is not performed and the program fails with a `BusError`.

## To Reproduce

Steps to reproduce the behavior:

```
import torch
from tempfile import mkdtemp
import os

filename = os.path.join(mkdtemp(), 'foo.dat')
storage = torch.DoubleStorage.from_file(filename, shared=True, size=1000000000000)
tensor = torch.DoubleTensor(storage)
tensor += 1
```

Fails with:

```
Bus error
```

The file exists though:

```
[user@system]$ ls -lisah /tmp/
total 8.0K
      99 4.0K -rw-------   1 user group  75G Jul 24 17:54 foo.dat
```

However, the content is still zero

```
[user@system]$ hexdump -n40 /tmp/foo.dat 
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000020 0000 0000 0000 0000                    
0000028
```

## Expected behavior

The values in the file should be updated, the program should not fail with a `BusError`.

## Environment

```
PyTorch version: 1.5.1
Is debug build: No
CUDA used to build PyTorch: 10.2

OS: CentOS Linux 7 (Core)
GCC version: (GCC) 8.3.0
CMake version: version 3.14.0

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 10.1.105
GPU models and configuration: GPU 0: Tesla V100-PCIE-32GB
Nvidia driver version: 440.33.01
cuDNN version: Could not collect

Versions of relevant libraries:
[pip3] numpy==1.15.2
[pip3] torch==1.5.1
[conda] Could not collect
```

## Additional context

The very same code fails with a `not-implemented` for CUDA storages. Any ideas, if and when you would provide the feature?

cc @ezyang @bhosmer @smessmer @ljk53
Repository: opencv
Issue: ONNX Importer does not process the "ceil_mode" attribute of pooling layers
Labels: category: dnn,needs reproducer,category: dnn (onnx)

##### System information (version)
- OpenCV => 4.3.0
- Operating System / Platform => Windows 64bit
- Compiler => Visual Studio 2019

##### Detailed description

In onnx_importer.cpp, it processes the ceil_mode attribute of Pooling layers by looking for the non-standard attribute name "pad_mode". Conforming ONNX models with "ceil_mode=1" attribute are not processed correctly and generate wrong output shapes.

##### Steps to reproduce

Import an ONNX model which was export from PyTorch v1.5, the model contains a MaxPool layer with ceil_mode=True. I confirmed in Netron that the MaxPool layer in the exported ONNX model do have the "ceil_mode=1" attribute.
Read the ONNX model in OpenCV and check the output shape of the MaxPool layer, the "ceil_mode=1" attribute has no effect.
Repository: rust
Issue: x.py test: add ability to stop after first test failure.
Labels: C-enhancement,T-bootstrap,A-libtest

In some cases it'd be useful to stop the tests after the first failure.

I'm currently tracking down a bug which causes some ui tests to fail. The turnaround is about 20 minutes, but it'd be sufficient to stop after the first failure (which happens early).

Thanks.
Repository: bitcoin
Issue: Expose PSBT AddInput/AddOutput via RPC
Labels: Feature

**Is your feature request related to a problem? Please describe.**

Alice creates a PSBT via the RPC API, and signs all inputs with `SIGHASH_SINGLE | SIGHASH_ANYONECANPAY`.  She then sends the signed PSBT to Bob, who wants to add some more inputs and outputs via the RPC API without losing Alice's signatures, so that he can broadcast the resulting transaction without asking Alice to re-sign.  Unfortunately, the PSBT RPC API doesn't seem to provide any way of appending new inputs/outputs to an existing PSBT; it only allows creating a new PSBT (via `createpsbt`) with the full set of inputs/outputs, which has the side effect of losing the existing signatures.

**Describe the solution you'd like**

It would be useful for the PSBT RPC API to expose the `AddInput` and `AddOutput` methods of `PartiallySignedTransaction`.  These would allow adding new inputs/outputs without affecting whatever signature data might already be present in the existing inputs.  Something like this:

`bitcoin-cli addoutputpsbt 'existingpsbt' '{"data":"00010203"}'`

**Describe alternatives you've considered**

I considered adapting `combinepsbt` to copy signatures between two transactions with different TXID's if the signatures are valid in both transactions given the `SIGHASH` flags, but this seems rather unwieldy.

It might be desirable to support adding multiple outputs (or inputs) in one RPC call, by making the 2nd argument an array of objects instead of an object.  Or this might just complicate things unnecessarily.  I don't feel particularly strongly about this.

**Additional context**

N/A.
Repository: flutter
Issue: TextArea widget in Flutter
Labels: a: text input,c: new feature,framework,would be a good package,c: proposal,P3,team-framework,triaged-framework

I want to suggest implementation of a new Input widget that is TextArea widget ,
rather than using TextField and adding the properties maxLines and maxLength to create a feel of TextArea
Repository: material-ui
Issue: [RFC] Refine logging strategy
Labels: discussion,ready to take,RFC

### Context

This is a follow-up on #15343. Looking at the components (under `/packages/*)`, we can count the following usage frequency of the different logging methods:

- `console.error` x69
- `console.warn` x25

Historically, React used to use console.warn. It was changed in https://github.com/facebook/react/pull/3440 to benefit from the stack trace of error. Something Chrome now supports for warn too:

<img width="589" alt="Capture d’écran 2020-07-28 à 13 29 31" src="https://user-images.githubusercontent.com/3165635/88660106-6be57500-d0d6-11ea-9034-28a79e63a41b.png">

### Problem

It doesn't seem that there is any rule or convention around when to use error over warn. Do we have an improvement opportunity here? Could we use it as leverage to help developers that need to **prioritize** which problem they should focus on first?

### Proposal

What do you think of:

- If we are unsure, better say it's an `error` over `warn` to be safe.
- `console.error` we use it for cases that are important. It can be a crash of the page, explaining what went wrong, or creating awareness about a significantly wrong user-experience. For instance:
https://github.com/mui/material-ui/blob/56a1141631905f65c1f5c1d5f41702016327a4ad/packages/material-ui/src/FormControl/FormControl.js#L135-L140
- `console.warn` is used as soon as something is not right, leading to incorrect behavior but not critical. For instance, these should be warnings:
https://github.com/mui/material-ui/blob/56a1141631905f65c1f5c1d5f41702016327a4ad/packages/material-ui/src/StepContent/StepContent.js#L44-L46
https://github.com/mui/material-ui/blob/56a1141631905f65c1f5c1d5f41702016327a4ad/packages/material-ui-icons/src/Motorcycle.js#L4-L8
https://github.com/mui/material-ui/blob/56a1141631905f65c1f5c1d5f41702016327a4ad/packages/material-ui/src/Breadcrumbs/Breadcrumbs.js#L81-L86
https://github.com/mui/material-ui/blob/56a1141631905f65c1f5c1d5f41702016327a4ad/packages/material-ui/src/GridList/GridList.js#L46-L50
Repository: pytorch
Issue: [docs] Add example of interop with DLPack created in plain C
Labels: module: docs,triaged,enhancement

Including creating the appropriate PyCapsule (pycapsule stuff seems to not be part of standard? or not mentioned explicitly?) and if its destructor is needed.

I recently did this work to interop with ffmpeg and made two examples: 

1. https://github.com/vadimkantorov/pydlpack (relevant PyCapsule code here: https://github.com/vadimkantorov/pydlpack/blob/master/dlpack.py#L91)
2. https://github.com/vadimkantorov/readaudio

While memory management in this scenario is hard to do completely right, it still may be useful for the cases when full-blown PyTorch Extension would require learning Torch C++ API and working with C++.

cc @jlin27
Repository: vscode
Issue: Text fails to drop after dragging a little too far to the left of the first column
Labels: bug,editor-drag-and-drop

Drag and drop fails to drop if the cursor is too far to the left of the margin, even though the text insertion point cursor is flashing right where it needs to be.

You might say I should move the cursor closer to where I want to drop but a quick way to ensure text is dropped in column 1 is to move the mouse further to the left than it needs to be.

It is beyond frustrating to watch the text insertion point go right to where you want to drop text, then when you let the mouse button up nothing happens.  Then a whole re-selection process has to happen again.

Either the insertion point cursor should be hidden if the drop is not going to be honored, or - ideally - just allow the drop since there's nothing else over there to drop the text on.  Please make sure that if the insertion point cursor is showing, dragged text WILL drop.

Thanks.
Repository: go
Issue: x/pkgsite: select healthy DB per request
Labels: NeedsInvestigation,FeatureRequest,pkgsite

Currently, our service processes connect to a single DB on startup. If that DB enters a bad state while running, the process continues to run, serving 500s.

Instead, we should pick from a set of healthy DBs on each request.
Repository: go
Issue: misc/wasm: incorrectly checks for require("fs") validity
Labels: NeedsInvestigation

When loaded, `wasm_exec.js` tries to know on which platform it is run. "fs" is loaded if not already available and check if it is empty (when using webpack to provide an empty implementation) or not (when running inside node). The check is wrongly implemented as `Object.keys` returns an array of key, not a count, thus making that check always true, and unable to use with webpack.

The line in question
https://github.com/golang/go/blob/c4fed25553ee266ed9cb3a98e7a33a82af110ed4/misc/wasm/wasm_exec.js#L31

Which can be easily fixed by adding a `.length` after the `Object.keys(fs)`.
Repository: opencv
Issue: Some Questions about EfficientDet
Labels: category: dnn,needs investigation

Really appreciate for your work about adding the EfficientDet to Opencv4.4
I'm trying to use that for detecting some objects on my own dataset but I have some questions.
First,I used the official EfficientD3 model to familiar with the process, I follow the steps which you provided
It is successful to detect objects in coco datasets such as dog and person
Next,I trained a EfficientD3 on my own dataset follow the EfficientDet tutorial, It can detect correctly by EfficientDet code,but when I use opencv to read that,it detect nothing, I have changed the confThreshold to 0.2 or 0.1,it can have some result but totally wrong.
And I compare the official model's result ouput by official code and opencv , i found it have a bit different.
After review the official code and opencv steps,i have some questions about that:
1.In opencv,it just convert the [0,255] input image to [0,1],using setInputScale(1/255),but in the official the img also to be devide by scale([0.229, 0.224, 0.225]) .Is this step have already included in the net.detect() API?if not,how can I do that manually.I have tried to do the preprocess before input it into the net ,but it reports error:
cv2.error: OpenCV(4.4.0) D:\Build\OpenCV\opencv-4.4.0\modules\dnn\src\dnn.cpp:371: error: (-215:Assertion failed) image.depth() == blob_.depth() in function 'cv::dnn::dnn4_v20200609::blobFromImages'
I think it mean that it can just input Uint8 img not float
2. In the opencv official step,it not uses net.setInputSwapRB(True),but when using opencv to read image,it will be bgr order.And in the efficientdet official code,it use PIL.Image to read img,it is RGB order. I'm confused.
3. In the official code,when the input image size is not equal to seting,it will crop and resize.But in the opencv steps,i don't found where to do the crop,it just resize . Is crop process already include in net.detect() API?
4.When I generate the pbtxt using tf_text_graph_efficientdet.py,it need me to set the num_classes.I feel uncertain about that.Should I set it to 1 if just have one class or set to 2 according to the efficientdet code？
That‘s all my questions.Looking forward to your answers.Thanks so much!
Repository: pytorch
Issue: Tracing a[b] records converting b to fixed device type of a
Labels: oncall: jit

## 🐛 Bug

## To Reproduce

Steps to reproduce the behavior:

```
def x(a, b):
    a[b]
    return b

a = torch.tensor([3.3])
b = torch.tensor([0])
f = torch.jit.trace(x, [a, b])
print(f(a, b).device)
print(f(a.cuda(), b.cuda()).device)
```

Output:
cpu
cpu


## Expected behavior

Expected output:
cpu
cuda

## Environment

 - PyTorch Version (e.g., 1.0): trunk
 - OS (e.g., Linux):
 - How you installed PyTorch (`conda`, `pip`, source): fbsource
 - Build command you used (if compiling from source):
 - Python version:
 - CUDA/cuDNN version:
 - GPU models and configuration:
 - Any other relevant information:



cc @suo @gmagogsfm
Repository: pytorch
Issue: Exclusive flag in torch.cumsum
Labels: triaged,function request

## 🚀 Feature
A nice feature in tf.math.cumsum is having an ``exclusive" flag. For instance:
` tf.cumsum([a, b, c], exclusive=True)  => [0, a, a + b].
`
Somehow pytorch does not have this feature if I am correct. It would be nice to have it as I think it is useful (e.g. to learn the index of position with padding on the left).
Repository: flutter
Issue: ShowTimePicker should allow selecting specific minutes in a single tap 
Labels: framework,f: material design,f: date/time picker,c: proposal,has reproducible steps,P3,found in release: 3.3,found in release: 3.6,team-design,triaged-design

Please clone this repository created just for this issue to see the problem yourself: https://github.com/Albert221/flutter_time_picker_issues

You cannot select a minute that's not dividable by 5 easily in `showTimePicker`!

### Steps to reproduce

1. Call `showTimePicker`.
2. Select random hour (to get to the minutes ring).

Now let's say I want to select 43rd minute. I click somewhere between `40` and `45`. `45` is selected, not as I wanted. I cannot easily tap on the minute I want, I have to firstly drag my finger on the printed minute AND ONLY THEN drag it to the minute in-between that I wanted.

[Link to a GIF showing that.](https://imgur.com/08UN60b)

```
[√] Flutter (Channel dev, 1.21.0-1.0.pre, on Microsoft Windows [Version 10.0.19041.388],
    locale pl-PL)
    • Flutter version 1.21.0-1.0.pre at D:\flutter
    • Framework revision f25bd9c55c (2 weeks ago), 2020-07-14 20:26:01 -0400
    • Engine revision 99c2b3a245
    • Dart version 2.9.0 (build 2.9.0-21.0.dev 20bf2fcf56)
```
Repository: pytorch
Issue: record_function no longer appears in the docs
Labels: module: docs,triaged

## 📚 Documentation

<!-- A clear and concise description of what content in https://pytorch.org/docs is an issue. If this has to do with the general https://pytorch.org website, please file an issue at https://github.com/pytorch/pytorch.github.io/issues/new/choose instead. If this has to do with https://pytorch.org/tutorials, please file an issue at https://github.com/pytorch/tutorials/issues/new -->

Latest: https://pytorch.org/docs/stable/autograd.html (no record_function)
V1.4: https://pytorch.org/docs/1.4.0/autograd.html (record_function documented)

cc @jlin27