sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Implement `signum()` on unsigned integers
Labels: T-libs-api,C-feature-request

This can be quite useful when writing macros that are generic over any integer.

For example, I just tried writing this code (bar is any of i8, i16, i32, u8, u16, u32 via a macro)

```rust
match (foo.signum(), bar.signum()) {
    (1, 1) | (-1, -1) => max,
    (-1, 1) | (1, -1) => min,
    _ => zero,
}
```

But because `u*::signum` isn't implemented, I had to resort to something far more verbose:

```rust
if foo > 0 {
    if bar > 0 {
        max
    }
    else if bar < 0 {
        min
    }
    else {
        zero
    }
} else if foo < 0 {
    if bar > 0 {
        min
    }
    else if bar < 0 {
        max
    }
    else {
        zero
    }
} else {
    zero
}
```

This can be simplified a bit, but at the expense of performing the operations more than once. This might be optimized away, though.

```rust
if (foo > 0 && bar > 0) || (foo < 0 && bar < 0) {
    max
} else if (foo > 0 && bar < 0) || (foo < 0 && bar > 0) {
    min
} else {
    zero
}
```

To allow for the first example to compile (along with the rest of the code, of course), I'd think having `u32::signum` return `i32` would make sense, despite returning `-1` being impossible. I definitely think using `signum` makes things clearer and more readable.

If this is something that is desired, I can submit a PR.
Repository: go
Issue: cmd/compile: binaries contain many ..type.eq funcs
Labels: NeedsInvestigation,binary-size,compiler/runtime

We have a meta bug for binary size (#6853), but as one specific item:

Go binaries contain many ..type.eq funcs to support == on types at runtime.

The compiler & linker could probably omit provably unneeded ones. Or even do some with slower reflect if they're large & unlikely to be needed at runtime.

Background:
* https://twitter.com/bradfitz/status/1255704982893912064, 
* https://go-review.googlesource.com/c/go/+/231118 (http)
* https://go-review.googlesource.com/c/net/+/231119 (http2)
* https://go-review.googlesource.com/c/go/+/231239 (runtime)
Repository: godot
Issue: set_script() fails if target node has no parent or if node is root sometimes
Labels: bug,topic:gdscript

**Godot version:**
v3.2.1.stable.official

**OS/device including version:**
Windows 10 Home, version 1903, build 18362.778

**Issue description:**
```set_script()``` doesn't work if it's **(1)** called on a node that has been added as a child in a script or if it's **(2)** being called on the root node by a child (created in a script) of the root node. I haven't tested the second part on anything except for the root node, so it might be a broader issue. I've also only tested with a Spatial root node and a Node child node. The first of these problems has a workaround: just add the child after setting the script. The second problem seems to happen as long as the child node was created a script (or at least the root/parent node's initial script), so there's no workaround that I'm aware of.

**Steps to reproduce:**
<details>
<summary><b>(1)</b> Calling set_script() on a Node That Has Been Added as a Child:</summary>
<p>
&emsp;<b>1.</b> Add a Spatial root node and give it a script<br/>
&emsp;<b>2.</b> In the script's _ready(), create a new Node,  add it as a child of the Spatial node, and set the new Node's script to the second script (we will write it in the next step) (make sure everything happens in that order)<br/>
&emsp;<b>3.</b> In the second script's _ready(), print something out to see if it ran
</p>
</details>
<details>
<summary><b>(2)</b> Calling set_script() on the Root Node in the Script of a Node Created by a Script:</summary>
<p>
The same first 2 steps except, in the second step, the new Node is added as a child after the script is set:<br/>
&emsp;<b>1.</b> Add a Spatial root node and give it a script<br/>
&emsp;<b>2.</b> In the script's _ready(), create a new Node, set the new Node's script to the second script (we will write it in the next step), and add it as a child of the Spatial node (make sure everything happens in that order)<br/>
&emsp;<b>3.</b> In the second script's _ready(), print something out to see if it ran, get the parent node (this will return the original Spatial node) and set its script to the third script:<br/>
&emsp;<b>4.</b> In the third script's _ready(), print something out to see if it ran
</p>
</details>

