sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Redundant counter in batchnorm impl
Labels: module: nn,triaged

## 🐛 Bug

This looks like an efficiency/perf bug (unless I am missing something).

`self.num_batches_tracked` is initialized and incremented but never used when `self.momentum` is not `None` during training (and tracking running stats).

## To Reproduce

Review code:
https://github.com/pytorch/pytorch/blob/b8f50d9cc860460c7e9b6d3b370cab546e9f9583/torch/nn/modules/batchnorm.py#L35

https://github.com/pytorch/pytorch/blob/b8f50d9cc860460c7e9b6d3b370cab546e9f9583/torch/nn/modules/batchnorm.py#L97-L102

## Expected behavior

`self.num_batches_tracked` should be set to `None` when `self.momentum` is not `None` to achieve a cleaner implementation

## Environment

NA

## Additional context

NA
Repository: pytorch
Issue: Expose bhistc to python
Labels: triaged,enhancement

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->
Calculate the histogram of the elements in 2d tensor x along the last dimension.

## 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 -->
https://discuss.pytorch.org/t/parallelize-histogram-calculation/60038

## Pitch

<!-- A clear and concise description of what you want to happen. -->
I found the backend implementation
https://github.com/pytorch/pytorch/blob/b8f50d9cc860460c7e9b6d3b370cab546e9f9583/aten/src/TH/generic/THTensorMoreMath.cpp#L1314-L1350
but it's not exposed to python so we can't easily use it, please add corresponding python bindings.

## Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->

## Additional context

<!-- Add any other context or screenshots about the feature request here. -->
Repository: TypeScript
Issue: JSDoc @typedef property description lost 
Labels: Bug,Domain: JSDoc,Domain: Quick Info

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
**TypeScript Version:**  3.8.0-dev.20191125

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
- jsdoc
- typedef
- property

**Repo**
For the JS:
```js
/** @typedef {Object.<string, any>} type
 * @property {string} prop1 - Missing Description 1
 * @property {string} prop2 - Missing Description 2
*/

/** @type {type} */
var a = {
    prop1: null,
    prop2: null
}

/** @type {type}
 * @class */
function b(){
    this.prop1 = null;
    this.prop2 = null;
}

var c = new b();
```

Type `c.prop1` to view `prop1` suggestion

**Expected behavior:**
Description from the typedef is shown: `Missing Description 1`

**Actual behavior:**
No description (but the property does have the correct type)
Repository: TypeScript
Issue: Extract Constant Refactoring: Add way to extract all instances of selected expression
Labels: Suggestion,Awaiting More Feedback

From https://github.com/microsoft/vscode/issues/85507

## Search Terms
- refactor
- extract 
- extract constant / extract function

<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

## Suggestion
For the code:

```js
function doStuff() {
    console.log('hello')
    console.log('hi')
    console.log('hello')
}
```

