sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Use better tempfile creation mechanism to avoid skip windows test
Labels: module: tests,triaged

This is a follow up on #45917 - Previously we fixed test_serialization by 
* avoiding the usage of filename in torch.save/load;
* kept one specific test to validate both file descriptor and filename code path for torch.save/load

However per @malfet 's [comment](https://github.com/pytorch/pytorch/pull/46120#discussion_r503463075) we can also abstract out temp file creation step to support the last skipped unittest on windows.




cc @mruberry @VitalyFedyunin
Repository: TypeScript
Issue: [docs] Document the interaction between `Parameters` and the `this` parameter
Labels: Docs

**Code**

```ts
type T = (this: Date, foo: string) => void;
type P = Parameters<T>;
//=> type P = [foo: string]
```

The `this` parameter is ignored. I could not find any documentation about this. I think the docs should mention that the `this` parameter is ignored by `Parameters<>`.
Repository: flutter
Issue:  WebView widget isn't setting new user agent after rebuild on iOS
Labels: platform-ios,p: webview,package,a: production,P2,team-ios,triaged-ios

Hello there!

### Background
I'm using `webview_flutter` plugin latest version (`1.0.1`) on my app. I need to set the user agent of my web view using the package info of my app, hence I use `package_info` library to get the package info. As `package_info` gets the data asynchronously, I need to await the data to be ready and then set the package info data to a variable on my state and then rebuild the web view with the variable containing package info set as the user agent.

### The problem
Turned out the process happens so quick, and then I found that when the web view gets build and then rebuild again after a small amount of time interval, the last web view didn't use the user agent I set from the variable of my latest state. 

Eventhough from run console I could see that the user agent is set to my latest state, but from the analytics dashboard of my web page it showed that the user agent was still not set, even if I navigated to some other pages, the user agent was still not set to the variable of my latest state.

**This issue only happens on iOS.**

### Expected result
After I set state and the web view gets rebuild using user agent set from one of variable on my state, it should use the user agent from variable on my latest state.

### Reproduce steps
I tried to replicate the issue on the example file of `webview_flutter` plugin. Instead of await for `package_info` library process, I use `Future.delayed`. Something like:
```
class _WebViewExampleState extends State<WebViewExample> {
    String webViewUserAgent = '';

    ...

    Future<void> setUserAgentVariable() {
        Future.delayed(Duration(milliseconds: 5), () {
          setState(() {
            webViewUserAgent = 'flutterwebviewexampleios';
          });
        });
    }

    @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(

            // This AppBar title got updated with the latest state after rebuild
            title: Text(webViewUserAgent),
            actions: <Widget>[
              NavigationControls(_controller.future),
              SampleMenu(_controller.future),
            ],
          ),
          body: Builder(builder: (BuildContext context) {
            return WebView(
              initialUrl: 'https://yoururlhere.com/',
              javascriptMode: JavascriptMode.unrestricted,

              // This userAgent didn't get updated with the latest state after rebuild
              userAgent: webViewUserAgent,
              ...
```

If I set the `Future.delayed` duration to `Duration(seconds: 1)`, the issue won't happen. The more duration of delay I set, the less the issue is likely to happen.
Repository: pytorch
Issue: torch.mode when input has nans
Labels: module: docs,triaged,module: numpy,module: NaNs and Infs,module: sorting and selection,module: reductions

## 🐛 Bug

`torch.mode` has inconsisent behavior when the input contains nans:

