sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Type the tagName string property of Element derivations to aid overloading and for discriminated unions
Labels: Suggestion,In Discussion

## Search Terms

tagName, nodeName

## Suggestion

Typing the tagName property in lib.dom.d.ts for Element and derivations ( or only concrete derivations and a discriminated type alias of these )
e.g 
interface SVGGElement extends SVGGraphicsElement {
    //..existing definition
    tagName:"g"
}

## Use Cases

Simpler to write overloads, overloaded by single argument type ( order does not matter )
Discriminated Unions


## Examples

interface SVGCircleElement{
    tagName:"circle"
}
interface SVGGElement{
    tagName:"g"
}
interface SVGRectElement{
    tagName:"rect"
}

Without above order matters with overload
adopt(node: SVGGElement): G;//issue with this before circle overload
adopt(node: SVGCircleElement): Circle;

With above and
type SVGTestUnionType=SVGCircleElement|SVGRectElement;



function(circleOrG:SVGTestUnionType){
switch(circleOrG.tagName){
  case "circle":
    //circle members available 
    break;
  case "rect":
  //rect members available
  break;
}
}

## Checklist

My suggestion meets these guidelines: YES
* [ ] This wouldn't be a breaking change in existing TypeScript / JavaScript code
* [ ] This wouldn't change the runtime behavior of existing JavaScript code
* [ ] This could be implemented without emitting different JS based on the types of the expressions
* [ ] This isn't a runtime feature (e.g. new expression-level syntax)
Repository: pytorch
Issue: [pytorch][feature request] Cosine distance / simialrity between samples of own tensor or two tensors
Labels: module: nn,triaged,module: numpy,function request,module: distance functions

## Issue description
This issue came about when trying to find the cosine similarity between samples in two different tensors. To my surprise `F.cosine_similarity` performs cosine similarity between pairs of tensors with the same index across certain dimension. I was expecting something like:

http://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.cosine_similarity.html

that is, a cosine similarity measure across all pairs of samples.
I can't really see the use cases of the current implementation of `F.cosine_similarity`. Since it is the special case of getting the diagonal of what I describe or using `F.pairwise_distance` with an extra normalize parameters. Perhaps would be nice to know what are the use cases for the current implementation.

In order to mantain  compatibility, I suggest creating an `F.cosine_distance` function and layer similar to:

https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.cosine.html

which operates in tensors, similar to the sklearn implementation
http://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.cosine_distances.html

I don't think this is difficult to implement btw

## Code example
```
def cosine_distance(x1, x2=None, eps=1e-8):
    x2 = x1 if x2 is None else x2
    w1 = x1.norm(p=2, dim=1, keepdim=True)
    w2 = w1 if x2 is x1 else x2.norm(p=2, dim=1, keepdim=True)
    return 1 - torch.mm(x1, x2.t()) / (w1 * w2.t()).clamp(min=eps)
```
Example:
```
>>> m1 = torch.tensor([[0, 1],
                   [0, 1]], dtype=torch.float64)
>>> cosine_distance(m1, m1)
tensor([[0., 0.],
        [0., 0.]], dtype=torch.float64)
>>> cosine_distance(m1)
tensor([[0., 0.],
        [0., 0.]], dtype=torch.float64)
>>> m2 = torch.tensor([[1, 0],
                   [0, 1]], dtype=torch.float64) 
>>> cosine_distance(m1, m2)
tensor([[1., 0.],
        [1., 0.]], dtype=torch.float64)
>>> m3 = torch.tensor([[0, 0],
                   [0, 0]], dtype=torch.float64)
>>> cosine_distance(m3)
tensor([[1., 1.],
        [1., 1.]], dtype=torch.float64)
>>> cosine_distance(m3, m3)
tensor([[1., 1.],
        [1., 1.]], dtype=torch.float64)
```
Creation of the layer from here is straight forward. if you think this might be a good idea I would like to make a PR

cc @albanD @mruberry @rgommers @heitorschueroff
Repository: rust
Issue: Incremental compilation fails when a generic function uses a private symbol
Labels: A-linkage,T-compiler,C-bug

The way that incremental compilation works breaks code that uses private symbols. For example, the following code will fail to compile when using incremental compilation (e.g. the default `cargo build`), but will build successfully when incremental compilation is disabled (e.g. the default `cargo build --release`):

