sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Allow returning types from functions
Labels: Suggestion,Awaiting More Feedback

## Search Terms

Not easily googleable because all the words are the same for extracting the function's return type.

export type from function, return type from function

## Suggestion

Make it possible to return a type from a function.

The type doesn't need to depend on the runtime values passed to the function, only on their types. This feature is just syntactic sugar.

Desired:

```typescript
const {decorated_fn, DecoratedFnParams} = decorate(fn);

declare const decorated_fn_params: DecoratedFnParams;
decorated_fn(decorated_fn_params);
```

Workaround:

```typescript
const decorated_fn = decorate(fn);
type DecoratedFnParams = DecoratedParams<typeof fn>;

declare const decorated_fn_params: DecoratedFnParams;
decorated_fn(decorated_fn_params);
```

Alternative syntax, since this only seems useful for functions that run once:

```typescript
import {decorated_fn, DecoratedFnParams} = decorate(fn);
```

(Shouldn't be a compatibility breaking change for the same reasons `import ... = require()` isn't).

## Use Cases

My case is decorating a class with multiple generic parameters. Currently I have to do this:

```typescript
interface Bar extends BaseBar {}
interface Baz extends BaseBaz {}
class Foo<Bar, Baz> extends BaseFoo {}

const DecoratedFoo = decorator(Foo);
type DecoratedFooBar = ExtractBar<DecoratedFoo>;
type DecoratedFooBaz = ExtractBaz<DecoratedFoo>;
```

But it could be just `const {DecoratedFoo, DecoratedFooBar, DecoratedFooBaz} = decorator(Foo);`

## 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).
Repository: kubernetes
Issue: Metrics Request: FS metrics such as Disk IO for PVCs
Labels: sig/storage,kind/feature,lifecycle/frozen

**What would you like to be added**:

Is it possible to extend `container_fs_io_time_seconds_total` and similar FS metrics for PVCs? I am not able to access metrics for any of the mounted PVC disks.
I can only access them via `node_disk_io_time_seconds_total` from node-exporter but there's no way to automatically map those to the container mounting the disk without some seriously manual process. I'm happy to contribute a fix for this with some guidance.

**Why is this needed**:
Monitoring disk IO is critical for several persistent workloads such as StatefulSets running in production environments.

Thank you!
Repository: tensorflow
Issue: CPU support for dilation rates larger than 1
Labels: stat:awaiting tensorflower,type:feature,comp:runtime


**System information**
- TensorFlow version (you are using): 1.13.1
- Are you willing to contribute it (Yes/No): Yes



**Describe the feature and the current behavior/state.**
Current behavior for a model we are training is that CPU training yields errors:
`tensorflow/core/common_runtime/executor.cc:624] Executor failed to create kernel. Invalid argument: Current libxsmm and customized CPU implementations do not yet support dilation rates larger than 1.
         [[{{node Train_1/Optimizer/TrainOperation/gradients/Conv2D_72_grad/Conv2DBackpropFilter}}]]
`

GPU training is successful. We would like to have parity between CPU and GPU train as not all developers have a local GPU host. This appears to be a documented issue but I could not find any mention of when it may be fixed or what may be blocking this issue. 

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/conv_grad_filter_ops.cc#L223

This is a feature request to complete the TODO mentioned in the above link. 

**Will this change the current api? How?**

**Who will benefit with this feature?**
Anyone that is trying to train on CPU for dilated convolutions
**Any Other info.**
Repository: rust
Issue: Where bounds are ignored as part of trait type parameters on an impl
Labels: C-enhancement,A-diagnostics,T-compiler,A-suggestion-diagnostics

Where bounds are ignored, but suggested by the compiler, when implementing trait objects with second order types.

A full example is available at: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d61ff8acea97a202e00ea6fc32def211

The bound on line 21 is ignored:

```rust
    <T as hyper::service::MakeService<&'a SC>>::Service: 'static,
```