* The torch [docs](https://pytorch.org/docs/stable/generated/torch.mode.html) do not say what the nan policy is, whereas the scipy [equivalent](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mode.html) lets the user decide
* On cpu, `torch.mode` acts like scipy's `nan_policy="omit"`
* On cuda, it gives a nonsense result

## To Reproduce

```python
def test(device):
    x = torch.rand(1000).mul(5).long().to(device)
    s = torch.bincount(x, minlength=5).argsort(descending=True)
    
    mode =  x.mode().values
    print(f'w/o nans, got {mode}, expected {s[0]}')

    y = x.clone().float()
    y[y == mode] = np.nan
    mode =  y.mode().values.long()
    print(f'w nans, got {mode}, expected {s[1]}')
```

When running `test("cpu")`, both lines always give the expected result:
```
In [17]: test('cpu')
w/o nans, got 3, expected 3
w nans, got 0, expected 0
```

whereas when running `test("cuda")`, the first line always gives the expected result, but the second line gives something seemingly random:
```
In [26]: test('cuda')
w/o nans, got 2, expected 2
w nans, got 4, expected 0
```

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment

Output of `collect_env.py`:
```
Collecting environment information...
PyTorch version: 1.6.0
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.3 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.10.2

Python version: 3.7 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: 10.0.130
GPU models and configuration:
GPU 0: TITAN RTX
GPU 1: TITAN RTX
GPU 2: GeForce RTX 2080 Ti
GPU 3: GeForce GTX 1080 Ti

Nvidia driver version: 440.64.00
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] msgpack-numpy==0.4.4.3
[pip3] numpy==1.16.1
[pip3] numpy-quaternion==2020.10.2.17.17.31
[pip3] numpy-stl==2.10.1
[pip3] torch==1.6.0
[pip3] torchvision==0.6.0
[conda] msgpack-numpy             0.4.4.3                  pypi_0    pypi
[conda] numpy                     1.16.1                   pypi_0    pypi
[conda] numpy-quaternion          2020.10.2.17.17.31          pypi_0    pypi
[conda] numpy-stl                 2.10.1                   pypi_0    pypi
[conda] torch                     1.6.0                    pypi_0    pypi
[conda] torchvision               0.6.0                    pypi_0    pypi
```



cc @brianjo @mruberry @rgommers @heitorschueroff @ezyang @gchanan @zou3519 @bdhirsh @ejguan @jlin27
Repository: youtube-dl
Issue: Site support request: gumroad.com
Labels: site-support-request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2020.09.20. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [X] I'm reporting a new site support request
- [X] I've verified that I'm running youtube-dl version **2020.09.20**
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that none of provided URLs violate any copyrights
- [X] I've searched the bugtracker for similar site support requests including closed ones


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

- Single video: https://gumroad.com/s/59bd0a45c6b12585318c698c03e4752d/kSlnXCva3zW8Ryu-u5hT4g==

## Description

In this example it is 1 single mp4 file if I inspect in my browser. In other cases it the file loads in chunked .ts and if I inspect browser I see a network request for something like https://gumroad.com/r/59bd0a45c6b12585318c698c03e4752d/kSlnXCva3zW8Ryu-u5hT4g==/index.m3u8 (FYI this will 404 on this specific video but other real videos work this way).

If i pass the m3u8 URL to youtube-dl it downloads the video fine, but I'd like to avoid having to inspect element and pass the URL like above.

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->
Repository: flutter
Issue: APK sha file should be moved to app specific storage.
Labels: platform-android,tool,P2,team-android,triaged-android

Currently the flutter tool stores a sha for each APK in '/data/local/tmp/sky.${apk.id}.sha1'. If the sha matches what the tool computes locally, the installation is skipped.

If the corresponding application is updated/removed/modified by the user, then the sha file can get out of sync with the application leading to staleness issues.

One possible solution is to place the sha file in the app specific storage so that it gets removed or replaced automatically if the application is modified.


https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/android/android_device.dart#L356
Repository: rust
Issue: Give a better error message for operator ? conversion with a lifetime mismatch
Labels: C-enhancement,A-diagnostics,A-lifetimes,A-borrow-checker,T-compiler,D-papercut

The following code:

```rust
struct MyError;

impl From<&'static str> for MyError {
    fn from(_e: &'static str) -> MyError {
        MyError
    }
}

fn throws(a: &str) -> Result<&str, &str> {
    Err(a)
}

fn func() -> Result<(), MyError> {
    let s = String::from("test");
    throws(&*s)?;
    Ok(())
}
```

Results in the error:

```
error[E0597]: `s` does not live long enough
  --> src/main.rs:15:14
   |
15 |     throws(&*s)?;
   |     ---------^-
   |     |        |
   |     |        borrowed value does not live long enough
   |     argument requires that `s` is borrowed for `'static`
16 |     Ok(())
17 | }
   | - `s` dropped here while still borrowed