```rust
// I have reproduced this issue for the following targets:
// mips-unknown-linux-gnu
// x86_64-unknown-linux-gnu
// x86_64-apple-darwin
// aarch64-apple-ios
fn foo<T>() {
    // See m:<mangling> at https://llvm.org/docs/LangRef.html#data-layout
    // This is only reproducible when using ELF, Mips, or Mach-O mangling.
    #[cfg_attr(all(target_os = "linux", not(target_arch = "mips")),
               export_name = "\x01.L_this_is_a_private_symbol")]
    #[cfg_attr(any(target_os = "macos", target_os = "ios"),
               export_name = "\x01L_this_is_a_private_symbol")]
    #[cfg_attr(target_arch = "mips", export_name = "\x01$_this_is_a_private_symbol")]
    static X: usize = 0;

    // Use the static symbol in a way that prevents the optimizer from
    // optimizing it away.
    unsafe { std::ptr::read_volatile(&X as *const _); }
}

fn main() {
    foo::<usize>();
}
```

Output (for both `cargo build` and `cargo build --release`):
```
$ cargo build
   Compiling zzz v0.1.0 (file:///private/tmp/zzz)
LLVM ERROR: unsupported relocation of undefined symbol 'L_this_is_a_private_symbol'
error: Could not compile `zzz`.

To learn more, run the command again with --verbose.
$ cargo build --release
   Compiling zzz v0.1.0 (file:///private/tmp/zzz)
    Finished release [optimized] target(s) in 0.26s
```

I have reproduced this issue for the following targets:
- `mips-unknown-linux-gnu`
- `x86_64-unknown-linux-gnu`
- `x86_64-apple-darwin`
- `aarch64-apple-ios`

I'm interested in fixing this issue, and have been trying to better understand [`librustc_mir/monomorphize/partitioning.rs`](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/monomorphize/partitioning.rs) (which I assume is where the problem is). I'll update this issue if I've made any progress, but I would appreciate any guidance anyone might be able to offer.

These private symbols are useful for low-level FFI work (e.g. the linker on macOS/iOS will deduplicate selector names only if they have a private symbol name).
Repository: godot
Issue: Label clip_text clips content
Labels: bug,confirmed,topic:gui

**Godot version:** 3.1alpha 19d5789

**Issue description:** A label with `clip_text` set to true clips its children. I would expect `clip_text` to only clip the text itself, and `Control.clip_content` to be the one responsible for children visibility. Here's an example with a color_rect as the label's child (drawing below parent), `clip_text` enabled on the right.

