sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: [jit] Bad error for incorrect container type
Labels: oncall: jit,triaged,jit-backlog

## 🐛 Bug

In Python2 input to `@torch.jit.script` cannot be `Tuple[Tensor]` but can be `List[Tensor]`. Since this is Python2 I use mypy-style type-hinting.

## To Reproduce

Steps to reproduce the behavior:

```python
@torch.jit.script
def smt_pred(confs, child, threshold, obj, height, width, a):
    # type: (Tuple[Tensor],List[List[int]],Tensor,Tensor,int,int,int) -> Tuple[Tensor,Tensor]

```

Results in 

> RuntimeError: smt_pred() Expected a value of type 'Tuple[Tensor]' for argument 'confs' but instead found type 'tuple'.

But if I change `Tuple` to `List` and pass `list(confs)` instead, it works. So this is an issue specific to `Tuple` in Python2.

## Expected behavior

Same as `List` to work

## Environment


PyTorch version: 1.2.0
Is debug build: No
CUDA used to build PyTorch: 10.0.130

OS: Ubuntu 16.04.6 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
CMake version: version 3.14.0

Python version: 2.7
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce GTX 1070
Nvidia driver version: 418.40.04
cuDNN version: /usr/local/lib/libcudnn.so.5.1.10

Versions of relevant libraries:
[pip] mictorch==0.0.1
[pip] numpy==1.16.4
[pip] torch==1.2.0
[pip] torchvision==0.4.0
[conda] Could not collect


## Additional context

I also asked about the issue [here](https://discuss.pytorch.org/t/python2-torchscript-type-annotation-tuple-vs-tuple/54504)


cc @suo
Repository: flutter
Issue: Consider tracking plugin entitlement requirements via pubspec.yaml
Labels: tool,P3,team-tool,triaged-tool

For sandboxed macOS apps—which may well be the default, but we want to support regardless—there are going to be cases where plugins require entitlements in the app (e.g., `camera`). The current solution to this kind of problem on mobile is to document it in the plugin docs, but that's error-prone, and may not be easy to debug.

In the new pubspec.yaml plugin format, we could add a key for macOS where plugins could list the entitlements they require. At build time we can collect the transitive list of those declared plugin entitlements, compare it to what's in the entitlements file, and warn/error if any are missing. (We could potentially have tooling for adding them automatically, but as @jmagman pointed out that's tricky since it's a user-owned file, and we don't want to stomp their changes).

(This general approach might be something we want to consider for mobile as well.)

/cc @jmagman @christopherfujino
Repository: opencv
Issue: Segfault in cv::divide
Labels: incomplete,needs reproducer

##### System information (version)
- OpenCV => 4.1
- Operating System / Platform => Ubuntu 18.04
- Compiler => gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

##### Detailed description

OpenCV segfaults when using cv::divide with the same input and output. I've attached a code snippet and the backtrace below.

##### Steps to reproduce

Unfortunately my code is quite complex and I can't upload all of it, but this is the gist of it:
```
  cv::Mat resized, normalized;
  cv::resize(kRawImage, resized, cv::Size(kModelInputDim_, kModelInputDim_));

  resized.convertTo(normalized, CV_32FC3, 1/255.0);
  normalized -= cv::Scalar(0.485, 0.456, 0.406);
  cv::divide(normalized, cv::Scalar(0.229, 0.224, 0.225), normalized);
```

Backtrace:
```Thread 21 "runner" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffe339ca700 (LWP 6685)]
0x00007fffe8db80f8 in _int_free (have_lock=0, p=0x7ffdb26b5d70, av=0xbecda8183f55776b) at malloc.c:4266
4266    malloc.c: No such file or directory.
(gdb) bt
#0  0x00007fffe8db80f8 in _int_free (have_lock=0, p=0x7ffdb26b5d70, av=0xbecda8183f55776b) at malloc.c:4266
#1  __GI___libc_free (mem=0x7ffdb26b5d80) at malloc.c:3124
#2  0x00007fffe9d61cf9 in cv::arithm_op(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, int, void (**)(unsigned char const*, unsigned long, unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, void*), bool, void*, int) () from /usr/local/lib/libopencv_core.so.4.1
#3  0x00007fffe9d64751 in cv::divide(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, double, int) () from /usr/local/lib/libopencv_core.so.4.1
#4  0x00005555556030f1 in OptimizedDataLoader::PreprocessImage(cv::Mat const&, float*) const ()
```
Repository: rust
Issue: Improve error when compiling a derive macro with -Z sanitizer
Labels: A-driver,C-enhancement,A-diagnostics,T-compiler,A-sanitizers,requires-nightly