If I run `extract constant on the string `'hello'`, it'd be nice if we offered a way to extract all instances of that expression in the current scope. This would turn the code into:

```js
function doStuff() {
    const text = 'hello'
    console.log(text)
    console.log('hi')
    console.log(text)
}
```

## Use Cases
- Help reducing duplicated code 
- Speed up code cleanup
Repository: opencv
Issue: unrepresentable indices in max_pooling/max_unpooling in fp16 target leads to illegal memory accesses
Labels: bug,feature,category: dnn

##### System information (version)
- OpenCV => master @ https://github.com/opencv/opencv/commit/ad0ab4109aec8173b34ee68d25bb488fbcfe5286
- Operating System / Platform => Ubuntu 18.04 64 Bit
- Compiler => GCC 7.4.0

##### Detailed description

Half-precision floats are not capable of accurately storing the indices in max_pooling layers for ENet.

```
max_idx as index_type: 65521
static_cast<__half>(max_idx): inf
static_cast<index_type>(static_cast<__half>(max_idx)): 2147483647
```

The max_pooling kernel computes the indices as integers but finally stores the index in `__half` format. The index which is retrieved after casting back to `index_type` in max_unpooling kernel can potentially leads to illegal memory access.

This renders the FP16 target unusable in networks which required max_unpooling for even reasonably small feature maps.

##### Steps to reproduce

DNNTestNetwork.ENet/1, where GetParam() = CUDA/CUDA_FP16
Repository: TypeScript
Issue: `as` keyword doesn't appear in completion list
Labels: Bug

 
![t](https://user-images.githubusercontent.com/20449848/69606469-d59c1380-105d-11ea-93af-b0e3078f8424.png)
Repository: PowerToys
Issue: Code formatting style
Labels: Idea-Enhancement,Area-Quality

# Summary of the new feature/enhancement
Uniform formatting style for the codebase helps navigating it and reduces time to review. We could also integrate format-check into CI to perform/verify the formatting automatically.

# Proposed technical implementation details
Currently #742 implements:
- a script which you need to invoke manually
- initial `.clang-format` style

As a first phase, I suggest to:
- approve the style itself
- merge a full codebase formatting commit 
- (optional) implement basic CI checks

Stuff currently implemented
- [x] common lib
- [x] msi_to_msix_upgrade_lib
- [x] notifications
- [x] notifications_dll
- [ ] UnitTests-CommonLib
- [ ] module template
- [x] runner
- [x] action_runner
- [x] settings
- [ ] interface
- [ ] FanzyZones
- [ ] ImageResizer
- [ ] PowerRename
- [ ] PreviewPane
- [ ] WindowWalker
- [x] ShortcutGuide
Repository: vue
Issue: Class Binding Type Missing
Labels: discussion,typescript

### What problem does this feature solve?
When writing a computed property for a class binding, I found I couldn't type it for typescript.
I made a temporary one and remembered, there are more possibilities, so instead of writing them myself, I thought best to use the built in ones.
Yet I can't seem to find a built in one. Am I being really dense and they are actually there right in front of my nose and I can't see them?

At any rate, I have wrote my own as 
```
export type VueClassBinding = string | readonly string[] | {
  readonly [className: string]: boolean,
};
```
Am I missing anything?
Is it possible someone can add this to the typings?

### What does the proposed API look like?
```
...
computed: {
  inputClassList(): VueClassBinding {
    if ( Math.random() > .5 ) return 'my-class-name';
    if ( Math.random() > .5 ) return ['my-class-name'];
    return {
      'my-class-name': true,
    };
  }
}
...
```

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: pytorch
Issue: add method to make tensor constant for debug purposes
Labels: module: autograd,triaged

## 🚀 Feature
Add method to make constant tensors

tensor.make_const()

## Motivation
This option will make it easy to find inplace operators in case of such exceptions:
```
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
```

Instead RuntimeError should be thrown when inplace operation is performed on constant tensor.

## Alternatives

Perhaps it is even better to make all tensors constant by default, since inplace operators rarely needed.

cc @ezyang @SsnL @albanD @zou3519 @gqchen
Repository: create-react-app
Issue: Find correct IPv4 for LAN when having multiples network interfaces
Labels: issue: proposal,needs triage

### Is your proposal related to a problem?

When I have multiples network interfaces actives on my Mac (ex: Wifi and Ethernet), and one or some of them as an invalid IPv4 (such as 169.254.0.0/16 when there's an issue with the DHCP for example), the IPv4 retrieved by using the `ip` static method of the `address` package is returning the first IPv4 found by iterating over the network interfaces.

### Describe the solution you'd like

I think the problem could be solved by iterating over the IPv4 of the different possible network interfaces and using the first **valid private IPv4** instead of using the first one found.

### Describe alternatives you've considered

I had to disconnect the network interfaces that were causing the issue. Not a big deal but annoying, especially everytime you forget it.
Repository: pytorch
Issue: `torch.multiprocessing.spawn` fails when `join=False`
Labels: module: multiprocessing,triaged

## 🐛 Bug

Invoking `torch.multiprocessing.spawn(fn, args=(), nprocs=n, join=False)` raises a `FileNotFoundError` when `join=False`. In contrast, `join=True` works as expected.

## To Reproduce

The following script reproduces the error on pytorch versions `1.1.0` and `1.3.0a0+f25d01e`.

```	
import torch.multiprocessing as mp
import time

