sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: net/http: Transport does not support proxy schemes added with RegisterProtocol
Labels: FeatureRequest

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.11.1 linux/amd64
</pre>

### Does this issue reproduce with the latest release?

I checked https://golang.org/src/net/http/transport.go?s=3628:10127#L93 using godoc and it has no handling for Proxies with schemes other than http(s)/socks5, so 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=""
GOCACHE="/Users/xxx/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/Users/xxx/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/Users/xxxx/src/devops-automation/go.mod"
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-build522908579=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

	dt.RegisterProtocol("ssh", proxy.NewSSHTransport(bastionHost))

`NewSSHTransport` returns an `http.Transport` which has `Dial()` which ensures a tunnel is open and then calls `ssh.Client.Dial()` on the open client to create a tunneled connection

        dt.Proxy() -> url.URL{Scheme: "ssh", Host: bastionHost+":22"}
        req := http.NewRequest("GET", "http://testurl.com", nil)

### What did you expect to see?

sshTransport Dial to be used for the proxy

### What did you see instead?

DefaultTransport Dial was used for the proxy.

It would be nice not to have to rewrite RoundTrip to allow additional proxy schemes.
I think that this could be solved by checking if either Request Scheme or Proxy Scheme use a different transport and then delegating the rest of the request to the scheme's Transport.
Repository: TypeScript
Issue: Incorrect rename of imported declaration
Labels: Bug

**TypeScript Version:**  aa3734c14834afb454c49bc956489980d990a765

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

**Code**

file1.ts
```ts
export const abc = 1;
```
file2.ts
```ts
import {abc} from "./file1";
abc; // Rename this one to def
```

**Expected behavior:** 

file1.ts
```ts
export const def = 1;
```
file2.ts
```ts
import {def} from "./file1";
def; // Rename this one to def
```

**Actual behavior:**

file1.ts
```ts
export const def = 1;
```
file2.ts
```ts
import {abc as def} from "./file1";
def; // Rename this one to def
```

It looks like the prefix/suffix logic assumes the export is a separate statement and not the declaration itself.
Repository: nodebestpractices
Issue: Security: Prevent SSRF attacks
Labels: help wanted,new best practice,security,writer-needed

SSRF (Server Side Request Forgery) vulnerability allows an attacker to change a parameter used on the Node.js application to create or control requests from the vulnerable server.

This introduces attack vectors such as
- scanning the internal network
- timeout the thread
- bypass host based authentication
- sending requests impersonating the server