I'm trying to build some code with the address sanitiser on; and I run into this error:

```
Compiling failure_derive v0.1.5
error: Only executables, staticlibs, cdylibs, dylibs and rlibs can be compiled with `-Z sanitizer`
error: aborting due to previous error
error: Could not compile `failure_derive`.
error: build failed
```

After some googling the solution appears to be(from #48199) to use `--target=...`. I was wondering if the message could be improved to something like:

```
Compiling failure_derive v0.1.5
error: Only executables, staticlibs, cdylibs, dylibs and rlibs can be compiled with `-Z sanitizer`
hint: Try running the command again, and specifying a target triple; e.g. `--target=x86_64-unknown-linux-gnu`
error: aborting due to previous error
error: Could not compile `failure_derive`.
error: build failed
```
Repository: opencv
Issue: more use of Mat_<_Tp>?
Labels: category: core,RFC

I'd like to bring up the issue that puzzles many newbies and users of the Eigen library and that is the need to hardcode element types in code using OpenCV. I'll take an example from [`cv::Mat::at`](https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa5d20fc86d41d59e4d71ae93daee9726):
```
Mat A(100, 100, CV_64F);
for(int i = 0; i < A.rows; i++)
    for(int j = 0; j < A.cols; j++)
        A.at<double>(i,j) = 1. / (i + j + 1);
```
Notice the need to repeat the element type in code, rather than it being inferred from the object's type. OpenCV *does* have a `Mat_<_Tp>` which takes care of this.
```
Mat_<double> B(A); // converts elements implicitly
for(int i = 0; i < B.rows; i++)
    for(int j = 0; j < B.cols; j++)
        B(i,j) = 1. / (i + j + 1);
```

`Mat_` even supports range-based for loops over elements! In C++17 those could even be improved by [providing an iterator over (index,value) pairs](https://www.codingame.com/playgrounds/2205/7-features-of-c17-that-will-simplify-your-code/structured-bindings) that could look like this (and possibly have a solution in C++11 too):
```
Mat_<double> C(A);
for (auto& [index, value]: C.indexed())
        value = 1. / (index[0] + index[1] + 1);
```

OpenCV APIs would benefit from using statically typed matrices (`Mat_<_Tp>`). You could get type errors at compile time. Less repetition reduces chances of error. All that would change is that a function gets templated overloads. The old signature using cv::Mat is still there.

Does anyone see downsides?
Repository: go
Issue: runtime: gc exhausts all cpu causing a short delay 
Labels: NeedsInvestigation,compiler/runtime

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.12.8 linux/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
GOARCH="amd64"
GOBIN="/home/zhoudazhuang/gobin/"
GOCACHE="/home/zhoudazhuang/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/zhoudazhuang/db11/jm/pro"
GOPROXY=""
GORACE=""
GOROOT="/home/zhoudazhuang/usr/local/go1.12.8/go"
GOTMPDIR=""
GOTOOLDIR="/home/zhoudazhuang/usr/local/go1.12.8/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build045404538=/tmp/go-build -gno-record-gcc-switches"

</pre></details>
each linux online server: 
cpu: 48c
memory: 96g
Linux ll-025065048-FWWG.AppPZFW.prod.bj1 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

### What did you do?
My tcp long connection server , Deploy a go program per machine. each go program deal about 800 000 user.
Usually my cpu utilization is only about 30%，But gc will burst to over 95%. This causes my application to occasionally generate traffic delay jitter during gc. There will probably be some processing time of 2-3 seconds or more (including json.marshal,net.dial, metux lock, base64 decode and any others).

I observed the gc log and the runtime sched log. The conclusion is that the gc concurrent scan takes up a lot of cpu and knows that my business has no remaining cpu available. I observed that about a quarter of the procs are used for gc, no allocation proc for other tasks. I don't understand why gc cost lots of  my cpu so that my business has no cpu resources available for a while, so my business has delayed jitter. Is there any solution or whether it can limit the numbers of cpu? 
<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->



### What did you expect to see?
Gc will not cause my business to delay



### What did you see instead?
Gc caused my business to delay
Repository: react
Issue: TypeError: "'requestAnimationFrame' called on an object that does not implement interface Window."
Labels: Type: Bug,Component: Scheduler

<!--
  Note: if the issue is about documentation or the website, please file it at:
  https://github.com/reactjs/reactjs.org/issues/new
-->

**Do you want to request a *feature* or report a *bug*?** **Bug**

**What is the current behavior?**
TypeError: "'requestAnimationFrame' called on an object that does not implement interface Window."

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:**

https://github.com/facebook/react/blob/0f6e3cd61cf4a5a1491bb3c92780936aebc2a146/packages/scheduler/src/forks/SchedulerHostConfig.default.js#L88

In the WebExtension content script, globalThis !== window.
So when `const requestAnimationFrame = window.requestAnimationFrame`, the `this` binding of `rAF` is lost.

In the after calling, `rAF` rebinds to the globalThis, but globalThis doesn't implements Window interface.

PoC: Install this extension in the Firefox and you will see the error reported.
```index.js
try {
    const raf = window.requestAnimationFrame
    raf(() => console.log('Okay.'))
} catch (e) {
    console.warn(e)
}
```

```manifest.json
{
    "name": "rAF in content script test",
    "version": "0.0.1",
    "manifest_version": 2,
    "content_scripts": [{ "js": ["/index.js"], "matches": ["<all_urls>"] }]
}
```

**What is the expected behavior?**

**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**
Firefox, in WebExtension. 

Related to https://github.com/facebook/react/issues/16605
Repository: rust
Issue: NLL issue when using DerefMut to access fields through a Pin, causing multiple mutable borrow error
Labels: C-enhancement,NLL-complete

The code below doesn't compile due to multiple mutable borrows, however the exact same code without the `std::pin::Pin` compiles fine actually. My expectation is however that the code would obviously compile fine in both cases.

```rust 
use std::pin::Pin;
use slab;

struct Entry {
    complete: u64
}

struct Ctx {}
impl Ctx {
    fn new() -> Self {
        Ctx{}
    }
    fn pread<T>(&mut self, _key: T) -> std::io::Result<()> {
        Ok(())
    }
}

struct Foo {
    ctx: Ctx,
    handles: slab::Slab<Entry>
}
impl Foo {
    fn new() -> Self {
        Foo {ctx: Ctx::new(),
             handles: slab::Slab::with_capacity(20)}
    }
    
    fn blah(mut self: Pin<&mut Self>) {
        let v = self.handles.vacant_entry();
        let key = v.key();
        match self.ctx.pread(key) {
            Ok(()) => {
                v.insert(Entry{complete:123});
            },
            Err(_) => {
                
            }
        }
        
    }
}

fn main() {
    Pin::new(&mut Foo::new()).blah();
}
```

The exception raised is:

```rust
error[E0499]: cannot borrow `self` as mutable more than once at a time
  --> src/main.rs:31:15
   |
29 |         let v = self.handles.vacant_entry();
   |                 ---- first mutable borrow occurs here
30 |         let key = v.key();
31 |         match self.ctx.pread(key) {
   |               ^^^^ second mutable borrow occurs here
32 |             Ok(()) => {
33 |                 v.insert(Entry{complete:123});
   |                 - first borrow later used here

error: aborting due to previous error
```

I'm able to get the code to compile also by creating additional scopes around the areas where I'm supposedly borrowing `self` like this:

```rust
let key = {
    let entry = self.handles.vacant_entry();
    entry.key()
};
match self.ctx.pread(key) {
    Ok(()) => {
        *self.handles.get_mut(key).unwrap() =
            Entry { complete: 123 };
    }
```

Although obviously that's pretty awkward. I'm told that this could possibly be a bug in the NLL, but I'm pretty new to the language so I'm just reporting this with a short reproducible example.

Hope it helps.
Repository: godot
Issue: Right operand of 'is' is not a class (type: <Anything>) vs. Build-in scripts
Labels: discussion,topic:gdscript,documentation

[BUG, UNCLEAR USAGE, DOCUMENTATION, BUILT-IN SCRIPT]

I have hard time identifying instances. I do not want to use groups. Scenes and instances should have enough information to identify each other. Question: is this instance an instance of the scene or not?
**Important: I use **built-in script** in script attachment process. So the script is inside the scene file.**



Godot 3.1.1
Ubuntu 18.04.3 LTS

Similar to
https://github.com/godotengine/godot/issues/23081


Example usecase:
**Godot throws error Right operand of 'is' is not a class (type: Node2D)**

I have var dogScene = load("**res://Dog.tscn"**) and not **Dog.gd** because built-in scripts.


```
extends Node2D

var dogScene = load("res://Dog.tscn")
var catScene = load("res://Cat.tscn")

func _ready():
	
	var d1 = dogScene.instance()
	var d2 = dogScene.instance()
	var c1 = catScene.instance()
	
	add_child(d1)
	add_child(d2)
	add_child(c1)
	
	
	if (d1 is d1):
		print("EXPECTED - same class or type")
	else:
		print("different class or type")
	
	
	if (c1 is d1):
		print("same class or type")
	else:
		print("EXPECTED - different class or type")
	

```
Example project.
	
[Is.zip](https://github.com/godotengine/godot/files/3554365/Is.zip)



Workaround:
I could solve the problem like this, but it is ugly hacking, not user friendly.

```

func isEqual(a, b):
	if (a != null && a.get_script()!=null && b != null && b.get_script()!=null):
		if (a.get_script().resource_path == b.get_script().resource_path):
			return true
		
	return false	 


```

**I would expect to do that from 'is' operator, based on documentation. In case of Built-in scripts too.**


https://docs.godotengine.org/en/3.1/getting_started/scripting/gdscript/gdscript_basics.html

```
# Cache the enemy class.
const Enemy = preload("enemy.gd")

# [...]

# Use 'is' to check inheritance.
if (entity is Enemy):
    entity.apply_damage()
```
Repository: pytorch
Issue: regarding builtin_function_or_method
Labels: feature,low priority,triaged

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->
some way to see the code for builtin_function_or_method
## 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 -->
consider this scenario
1) I am using google colab, I want to see the implementation of nn.Dropout
2) I ctrl+click on nn.Dropout, it takes me to dropout.py, where I find Dropout class, which returns
`
F.dropout(input, self.p, self.training, self.inplace)
`
3) so, I ctrl+click on F.dropout, it takes me to functional.py, where I see this
`
return (_VF.dropout_(input, p, training)
            if inplace
            else _VF.dropout(input, p, training))
`
4) now, I am stuck, because this is a builtin, and only way for me to look at its code, is to search for this in github.
5) same thing happens when I want to see the implementation of nn.CrossMapLRN2d, it redirects to torch.group_norm, which is builtin.
6) similarly for view, permute, this way to understand what these builtins are doing becomes difficult