but suggested (with inaccurate markers):

```
error[E0310]: the associated type `<T as hyper::service::make_service::MakeService<&SC>>::Service` may not live long enough
  --> src/lib.rs:10:32
   |
10 | impl<'a, T, SC, RC, F, OB, ME> hyper::service::MakeService<&'a SC>
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider adding an explicit lifetime bound `<T as hyper::service::make_service::MakeService<&SC>>::Service: 'static`...
note: ...so that the type `<T as hyper::service::make_service::MakeService<&SC>>::Service` will meet its required lifetime bounds
  --> src/lib.rs:10:32
   |
10 | impl<'a, T, SC, RC, F, OB, ME> hyper::service::MakeService<&'a SC>
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

In fact, in the example given, the error is repeated four times for good measure, in a standard `cargo build`.

The workaround is to add another type parameter to the function declaration - i.e. changing:

```rust
impl<'a, T, S, SC, RC, F, OB, ME> hyper::service::MakeService<&'a SC>
    for MakeService<T, RC>
where
    T: hyper::service::MakeService<
        &'a SC,
        ReqBody = hyper::Body,
        ResBody = OB,
        Error = hyper::Error,
        MakeError = ME,
        Future = F,
    >,
    <T as hyper::service::MakeService<&'a SC>>::Service: 'static,
```

to 

```rust
impl<'a, T, SC, RC, F, OB, ME> hyper::service::MakeService<&'a SC>
    for MakeService<T, RC>
where
    T: hyper::service::MakeService<
        &'a SC,
        ReqBody = hyper::Body,
        ResBody = OB,
        Error = hyper::Error,
        Service = S,
        MakeError = ME,
        Future = F,
    >,
    S: 'static,
```