def worker(nproc, arg1, arg2, arg3):
    # do something...
    test = True

if __name__ == '__main__':
    mp.spawn(worker, (None, None, None), nprocs=1, join=False)
    time.sleep(3)
    print('terminated')
```

The script fails with the following error message:
```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".../python3.7/multiprocessing/spawn.py", line 105 in spawn_main
    exitcode = _main(fd)
  File ".../python3.7/multiprocessing/spawn.py", line 115, in _main
    self = reduction.pickle.load(from_parent)
  File ".../python3.7/multiprocessing/synchronize.py", line 110, in __setstate__
    self._semlock = _multiprocessing.SemLock._rebuild(*state)
FileNotFoundError: [Errno 2] No such file or directory
terminated
```

Note that `terminated` is printed, showing that the error occurs in the worker thread.

## Expected behavior

The `FileNotFoundError` should not occur. Indeed, `terminated` is printed without any errors if we change `join=False` to `join=True`.

## Environment

PyTorch version: 1.3.0a0+f25d01e
Is debug build: No
CUDA used to build PyTorch: 10.0.130

OS: Ubuntu 18.04.1 LTS
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
CMake version: version 3.14.0

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.0.130
GPU models and configuration:
GPU 0: Quadro GP100
GPU 1: Quadro GP100

Nvidia driver version: 410.79
cuDNN version: Could not collect

Versions of relevant libraries:
[pip] numpy==1.17.2
[pip] torch==1.3.0a0+f25d01e
[pip] torchvision==0.5.0a0+937c83a
[conda] blas                      1.0                   mkl.conda
[conda] magma-cuda100             2.5.1                         1    pytorch
[conda] mkl                       2019.4                243.conda
[conda] mkl-include               2019.4                243.conda
[conda] mkl-service               2.3.0           py37he904b0f_0.conda
[conda] mkl_fft                   1.0.14          py37ha843d7b_0.conda
[conda] mkl_random                1.1.0           py37hd6b4f25_0.conda
[conda] torch                     1.3.0a0+f25d01e           <pip>
Repository: opencv
Issue: Feature Request: Add more Gstreamer Capture Formats
Labels: priority: low,category: gpu/cuda (contrib)

I know Opencv now supports

// we support 11 types of data:
    //     video/x-raw, format=BGR   -> 8bit, 3 channels
    //     video/x-raw, format=GRAY8 -> 8bit, 1 channel
    //     video/x-raw, format=UYVY  -> 8bit, 2 channel
    //     video/x-raw, format=YUY2  -> 8bit, 2 channel
    //     video/x-raw, format=YVYU  -> 8bit, 2 channel
    //     video/x-raw, format=NV12  -> 8bit, 1 channel (height is 1.5x larger than true height)
    //     video/x-raw, format=NV21  -> 8bit, 1 channel (height is 1.5x larger than true height)
    //     video/x-raw, format=YV12  -> 8bit, 1 channel (height is 1.5x larger than true height)
    //     video/x-raw, format=I420  -> 8bit, 1 channel (height is 1.5x larger than true height)
    //     video/x-bayer             -> 8bit, 1 channel
    //     image/jpeg                -> 8bit, mjpeg: buffer_size x 1 x 1
    // bayer data is never decoded, the user is responsible for that
    // everything is 8 bit, so we just test the caps for bit depth

but Nvidia HW accelerated converter has this follow formats.

 Capabilities:
      video/x-raw(memory:NVMM)
                 format: { (string)I420, (string)NV12, (string)BGRx, (string)RGBA, (string)GRAY8 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { (string)I420, (string)NV12, (string)BGRx, (string)RGBA, (string)GRAY8 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

Also, most of the Deep Learning models needs RGB or BGR Mat formats...
so maybe it will be a good option to accept RGB.

Also based on video/x-raw(memory:NVMM) It Could be possible to add it?? As CudaMat???
Repository: TypeScript
Issue: Support mixins for abstract classes
Labels: Suggestion,Awaiting More Feedback

## Search Terms
Related to #32122, but not the same.
abstract mixins classes

## Suggestion
Right now we can't to extending abstract classes with mixins. So, it would be nice to create a solution for this case.

## Use Cases
```
abstract class Test {
}

