sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: kubernetes
Issue: kubeconfig config set-context fails with mix of writable & non-writable entries in KUBECONFIG
Labels: kind/bug,priority/backlog,area/kubectl,sig/cli,lifecycle/frozen

**Is this a BUG REPORT or FEATURE REQUEST?**:

> Uncomment only one, leave it on its own line:
>
/kind bug
> /kind feature


**What happened**:

with `KUBECONFIG=/home/pdbogen/.kube/config:/etc/kube/config`, `kubeconfig config set current-context sandbox` returns `error: open /etc/kube/config.lock: permission denied`

**What you expected to happen**:

kubeconfig should lock only `/home/pdbogen/.kube/config` and set the indicated setting there

**How to reproduce it (as minimally and precisely as possible)**:

```sh
$ mkdir readonly writable
$ chmod -w readonly
$ KUBECONFIG=$PWD/writable/config:$PWD/readonly/config kubectl config set current-context example
error: open /home/pdbogen/readonly/config.lock: permission denied
```

**Anything else we need to know?**:

I want to be able to provide my users a system-managed kubernetes config that describes various clusters. I would like them to be able to specify things like current-context easily, via `kubectl config`.

Even when `~/.kube/config` exists and contains a `current-context` setting, `kubectl config set current-context` still tries to lock /etc/kube/config.