![image](https://user-images.githubusercontent.com/35355161/45002961-00a6cd00-afab-11e8-9fec-7efdee035626.png)

edit: Just realized `clip_text` is subject to removal as as per #16863. Should I close this issue?
Repository: godot
Issue: Canvas Modulate should use light mask
Labels: enhancement,topic:rendering

Canvas modulate can be thought of as a light that applies uniformly to everything in 2D. It would be helpful, if you could apply it to some nodes, but not others based on the light mask.
Repository: go
Issue: x/mobile: application freeze after resumed from suspend state on iOS
Labels: mobile

Please answer these questions before submitting your issue. Thanks!


### What version of Go are you using (`go version`)?

go version go1.8.1 darwin/amd64

### Does this issue reproduce with the latest release?
YES
### What did you do?

Git clone the [basic](https://godoc.org/golang.org/x/mobile/example/basic) example, change the lifecycle code to:
```
switch e.Crosses(lifecycle.StageAlive) {
	case lifecycle.CrossOn:
		glctx, _ = e.DrawContext.(gl.Context)
		onStart(glctx)
		a.Send(paint.Event{})
	case lifecycle.CrossOff:
		onStop(glctx)
		glctx = nil
	}
```
In the original code,  use `switch e.Crosses(lifecycle. StageVisible) ` to manage lifecycle, but this code will result in create/destroy gl resource each time the application resume/pause. In practical app, we should use `e.Crosses(lifecycle.StageAlive)`, but this will result in application freeze if app just resumed from suspend state in iOS. I have written a native iOS app with Obj-C/GLKView, but it doesn't have the problem, it must be a bug in gomobile .

(PS: Android will just lost glContext, I have created another [issue](https://github.com/golang/go/issues/26962) for Android).

### What did you expect to see?

The example don't freeze after resumed from suspend state on iOS.

### What did you see instead?

The example freezed.
Repository: angular
Issue: Pseudo-events do not work properly for different input languages
Labels: type: bug/fix,freq2: medium,area: core,core: event listeners,P3

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
</code></pre>

## Current behavior
I'm creating an event listener using Angular's pseudo-event: 
`@HostListener('window:keyup.control.q', ['$event'])`
But it's only working when user's keyboard input language is set to English. In all other cases it's not working.

## Expected behavior
It is expected that pseudo-events will use event.code, which is not dependent on user's input language. So in case of Russian language selected `event.key === 'й'` but `event.code === 'KeyQ'`, so I still able to handle hotkeys properly.


## Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/angular-gitter-u3nhhd

## What is the motivation / use case for changing the behavior?
I18n support


## Environment

<pre><code>
Angular version: 6.0.2
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- [x] Chrome (desktop) version 68
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version 61
- [x] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  <!-- run `node --version` -->
- Platform:  <!-- Mac, Linux, Windows -->

Others:
<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->
</code></pre>
Repository: go
Issue: proposal: crypto/tls: add support for AES-CCM
Labels: Proposal,Proposal-Hold,Proposal-Crypto

Hi! I am working in a project that requires `AES-CCM` cipher suite within TLS. I know that `crypto/tls` aims to support a limited safe subset of TLS. But since TLS 1.3 will only support the following cipher suites:

TLS_AES_128_GCM_SHA256 
TLS_AES_256_GCM_SHA384
TLS_CHACHA20_POLY1305_SHA256
TLS_AES_128_CCM_SHA256
TLS_AES_128_CCM_8_SHA256

Reducing that list from 5 to only 3 choices seems pretty unfair. 

I've seen some working golang `AES-CCM` implementations around github. Is there any specific reason why this cipher suite is not included?

Thanks!

Update:
Another option could be to port the code from BoringSSL: https://github.com/google/boringssl/blob/master/crypto/cipher_extra/e_aesccm.c

/cc @FiloSottile @agl
Repository: rust
Issue: Regression on nightly since LLVM 8 upgrade: `thread` sanitizer doesn't compile anymore
Labels: A-LLVM,T-compiler,A-sanitizers

Hi, the [fuzzer](https://crates.io/crates/honggfuzz) I maintain is failing to build on the latest nightlies:

The interesting part of the error log seems to be:
```
note: /usr/bin/ld: __sancov_guards has both ordered [`__sancov_guards' in /home/travis/build/rust-fuzz/honggfuzz-rs/example/hfuzz_target/x86_64-unknown-linux-gnu/release/deps/example-934b6185f6a63e31.example.ajs5tmgw-cgu.0.rcgu.o] and unordered [`__sancov_guards' in /home/travis/build/rust-fuzz/honggfuzz-rs/example/hfuzz_target/x86_64-unknown-linux-gnu/release/deps/example-934b6185f6a63e31.example.ajs5tmgw-cgu.0.rcgu.o] sections
          /usr/bin/ld: final link failed: Bad value
          collect2: error: ld returned 1 exit status
```

You can find the full log here:
https://travis-ci.org/rust-fuzz/honggfuzz-rs/jobs/424079778

I bisected on my computer the exact rust version that fails and it seems to be related to the LLVM 8 upgrade.

This version works well:
```
# rustup default nightly-2018-09-01
# rustc -vV
rustc 1.30.0-nightly (aaa170beb 2018-08-31)
binary: rustc
commit-hash: aaa170bebe31d03e2eea14e8cb06dc2e8891216b
commit-date: 2018-08-31
host: x86_64-unknown-linux-gnu
release: 1.30.0-nightly
LLVM version: 7.0
```

This version doesn't:
```
# rustup default nightly-2018-09-02
# rustc -vV                                                                                                                             Tue 04 Sep 2018 02:25:07 PM CEST
rustc 1.30.0-nightly (28bcffead 2018-09-01)
binary: rustc
commit-hash: 28bcffead74d5e17c6cb1f7de432e37f93a6b50c
commit-date: 2018-09-01
host: x86_64-unknown-linux-gnu
release: 1.30.0-nightly
LLVM version: 8.0
```
Repository: go
Issue: x/build/cmd/gopherbot: ignore versions in other paragraphs of backport requests
Labels: Builders,NeedsFix,FeatureRequest,Backport

In https://github.com/golang/go/issues/27486#issuecomment-418350497, I attempted to set up a backport issue for Go 1.11. However, apparently because I mentioned “from 1.9 or 1.10” in the justification, `gopherbot` constructed a backport issue for 1.10 too.

I think we should make `gopherbot` ignore versions that are separated from the first version in the comment by any punctuation other than a comma. (However, we should be careful not to stop after a period that appears as part of a version string.)

So, for example:
`@gopherbot, p—— backport to Go 1.11: this is a regression from 1.9.` should backport to 1.11 only.
`@gopherbot, p—— backport to Go 1.11, and possibly 1.10: this is a bad runtime bug.` should backport to both 1.11, 1.10.

(CC @FiloSottile )
Repository: TypeScript
Issue: Quick info for parameter redundantly shows @param tag
Labels: Suggestion,Committed,Domain: Quick Info

**TypeScript Version:**  3.1.0-dev.20180830

**Code**

```ts
/**
 * @param p
 * Once upon a time there was a parameter named p.
 * P lived in a function called f.
 * Then a big bad wolf came and blew f down.
 */
function f(p: number): void {}
```

**Expected behavior:**

Documentation for `p` is shown only once.

**Actual behavior:**

Documentation is shown twice -- once as the normal documentation (good), once as documentation for the `@param` tag which is redundant since we took the documentation from there. This doubles the size of the quick info.

![param](https://user-images.githubusercontent.com/19274678/45046727-e52fd680-b02b-11e8-8d34-a7562eb55926.jpg)
Repository: javascript-algorithms
Issue: Add TimSort
Labels: enhancement

Chrome 70 Array.prototype.sort  use the stable TimSort algorithm

https://twitter.com/mathias/status/1036626116654637057
Repository: tensorflow
Issue: Optimizing slice of variable not possible
Labels: stat:awaiting tensorflower,type:bug,comp:ops,TF 2.11

Applying the gradient of a variable slice currently results in a `NotImplemented` error of tf.train.Optimizer.

**The following two examples are working:**
```python
### WORKING ###
X = tf.Variable(2, dtype=tf.float32)
y = tf.constant(10, dtype="float32")
loss = y - (X*X)

variables=[X]
gradient = tf.gradients(loss, variables)
gradient = [(g, v) for g, v in zip(gradient, variables)]
train_op = tf.train.AdamOptimizer().apply_gradients(gradient)
```

```python
### WORKING ###
big_X = tf.Variable([2,3,4], dtype=tf.float32)
X = big_X[0]
y = tf.constant(10, dtype="float32")
loss = y - (X*X)

train_op = train_op = tf.train.AdamOptimizer().minimize(loss)
```

**The following example throws an error:**
```python
### NOT WORKING ###
big_X = tf.Variable([2,3,4], dtype=tf.float32)
X = big_X[0]
y = tf.constant(10, dtype="float32")
loss = y - (X*X)

variables=[X]
gradient = tf.gradients(loss, variables)
gradient = [(g, v) for g, v in zip(gradient, variables)]
train_op = tf.train.AdamOptimizer().apply_gradients(gradient)
```
The error:
```
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py", line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-22-10282dee2005>", line 10, in <module>
    train_op = tf.train.AdamOptimizer().apply_gradients(gradient)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/optimizer.py", line 605, in apply_gradients
    update_ops.append(processor.update_op(self, grad))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/optimizer.py", line 189, in update_op
    raise NotImplementedError("Trying to update a Tensor ", self._v)
NotImplementedError: ('Trying to update a Tensor ', <tf.Tensor 'strided_slice_9:0' shape=() dtype=float32>)
```
------------------------

### System information
- **Have I written custom code (as opposed to using a stock example script provided in TensorFlow)**: yes
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Ubuntu 18.04
- **Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device**: NA
- **TensorFlow installed from (source or binary)**: binary
- **TensorFlow version (use command below)**: v1.10.1-0-g4dcfddc5d1 1.10.1
- **Python version**: 3.6.5
- **Bazel version (if compiling from source)**: NA
- **GCC/Compiler version (if compiling from source)**: NA
- **CUDA/cuDNN version**: NA
- **GPU model and memory**: NA
- **Exact command to reproduce**: NA
Repository: go
Issue: x/build/cmd/gopherbot: backport issues should retain topic labels of original
Labels: Builders,NeedsFix

GopherBot created https://github.com/golang/go/issues/27498 from a source issue that had the labels “Documentation” and “modules”, but did not carry over those labels.

It makes sense for GopherBot to strip out status labels (such as NeedsFix), but I think it should retain the others.

(CC: @FiloSottile)
Repository: TypeScript
Issue: Generic types from JSDoc aren't really generic
Labels: Bug,Domain: JSDoc,Domain: JavaScript

```js
/**
 * @constructor
 * @template {string} K
 * @template V
 */
function Multimap() {
    /** @type {Object<string, V>} TODO: Remove the prototype from the fresh object */
    this._map = {};
};

var Ns = {}
/** @type {Multimap<"a" | "b", number>} */
const map = new Multimap();
const n = map._map['hi']
```

**Expected behavior:**
`n: number`

**Actual behavior:**
`n: any` in 3.0; `n: V` in 3.1-dev.

Types resolved from functions are never properly generic, even that function has `@template`-specified type parameters; they're only special-cased in a few places to produce a specific instantiation of a type. They should use the normal generic type machinery that Typescript does.
Repository: flutter
Issue: Allow giving custom radius to InkHighlight
Labels: c: new feature,framework,f: material design,P2,team-design,triaged-design

As seen in [this line of the ink_highlight.dart](https://github.com/flutter/flutter/blob/5b5a5b82286923f52225320f5e9fc9f558838c05/packages/flutter/lib/src/material/ink_highlight.dart#L109), Material.defaultSplashRadius is used as a constant in painting the highlight.

This makes users unable to make their own IconButtons similar to those seen in the play store.

It also makes InkResponse look terrible when using any other radius than the default one.
(Exaggerated here)
![Closeup of an inkresponse acting wierdly, the highlight is tiny, while the radius is huge](https://i.imgur.com/ED41ERI.png)

Example in the play store:
![Image of the play store's account page, the search button is highlighted, and it is smaller than the appbar](https://cdn.discordapp.com/attachments/408312522521706496/486636085166997549/Screenshot_2018-09-04-22-35-57-921_com.android.vending.png)
<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
```
Repository: react
Issue: "scheduler" package umbrella
Labels: Type: Umbrella,React Core Team

### Short term
- [x] #13561: Replace the [`__getInteractionsRef` and `__getSubscriberRef` methods](https://github.com/facebook/react/blob/fb88fd9d8c9f72b8e2e7e1ae89652d2a6a707562/packages/schedule/src/Tracking.js#L84-L90) with direct ~~mutable~~ exports  (`__interactions` and `__subscriber`)  and [update the `ScheduleTracking` UMD fork](https://github.com/facebook/react/blob/master/packages/shared/forks/ScheduleTracking.umd.js).
- [x] #13561: Remove `__getInteractionsRef` and `__getSubscriberRef` from the `schedule/tracking` UMD [dev](https://github.com/facebook/react/blob/master/packages/schedule/npm/umd/schedule-tracking.development.js) and [prod](https://github.com/facebook/react/blob/master/packages/schedule/npm/umd/schedule-tracking.production.min.js) bundles since it's not part of the public API.
- [x] Fix interaction-tracking reference count bug (#13574)
- [ ] Split subscriptions entry point apart from tracking (e.g. break `scheduler/tracking` into `scheduler/tracking` and `scheduler/subscriptions`)

### Long term
- [ ] Move `scheduler` to is own git repo (maybe even its own org) prior to a 1.0 release.
- [ ] Enable it to be used without a build step by replacing the dev/prod check with a single export.
- [ ] Add an ES module entry point as well as the CJS and UMD entry points
Repository: flutter
Issue: Add "namespace" prefixes to embedder.h enum values
Labels: engine,e: embedder,P2,team-engine,triaged-engine

Since the embedding API header is C, not C++, there's no namespace or `enum class`. That means that enum values like "kSuccess" and "kCancel" are in the global namespace of any application using the header, making them very prone to collision and/or confusion.

They should ideally use a naming convention that makes them unique and easily identifiable. E.g., kFlutterResultSuccess, kFlutterPointerPhaseCancel.
Repository: flutter
Issue: Create integration/smoke test for Android & TalkBack
Labels: a: tests,team,a: accessibility,P2,team-android,triaged-android

For example, run through some non-trivial interactions in the gallery with semantics enabled and scan the system logs for exceptions specifically emitted through TalkBack. This will require a new addition to the device lab of a current generation Android device running the latest TalkBack. Ideally we could always run on the latest TalkBack version.