type Constructor = new (...args: any[]) => any;

function MyAwesomeMixin<T extends Constructor>(Constructor: Constructor) {
  abstract class MyAwesomeMixin extends Constructor {
  }
  return MyAwesomeMixin;
}

class A extends MyAwesomeMixin(Test) {
  /* Argument of type 'typeof Test' is not assignable to parameter of type 'Constructor'.
  Cannot assign an abstract constructor type to a non-abstract constructor type.(2345) */
}
```

Okay, try to create abstract constructor type:
```
type Constructor = abstract new (...args: any[]) => any;
/* Syntax error */
```

Hmm,..

## Examples
Here is two way to create solution for this problem:
1. (simple) Allow create abstract constructor types
```
type Constructor = (new (...args: any[]) => any) | (abstract new (...args: any[]) => any);
```

2. (complex, but beautiful) Add new syntax to define mixins, and initially add support to extending abstract classes, like this:
```
abstract class Test {
   abstract mainMethod(): void;
}

mixin MyAwesomeMixin {
   public someMethod(): void {
      console.log('hello');
   }
}

class A extends MyAwesomeMixin(Test) {
   public mainMethod(): void {
      this.someMethod();
   }
}

// AND

abstract mixin MyAwesomeAbstractMixin {
    abstract someMethod(): void;
}

class B extends MyAwesomeAbstractMixin(Test) {
   public mainMethod(): void {
      this.someMethod();
   }
}

// Also this can add support to extending mixins without Mixin(Mixin2(Mixin3(Class)))

mixin MyAwesomeExtendedMixin extends MyAwesomeAbstractMixin {
   public someMethod(): void {
      ...
   }
}

```

## 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: node
Issue: investigate flaky sequential/test-perf-hooks in CI
Labels: flaky-test,perf_hooks

<!--
Thank you for reporting a possible bug in Node.js.

Please fill in as much of the template below as you can.

Version: output of `node -v`
Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)
Subsystem: if known, please specify the affected core module name

If possible, please provide code that demonstrates the problem, keeping it as
simple and free of external dependencies as you can.
-->

* **Version**: master
* **Platform**: ubuntu1804_sharedlibs_withoutssl_x64
* **Subsystem**: perf_hooks

<!-- Please provide more details below this comment. -->

```
not ok 2761 sequential/test-perf-hooks
  ---
  duration_ms: 1.517
  severity: fail
  exitcode: 1
  stack: |-
    {
      name: 'node',
      entryType: 'node',
      startTime: 0,
      duration: { around: 52.144811153411865 },
      nodeStart: { around: 0 },
      v8Start: { around: 0 },
      bootstrapComplete: { around: 48.848198890686035, delay: 2500 },
      environment: { around: 0 },
      loopStart: -1,
      loopExit: -1
    }
    {
      name: 'node',
      entryType: 'node',
      startTime: 0,
      duration: { around: 1058.5430703163147 },
      nodeStart: { around: 0 },
      v8Start: { around: 0 },
      bootstrapComplete: { around: 48.848198890686035, delay: 2500 },
      environment: { around: 0 },
      loopStart: { around: 48.848198890686035, delay: 2500 },
      loopExit: -1
    }
    {
      name: 'node',
      entryType: 'node',
      startTime: 0,
      duration: { around: 1379.0943932533264 },
      nodeStart: { around: 0 },
      v8Start: { around: 0 },
      bootstrapComplete: { around: 48.848198890686035, delay: 2500 },
      environment: { around: 0 },
      loopStart: { around: 48.848198890686035, delay: 2500 },
      loopExit: { around: 1379.1089520454407 }
    }
    assert.js:383
        throw err;
        ^
    
    AssertionError [ERR_ASSERTION]: duration: 319.4689869880676 >= 250
        at checkNodeTiming (/home/iojs/build/workspace/node-test-commit-linux-containered/test/sequential/test-perf-hooks.js:67:7)
        at Timeout._onTimeout (/home/iojs/build/workspace/node-test-commit-linux-containered/test/sequential/test-perf-hooks.js:93:3)
        at listOnTimeout (internal/timers.js:535:17)
        at processTimers (internal/timers.js:479:7) {
      generatedMessage: false,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '=='
    }
  ...