because of this I raised an issue in google colab, to provide a way to look at builtin_function_or_method, they told 

"
No, there's no way to get directly to the source in this case.

In particular, for a .so, it could be a cython file, or it could be another kind of C extension (built via vanilla C/C++ code, or SWIG'd in, or something else completely). All we have is the installed package -- there's no way for us to trace that back to source, and in cases like this (torch is distributed as a .whl file) the source isn't included.
"


## Pitch

<!-- A clear and concise description of what you want to happen. -->

## 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: rust
Issue: Tracking issue for const fn pointers
Labels: T-lang,C-tracking-issue,A-const-eval,S-tracking-needs-summary

Sub-tracking issue for https://github.com/rust-lang/rust/issues/57563.

This tracks `const fn` types and calling `fn` types in `const fn`. 

---

From the RFC (https://github.com/oli-obk/rfcs/blob/const_generic_const_fn_bounds/text/0000-const-generic-const-fn-bounds.md#const-function-pointers):

## `const` function pointers

```rust
const fn foo(f: fn() -> i32) -> i32 {
    f()
}
```

is illegal before and with this RFC. While we can change the language to allow this feature, two
questions make themselves known:

1. fn pointers in constants

    ```rust
    const F: fn() -> i32 = ...;
    ```

    is already legal in Rust today, even though the `F` doesn't need to be a `const` function.

2. Opt out bounds might seem unintuitive?

    ```rust
    const fn foo(f: ?const fn() -> i32) -> i32 {
        // not allowed to call `f` here, because we can't guarantee that it points to a `const fn`
    }
    const fn foo(f: fn() -> i32) -> i32 {
        f()
    }
    ```

Alternatively one can prefix function pointers to `const` functions with `const`:

```rust
const fn foo(f: const fn() -> i32) -> i32 {
    f()
}
const fn bar(f: fn() -> i32) -> i32 {
    f() // ERROR
}
```

This opens up the curious situation of `const` function pointers in non-const functions:

```rust
fn foo(f: const fn() -> i32) -> i32 {
    f()
}
```

Which is useless except for ensuring some sense of "purity" of the function pointer ensuring that
subsequent calls will only modify global state if passed in via arguments.
Repository: godot
Issue: Not able to use linear RGB textures in 3d
Labels: bug,topic:rendering,confirmed

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
Godot 3.1.1 and current master (https://github.com/godotengine/godot/commit/a6b094cdfc6cb102a4c2e378f6ae2a06ac646638)
<!-- Specify commit hash if non-official. -->


**OS/device including version:**
Windows 10 64bit as well as Fedora 30 Linux (64bit)
<!-- Specify GPU model and drivers if graphics-related. -->


**Issue description:**
I am unable to use a .png image as a linear texture inside 3d rendering. Linear in 2d works as expected but the setting seems not to effect 3d use. The import settings I used are:
![image](https://user-images.githubusercontent.com/1610621/63931040-c43e6d80-ca54-11e9-9187-cd415c86f2c6.png)

<!-- What happened, and what was expected. -->
Changing the import settings from sRGB enabled to disabled should change the interpretation of the color but the resulting rendering is unchanged. (Also it seems there is always a R8G8B8_SRGB texture created internally for OpenGL).

This screenshots shows the expected behaviour in 2d (and the unchanged beaviour in 3d):
![image](https://user-images.githubusercontent.com/1610621/63932058-bd185f00-ca56-11e9-88ff-04b8b0dbf877.png)


**Steps to reproduce:**
Apply a .png texture to the albedo and toggle the import settings Srgb between enabled/disabled and reimport.

**Minimal reproduction project:**
<!-- Recommended as it greatly speeds up debugging. Drag and drop a zip archive to upload it. -->
[reproducer_LinearRGBTexture_3d.zip](https://github.com/godotengine/godot/files/3554993/reproducer_LinearRGBTexture_3d.zip)
Repository: neovim
Issue: :messages filtering, avoid duplicates, "provider" hook
Labels: enhancement,provider,core,messages


<!-- Before reporting: search existing issues and check the FAQ. -->

### Actual behaviour

When searching for something, and `wrapscan` is not set, and the search is not found `E385` or `E384` is shown, depending on the search direction. Another case is if a search is made using `*` or `#` the same error gets repeated every time `n` or `N` is pressed, cluttering `mess`.

### Expected behaviour

I propose a new `shortmess` option, maybe `e`, that silences, `E385` and `E384`.
Repository: go
Issue: database/sql: close Rows if Conn is closed
Labels: NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.12.9 linux/amd64
</pre>

### Does this issue reproduce with the latest release?
Reproduces on play.golang.org

### What did you do?
https://play.golang.org/p/jMMhYBt-K9T

I have also locally tested it with https://godoc.org/github.com/lib/pq, same result.

### What did you expect to see?
"Hello, playground"


### What did you see instead?
<pre>
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [semacquire]:
sync.runtime_SemacquireMutex(0x43024c, 0x100)
	/usr/local/go/src/runtime/sema.go:71 +0x40
sync.(*RWMutex).Lock(0x430244, 0x40e058)
	/usr/local/go/src/sync/rwmutex.go:98 +0xa0
database/sql.(*Conn).close(0x430240, 0x0, 0x0, 0x1a2ebc, 0x0, 0x0)
	/usr/local/go/src/database/sql/sql.go:1845 +0x60
database/sql.(*Conn).Close(0x430240, 0x1, 0x430240, 0x0)
	/usr/local/go/src/database/sql/sql.go:1860 +0x40
main.TestDatabase()
	/tmp/sandbox755004132/prog.go:60 +0x9bb
main.main()
	/tmp/sandbox755004132/prog.go:63 +0x20

goroutine 5 [select]:
database/sql.(*DB).connectionOpener(0x44c120, 0x1be8a0, 0x43e320, 0x161)
	/usr/local/go/src/database/sql/sql.go:1000 +0xe0
created by database/sql.OpenDB
	/usr/local/go/src/database/sql/sql.go:670 +0x1a0

goroutine 6 [select]:
database/sql.(*DB).connectionResetter(0x44c120, 0x1be8a0, 0x43e320, 0x161)
	/usr/local/go/src/database/sql/sql.go:1013 +0x100
created by database/sql.OpenDB
	/usr/local/go/src/database/sql/sql.go:671 +0x1e0

Program exited: status 2.
</pre>