The example could show the use of a whitelist of allowed domains and protocols from where the Node.js can fetch remote resources (and mention to avoid the use of user provided url's unless really required)
Repository: opencv
Issue: HDR MergeMertens - tif uint16 output missing
Labels: feature,category: photo

When using python to produce LDR image (example [here](https://docs.opencv.org/3.2.0/d3/db7/tutorial_hdr_imaging.html)) I am able to import TIFF 16 bit , three channel , colour images unchanged. However processing using MergeMertens results only in uint 8-Bit tiff colour images.

Would it be possible to include something like bittype as an argument when using mergemertens?
I could not find any option (or documentation) how to solve this problem.

- OpenCV => 3.2.0
- Operating System / Platform => Windows 64 Bit
- Python=> 2.7.15
Repository: pytorch
Issue: DeviceOption::set_device_type() doesn't accept caffe2::CPU anymore
Labels: caffe2

## 📚 Documentation

### TL;DR
It'd be best if someone could write up an up-to-date method on loading a (pretrained) caffe2 network in C++. I've searched for the past couple of days, but all methods that I've tried don't work with the current pytorch version ('1.0.0a0+60e7d04', from the master branch)

But at the same time I understand that pytorch v1.0 is still a preview and there could be big API changes, in which case I would like to ask a small question. How, in its current state, am I supposed to call the `DeviceOption::set_device_type()` function? It seems like it used to be by passing in `c10::DeviceType`, but now it's expecting an integer (`::google::protobuf::int32`). But I saw no documentation on this.

---

### My situation

I have a model that I trained in Pytorch, in Python. Using onnx, I converted my model, and saved it as two different .pb files using the `caffe2.python.backend.Caffe2Backend.onnx_graph_to_caffe2_net()` function, and then saving it `with open(...)`. Now I'm trying to load it in C++ caffe2. Here's my current code.

```
int main() {

    caffe2::NetDef init_net, pred_net;

    std::string init_path = "10B_2018-11-27_10-27-38_init.pb";
    std::string pred_path = "10B_2018-11-27_10-27-38_pred.pb";


    CAFFE_ENFORCE(caffe2::ReadProtoFromFile(init_path, &init_net));
    CAFFE_ENFORCE(caffe2::ReadProtoFromFile(pred_path, &pred_net));

    init_net.mutable_device_option()->set_device_type(<???>);
                                                       ^^^
    pred_net.mutable_device_option()->set_device_type(<???>);
                                                       ^^^
```

Now when I look at some previous sources, like [this](https://github.com/caffe2/caffe2/issues/1737) or [this](https://github.com/BIGBALLON/Caffe2_Demo/blob/master/03_cpp_forward/main.cpp), I'm supposed to pass in `caffe2::CPU`, which is of type `const c10::DeviceType`, but currently in Pytorch '1.0.0a0+60e7d04', this function expects type `'::google::protobuf::int32' (aka 'int')`, but **there is no documentation** on which integer represents CPU or CUDA etc..

Furthermore, some (more recent) resources suggest saving it directly as an onnx model and loading it with caffe2 backend (c.f., [TRANSFERING A MODEL FROM PYTORCH TO CAFFE2 AND MOBILE USING ONNX](https://pytorch.org/tutorials/advanced/super_resolution_with_caffe2.html)), I haven't seen anything similar in C++. Is it not yet supported?

Any help would be highly appreciated. Please help!
Repository: angular
Issue: Refine RouteReuseStrategy
Labels: feature,area: router,feature: under consideration

# 🚀 RouteReuseStrategy 2.0

### Relevant Package

This feature request is for @angular/router

### Description
The current [`RouteReuseStrategy` API](https://angular.io/api/router/RouteReuseStrategy) is totally confusing and probably broken.

### Describe the solution you'd like

In order for this API to become usable, at least the following problems have to be solved:

* #25521: Introduce `ngOnAttach`/`ngOnDetach` lifecycle hooks
* #20114: impossible to store/retrieve siblings AND ALSO a non-sibling
* #20072: RouteReuseStrategy doesn't reuse the parent tree components
* [Why is `retrieve` called before `shouldAttach`](https://github.com/angular/angular/pull/22475#issuecomment-441914257)?
* There is no 'official' way to properly dispose cached routes. `DetachedRouteHandle` is said to be 'opaque', but to dispose a route one has to use the content of this structure: `(handle as any).componentRef.destroy()`. Does this call suffice to dispose a route? Why not add a public API for this? Also a `(handle as any).componentRef.hostView.destroyed` check has to be used in `retrieve` because of #20072 to avoid reattaching a destroyed component.
* Documentation. More than one sentence for every method and a clear description of their call sequence are needed.
* Code examples (working).
* Ship alternative ready-to-use implementations with the router, not only `DefaultRouteReuseStrategy`. E.g. a greedy strategy that tries to cache and reuse all the routes.


### Describe alternatives you've considered
<!-- ✍️--> Have you considered any alternative solutions or workarounds?

The current API makes you use a lot of workarounds, and still you cannot be sure whether you've done everything right. E.g. see [my attempt to implement](https://stackblitz.com/github/thorn0/angular-router-experiments?file=src%2Fapp%2Fcustom-reuse-strategy.ts) the greedy reuse strategy.
Repository: rust
Issue: help, pass closure variable to Ref::map function failed 
Labels: C-enhancement,A-diagnostics,A-closures,T-compiler

The demo code is: 
```rust
#![feature(refcell_map_split)]
use std::cell::{Ref, RefCell};    

fn main() { 
    let cell = RefCell::new([1, 2, 3, 4,5]);
    let borrow = cell.borrow(); 
     //    let (begin, end) = Ref::map_split(borrow, |s| s.split_at(3));   // OK

    // extract closure as a variable then pass as argument, raise error.
    let lambda = |s: &[i32;5]| s.split_at(3);
    let (begin, end) = Ref::map_split(borrow, lambda);

    assert_eq!(*begin, [1, 2, 3]);
    assert_eq!(*end, [4, 5]);
}
```
 

[It complains error when run](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=658e5261a8d79ef36cc18aa43359ff76):

```
error[E0271]: type mismatch resolving `for<'r> <[closure@examples/dddd.rs:10:18: 10:45] as std::ops::FnOnce<(&'r [i32; 5],)>>::Output == (&'r _, &'r _)`
  --> examples/dddd.rs:11:24
   |
11 |     let (begin, end) = Ref::map_split(borrow, lambda);
   |                        ^^^^^^^^^^^^^^ expected bound lifetime parameter, found concrete lifetime
   |
   = note: required by `<std::cell::Ref<'b, T>>::map_split`
```

How to fix this while keep passing closure as an argument to  Ref::map_split ?
Repository: create-react-app
Issue: Remove bit.ly links from template
Labels: tag: documentation,tag: internal

We need to remove the bit.ly links from the template because they point to the old README. We need to decide what to replace them with though. We could pick a new URL shortner but we could wind up in this situation again. Some allow you to change link destinations but who would own that account?

Follow up to: https://github.com/facebook/create-react-app/pull/5808.
Related: https://github.com/facebook/create-react-app/issues/5536
Repository: go
Issue: cmd/compile: initialization optimization fails when using -ldflags=-X=VAL
Labels: NeedsFix,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.11.1 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?
yes, tested with `go version go1.11.2 darwin/amd64`


### 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=""
GOCACHE="/Users/thibault.jamet/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/thibault.jamet/dev/"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/z3/r2mc8fw12vb83952716284n00000gq/T/go-build606665018=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->
I narrowed down the problem to a simple go program:
```package main

import "fmt"

var version = "dev"
var versions = struct {
    API  string
    Code string
}{"0.1.0", version}

func main() {
    fmt.Println(version)
    fmt.Println(versions)
}
```
Then build it using the specific flag described in the [toolchain tricks](https://github.com/golang/go/wiki/GcToolchainTricks#including-build-information-in-the-executable), `go build -o test -ldflags "-X main.version=1.0.0" .`


### What did you expect to see?
When running `./test` I would expect to get an output of 
```
1.0.0
{0.1.0 1.0.0}
```

### What did you see instead?
An output of
```
1.0.0
{0.1.0 dev}
```

I suspect this is related to when `main.version` is evaluated, using ldflags makes the version resolved at link time, where the compiler may have already inlined its use and thus remove the reference used by the linker
Repository: opencv
Issue: imgproc: use of undeclared identifier 'ippBorderFirstStageInMem'
Labels: bug,category: imgproc,priority: low,category: build/install

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

Please:

* Read the documentation to test with the latest developer build.
* Check if other person has already created the same issue to avoid duplicates. You can comment on it if there already is an issue.
* Try to be as detailed as possible in your report.
* Report only one problem per created issue.


This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->

- OpenCV => 3.4.4
- Operating System / Platform => Arch Linux
- Compiler => gcc (GCC) 8.2.1 20180831

##### Detailed description

While compiling with Intel IPP 2017.0 I get
```
/home/sergiu/Projects/opencv/modules/imgproc/src/morph.cpp: In function ‘bool cv::ippMorph(int, int, int, const uchar*, size_t, uchar*, size_t, int, int, int, int, int, int, int, int, int, int, int, uchar*, size_t, int, int, int, int, int, const double*, int, bool)’:
/home/sergiu/Projects/opencv/modules/imgproc/src/morph.cpp:1226:34: error: ‘ippBorderFirstStageInMem’ was not declared in this scope
                 iwBorderType &=  ippBorderFirstStageInMem;
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
/home/sergiu/Projects/opencv/modules/imgproc/src/morph.cpp:1226:34: note: suggested alternative: ‘ippBorderInMem’
                 iwBorderType &=  ippBorderFirstStageInMem;
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
                                  ippBorderInMem
```

##### Steps to reproduce

1. Install Intel IPP 2017
2. Run CMake on OpenCV 3.4.4
3. Compile `opencv_imgproc`
Repository: pytorch
Issue: BUILD_CAFFE2_OPS=OFF is not tested in CI
Labels: caffe2
Repository: godot
Issue: Polygon2D UV Editor doesn't allow points to be added.
Labels: enhancement,topic:editor,usability

c23710a

Another small feature/enhancement request.

It would be nice if the Polygon2D UV/Poly edit tools allowed points to be added after creating the polygons.  So all operations can be done in the tool without having to switch back and forth or reset things.

![image](https://user-images.githubusercontent.com/13004169/49115970-de200980-f2a4-11e8-80cb-ad45fe63c6a2.png)
Repository: pytorch
Issue: Use of STL templates in cpu/ directory (compiling with different AVX settings) is silently hazardous
Labels: module: build,triaged

In #13993, a user noticed that when compiling with fbgemm, AVX2 instructions started being used in unrelated invocations of `std::unordered_map`. The root cause turned out to be because we compiled code with `-mavx`, and that caused some standard library functions (used by those files) to be compiled with AVX instructions, which then clobbered the non-AVX compiled versions of those library functions. The blog post at https://randomascii.wordpress.com/2016/12/05/vc-archavx-option-unsafe-at-any-speed/ nicely explains the situation.

The general "cure" for this problem is to very carefully not use any inline functions or templates inside AVX compiled files. However, this is a pretty subtle matter (for example, `floorf` in `math.h` is non-static inline on VC++) and easy to get wrong. It would be nice to detect in the build system in some way if we have gotten it wrong.

One possible approach to solving this problem is to write some extra scripts to grovel through the object files we produce when compiling this code, and check if there are any symbols from the standard library which could get clobbered in this case. You'd have to implement this separately for each platform, because standard library implementations are different and that can cause differences in whether or not things get recompiled into the compilation unit or not.

CC @dskhudia

cc @malfet @seemethere @walterddr
Repository: TypeScript
Issue: Object.defineProperty doesn't define properties on 'this'
Labels: Suggestion,Awaiting More Feedback,Domain: JavaScript

```js
// @ts-check

class C {
  constructor() {
    Object.defineProperty(this, "x", { value: "hello" });

    this.x.toLowerCase();
  }
}
```

**Expected**: No error.
**Actual**: `Property 'x' does not exist on type 'C'.`
Repository: flutter
Issue: GIFs with high frame rates run slower than expected
Labels: engine,a: quality,customer: product,a: images,has reproducible steps,P2,found in release: 3.7,found in release: 3.9,team-engine,triaged-engine

## Steps to Reproduce

1. Have a gif file
2. Have code like final Image image = Image.file(File('gif_file_path'), fit: BoxFit.contain);
3. Compare gif in chrome with flutter and notice it repeats or runs slower in Flutter

Here's an example video: https://www.youtube.com/watch?v=EoLbQRfTSbM


## Flutter Doctor
```
$ flutter doctor -v
[✓] Flutter (Channel master, v0.11.11-pre.7, on Mac OS X 10.13.6 17G65, locale en-US)
    • Flutter version 0.11.11-pre.7 at /Users/KG/Developer/Flutter/flutter
    • Framework revision bcac1bd5e2 (37 minutes ago), 2018-11-27 14:44:53 -0800
    • Engine revision 5bf4deb435
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/KG/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/KG/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 28.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.2.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 29.1.3
    • Dart plugin version 182.4892.25

[!] VS Code (version 1.21.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[!] Connected device
    ! No devices available

```
Repository: flutter
Issue: the canvas content overflow from the child page when drag back.
Labels: framework,f: routes,has reproducible steps,P2,found in release: 3.3,found in release: 3.5,team-framework,triaged-framework

![image](https://user-images.githubusercontent.com/5997900/49120123-cd948100-f2ee-11e8-890d-56a8db49b638.png)

The body of child page was a entire custompainter, and when I drag back, it overflowed from the page.

Is this a flutter problem?
Repository: flutter
Issue: Provide a flutter tool wrapper around dartdoc?
Labels: c: new feature,tool,P3,team-tool,triaged-tool

The `flutter` tool already basically provides a wrapper around dartanalyzer.  Maybe it could provide a wrapper around `dartdoc` too?

Currently `dartdoc` requires setting the `FLUTTER_ROOT` environment variable to generate project documentation with working references to Flutter API documentation, and it requires using `--link-to-remote`.  Meanwhile the `flutter` tool already sets `FLUTTER_ROOT` itself and hides it from users.
Repository: pytorch
Issue: [JIT] Tracing a script function/module where not all args are Tensors
Labels: oncall: jit

## 🐛 Bug
Suppose I write a script function/module where one argument is an int.

Then tracing a larger model that uses this script function will fail.

## To Reproduce

```python
@torch.jit.script
def foo(x, y:int):
    return x + y

def bar(x):
    return foo(x, 4)

x = torch.zeros(3)
foo(x, 4)     # this works for any `x` and `y`
bar(x)         # this works too
traced_bar = torch.jit.trace(bar, (x,)) # this errors
```

The tracing fails with `ValueError: Auto nesting doesn't know how to process an input object of type int. Accepted types: Tensors, or lists/tuples of them`

## Environment

PyTorch version: 1.0.0a0+60e7d04
Is debug build: No
CUDA used to build PyTorch: 9.1.85

OS: Ubuntu 16.04.5 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
CMake version: version 3.11.1

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.1.85
GPU models and configuration:
GPU 0: GeForce GTX 1080 Ti
GPU 1: GeForce GTX 1080 Ti
GPU 2: GeForce GTX 1080 Ti
GPU 3: GeForce GTX 1080 Ti

Nvidia driver version: 390.77
cuDNN version: Probably one of the following:
/usr/local/cuda-9.1/targets/x86_64-linux/lib/libcudnn.so.7.1.3
/usr/local/cuda-9.1/targets/x86_64-linux/lib/libcudnn_static.a

Versions of relevant libraries:
[pip] Could not collect
[conda] cuda91                    1.0                  h4c16780_0    pytorch
[conda] magma-cuda91              2.3.0                         1    pytorch
[conda] torch                     1.0.0a0+60e7d04           <pip>
[conda] torchvision               0.2.1                    py36_1    pytorch