```

ref: https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu1804_sharedlibs_withoutssl_x64/16233/consoleText
Repository: rust
Issue: Add a `starts_with(s: &str) -> bool` method for `fmt::Arguments`?
Labels: T-libs-api,C-feature-request

It's currently very cumbersome to check whether a panic message starts with an expected `&str` in `no_std` mode:

```rust
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
    use core::fmt::Write;

    let mut check_message = CheckPanicMessage::new("some panic message:");
    let error = write!(&mut check_message, "{}", info.message().unwrap_or(&format_args!(""))).is_err();
    if !error && check_message.starts_as_expected() {
       // do something (e.g. mark test as successful)
    } else {
        // do something else (e.g. mark test as failed)
    }
}

struct CheckPanicMessage<'a> {
    expected_prefix: &'a str,
    mismatch: bool,
}

impl<'a> CheckPanicMessage<'a> {
    fn new(expected_prefix: &'a str) -> Self {
        Self {
            expected_prefix,
            mismatch: false,
        }
    }

    fn starts_as_expected(&self) -> bool {
        !self.mismatch && self.expected_prefix == ""
    }
}

use core::fmt;

impl fmt::Write for CheckPanicMessage<'_> {
    fn write_str(&mut self, s: &str) -> fmt::Result {
        let len = s.len().min(self.expected_prefix.len());
        if !self.mismatch {
            if s.starts_with(&self.expected_prefix[..len]) {
                serial_println!("[ok] expected: <{}>, got: <{}>", &self.expected_prefix[..len], s);
                self.expected_prefix = &self.expected_prefix[len..];
            } else {
                serial_println!("expected: <{}>, got: <{}>", &self.expected_prefix[..len], s);
                self.mismatch = true;
            }
        }
        Ok(())
    }
}
```

(If there is an easier way to achieve this, please let me know.)

How about adding a `starts_with(&self, &str) -> bool` method to `fmt::Arguments`? With such a method, the above could be shortened to:

```rust
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
    if info.message().unwrap_or(&format_args!("")).starts_with("some panic message:") {
        // do something (e.g. mark test as successful)
    } else {
        // do something else (e.g. mark test as failed)
    }
}
```

I would be happy to write a PR that adds this as an unstable method if it is desired.
Repository: youtube-dl
Issue: how to download  lang=en-IE and tlang=zh-Hans subtitle 
Labels: question

https://www.youtube.com/api/timedtext?v=zDujFhvgUzI&asr_langs=de%2Cen%2Ces%2Cfr%2Cit%2Cja%2Cko%2Cnl%2Cpt%2Cru&caps=asr&xorp=true&hl=en&ip=0.0.0.0&ipbits=0&expire=1574796999&sparams=ip%2Cipbits%2Cexpire%2Cv%2Casr_langs%2Ccaps%2Cxorp&signature=55E79DD91B83B7794DB068675B36A741FC068DAF.CB674DFA36D22BDE6033A12BF41D65B8AE06155D&key=yt8&lang=en-IE&fmt=srv3&xorb=2&xobt=3&xovt=3&tlang=zh-Hans

how to download  lang=en-IE and tlang=zh-Hans subtitle 

when
--write-auto-sub --sub-lang=zh-Hans --convert-subs=ass 
then
lang=en and tlang=zh-Hans subtitle