which additionally requires duplicating any bounds on the inner type (i.e,
```rust
    type Service: Service<
        ReqBody=Self::ReqBody,
        ResBody=Self::ResBody,
        Error=Self::Error,
    >;
```

specified at https://docs.rs/hyper/0.12.25/src/hyper/service/make_service.rs.html#10-44).

This results in function declarations with large numbers of type parameters, and more complex bounds than is strictly necessary.
Repository: pytorch
Issue: caffe2/resnet50 assert in fetch_blob() when base_learning_rate = 0
Labels: caffe2

## 🐛 Bug

The MultiPrecisionSgdOptimizer used by the resnet50_trainer.py Caffe2 example avoids setting up a learning rate blob (doesn't call build_lr()) if the base_learning_rate is 0:

From `caffe2/python/optimizer.py`:

```
class MultiPrecisionSgdOptimizer(SgdOptimizer):
    def __init__(self, base_learning_rate=0.1, ...):
        super(MultiPrecisionSgdOptimizer, self).__init__(
            base_learning_rate=base_learning_rate,
...
        )

    def _run(self, net, param_init_net, param_info):
...
        if self.base_learning_rate == 0:
            return
...
        lr, _ = self.build_lr(
            net, param_init_net,
            base_learning_rate=-self.base_learning_rate,
            policy=self.policy,
            **(self.init_kwargs)
        )
```

But the resnet50_trainer.py example code tries to fetch the learning rate blob without regard for whether `base_learning_rate` was non-zero.

From `caffe2/examples/resnet50_trainer.py`:

```
def RunEpoch(...):
...
    learning_rate = workspace.FetchBlob(
        data_parallel_model.GetLearningRateBlobNames(train_model)[0]
    )
```

So at the end of a training epoch, if base_learning_rate was specified as 0, an assert / enforce fail occurs in fetch_blob() as the code tries to fetch a blob that doesn't exist:

```
$ python resnet50_trainer.py ... --base_learning_rate 0.0 ...
Traceback (most recent call last):
  File "resnet50_trainer.py", line 660, in <module>
    main()
  File "resnet50_trainer.py", line 655, in main
    Train(args)
  File "resnet50_trainer.py", line 563, in Train
    explog
  File "resnet50_trainer.py", line 209, in RunEpoch
    data_parallel_model.GetLearningRateBlobNames(train_model)[0]
  File "/.../lib/python2.7/site-packages/caffe2/python/workspace.py", line 356, in FetchBlob
    result = C.fetch_blob(StringifyBlobName(name))
RuntimeError: [enforce fail at pybind_state.cc:183] ws->HasBlob(name). Can't find blob: MultiPrecisionSgdOptimizer_0_lr_gpu0
```

I'd be happy to submit a PR for this, but not sure whether the better solution is to qualify the example's call to FetchBlob(), or just to assert (at the top of Train()) that the user specified a non-zero base_learning_rate.

I'd lean toward the assert as I don't see much value in a training run with LR = 0, but that leaves me wondering why the optimizer codes expects / special-cases 0 in the first place.

## To Reproduce

See above


## Expected behavior

Training should either proceed despite the (perhaps nonsense LR), or should fail in a way that more obviously indicates what's wrong.

## Environment

 - PyTorch Version (e.g., 1.0): 1.0.1
 - OS (e.g., Linux): Linux
 - How you installed PyTorch (`conda`, `pip`, source): locally-built conda package
 - Build command you used (if compiling from source):
 - Python version: any; confirmed with 2.7 and 3.6
 - CUDA/cuDNN version: 10.1 / 7.5
 - GPU models and configuration: V100
 - Any other relevant information:

## Additional context
Repository: youtube-dl
Issue: Site Support - ceknito.sk
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 2019.04.30. 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 **2019.04.30**
- [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://www.ceknito.sk/video/480877
- User: https://www.ceknito.sk/channel/Proxymo
- Single Video Metadata/Links: https://www.ceknito.sk/d/embed/001d/480877/info.xml


## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

This is apparently the first Slovakian video sharing site. It uses an Adobe Flash video player, and provides metadata in XML format.
Repository: godot
Issue: Saving a scene that has an animationTree node "working" mess up ragdoll setup on reload
Labels: bug,topic:editor,confirmed

**Godot version:**
v3.2.dev.custom_build.2931b4d

**OS/device including version:**
OS: Ubuntu 18.04.2

**Issue description:**
I noticed that every time I saved a scene of a character that has a ragdoll setup and an AnimationTree that is active with an animation running, close the scene and then reopen, the location of the physical bones it's all messed up as seen in [this video](https://streamable.com/yul38),
(in the video I keep switching back and forth between scenes to "disable" the rendering of joint constraints to see the physical bones setup)

**Minimal reproduction project:**
[testm2.zip](https://github.com/godotengine/godot/files/3129785/testm2.zip)
Repository: create-react-app
Issue: Allow import of built-in browser modules, i.e. std:kv-storage
Labels: tag: underlying tools,tag: new feature

# Should built-in browser modules be supported?

As it currently stands, CRA does not support built-in, standard library, browser modules and I haven't been able to find any information or discussion on future support for these modules (i.e. `std:kv-storage`).

If built-in modules are to ever be supported it would make sense to use polyfills as fallbacks. CRA could handle polyfilling those modules itself or allow developers to provide a mapping of built-in module names to fallbacks (i.e. a URL or a module in `node_modules/`).

### Is this a bug report?

Yes

### Environment

Browser: **Chrome v74** (you'll need this to import `std:kv-storage`)
Dev Environment: **Codesandbox** but the problem is everywhere
CRA version: **3.0.0**

### Steps to Reproduce

0. **Enable experimental web platform features on Chrome**
chrome://flags/#enable-experimental-web-platform-features
1. Create a new project with CRA
2. Attempt to import `storage` from `std:kv-storage` inside any js file (I used `/src/index.js`) like so:
```js
import { storage } from 'std:kv-storage';
```
3. Try to `console.log` the imported `storage` variable.
```js
console.log(storage);
```

### Expected Behavior

I expected the build to succeed by being able to identify that this import was referencing a built-in module because it was prefixed with `std:`, and, therefore, **not** attempt to find and bundle a module called `std:kv-storage` from `/node_modules/`.

Since it didn't build the application, this part never happened but I expected the `console.log(storage)` log the following to the console:
```js
StorageArea {}
```

### Actual Behavior

The build fails with the error:
```
Module not found: Can't resolve 'std:kv-storage'
```

### Reproducible Demo

CRA unsuccessful build repro:
https://codesandbox.io/s/4lw89q0l14?fontsize=14

Static example of importing `std:kv-storage`:
https://codesandbox.io/s/7m87rjjk90?fontsize=14
Repository: angular
Issue: Angular Elements  -  Will show ExpressionChangedAfterItHasBeenCheckedError when use variable in attribute
Labels: type: bug/fix,freq1: low,workaround2: non-obvious,area: elements,state: confirmed,P4

# 🐞 bug report

### Affected Package
The issue is caused by package @angular/elements 7.1.0

### Is this a regression?
 Yes, the previous version in 6.1.9  also existed.

### Description

popup-element is a custom element created by angular element. Just the same as Demo in angular document. https://angular.cn/guide/elements#example-a-popup-service


And I use popup-element like this:
```
<popup-element  [message]="'ww'"></popup-element>
```

Add this code to AppComponent html.

## 🔬 Minimal Reproduction
https://github.com/wszhi/angular-element-demo

## 🔥 Exception or Error
This error will be shown in console.
<pre><code>
ng:///AppModule/PopupComponent.ngfactory.js:8 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'null: undefined'. Current value: 'null: ww'.
    at viewDebugError (vendor.js:47267)
    at expressionChangedAfterItHasBeenCheckedError (vendor.js:47244)
    at checkBindingNoChanges (vendor.js:47416)
    at checkNoChangesNodeInline (vendor.js:51494)
    at checkNoChangesNode (vendor.js:51467)
    at debugCheckNoChangesNode (vendor.js:52362)
    at debugCheckRenderNodeFn (vendor.js:52294)
    at Object.eval [as updateRenderer] (ng:///AppModule/PopupComponent.ngfactory.js:12)
    at Object.debugUpdateRenderer [as updateRenderer] (vendor.js:52279)
    at checkNoChangesView (vendor.js:51302)
</code></pre>


## 🌍  Your Environment

**Angular Version:**

```
Angular CLI: 7.3.8
Node: 10.12.0
OS: darwin x64
Angular: 7.2.5
```

**Anything else relevant?**
In chrome browser Version 73.0.3683.103 (Official Build) (64-bit)
Repository: rust
Issue: Tracking issue for RFC 2645, "Transparent Unions" (formerly:  and Enums)
Labels: B-RFC-approved,T-lang,B-unstable,B-RFC-implemented,C-tracking-issue,S-tracking-design-concerns,A-repr

This is a tracking issue for the RFC "Transparent Unions and Enums" (rust-lang/rfcs#2645).

**Steps:**

- [x] Implement the RFC (cc @rust-lang/compiler  -- can anyone write up mentoring instructions?)
- [ ] Adjust documentation ([see instructions on forge][doc-guide])
- [ ] Stabilization PR ([see instructions on forge][stabilization-guide]) [done for enums]

[stabilization-guide]: https://forge.rust-lang.org/stabilization-guide.html
[doc-guide]: https://forge.rust-lang.org/stabilization-guide.html#updating-documentation

**Unresolved questions:**

> The role of `#[repr(transparent)]` in nonnull-style optimizations is not entirely clear. Specifically, it is unclear whether the user can rely on these optimizations to be performed when they make a type transparent. [Transparent `union`s somewhat complicate the matter](https://github.com/rust-lang/rfcs/pull/2645#issuecomment-470699497). General concensus seems to be that the compiler is free to decide where and when to perform nonnull-style optimizations on `union`s (regardless of whether or not the `union` is transaprent), and no guarantees are made to the user about when and if those optimizations will be applied. It is still an open question exactly what guarantees (if any) Rust makes about transparent `struct`s (and `enum`s) and nonnull-style optimizations.
> 
> This RFC doesn't propose any changes to transparent `struct`s, and so does not strictly depend on this question being resolved. But since this RFC is attempting to round out the `#[repr(transparent)]` feature, it seems reasonable to dedicate some time to attempting to round out the guarantees about `#[repr(transparent)]` on `struct`s.

Also it is not clear if [transparent unions can even be implemented on LLVM without seriously restricting our semantics for unions overall](https://github.com/rust-lang/rust/issues/60405#issuecomment-624860809).
Repository: pytorch
Issue: On first construction, CUDAContext changes default CPU allocator behavior
Labels: caffe2

The first time you construct a CUDAContext, the CPU memory allocator will be changed into one that allocates CUDA pinned memory, reporting that this occurred at level `VLOG(1)`. This is not documented anywhere end-users are likely to see, and is a silent performance hazard for anyone doing Caffe2-PyTorch interop, as it will *also* silently change the behavior of all PyTorch allocation functions to also start allocating pinned CPU memory by default. I see some evidence in old design discussions that we were planning to use some sort of thread-local guard to toggle between pinned memory / non-pinned memory (and have the Caffe2 executor toggle this guard), but it does not look like we ever implemented this for real.

Relevant code is `Caffe2UsePinnedCPUAllocator` in `caffe2/core/context_gpu.cu`

Cc @dzhulgakov @jerryzh168 
Also cc @smessmer, I think you're most likely to accidentally trigger this
Repository: flutter
Issue: Would like hooks to record user interactions for later playback
Labels: c: new feature,framework,customer: alibaba,P3,team-framework,triaged-framework

Alibaba has created their own internal record/playback system for quickly turning manual testing of Flutter-built apps into automated tests.

They currently maintain forks to the framework to make this happen (some "assert" wrapped calls to their record system in a few strategic places, e.g. GestureDetector).

Having hooks through which it's possible to write gesture recording systems might be a reasonable addition to the framework instead of requiring customers to maintain a fork.

Thoughts @goderbauer?  FYI @kangwang1988
Repository: kubernetes
Issue: leveraging etcd minor version features
Labels: sig/api-machinery,kind/feature,lifecycle/frozen

etcd 3.4 is slated for release in late June 2019. It includes additions to the API that Kubernetes can only leverage if the kube-apiserver knows it's making requests to a etcd 3.4+ cluster.

The kube-apiserver's `--storage-backend` flag is available to set the etcd major version ("etcd3").

Would it be acceptable to introduce minor version options to this flag, e.g. "etcd3.4" ?

An alternative would be to have the kube-apiserver make a request to etcd when it starts to determine the "cluster version" and then enable features based on that.

Example of a feature we might leverage: https://github.com/etcd-io/etcd/pull/9869

cc @wojtek-t
Repository: TypeScript
Issue: Namespaced ES6 classes are not recognized as types
Labels: Bug

<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.33.1
- OS Version: Linux x64

MWE:
jsconfig.json
```json
{
    "compilerOptions": {
        "target": "es2018",
        "checkJs": true
    },
    "files": [
        "mwe.js",
        "mwe.d.ts"
    ]
}
```
mwe.js:
```js
class T {
	constructor() {
		this.x = 1.23;
	}
}

var NS = {}

NS.T = class {
	constructor() {
		this.x = 1.23;
	}
}
```
mwe.d.ts:
```typescript
function f1(x: T): void;
function f2(x: NS.T): void;
```

The problem: the type of parameter for `f2` is shown as `any` and no type checking is done.  

Does this issue occur when all extensions are disabled?: Yes