**Environment**:
- Kubernetes version (use `kubectl version`): `Client Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.5-16", GitCommit:"32ac1c9073b132b8ba18aa830f46b77dcceb0723", GitTreeState:"clean", BuildDate:"2018-06-27T17:46:30Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}` (we build our own, currently can't use 1.11)
- Cloud provider or hardware configuration: n/a; but, Amazon EKS
- OS (e.g. from /etc/os-release): Ubuntu Xenial 16.04.5
- Kernel (e.g. `uname -a`): 4.4.0-1063-aws
- Install tools: na
- Others: na
Repository: flutter
Issue: FlutterDriver documentation update needed.
Labels: a: tests,tool,d: api docs,t: flutter driver,P2,team-tool,triaged-tool

SendKeys or type-into-field isn't mentioned in the documentation but now exists as a feature per #12599
Repository: go
Issue: x/tools/cmd/gomvpkg: `// import ` not changed
Labels: Tools

Please answer these questions before submitting your issue. Thanks!


### What version of Go are you using (`go version`)?
1.10.3

### Does this issue reproduce with the latest release?
1.10.3 is the latest

### What operating system and processor architecture are you using (`go env`)?


### What did you do?
```
go get -u golang.org/x/tools/cmd/gomvpkg
gomvpkg -from istio.io/fortio -to fortio.org/fortio
# the fnet/network.go file has the other package changed but not itself (same for all files):
package fnet // import "istio.io/fortio/fnet"

import (
        "fmt"
        "io"
        "io/ioutil"
        "math/rand"
        "net"
        "os"
        "strconv"
        "strings"
        "sync"

        "fortio.org/fortio/log"
        "fortio.org/fortio/version"
)
```
### What did you expect to see?

The import comment to be change to be the new location

### What did you see instead?

No change on the // import
Repository: node
Issue: readline: processing \u2028 and \u2029
Labels: help wanted,readline

Not sure if we should fix, document, or ignore this and if it has been discussed, so to be on the safe side.

Currently, `\u2028` and `\u2029` are considered as line breaks by JavaScript `RegExp`s, while they are ignored by the `readline`:

```js
'use strict';

const fs = require('fs');
const readline = require('readline');

const str = '123\n456\r123\u{2028}456\u{2029}789';

console.log(str.split(/^/mu));

fs.writeFileSync('readline-test.txt', str, 'utf8');

const rl = readline.createInterface({
  input: fs.createReadStream('readline-test.txt', 'utf8'),
  crlfDelay: Infinity,
});

rl.on('line', console.log);
```

![out](https://user-images.githubusercontent.com/10393198/44431861-5db48300-a5a8-11e8-8773-92ab994619b2.png)

Feel free to close if this is a wontfix.
Repository: pytorch
Issue: Unexpected Behavior when Pointwise Operations Write to Expanded Tensors
Labels: module: internals,good first issue,triaged,module: partial aliasing

I discovered this when writing some masking code, it seems that unexpected behavior can arise when using pointwise operations to write to expanded tensors. The code below reproduces and explains the issue:

We start off by constructing an example array and constructing a mask from it:
```python
example_batch = torch.Tensor([
    [[1, 2, 0, 0],
     [2, 1, 3, 0],
     [2, 1, 3, 0]]
])

mask = (example_batch == 0)
>>> mask
tensor([[[0, 0, 1, 1],
         [0, 0, 0, 1],
         [0, 0, 0, 1]]], dtype=torch.uint8)
```

We then expand a range into our example batch:

```python
index_filled = torch.arange(1, example_batch.size(-1) + 1).expand_as(example_batch)
>>> index_filled
tensor([[[1, 2, 3, 4],
         [1, 2, 3, 4],
         [1, 2, 3, 4]]])
```

So far, so good, yet the problem appears when we try to do a `masked_fill` on `index_filled` using our masked array:

```python
masked = index_filled.masked_fill_(mask, 0)
>>> masked
tensor([[[1, 2, 0, 0],
         [1, 2, 0, 0],
         [1, 2, 0, 0]]])
```

This doesn't seem to be what we would expect from our mask operation, what we where expecting was:

```python
tensor([[[1., 2., 0., 0.],
         [1., 2., 3., 0.],
         [1., 2., 3., 0.]]])
```

This behavior also happens with `.add_` (an ATen operation):
```python
>>> index_filled.add_(mask.long())
tensor([[[1, 2, 4, 7],
         [1, 2, 4, 7],
         [1, 2, 4, 7]]])
```
Verse if we try with `.contiguous()`...
```python
>>> index_filled.contiguous().add_(mask.long())
tensor([[[1, 2, 4, 5],
         [1, 2, 3, 5],
         [1, 2, 3, 5]]])
```

The "quick fix" to this is to call `.contiguous()` before `add_` or `masked_fill`, however I feel that this solution is non-obvious if the user is not aware of strides (and non-obvious even if the user is). Maybe a check for this type of case should exist? Thanks to @jekbradbury for helping me figure out this issue.

## System Info
- Python version: 3.6
- CUDA available: No
- PyTorch or Caffe2: PyTorch
- How you installed PyTorch (conda, pip, source): Conda
- OS: Mac OSX 10.13.6
- PyTorch version: 0.4.1
- Python version: 3.6
Repository: go
Issue: net/http: custom error handlers for http.FileServer
Labels: FeatureRequest

Noticed that in Go 1.11 a error handler field was added to httputil's ReverseProxy to allow sending allow writing a custom error.

I think the same should be done for http.FileServer, http.ServeFile and http.ServeContent.

I don't see an easy way to do this without breaking the API or adding more API so maybe this is better for Go 2.
Repository: rust
Issue: confusing "unused type parameter" diagnostic
Labels: C-enhancement,A-diagnostics,T-compiler,A-suggestion-diagnostics,D-papercut

I really don't get this diagnostic. It says that U is unused, but removing U causes a " cannot find type `U` in this scope" diagnostic. Is U used or not? I feel like this diagnostic could be improved. 

(btw, I arrived at this code while reading https://doc.rust-lang.org/book/2018-edition/ch13-01-closures.html#limitations-of-the-cacher-implementation)

```rust

struct Cacher<T, U: Copy>
    where T: Fn(U) -> U
{
    calculation: T,
    value: Option<u32>,
}


fn main() {
    let c = Cacher::new(|x| x);
    println!("Hello, world!");
}
```

([Playground](https://play.rust-lang.org/?gist=9234bed2d2121051f9a3d3ac9fafab48&version=nightly&mode=debug&edition=2015))

Errors:

```
   Compiling playground v0.0.1 (file:///playground)
error[E0392]: parameter `U` is never used
 --> src/main.rs:2:18
  |
2 | struct Cacher<T, U: Copy>
  |                  ^ unused type parameter
  |
  = help: consider removing `U` or using a marker such as `std::marker::PhantomData`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0392`.
error: Could not compile `playground`.

To learn more, run the command again with --verbose.

```
Repository: rust
Issue: incremental: hash items' source tokens to generate DefId's.
Labels: T-compiler,A-incr-comp

We should strive to handle the "only touched one item" case *very well*, which means *either* knowing the exact modified range, *or inferring it* through a series of heuristics.

The current `DefPath` machinery doesn't know how to properly understand things like e.g. `impl`s haven't changed, and would assume that adding an impl invalidates later ones in the same module.

If we *only* apply the existing machinery between the "leftover" old and new items that didn't have a match in their "source tokens hash", we should be able to get overall more consistent `DefId` matches, even in trickier situations where, for example, the whole file was moved around.

Original source could also be used, but ignoring whitespace & comments seems useful.

<hr/>

One way I can see us proceeding is by gathering some statistics of the hit/miss rate of this scheme for typical editing scenarios, and the cost of actually doing the hashing.

We can probably compute the hash for each `Item` after finishing parsing it, from its `tokens` field (which is there for proc macros, but it should be fine to reuse for our purposes).

cc @nikomatsakis @michaelwoerister 

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":null}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: rust
Issue: Separate the Res::Local case from hir::ExprKind::Path.
Labels: C-cleanup,T-compiler,A-HIR

All other things an expression can refer to, have `DefId`s.
If we separate them, then we can use a proper `HirId` for `hir::ExprKind::Local`, and maybe even refactor the current `hir::def::Res` enum away.

Somewhat related to #53553.

cc @nikomatsakis @michaelwoerister
Repository: create-react-app
Issue: @next react-scripts(webpack.config.js) to resolve `.wasm` extension?
Labels: issue: proposal

I was curious if there was any reason `.wasm` extension was left out from [`resolve.extensions` list](https://github.com/facebook/create-react-app/blob/next/packages/react-scripts/config/webpack.config.dev.js#L146)?

Webpack also default to [include `.wasm`](https://webpack.js.org/configuration/resolve/#resolve-extensions).

It'd be nice to start using/experimenting wasm from create-react-app!
Repository: go
Issue: x/crypto/ssh: concurrent call ssh.Dial will fail
Labels: NeedsInvestigation

Please answer these questions before submitting your issue. Thanks!


### What version of Go are you using (`go version`)?
1.8.3

### Does this issue reproduce with the latest release?
https://github.com/golang/crypto.git
commit : 614d502a4dac94afa3a6ce146bd1736da82514c6

### What operating system and processor architecture are you using (`go env`)?
centos 7

### What did you do?

	auth := make([]ssh.AuthMethod, 0)
	auth = append(auth, ssh.Password("123456"))
	config := &ssh.ClientConfig {
		User: "root",
		Auth: auth,
		HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error {
			return nil
		},
		Timeout: 30 * time.Second,
	}
	for i:=0;i<2;i++ {
		go func() {
			client, err := ssh.Dial("tcp", "ip:port", config)
			fmt.Println(err) // the 2th thread (maybe 3th or other litter value) will error
			time.Sleep(5 * time.Second)
			// error is not here, it just a test code
			client.Close()
		}()
	}

### What did you expect to see?
run pass

### What did you see instead?
<nil>
ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

the second thread error , other machines maybe 3 or ...
Repository: flutter
Issue: Request ID token option for google_sign_in plugin
Labels: c: new feature,p: google_sign_in,package,team-ecosystem,P2,triaged-ecosystem

With google_sign_in v3.0.4, there is no option to request an ID token.

On iOS, the ID token is always returned, but on Android it is null unless the builder option is provided.

Here is the [documentation](https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInOptions.Builder.html#requestIdToken(java.lang.String)) of the missing option method.
Repository: go
Issue: x/tools/cmd/gomvpkg: package not changed in files with different OS build tags
Labels: Tools

Please answer these questions before submitting your issue. Thanks!


### What version of Go are you using (`go version`)?

`go version go1.10.2 darwin/amd64`

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

```
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
```

### What did you do?

Ran `gomvpkg -from github.com/hashicorp/consul/agent/proxy -to github.com/hashicorp/consul/agent/proxyprocess -vcs_mv_cmd "git mv {{.Src}} {{.Dst}}"`

If you checkout the current head of Consul 4d658f34cfcb5c2e0b29ae5103e923872bddcaa7 and run the same command you should see the same issue.

### What did you expect to see?

All files moved to the new package name and their package declarations updates

### What did you see instead?

All files moved _but_ two files with build tags that didn't match my host OS were not modified and so kept the old `package proxy` declaration.

The two files are https://github.com/hashicorp/consul/blob/4d658f34cfcb5c2e0b29ae5103e923872bddcaa7/agent/proxy/process_windows.go#L1-L3 
```go
// +build windows

package proxy
```

and 

https://github.com/hashicorp/consul/blob/4d658f34cfcb5c2e0b29ae5103e923872bddcaa7/agent/proxy/exitstatus_other.go#L1-L3
```go
// +build !darwin,!linux,!windows

package proxy
```

This is unpleasant as build and test pass locally still naturally!

This may well be a "known" issue caused by something in the tool chain that is hard to work around, however I don't see an open issue for it and it's certainly surprising to me that this wouldn't work for files with os-dependent build tags. Even if the tooling makes it hard to fix those for some reason, it would be better to at least detect that happening and warn the user to update manually.

Thanks!
Repository: angular
Issue: downgrade component doesn't forward errors to $exceptionHandler
Labels: type: bug/fix,area: upgrade,state: confirmed,P4

<!--
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.

ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
-->

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->
Seems like errors that occur in component constructor are resulting in unhandled promise rejection error:

![image](https://user-images.githubusercontent.com/1985429/44462014-5ececa00-a613-11e8-898e-7fa1b41f9098.png)


## Expected behavior
<!-- Describe what the desired behavior would be. -->
Instead of being logged by zone.js (which is nice!) it should be forwarded to angular.js $exceptionHandler and handled according to the project setup - in this case custom a logger service

![image](https://user-images.githubusercontent.com/1985429/44462376-b3267980-a614-11e8-9d32-a88c783810c0.png)


## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->
This way errors would be forwarded to some implementation of $log or custom $exception handler and could be tracked / reported. 

The fix is simple: include `$exceptionHandler` to [dependencies](https://github.com/angular/angular/blob/master/packages/upgrade/src/common/downgrade_component.ts#L157) and add `.catch($exceptionHandler)` in [here](https://github.com/angular/angular/blob/master/packages/upgrade/src/common/downgrade_component.ts#L146) 

## other
We are still using `upgrade/static`

EDIT: For suggested change to work correctly, `ParentInjectorPromise` should also return an object with a noop `catch` method
Repository: go
Issue: cmd/compile: optimise ranges over string(byteSlice)
Labels: Performance,NeedsInvestigation,compiler/runtime

Take these two benchmarks: https://play.golang.org/p/QI4BxUq8MGp

The first code is cleaner, more idiomatic, and easier to write/maintain. The second is much trickier, and I'm not even sure I wrote it correctly.

Lucky for us, the first tends to perform about the same or slightly better in terms of time:

```
$ go test -bench=. -benchmem
goos: linux
goarch: amd64
pkg: mvdan.cc/p
BenchmarkIdiomatic-4      500000              2389 ns/op            2688 B/op          1 allocs/op
BenchmarkManual-4         500000              2645 ns/op               0 B/op          0 allocs/op
PASS
ok      mvdan.cc/p      2.578s
```

However, as one can see, it still incurs an extra allocation. I'm not sure why that is - via `go test -gcflags=-m`, I can see `./f_test.go:16:27: BenchmarkIdiomatic string(Input) does not escape`.

We have optimized other common string conversion patterns, such as `switch string(byteSlice)` 
in 566e3e074c089568412a44a8d315c2881cfd8e8f, and I believe `someMap[string(byteSlice)]` was optimized too.

Would it be possible to get rid of this allocation somehow? My knowledge of the runtime and compiler is a bit limited, but I'd think that it is possible.

As for a real use case - there's a few occurrences in the standard library that could be greatly simplified. For example, in `encoding/json` we'd remove ten lines of tricky code:

```
diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go
index 2e734fb39e..fa09b85aab 100644
--- a/src/encoding/json/decode.go
+++ b/src/encoding/json/decode.go
@@ -1210,20 +1210,11 @@ func unquoteBytes(s []byte) (t []byte, ok bool) {
 	// then no unquoting is needed, so return a slice of the
 	// original bytes.
 	r := 0
-	for r < len(s) {
-		c := s[r]
-		if c == '\\' || c == '"' || c < ' ' {
-			break
-		}
-		if c < utf8.RuneSelf {
-			r++
-			continue
-		}
-		rr, size := utf8.DecodeRune(s[r:])
-		if rr == utf8.RuneError && size == 1 {
+	for i, c := range string(s) {
+		if c == '\\' || c == '"' || c < ' ' || c == utf8.RuneError {
 			break
 		}
-		r += size
+		r = i
 	}
 	if r == len(s) {
 		return s, true
```

However, that currently means a bad regression in speed and allocations:

```
name           old time/op    new time/op    delta
CodeDecoder-4    27.3ms ± 1%    31.2ms ± 1%   +14.16%  (p=0.002 n=6+6)

name           old speed      new speed      delta
CodeDecoder-4  71.1MB/s ± 1%  62.3MB/s ± 1%   -12.41%  (p=0.002 n=6+6)

name           old alloc/op   new alloc/op   delta
CodeDecoder-4    2.74MB ± 0%    5.13MB ± 0%   +87.28%  (p=0.002 n=6+6)

name           old allocs/op  new allocs/op  delta
CodeDecoder-4     77.5k ± 0%    184.3k ± 0%  +137.72%  (p=0.002 n=6+6)
```

I haven't investigated why my microbenchmark is faster when simpler, while json gets so much slower when made simpler.

Any input appreciated. cc @josharian @martisch @randall77 @TocarIP
Repository: opencv
Issue: reprojectImageTo3D not thread safe
Labels: incomplete



- OpenCV => 3.4.1:
- Operating System / Platform => Ubuntu 16.04:
- Compiler => GCC 5.5

##### Detailed description

cv::reprojectImageTo3D from calib3d is not thread safe. When used in a multithreaded application, it gives large memory leaks. My current real-time application leaks approx 50 MB/sec, which can be manually traced to this function. 
 (valgrind does not work due to an AVX512 assertion, even though OpenCV was build while specifically disabling all AVX instructions using -D CPU_BASELINE_DISABLE= AVX512F AVX2 AVX SSE4.1 SSSE3 SSE3 AVX512_SKX. So please dont ask for valgrind output).

Can be easily reproduced in a tbb::pipeline or using tbb::parallel_invoke as shown below.

In my own application the output is ok, only the memory leaks.

##### Steps to reproduce

Run the below code and check the memory usage, which will grow for each call. 

// C++ code example
```
#include <opencv2/core.hpp>
#include <opencv2/calib3d.hpp>
#include <tbb/parallel_invoke.h>
#include <iostream>

void testReprojection1()
{
  cv::Mat fakeDisparity(1920, 1440, CV_32F);
  cv::randn(fakeDisparity, 200, 100);

  cv::Mat Q = (cv::Mat_<float>(4, 4) << 1, 0, 0, -960, 0 , 1, 0, -720, 0 , 0, 0, 1500, 0 , 0, 1/150, 0);
  cv::Mat output;
  cv::reprojectImageTo3D(fakeDisparity, output, Q, false);
}

void testReprojection2()
{
  cv::Mat fakeDisparity(1920, 1440, CV_32F);
  cv::randn(fakeDisparity, 200, 100);

  cv::Mat Q = (cv::Mat_<float>(4, 4) << 1, 0, 0, -960, 0 , 1, 0, -720, 0 , 0, 0, 1500, 0 , 0, 1/150, 0);
  cv::Mat output;
  cv::reprojectImageTo3D(fakeDisparity, output, Q, false);
}

int main(int fArgc, char **fArgv)
{
  try
  {
    for (int i = 0; i < 1000; ++i)
    {
      tbb::parallel_invoke(testReprojection1, testReprojection2);
    }
  }
  catch (const std::exception &fEx)
  {
    std::cerr << "Error: " << fEx.what() << std::endl;
    return EXIT_FAILURE;
  }
  std::cout << "Exiting program" << std::endl;
}

```
Repository: TypeScript
Issue: Missing completion for abstract indexed types
Labels: Bug

**TypeScript Version:**  5.1.3

**Search Terms:**
missing, suggestion, code completions, language-server, abstract, generic

**Code**

```ts
export abstract class StateMachine {
  abstract state: any;

  getProperty<K extends keyof this["state"]>(key: K): this["state"][K] {
    return this.state[key];
  }
}

export class SomeStateMachine extends StateMachine {
  state = {
    menu: {
      login() {
        console.log("Menu.login");
      },
    },
    game: {
      update() {
        console.log("Game.update");
      },
    },
  };

  constructor() {
    super();
    //                ⌄--- No code-completions here...!
    this.getProperty("menu").login();
  }
}


```

**Expected behavior:**

I expected to get suggestions for the `this.getProperty`'s key parameter (used in the constructor).
The suggestion should be "menu" or "game".

**Actual behavior:**

The compiler is able to identify the "correct" keys ("menu" | "game") but not able to suggest them via code completions.

**Playground Link:**
[Playground link](https://www.typescriptlang.org/play?pretty=false&ts=5.1.3#code/IYIwzgLgTsDGEAJYBthjAgyhYECmAsnABYCWAdnggN4CwAUAgqJDPApLngFzPkCeAbgYMmAczwQAClAD2ABzxQI-ADwBpBHgAe+cgBMMAazz9ZAMwQQyYANoAiTvnsBdAHwAKE-17qAlLzWpHaOOM4utuouNKJMCFCSAK5Q5FY2AHROeLbeLsKMCAC+DMX0DChoGJiyALZ42FxEsGSUWrp4BlVhhCQUVHQFWQgAvDEFTHXkibwDcXHIsmIUHn5jc3OwsuRgssh46QtiHvYEHYkHixT2fvnrRQA0sUyFj+MIYsB1M09xifL6XBWazuSC2Oz2FyO9gA4p99n8Ac4bj9nq85i9YoV8rFNttoIl4LIoEDZnEwH8lCtbnEgmB0hJpHJFMp+MdJolrpDlsiCqVSkA)

**Related Issues:**
Found none.
Repository: flutter
Issue: InkWell and InkResponse not close enough to the real thing
Labels: framework,f: material design,a: fidelity,f: gestures,customer: crowd,P2,team-design,triaged-design

When I briefly tap stuff on native Android, I usually can see the highlight and splash very easily. However, in Flutter, both `InkRipple.splashFactory` and `InkSplash.splashFactory` are slower to show/hide. `InkRipple.splashFactory` is better in my opinion, should be the default, but it's not quite right also. 

More importantly, in Android native the splash is shown when I REMOVE my finger, while in Flutter it's shown when I hold my finger down.

I wish splash/highlight were tweaked to obtain the exact same effect of native Android.