**Minimal reproduction project:**
Each example has its own scene. I've included two working examples to show that the first problem doesn't occur when the new Node is added as a child after the script is set and that the second problem doesn't occur when the new Node is added in the editor as opposed to being added by a script.
[set_script() Issue Examples.zip](https://github.com/godotengine/godot/files/4562384/set_script.Issue.Examples.zip)
Repository: go
Issue: reflect: can't call methods on StructOf with embedded interface field
Labels: NeedsInvestigation,compiler/runtime

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version devel +4c78d54fdd Thu Apr 30 22:06:07 2020 +0000 darwin/amd64

Same behavior with:

$ go version
go version go1.14.2 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mitchellh/Library/Caches/go-build"
GOENV="/Users/mitchellh/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY="github.com/mitchellh,github.com/hashicorp"
GONOSUMDB="github.com/mitchellh,github.com/hashicorp"
GOOS="darwin"
GOPATH="/Users/mitchellh/code/go"
GOPRIVATE="github.com/mitchellh,github.com/hashicorp"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.2_1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.2_1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/xj/vc6mm2px1x5745hbvfpxkx5h0000gn/T/go-build768892661=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

Use `reflect.StructOf` with one field with an embedded interface and then attempt to call a method on that interface (with a non-nil value set). https://play.golang.org/p/GwTyV_AFWv6

Note that using an embedded struct (not an interface) works fine: https://play.golang.org/p/jVFT3pcw7ia

### What did you expect to see?

The function to be called and the result shown: "42".

Or, if this isn't supported, a panic probably.

### What did you see instead?

A segfault.
Repository: create-react-app
Issue: Failed to load plugin '@typescript-eslint' declared in '.eslintrc » eslint-config-react-app#overrides[0]': Cannot find module 'typescript'
Labels: issue: needs investigation,issue: bug report

### Describe the bug

When I run `eslint: lint whole folder` task, it fails because of the error mentioned in the title.

### Did you try recovering your dependencies?

Yes, I did.

### Which terms did you search for in User Guide?

The issue is not related to any of them, it's ESLint.

### Environment

```
Environment Info:

  current version of create-react-app: 3.4.1
  running from C:\Users\X\AppData\Roaming\npm\node_modules\create-react-app

  System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
  Binaries:
    Node: 12.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Users\X\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.4 - C:\Users\X\AppData\Roaming\npm\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
    Internet Explorer: Not Found
  npmPackages:
    react: ^16.13.1 => 16.13.1
    react-dom: ^16.13.1 => 16.13.1
    react-scripts: ^3.4.1 => 3.4.1
  npmGlobalPackages:
    create-react-app: Not Found
```

### Steps to reproduce

Just run `eslint: lint whole folder` task.

This is my ESLint config:
```json
{
  "extends": [
    "react-app",
    "airbnb",
    "prettier"
  ],
  "env": {
    "mocha": true,
    "es6": true,
    "commonjs": true,
    "browser": true
  },
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaVersion": 2020,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true,
      "modules": true,
      "experimentalObjectRestSpread": true
    }
  },
  "plugins": [
    "prettier"
  ],
  "rules": {
    "no-underscore-dangle": "off",
    "class-methods-use-this": "off",
    "import/no-extraneous-dependencies": [
      "error",
      {
        "devDependencies": true
      }
    ]
  }
}
```

### Expected behavior

It should not throw exceptions.

### Actual behavior

It throws the above exception.

### Reproducible demo
Repository: go
Issue: cmd/compile: more compact initialization of maps with dynamic content
Labels: NeedsInvestigation,binary-size,compiler/runtime

Iooking into the size of `unicode.init` I found that the optimization to init maps from arrays of keys and values with a for loop instead of making an mapassign call for each key/value doesnt trigger for the maps in package unicode because the values are variables and not static. 

The allowed types for this optimization were already expanded before and it seems there is room to go further.
https://go-review.googlesource.com/c/go/+/66050/

Writing a prototype compiler CL allowing `ONAME` to also be used as a value and marking value arrays used for initialization as dynamic and not readonly (when ONAME is present) cuts the size of unicode.init roughly in half (saves 8kb currently). A hello world binary gains a 4kb size reduction.

I dont see yet see a problem with side effects if all keys are static and all values are either ONAME or statics.

Unfortunately since the values in the unicode case are pointers there are still a lot of gcwritebarrier entries that bloat the init function. There seems more room to make unicode.init smaller by optimizing the init func generation.

@josharian @randall77 @bradfitz
Repository: frp
Issue: [feature request] Add client count metrics broken down by name in prometheus metrics
Labels: proposal

Currently, it is not possible to see which clients are online in a dashboard.

There is currently this:
https://github.com/fatedier/frp/blob/23bb76397a0484485a16e1a3e990385b13ee388d/models/metrics/prometheus/server.go#L58-L63

Which is an integer of the total amount of clients connected to frps. But I wish that there could be another metric `clients` that shows the total amount of clients by name. So if I have a service/client like this:
```
# frpc.ini
[my-cool-client]
...
```

Then I would see in `ip_address:7500/metrics`:

> \# HELP frp_server_client_counts The current client counts of frps
> \# TYPE frp_server_client_counts gauge
> frp_server_client_counts 1
> **\# HELP frp_server_clients The current clients of frps broken down by name
> \# TYPE frp_server_clients gauge
> frp_server_clients{name="my-cool-service"} 1**
> \# HELP frp_server_connection_counts The current connection counts
> \# TYPE frp_server_connection_counts gauge
> frp_server_connection_counts{name="my-cool-service",type="tcp"} 1
> frp_server_connection_counts{name="ssh",type="tcp"} 0

Note the **bolded**, which are what I would like to achive.

TL;DR: I'm trying to replicate the dashboard page in grafana and I would like to know which clients are online, not how many clients are online.

![image](https://user-images.githubusercontent.com/6134511/80794852-34306500-8b9b-11ea-8c15-1f184612da2e.png)

but the prometheus `/metrics` page doesn't.

I would love to help by submitting a PR but I have never worked with `golang` so I'm afraid I wont be with too much help.
Repository: excalidraw
Issue: Debounce/set interval to syncing in collaborative mode
Labels: discussion,collaboration

If you start drawing diagrams and do frequent rotations / resizing/ moving shapes, it leads to at least 8-10 seconds and even goes to 15-20 seconds lag. Also, cursor sync takes good amount of bandwidth.

I tried adding debounce of around 30ms and it takes way less bandwidth compared to current state and I didn't notice any lag as well.
should we try that out?

Any other thoughts on optimizing?
Repository: youtube-dl
Issue: arteradio.com
Labels: site-support-request

## 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.03.24. 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.03.24**
- [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

episode link: https://www.arteradio.com/son/61663819/bookmakers_alice_zeniter_1_3
series/playlist link: https://www.arteradio.com/serie/bookmakers

## Description
There’s already a scraper for arte.tv fwiw: https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/arte.py
Repository: angular
Issue: fix(elements): fix type signature of `NgElementStrategy#get/setInputValue()`
Labels: type: bug/fix,breaking changes,area: elements,state: confirmed,P4

Currently, the [type signature][1] of `NgElementStrategy#setInputValue()` specifies that the second `value` argument should be of type `string`.

https://github.com/angular/angular/blob/49be32c9315a5c7ff155c5b88191e504006f595b/packages/elements/src/element-strategy.ts#L32-L33

This is true when setting the property based off of an HTML attribute value, but is not correct when the property is set on the element (where it can have any value). The `getInputValue()` signature is correct, specifying that a value of type `any` is returned.

We can fix the type signature of `setInputValue()` with `value: any` or with `value: unknown` (and the equivalent change for `getInputValue()`'s return value). The former is non-breaking, but may cover type errors. The latter is preferrable from a typings standpoint, but is a breaking change.

##
For context, this was attempted in #36114 (see commit 8795214d40f94737a698c93c5531e8d276c8e8bf). See relevant discussions [here][1] and [there][2]. However, more investigation was required to determine the impact of the change, which was outside the scope of #36114.

See, also, https://github.com/angular/angular/pull/36114#issuecomment-622378247 for some preliminary results.

[1]: https://github.com/angular/angular/pull/36114#discussion_r416748651
[2]: https://github.com/angular/angular/pull/36114#pullrequestreview-402274167
Repository: pytorch
Issue: Remove everything from a GPU (including drivers)
Labels: module: cuda,triaged,enhancement

## 🚀 Feature
Hi, it seems that once one send a Tensor to the GPU memory, it is not possible to release the memory usage of the GPU back to zero. 
example:
```python
import torch
tm = torch.Tensor([1,2]).to("cuda")
!nvidia-smi

|===============================+======================+======================|
|   0  GeForce RTX 208...  On   | 00000000:3D:00.0 Off |                  N/A |
|  0%   37C    P2    52W / 250W |    730MiB / 10989MiB |      0%      Default
```
So I use 730MiB...
Now no matter what I try I can not make the 730MiB go to zero:
```python
del tm                                                                                                                                                                                                 
torch.cuda.empty_cache()                                                                                                                                                                               
import sys;sys.modules[__name__].__dict__.clear()                                                                                                                                                      
%reset                                                                                                                                                                                                 
Once deleted, variables cannot be recovered. Proceed (y/[n])? y
!nvidia-smi
|   0  GeForce RTX 208...  On   | 00000000:3D:00.0 Off |                  N/A |
|  0%   35C    P8     1W / 250W |    728MiB / 10989MiB |      0%      Default |
```


## Motivation
I am building an agile algorithm that uses a changing amount of GPUs, increasing and decreasing the number of GPUs that are needed. It constantly checked for free GPUs, but it seems that I can not really free a GPU after I already sent an object to the GPU. Also, I am not the only one that uses the machine, so if I don't need a GPU anymore I would like it to show zero MEM so other users will use this GPU.

## Pitch
Well, it would be great if there was a command - torch.cuda.release_device(device=..)

See also - https://discuss.pytorch.org/t/how-totally-remove-data-and-free-gpu/79272


cc @ngimel
Repository: godot
Issue: ArrayMesh created in separate Thread loses surfaces when passed to `call_deferred()`
Labels: enhancement,topic:core,topic:rendering,documentation

**Godot version:**
v3.2.1, master branch

**OS/device including version:**
Windows 10 (1909)

**Issue description:**
ArrayMesh created by SurfaceTool.commit() in a separate Thread, loses its Surfaces when passed back to MainThread as a argument using call_deferred().

**Steps to reproduce:**
1. Create a separate Thread
2. Create a ArrayMesh in this thread using the SurfaceTool
3. Pass the ArrayMesh as argument to a method using call_deferred()
4. Set the mesh in an MeshInstance and call MeshInstance.create_trimesh_collision()
5. Get Errors saying that mesh.surfaces.size() equals 0

BONUS: 
* if you add `print(mesh.surfaces.size())` directly after SurfaceTool.commit() (see minimal reproduction on line 86, it solves the problem. But why?

**Minimal reproduction project:**
In the reproduction project the "Visible Collision Shapes"-Option is activated.
If you run the project there are no Collision Shapes visible. If you uncomment the print statement on line 88 the collision shapes are visible.
[no-mesh-surfaces-deffered-minimal-reproduction.zip](https://github.com/godotengine/godot/files/4564782/no-mesh-surfaces-deffered-minimal-reproduction.zip)
or [ProceduralTerrain.gd](https://gist.github.com/dardanbujupaj/f91dc8c0fd8a79bdd50ead6350de05d1)
Repository: create-react-app
Issue: Improve release process
Labels: issue: proposal,needs triage

### Is your proposal related to a problem?

As a contributor, I see three places how contributing can be less frustrating:

1. Release bug fixes in a patch release.
2. Release fixes from the pull request sooner.
3. If it is not possible, give explain the problem to the contributor.

My recent small [bugfix PR](https://github.com/facebook/create-react-app/pull/8768) can be an example.

### Describe the solution you'd like

As the first suggestion, we can add a rule to always create a branch for major release development. Seems like 4.x development happened in `master` and was a reason why several PRs waited for a month for release.

### Describe alternatives you've considered

But as a person outside of the project, I can miss something. What is the longest step in the current release process? Or maybe there are some psychological blockers (like afraid of multiple issues if patch release will break anything)?
Repository: TypeScript
Issue: Leading JSDoc `*` in type expression incorrectly parsed
Labels: Bug,Domain: JSDoc

I tried the following snippet

```js
/**
 * @typedef {
 *   import('../src/index.js').FakeCloudwatchLogs
 * } FakeCloudwatchLogs
 */
```

This did not compile with

```
test/index.js:11:6 - error TS1005: '}' expected.

11  *   import('../src/index.js').FakeCloudwatchLogs
        ~~~~~~

```

Removing the `*` and writing

```js
/**
 * @typedef {
     import('../src/index.js').FakeCloudwatchLogs
 * } FakeCloudwatchLogs
 */
```
Does compile.

I am using typsecript 3.8.3

There is a related issue

 - https://github.com/microsoft/TypeScript/pull/26528
 - https://github.com/microsoft/TypeScript/issues/26846
 - https://github.com/microsoft/TypeScript/issues/23667
Repository: TypeScript
Issue: checkJS + JSDoc + inline d.ts syntax
Labels: Suggestion,Awaiting More Feedback

## Search Terms

jsdoc, interface, import, inline, d.ts file, checkJs

## Suggestion

Improve the user experience for checkJS users. Currently TypeScript checkJS supports 99% of the use cases of TypeScript and that's an amazing feat as it stands.

The support for `@typedef` with `import(...)` helps a lot !

It would be amazing if there was support for something like `@tsdeclare`

```js
// foo.js
/**
 * @tsdeclare {
 * import type {
 *     LogStream
 * } from 'aws-sdk/clients/cloudwatchlogs';
 *
 *  interface Dictionary<T> {
 *    [key: string]: T | undefined;
 *  }
 * }
 */

class FakeCloudwatchLogs {
  constructor () {
    /** @type {Dictionary<LogStream[]>} */
    this.rawStreams = {}
  }
}
```

If I could declare statements that are valid in a `foo.d.ts` file but instead inline in my javascript file withing a `@tsdeclare` block.

This is very similar to https://github.com/microsoft/TypeScript/issues/9694#issuecomment-409158590 but it's even smaller in scope.

The scope of the `@tsdeclare` block is only about importing types and declaring interfaces and other non trivial types that can then be used in the file.

Actually annotating types of javascript symbols is left for `@param` ; `@type` & `@returns` etc.

The `@tsdeclare` is a more powerful version of `@typedef`

## Use Cases

I want to check my JavaScript files with TypeScript and I am currently declaring type definitions and interfaces in a `foo.d.ts` file next to my JS file.

## Examples

I want to use this for declaring `interface` in a JS file.

The existing approach requires two files, a js file and a `.d.ts` file.

https://github.com/microsoft/TypeScript/issues/9694#issuecomment-500619014

I know that its possible to split the code across two files. with more advanced types in a `d.ts` file but that's a frustrating user experience of splitting the documentation of my code across two files.

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).