sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Re-implement `Optimizer.__repr__`
Labels: module: optimizer,triaged,needs design,module: python frontend

## 🚀 Feature

The `Optimizer.__repr__` implementation (originally added in https://github.com/pytorch/pytorch/issues/4362) does not adhere to what `__repr__` is supposed to be, instead, it's more appropriate for `__str__`.

## Motivation

[See this SO answer on the difference.](https://stackoverflow.com/a/2626364)

~~This is useful for debugging, as debuggers typically call `__repr__` instead of `__str__` to show the current variable values. Since non-terminal debugger environments typically have only one line available (e.g PyCharm's in-code values or the "Debugger variables" window"), the current output is unreadable.~~

## Pitch

Convert the existing `__repr__` implementation to `__str__`.

Write a new, unambiguous, `__repr__` implementation, for example:

```python
def __repr__(self) -> str:
    groups = [
        {k: v for k, v in sorted(group.items()) if k != "params"}
        for group in self.param_groups
    ]
    return f"{self.__class__.__name__}(groups={groups})"
```

so we have:

```python
>>> repr(adam)
Adam(groups=[{'amsgrad': False, 'betas': (0.9, 0.999), 'eps': 1e-08, 'lr': 0.001, 'weight_decay': 0}])
```

instead of what master currently shows:


```python
>>> repr(adam)
Adam (
Parameter Group 0
    amsgrad: False
    betas: (0.9, 0.999)
    eps: 1e-08
    lr: 0.001
    weight_decay: 0
)
```

## Alternatives

Keep it as is.

## Additional context

This came up during a clean-up of the `Optimizer` wrapper we use in PyTorch Lightning for us to hook into our internal machinery: https://github.com/PyTorchLightning/pytorch-lightning/pull/10224/files#r738871980

cc @vincentqb @jbschlosser @albanD
Repository: rust
Issue: Tracking issue for `#![feature(rustdoc_internals)]`
Labels: T-rustdoc,C-tracking-issue,requires-nightly,S-tracking-perma-unstable

It'll group features that aren't meant to be stabilized like [`doc_keyword`](https://github.com/rust-lang/rust/issues/51315) and [`doc_primitive`](https://github.com/rust-lang/rust/issues/88070).
Repository: pytorch
Issue: Expose the `OptState` in `torch.cuda.amp.GradScaler`
Labels: feature,triaged,module: amp (automated mixed precision)

## 🚀 Feature

Add a read-only property for users to know what's the current state of the scaler

## Motivation

Having access to the state of each optimizer is very useful for advanced users of scaling. It's also advantageous for testing purposes of libraries that add scaling integration.

## Pitch

```python
class GradScaler:
    @property
    def state(self, optimizer: Optimizer) -> OptState:
        return self._per_optimizer_states[id(optimizer)]["stage"]
```

or

```python
class GradScaler:
    @property
    def state(self, optimizer: Optimizer) -> str:
        return self._per_optimizer_states[id(optimizer)]["stage"].name
```

This addition is also useful for the reason described in #67590 

## Alternatives

Make `self._per_optimizer_states` public.

## Additional context

We are accessing the protected attribute in PyTorch Lightning for test purposes:

https://github.com/PyTorchLightning/pytorch-lightning/blob/2b24be2e451af55e05f51c214a2803ff9c11c261/tests/plugins/test_amp_plugins.py#L93-L94

https://github.com/PyTorchLightning/pytorch-lightning/blob/2b24be2e451af55e05f51c214a2803ff9c11c261/tests/trainer/optimization/test_manual_optimization.py#L441-L442


cc @mcarilli @ptrblck
Repository: flutter
Issue: [Proposal] FocusableActionDetector class should have HitTestBehavior similar to GestureDetector
Labels: framework,f: gestures,c: proposal,f: focus,P3,team-framework,triaged-framework

I need to logout user if he is inactive for certain time in Flutter Web Application. 

I could achieve this by wrapping my application in FocusableActionDetector class and reset a timer every time user interacts with the app. After period of inactivity, timer fires and logs user out. 

This is possible if FocusableActionDetector class had translucent behavior similar to that for the GestureDetector.
Repository: create-react-app
Issue: FAST_REFRESH reports true when in production
Labels: issue: proposal,needs triage

Noticing that CRA reports FAST_REFRESH as being true in production builds.  Not sure if it should be.


![FAST_REFRESH_env](https://user-images.githubusercontent.com/1139657/139555715-cd23df97-da07-4ed7-a086-999c57c69ffe.png)
Repository: youtube-dl
Issue:  Could you please add support for 365datascience.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 2021.06.06. 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 **2021.06.06**
- [ 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://learn.365datascience.com/courses/introduction-to-microsoft-excel/excel-made-easy-a-beginner-s-guide-to-excel-spreadsheets/
- Playlist: https://learn.365datascience.com/courses/preview/introduction-to-microsoft-excel/


## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->
Requires a login; free to register. till 18.11 has a free month. Would be great to have support for this site for downloading videos.
Repository: realworld
Issue: [Feature Request]: Add ability for users to destroy/delete their account on front + backend
Labels: v2 changelog

### Relevant Scope

Front + Backend specs

### Description

Would be another good test of some DB cascading action. Also a low cost source of slightly greater realism.

### Describe the solution you'd like

_No response_

### Describe alternatives you've considered

_No response_
Repository: realworld
Issue: [Feature Request]: Delete tag when there are no more articles with that tag
Labels: v2 changelog

### Relevant Scope

Backend specs

### Description

Currently there are no test that tags without any articles should be removed I think, but that is visible on `/api/tags`.

The nicer behavior would be to delete the tags when they are not needed anymore to not clutter the server.

I would just add a test for that under https://github.com/gothinkster/realworld/blob/78c4efa9d40763e5c8f988c297630cdde2194f4d/api/Conduit.postman_collection.json#L1864 or https://github.com/gothinkster/realworld/blob/78c4efa9d40763e5c8f988c297630cdde2194f4d/api/Conduit.postman_collection.json#L2188

Part of the problem is that some of the tests appear to expect a non-clean server, so the full tag list might be unknown, so the tags test doesn't really seem to assert a precise test list.

I recommend that we just drop this philosophy, and instead focus on testing in a clean test environment always, with a controlled tag list.

My initial motivation for this is to help keep a demoserver data limited. But I don't want to cron delete things, I'd rather "delete if there are too many and a new one is added" basis.

Implementing it in SQL properly also requires LOCKing which would serve as a valuable example.

### Describe the solution you'd like

_No response_

### Describe alternatives you've considered

_No response_
Repository: rust
Issue: Followup from #83174
Labels: A-diagnostics,A-borrow-checker,T-compiler

Things I'm planning to follow up on once #83174 is merged:

- https://github.com/rust-lang/rust/pull/83174#discussion_r733079602
Repository: pytorch
Issue: Feature request: set_grad_enabled(*mods_or_params) as a safe context manager
Labels: feature,module: autograd,module: nn,low priority,triaged

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->
```py
with model.requires_grad_as(False):
	z = model(x)
# x has grad recorded as usual
# model.parameters() do not
# At context manager exit, all parameters in model are restored to their original requires_grad values
```

## Motivation

<!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->
Useful for models that freeze/unfreeze different parts conditionally.

## Pitch

<!-- A clear and concise description of what you want to happen. -->

Maybe (untested):
```py
@contextmanager
def requires_grad_as(mod: nn.Module, mode: bool):
    old_modes = [param.requires_grad for param in mod.parameters()]
    for param in mod.parameters():
		param.requires_grad_(mode)
	yield mod
	for mode, param in zip(old_modes, mod.parameters()):
		param.requires_grad_(mode)
```

## Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->
Function is put in `torch` and takes the model (or list of models) as an argument. E.g. `with torch.set_grad_enabled(modules or parameters...)` as extensions of the current function. Same for `set_grad_disabled`. 

## Additional context

<!-- Add any other context or screenshots about the feature request here. -->
This isn't totally safe. But if someone is using this API, they'd probably know to keep an eye out for parts of the forward pass that might change `requires_grad` inside the context.


cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7 @mruberry @jbschlosser @walterddr
Repository: rust
Issue: `f32` and `f64` `powf` NaN handling should be documented
Labels: T-libs-api,A-docs,C-bug,A-floating-point

The `f32` and `f64` `powf` methods follow the IEEE 754-2008 recommendations for NaN handling, but these are quite surprising. For example, `f64::powf(1.0, f64::NAN)` returns `1.0`, not `f64::NAN`. This behavior should be documented.

The current docs don't mention NaN at all, which leads one to assume that any argument being NaN would produce a NaN result, like arithmetic operations. But these are not the standard behavior for `powf`.

This was mentioned in #60468, which links a playground illustrating the exceptions.
Repository: TypeScript
Issue: Symlink not resolved on relative imports
Labels: Bug

# Bug Report

Hi, I'm using PNPM and try import to something from 'node_modules' for reusing singleton. But the resolving mechanism seems doesn't work well with using the symlink.

Thers is real propject video demosrationg:

https://user-images.githubusercontent.com/1303154/138014608-e9f1e289-3361-41d8-a132-fe52d31dd4c3.mov

### 🔎 Search Terms

pnpm, node_modules, symmlink

### 🕗 Version & Regression Information

pnpm: 5.18.7
tsc: 4.4.4

### ⏯ Reproduction

There is a reproducible repo: 

**https://github.com/zheeeng/test-pkgs-baz**

### 💻 Code

Let's take a look at the monorepo files:

Foo package:

```ts
export type Foo = {
    method: () => string,
    str: string,
    num: number,
}

export const foo: Foo = {
    method () { return 'foo' },
    str: 'foo',
    num: 42,
}
```

Bar package:

```ts
import type { Foo } from 'test-pkgs-foo'

export interface Bar extends Foo {
    nil: null
}

export const bar: Bar = {
    method: () => 'bar',
    str: 'bar',
    num: 41,
    nil: null,
}
```

Baz package:

```ts
// **please toggle this comment:**
// import 'test-pkgs-bar'

import { Bar } from './node_modules/test-pkgs-bar'

const bar: Bar = {
    nil: null,
}
````

The comment above influences the referencing result, how to make sure the `Foo` type will be referenced well in `Bar` package?

### 🙁 Actual behavior

`Bar` type lost the `Foo` type part, coz the resoving failed.

### 🙂 Expected behavior

`Bar` type should mixed with `Foo` type and its own structure
Repository: create-react-app
Issue: React create-react-app errors, npm audit fix and npm install
Labels: stale,needs triage

If you have a general question about Create React App or about building an app with Create React App we encourage you to post in GitHub Discussions instead of this issue tracker. The maintainers and other community members can provide help and answer your questions there: https://github.com/facebook/create-react-app/discussions

If you're looking for general information on using React, the React docs have a list of resources: https://reactjs.org/community/support.html

If you've discovered a bug or would like to propose a change please use one of the other issue templates.

Thanks!
Repository: vscode
Issue: Git - The git branch name is garbled   in vscode status bar
Labels: bug,help wanted,git

Issue Type: <b>Bug</b>

Using chinese word 優惠  for git branch name 
the "惠"  will show garbled  and cause git push / pull not work
but the word(優惠) is correct  in .git/config or git-graph  

VS Code version: Code 1.61.2 (6cba118ac49a1b88332f312a8f67186f7f3c1643, 2021-10-19T15:03:09.437Z)
OS version: Darwin arm64 21.1.0
Restricted Mode: No

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Apple M1 (8 x 24)|
|GPU Status|2d_canvas: enabled<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>oop_rasterization: enabled<br>opengl: enabled_on<br>rasterization: enabled<br>skia_renderer: disabled_off_ok<br>video_decode: enabled<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|2, 2, 2|
|Memory (System)|16.00GB (0.11GB free)|
|Process Argv|--crash-reporter-id 79f9f017-29a5-4e7c-bc0a-82b8ff466857|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (19)</summary>

Extension|Author (truncated)|Version
---|---|---
gopium|1pk|1.5.0
vscode-perl|cfg|1.18.0
gitlens|eam|11.6.1
go|gol|0.29.0
solidity|Jua|0.0.134
git-graph|mhu|1.30.0
vscode-language-pack-zh-hant|MS-|1.61.5
python|ms-|2021.11.1347845452-dev
vscode-pylance|ms-|2021.10.3
jupyter|ms-|2021.9.1101343141
jupyter-keymap|ms-|1.0.0
jupyter-renderers|ms-|1.0.3
remote-containers|ms-|0.202.5
cpptools|ms-|1.7.1
perl|ric|2.3.0
perltidy|sfo|1.3.3
vscode-todo-highlight|way|1.0.5
local-history|xyz|1.8.1
vscode-proto3|zxh|0.5.4


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythontb:30283811
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
vsccppwtct:30382698
bridge0708:30335490
pygetstartedt3:30385195
dockerwalkthru:30377721
bridge0723:30353136
pythonrunftest32:30373476
pythonf5test824:30373475
javagetstartedt:30364666
pythonvspyt187:30373474
vsqsis200cf:30386380
vsaa593cf:30376535
vssld246cf:30386378

```

</details>

<!-- generated by issue reporter -->
Repository: pytorch
Issue: torch.kthvalue (and maybe torch.quantile) should support argument descending/largest (=True) like topk/sort
Labels: feature,triaged,module: sorting and selection

This is needed to compute some quantile value for keeping only highest scores/objects (maybe torch.quantile would benefit from `descending` as well)

Real-world example of such need: https://github.com/NVlabs/wetectron/blob/master/wetectron/modeling/roi_heads/box_head/inference.py#L146-L148 in postprocessing object detections

Also, a bit unfortunate, PyTorch has two different names for the same concept: `descending` and `largest`
Repository: pytorch
Issue: unnecessary warning with autocast 
Labels: triaged,module: amp (automated mixed precision)

Using autocast like this
```python3
with autocast(enable=(False if device=='cpu' else True)):
    pass
```
When I'm using `device='cpu'`, autocast should be disabled. However, it still raise warning, 
```
.../python3.9/site-packages/torch/autocast_mode.py:141: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
  warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')
```
which I think should be suppressed when `enable=False`.  The code lies at

https://github.com/pytorch/pytorch/blob/97f29bda59deab8c063cf01f0a8ff4321b93c55e/torch/autocast_mode.py#L162


cc @mcarilli @ptrblck
Repository: vscode
Issue: Extension provided tasks are not recognized in workspace settings file only in .vscode/launch.json (for instance)
Labels: bug,debug

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
Version: 1.61.2
Commit: 6cba118ac49a1b88332f312a8f67186f7f3c1643
Date: 2021-10-19T14:58:13.605Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.11.0-38-generic snap

Provided tasks from extension are not recognized when told to launch in a preLaunchTask from the "workspace" configuration file. However, if a launch.json is provided in the .vscode/ folder, with the `"preLaunchTask": "someTaskExtensionProvides"` then it works. 

There seems to be no documentation anywhere that describes the difference here or what I need to do, to expose my provided task to be recognized from the workspace configuration file.
Repository: flutter
Issue: Flutter google maps web memory leak 
Labels: p: maps,platform-web,package,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,has partial patch,team-web,triaged-web

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a performance problem, then fill out the template below.
     Please read our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Details

<!--
1.  Please tell us exactly how to reproduce the problem you are running into, and how you measured the performance.

2.  Please attach a small application (ideally just one main.dart file) that
     reproduces the problem. You could use https://gist.github.com/ for this.

3.  Switch flutter to master channel and run this app on a physical device
     using profile or release mode. Verify that the performance issue can be
     reproduced there.

     The bleeding edge master channel is encouraged here because Flutter is
     constantly fixing bugs and improving its performance. Your problem in an
     older Flutter version may have already been solved in the master channel.
-->

<!--
     Please tell us which target platform(s) the problem occurs (Android / iOS / Web / macOS / Linux / Windows)
     Which target OS version, for Web, browser, is the test system running?
     Does the problem occur on an emulator/simulator as well as on physical devices?
-->

**Target Platform:*Web*
**Target OS version/browser:*Browser*
**Devices:**

## Logs
- Can't clear google maps view in flutter web every time I create new Google maps view the app use more memory. appear that the old created map is not disposed or cleared. somehow is still there.
I found an issue already open but on the ios devices.
<details>

<summary>Logs</summary>
<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
```

<!-- Finally, paste the output of running `flutter doctor -v` here, with your device plugged in. -->

```
```

</details>
Repository: go
Issue: crypto/md5: remove assembly cores
Labels: Performance,NeedsInvestigation

crypto/md5 has a series of assembly cores, all looking pretty much the same and very similar to the generic code.

The generic code looks like something that should intrinsify well, and the assembly doesn't use any special platform instructions as far as I can tell.

https://github.com/golang/go/blob/2ebe77a2fda1ee9ff6fd9a3e08933ad1ebaea039/src/crypto/md5/md5block.go

MD5 is broken and obsolete, so ideally we'd reduce the complexity budget we spend on it over time.

If we can get the generic code within 80% of the performance of the assembly, I'd be happy to remove the cores.
Repository: PowerToys
Issue: [Image Resizer] Option to reorder presets and/or show presets as buttons instead of a drop-down
Labels: Idea-Enhancement,Product-Settings,Area-User Interface,Product-Image Resizer

### Description of the new feature / enhancement

Right now the presets are shown in a drop-down in the order they were created and the top preset is shown as default when opening the resizer. If the users adds new preset it is at the bottom. To change the order all presets have to be deleted and entered again.

It would be useful to be able to reorder the presets in the options, so that the most-wanted preset is on top.  

Alternatively or additionally the presets could be shown as buttons instead of entries in a drop-down list when using the application.

### Scenario when this would be used?

every time the user wants to select a different preset.

### Supporting information

_No response_