```

I would have expected the message to point to the `?` as the source of the error instead of the argument. It seems it only happens when a conversion is needed but the lifetime is the only mismatch, because `impl<E> From<E> for MyError where E: AsRef<[u8]> + 'static` yields the same error.

Similar conversion issues (like changing the signature of `func` to `fn func() -> Result<(), &'static str>` or no appropriate conversion) usually point to the `?` as the culprit, like so:

```
error[E0515]: cannot return value referencing local variable `s`
  --> src\main.rs:25:16
   |
25 |     throws(&*s)?;
   |              - ^ returns a value referencing data owned by the current function
   |              |
   |              `s` is borrowed here
```

This came up in a [stack overflow post](https://stackoverflow.com/q/64321515/2189130) where it wasn't obvious the problem was coming from the error handling.
Repository: create-react-app
Issue: create react app without automatically installing node modules.
Labels: issue: proposal,needs triage

### Is your proposal related to a problem?
I want to use pnpm to to install dependencies to save some disk space and data download for packages i already have installed, but create-react-app automatically installs all the dependencies during project setup and there is currently no flag to stop it except hitting ctrl + c when it starts  installing which I guess may cause some problems if there are others tasks to perform after installing node_modules.

### Describe the solution you'd like
- Need a flag to NOT install dependencies but just make the setup and configuration files and ask user to run `npm install` or whatever package manager user likes to use.
OR
- add support for `pnpm` as `--use-pnpm`.
Repository: electron
Issue: Status Code in DownloadItem API
Labels: enhancement :sparkles:

Could we get the status code in the response of DownloadItem API? Because sometimes there is status other than 200 and we are getting only states e.g., "interrupted" and sometimes there is a JSON file of 0 bytes.

### Proposed Solution
It would be nice if we have a method e.g., `downloadItem.getStatus()`
Repository: go
Issue: runtime: selectgo need not  lock all the channels involved in the select 
Labels: Performance,NeedsInvestigation,compiler/runtime,Scalability

i read the select function:
```
func selectgo(cas0 *scase, order0 *uint16, ncases int) (int, bool) {
   ...
	// lock all the channels involved in the select
	sellock(scases, lockorder)

}
```

why we should lock  all the channels?
 i think lock one by one  when loop may be better , because it will quickly
Repository: terminal
Issue: Change tab colour automatically based on tab title text using preset regex in settings
Labels: Issue-Feature,Area-Extensibility,Product-Terminal

# Description of the new feature/enhancement

The ability to preset what colour a tab would be by what text is in the title of the tab.

I regularly have multiple tabs open to different servers but also multiple tabs open to the same server at the same time. An example tab bar could look like 

me@laptop, bob@serverA, bob@serverA, bob@serverB, bob@serverC

On top of that I regularly close and open tabs to 'serverA' or 'serverB' throughout the day. So the ability to choose a colour manually for an open tab is useful but the frequency I open and close tabs means it isn't very efficient.

I'd like to be able to put a setting in the settings file that is something like 

_"tabColours":
        {
              "serverA" : "red",
              "laptop" : "yellow",
              "server[B,C]" : "green",
        },_

Then when I open a new tab and connect to serverB, the tab would automatically switch to the colour green. If I disconnected from ServerB and the Terminal session title changed back to 'me@laptop' the tab colour would auto switch to the colour yellow from green.

# Proposed technical implementation details (optional)

Supporting regex pattern matching would be nice but even if it couldn't do that and was just basic static text matching would be good.
Repository: flutter
Issue: Add type-specific Clipboard methods
Labels: a: text input,c: new feature,platform-ios,c: proposal,P2,team-framework,triaged-framework

@justinmc As discussed in #60145...

Based on iOS 14's new [UIPasteboard APIs](https://developer.apple.com/documentation/uikit/uipasteboard), we need to add type-specific methods to Flutter's [Clipboard](https://api.flutter.dev/flutter/services/Clipboard-class.html) utility:

- `Clipboard.getImages`
Used most commonly in chat apps. Should implement `UIPasteboard` and `hasImages`. ([Docs](https://developer.apple.com/documentation/uikit/uipasteboard/1829411-hasimages)) 
- `Clipboard.getNumbers`
Used most commonly for auto-verifications. Should implement `UIPasteboard` and `detectPatterns`. ([Docs](https://developer.apple.com/documentation/uikit/uipasteboard/detectionpattern)) 
- `Clipboard.getStrings`
Used most commonly in journaling/editing apps. Should implement `UIPasteboard` and `hasStrings`. ([Docs](https://developer.apple.com/documentation/uikit/uipasteboard/1829416-hasstrings))
- `Clipboard.getUrls`
Used most commonly for deep-linking and auto-population of URLs. Should implement `UIPasteboard` and `hasURLs`. ([Docs](https://developer.apple.com/documentation/uikit/uipasteboard/1829410-hasurls))
Repository: electron
Issue: Add ICO icon support for shell.writeShortcutLink
Labels: enhancement :sparkles:,platform/windows

<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [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 for a feature request that matches the one I want to file, without success.

### Problem Description
<!-- Is your feature request related to a problem? Please add a clear and concise description of what the problem is. -->
I currently building WebCatalog (https://webcatalog.app). I need to create shortcut file (*.lnk) on Windows and set it icon to an ICO file.

### Proposed Solution
<!-- Describe the solution you'd like in a clear and concise manner -->
`shell.writeShortcutLink` currently only supports setting icon with DLL or EXE file path. It would be great to add support for ICO file path.

### Alternatives Considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
I currently using https://www.npmjs.com/package/windows-shortcuts for this purpose. Is it possible to port it to Electron?

### Additional Information
<!-- Add any other context about the problem here. -->
Repository: terminal
Issue: [Screen Reader-Command Palette]-Narrator focus is not in sync while navigating using arrow keys in suggestion list after searching for any command.
Labels: Issue-Bug,Area-UserInterface,Area-Accessibility,Product-Terminal,Priority-3,Impact-Compliance,HCL-E+D,Area-CmdPal,A11yWCAG,HCL-WindowsTerminal,A11yCO,A11ySev3

**User Experience:**
Users who rely on screen reader will not be able get the control info if narrator focus is not in sync with arrow keys

**Test Environment:**
App: Windows Terminal Preview
Feature: Command Palette
Screen Reader: Narrator
OS: Win 10 2004 Build (19041.508)

**Repro Steps:**
1.Open Windows terminal Preview app
2.Open Command Palette using shortcut (Ctrl+shift+p)
3.Search for any command in the search field
4.Navigate using arrow key in the suggestion list.
5.Verify whether narrator focus moves onto suggestion list when user press down arrow key to move onto suggestions

**Actual**:
Narrator focus is not in sync while navigating using arrow keys in suggestion list after searching for any command.

**Expected:**
Narrator focus should be  in sync while navigating using arrow keys in suggestion list after searching for any command so that screen reader can read the focused control info.

**MAS Reference:**
https://microsoft.sharepoint.com/:w:/r/teams/msenable/_layouts/15/WopiFrame.aspx?sourcedoc={b24201d1-2276-4471-8183-e1e5353031ad}
Repository: flutter
Issue: DropdownButton very slow on first opening
Labels: framework,f: material design,c: performance,a: quality,has reproducible steps,found in release: 3.3,found in release: 3.7,team-design,triaged-design

When using a DropdownButton for the first time, it is very slow, the opening of list takes around 3 seconds.
After that the dropdown opens immediately every time I try.

I think it takes very long to layout the items and later on they are cached? But it's only 30 items in my list? Even with 3000 items the delay seems to be the same, so not sure where it might come from.

Here's a minimal example, I just created a fresh flutter project with Android Studio and put this in the children array.

```
DropdownButton(
  hint: Text("XYZ"),
  value: 0,
  items: List<DropdownMenuItem>.generate(3000, (int index) => DropdownMenuItem(
    value: index,
    child: Text("Item "+index.toString()),
  )),
  onChanged: (value) {
    log(value.toString());
  },
),
```

Is that delay expected? Any solution like pre-rendering or loading the DropdownMenuItems on the fly instead of using toList()?
Repository: pytorch
Issue: Support "symmetric" reflection padding
Labels: module: nn,triaged,module: numpy,function request,module: padding,module: tensorflow

## 🚀 Feature

Currently `ReflectionPadNd` does *not* repeat the boundary pixels, as demonstrated by the docs:

```
>>> m = nn.ReflectionPad2d(2)
>>> input = torch.arange(9, dtype=torch.float).reshape(1, 1, 3, 3)
>>> input
tensor([[[[0., 1., 2.],
          [3., 4., 5.],
          [6., 7., 8.]]]])
>>> m(input)
tensor([[[[8., 7., 6., 7., 8., 7., 6.],
          [5., 4., 3., 4., 5., 4., 3.],
          [2., 1., 0., 1., 2., 1., 0.],
          [5., 4., 3., 4., 5., 4., 3.],
          [8., 7., 6., 7., 8., 7., 6.],
          [5., 4., 3., 4., 5., 4., 3.],
          [2., 1., 0., 1., 2., 1., 0.]]]])
```

According to the paper mentioned below, it would be very beneficial to use the `SYMMETRIC` variation that is already available in [tensorflow](https://www.tensorflow.org/api_docs/python/tf/pad) - I'm quoting the example from the linked page:

```
t = tf.constant([[1, 2, 3], [4, 5, 6]])
paddings = tf.constant([[1, 1,], [2, 2]])
# 'constant_values' is 0.
# rank of 't' is 2.
tf.pad(t, paddings, "CONSTANT")  # [[0, 0, 0, 0, 0, 0, 0],
                                 #  [0, 0, 1, 2, 3, 0, 0],
                                 #  [0, 0, 4, 5, 6, 0, 0],
                                 #  [0, 0, 0, 0, 0, 0, 0]]

tf.pad(t, paddings, "REFLECT")  # [[6, 5, 4, 5, 6, 5, 4],
                                #  [3, 2, 1, 2, 3, 2, 1],
                                #  [6, 5, 4, 5, 6, 5, 4],
                                #  [3, 2, 1, 2, 3, 2, 1]]

tf.pad(t, paddings, "SYMMETRIC")  # [[2, 1, 1, 2, 3, 3, 2],
                                  #  [2, 1, 1, 2, 3, 3, 2],
                                  #  [5, 4, 4, 5, 6, 6, 5],
                                  #  [5, 4, 4, 5, 6, 6, 5]]

```

I propose two ways in which this could be done: Either we extend `ReflectionPadXd()` with a `mode` argument, or alternatively we introduce `SymmetricPadXd()` as a separate class in `torch.nn`.

## Motivation

This is prompted by the paper [Mind the Pad -- CNNs can Develop Blind Spots](https://arxiv.org/abs/2010.02178v1) (Alsallakh et al, facebook AI), which investigated the behaviour of different padding methods and how some of them have a detrimental effect to the network.

## Pitch

Add a new method that pads an array `[1,2,3,4,5,6]` symmetically by repeating the boundary pixel  as `[2,1,1,2,3,4,5,6,6,5]` (unlike `ReflectionPadNd()` that does *not* repeat the boundary pixel: `[3,2,1,2,3,4,5,6,5,4]`).

## Alternatives

This behaviour can still be done using the current methods by first using a 1-pixel `ReplicationPadXd()` and add the `ReflectionPadXd()` after that, but it is quite cumbersome.

## Additional context

The *"symmetric padding"* is also popular in wavelet transforms or discrete convolutions, see e.g. [here](https://pywavelets.readthedocs.io/en/latest/ref/signal-extension-modes.html).


cc @albanD @mruberry @rgommers @heitorschueroff @ezyang