sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: "Move to new file" breaks imports when using re-exports
Labels: Bug,Domain: Refactorings

<!-- 🚨 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 `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.5.2

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** re-export es modules import move to new file

**Code**

Given:

``` ts
// ./foo.ts
export const bar = 1;

export const foo = 1;
```

``` ts
// ./re-exports.ts
export { foo } from './foo';
```

```ts
// ./main.ts
import { foo } from './re-exports';

console.log(foo);
```

If I action "move to new file" on this line from `./foo.ts`:

``` ts
export const foo = 1;
```

**Expected behavior:**

- The import in `./main.ts` should still work

**Actual behavior:**

- The import in `./main.ts` is now broken (because the re-export in `./re-exports.ts` is now broken)

**Related Issues:** https://github.com/microsoft/TypeScript/issues/32344
Repository: rust
Issue: warning lint on chained assignment
Labels: C-enhancement,A-lints,A-diagnostics,T-lang,T-compiler,A-suggestion-diagnostics

(This is a first impl on https://users.rust-lang.org/t/warn-about-using-the-value-of-an-assignment-expression/31324, thanks to @sourcefrog )

Code like `a = b = 3` is a "common" pattern in C, python and other languages. People who are coming to Rust may be surprised to see, that it doesn't work the intended way. There's no warning whatsoever, just a clippy lint:
```text
warning: this let-binding has unit value
 --> src/main.rs:2:5
  |
2 |     let a;
  |     ^^^^^^
```

I managed to implement this:
```text
warning: chaining assignment is not supported in Rust
 --> a.rs:4:5
  |
4 |     a = b = 3;
  |     ^^^^^^^^^
  |
  = note: `#[warn(chained_assignment)]` on by default
```

But I have a few questions:
What does the user actually want?
Does he want
  1 `a = 3; b = 3`
  2 `a = b == 3`

The first one only works if the value is `Copy` for obvious reasons.
The second one only works if the value implements `PartialEq`.

I would like to see this in the Rust compiler, what do you think? What is missing? Am I overlooking something? Is everything covered? Would it brake any existing code?
Repository: opencv
Issue: Documentation deprecated
Labels: category: documentation,category: gpu/cuda (contrib),Hackathon

Hi,

OpenCV version > 4.1.1

Please update the docs to remove features that disappeared...
https://docs.opencv.org/4.1.1/d9/d80/classcv_1_1cuda_1_1CascadeClassifier.html
https://answers.opencv.org/question/205087/how-to-use-cascadeclassifiercreate-in-opencv-40/
Or add a big "no longer working, go back to 3.4.XX..."

And remove sample code that therefore cannot work
samples/gpu/cascadeclassifier.cpp
Or clog out a big "no longer working, go back to 3.4.XX..."
Repository: kubernetes
Issue: JSONPatch accepts invalid paths with a spurious leading segment
Labels: kind/bug,sig/api-machinery,priority/important-longterm,lifecycle/frozen

**What happened**:

```sh
kubectl patch namespaces/default -o json --type json -p '[{"op":"replace", "path":"bogus/metadata/annotations","value":{"k":"v"}}]'
```

The patch was applied and metadata.annotations modified

**What you expected to happen**:

The invalid path (no leading `/`) would be rejected

**How to reproduce it (as minimally and precisely as possible)**:

**Anything else we need to know?**:

The JSONPatch library splits the path by `/` and discards the first segment, assuming it is empty:

https://github.com/kubernetes/kubernetes/blob/f6a70ef27163d1171412b6f97049968896b8d1f9/vendor/github.com/evanphx/json-patch/patch.go#L307-L313

Before fixing this, we should consider the compatibility implications of rejecting patches that were previously accepted.

/sig api-machinery
/cc @jpbetz
Repository: storybook
Issue: Addon-docs: Automatically display component import paths
Labels: feature request,addon: docs

<img width="468" alt="Screen Shot 2019-08-14 at 1 12 23 PM" src="https://user-images.githubusercontent.com/52427513/63041165-2e6fe380-be95-11e9-893d-c85404ee2dc2.png">

Above screenshot is from React Styleguidist, which automatically displays a copy / paste link of the import path for end user convenience. I think this would be a great feature for Storybook. Here's a link where you can see this live in action: https://react-styleguidist.js.org/examples/basic/

(Developers do not need to assist this on a per component basis, this is just configured somewhere once and every component gets this copy & paste feature). 

@shilman
Repository: material-ui
Issue: [Select] getting slow when loading 2000 options
Labels: performance,component: select

## Current Behavior 😯

- When Select Component rendered with 2000 options, getting delay to show the drop-down and select the value

<!-- Describe what happens instead of the expected behavior. -->

## Expected Behavior 🤔

Need to be fast on showing the drop-down and selecting the value

<!-- Describe what should happen. -->

## Steps to Reproduce 🕹
https://codesandbox.io/s/material-demo-5ygxr
<!--
  Provide a link to a live example (you can use codesandbox.io) and an unambiguous set of steps to reproduce this bug.
  Include code to reproduce, if relevant (which it most likely is).

  This codesandbox.io template _may_ be a good starting point:
  https://codesandbox.io/s/github/mui-org/material-ui/tree/master/examples/create-react-app

  If you're using typescript a better starting point would be
  https://codesandbox.io/s/github/mui-org/material-ui/tree/master/examples/create-react-app-with-typescript

  If YOU DO NOT take time to provide a codesandbox.io reproduction, should the COMMUNITY take time to help you?
-->

## Your Environment 🌎

<!--
  Include as many relevant details about the environment with which you experienced the bug.
  If you encounter issues with typescript please include version and tsconfig.
-->

| Tech        | Version |
| ----------- | ------- |
| Material-UI | v4.3.2  |
| React       |  16.9.1       |
| Browser     |    chrome     |
| etc.        |         |
Repository: pytorch
Issue: Consider changing the behavior of Tensor.__contains__(Tensor) to make more sense
Labels: triaged,module: numpy,module: ux

## 🐛 Bug

```
import torch
x = torch.tensor([1, 2, 3])
y = torch.tensor([5, 6, 3])
y in x  # True
```

## Expected behavior

This particular case should be False.  Related: https://github.com/pytorch/pytorch/pull/17733 https://github.com/pytorch/pytorch/pull/24156
The incorrect semantics was introduced in PyTorch 1.2 (May), but no one else has complained about it yet in the three months since.

## Environment

pytorch master.

cc @mruberry @rgommers @heitorschueroff
Repository: rust
Issue: Confusing error deriving PartialEq when child type impls PartialEq<OtherType>
Labels: A-type-system,C-enhancement,A-diagnostics,A-macros,T-compiler,T-types

Compiling the following code

```rust
struct TypeA;
struct TypeB;

#[derive(PartialEq)]
struct TypeC(TypeA);

impl std::cmp::PartialEq<TypeA> for TypeB {
    fn eq(&self, other: &TypeA) -> bool { true }
}

impl std::cmp::PartialEq<TypeB> for TypeA {
    fn eq(&self, other: &TypeB) -> bool { true }
}


fn main() {
    let one = TypeC(TypeA);
    let two = TypeC(TypeA);
    if one == two {
        eprintln!("yay");
    }
}
```
produces,

```
error[E0308]: mismatched types
 --> src/main.rs:8:14
  |
8 | struct TypeC(TypeA);
  |              ^^^^^ expected struct `TypeB`, found struct `TypeA`
  |
  = note: expected type `TypeB`
             found type `TypeA`
```

Which I found very confusing. It would be helpful, at least, if we could indicate that this error occurred during macro expansion?

Playground here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ac13781b2c40c1966e18adfb919c236c
Repository: rust
Issue:  Tracking issue for `#![feature(maybe_uninit_slice)]`
Labels: T-libs-api,B-unstable,C-tracking-issue,requires-nightly,A-slice,Libs-Tracked,A-raw-pointers

This is a tracking issue for the RFC "Deprecate `uninitialized` in favor of a new `MaybeUninit` type" (rust-lang/rfcs#1892).

Most of this has been stabilized, this issue now only tracks the below unstable methods.

### Public API

```rust
impl<T> [MaybeUninit<T>] {
    pub unsafe fn assume_init_drop(&mut self);
    pub const unsafe fn assume_init_ref(&self) -> &[T];
    pub const unsafe fn assume_init_mut(&mut self) -> &mut [T];

    pub const fn slice_as_ptr(this: &[MaybeUninit<T>]) -> *const T;
    pub const fn slice_as_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T;
}
```

### Steps / History

- [x] Implementation
- [ ] Make slice methods inherent: https://github.com/rust-lang/rust/pull/129259
- [ ] Ensure documentation has examples
- [ ] Final comment period (FCP)
- [ ] Stabilization PR

### Unresolved Questions

- Should `slice_as_ptr`/`slice_as_mut_ptr` be methods (with some `Self` parameter) instead of functions?
Repository: pytorch
Issue: Unified representation for enum types
Labels: oncall: jit,triaged

Right now we have several enums in PyTorch:

* dtype https://github.com/pytorch/pytorch/blob/master/torch/csrc/Dtype.cpp
* device (actually a tuple) https://github.com/pytorch/pytorch/blob/master/torch/csrc/Device.cpp
* qscheme https://github.com/pytorch/pytorch/blob/master/torch/csrc/QScheme.cpp

(and I'm sure there's more)

These use the Python C API to define the representation in Python, and in TorchScript they use special cases in conversion functions. For example, for dtype:

https://github.com/pytorch/pytorch/blob/0f8d1fbe96114131e59d7b064a336b1acb420125/torch/csrc/jit/pybind_utils.h#L339
https://github.com/pytorch/pytorch/blob/0f8d1fbe96114131e59d7b064a336b1acb420125/torch/csrc/jit/pybind_utils.h#L445

Proposal:

* Keep defining enums in C++, as today
* Use pybind11 to bind the values into Python (maybe unnecessary)
* Add native enum support to TorchScript
* Extend TorchBind to support these enum types https://github.com/pytorch/pytorch/blob/master/torch/custom_class.h#L62



cc @suo
Repository: vscode
Issue: [css] Add support for CSS @supports selector() function
Labels: feature-request,css-less-scss,grammar

The **CSS Conditional Rules Module Level 4** adds [the `selector()` function to the `@supports` at&#x2011;rule](https://drafts.csswg.org/css-conditional-4/#at-supports-ext), which is used to test whether the user agent [supports a new **CSS Selectors** feature](https://drafts.csswg.org/css-conditional-4/#support-definition-ext) (e.g. the `:is(…)` pseudo&#x2011;class or multi&#x2011;value `:not(…)`).

**Visual Studio Code** should provide syntax highlighting and auto&#x2011;completion for this.
Repository: TypeScript
Issue: Disallow values of type 'symbol' from being passed to 'Number' function/constructor or 'String' constructor
Labels: Suggestion,Awaiting More Feedback

## Suggestion

Change the `NumberConstructor` and `StringConstructor` interfaces to disallow passing values of type `Symbol`. Currently it accepts values of type `any`.

Attempting to call `Number(Symbol())`, `new Number(Symbol())`, or `new String(Symbol())` all throw `TypeError`s at runtime.

**Note**: `String(Symbol())` is fine - only `new String(Symbol())` will throw.

## Use Cases

Any time a value of type `any` is passed to `Number`, there is a risk of that value being a `symbol` and throwing a `TypeError`.

Object keys are explicitly allowed to be of type `symbol` (as `number | string | symbol`). Passing an arbitrary object key to `Number` can throw a `TypeError` as well.

## Examples

### Checking if a value can be coerced to a number
I just ran into this issue when checking if an object key could be a valid array index. The following should be an error as it will throw if `value` is of type `symbol`.

```
function keyCanBeArrayIndex(value: string | number | symbol): boolean {
  return !Number.isNaN(Number(value));
}
```

Having this be invalid would have forced me to write something like:

```
function canBeArrayIndex(value: string | number | symbol): boolean {
  try {
    return !Number.isNaN(Number(value));
  } catch {
    return false;
  }
}
```

## 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: pytorch
Issue: Visual Studio Code not providing autosuggestions for submodules
Labels: triaged

Visual Studio Code is not providing autocomplete suggestions for (at least) the `nn` and `optim` submodules as of PyTorch 1.2, despite the type stubs for them being valid (as shown by mypy making correct use of them).

This seems to be an upstream bug with Microsoft's Python language server implementation, https://github.com/microsoft/python-language-server/issues/1301.
Repository: pytorch
Issue: Default warning handler in C++ doesn't seem to unique warnings
Labels: module: error checking,triaged

This default warning handler just prints the warning to cerr:

https://github.com/pytorch/pytorch/blob/4bfd33ed36f853bd6a5c3d410eeebbcee1d1653c/c10/util/Exception.cpp#L77

However, this causes issues if TORCH_WARN is used, for example, in an operator implementation. We could possibly unique the warnings here based on the SourceLocation and only print them once
Repository: rust
Issue: Bad compiler warning when code resolves to multiple experimental APIs
Labels: C-enhancement,A-diagnostics,T-lang,T-libs-api,T-compiler

With Rust 1.36.0, `Range` has two implementations of `is_empty`, one in an inherent impl, the other in an impl for the `std::iter::ExactSizeIterator` trait. Both of these methods are experimental in this version of Rust.

Given the following code:

```rust
fn main() {
    let r = 1u16..10;
    println!("{:?}", r.is_empty());
}
```

This produces the following output:

```
error[E0034]: multiple applicable items in scope
 --> src/main.rs:3:24
  |
3 |     println!("{:?}", r.is_empty());
  |                        ^^^^^^^^ multiple `is_empty` found
  |
  = note: candidate #1 is defined in an impl for the type `std::ops::Range<_>`
  = note: candidate #2 is defined in an impl of the trait `std::iter::ExactSizeIterator` for the type `std::ops::Range<u16>`
  = help: to disambiguate the method call, write `std::iter::ExactSizeIterator::is_empty(r)` instead
```

The problem is this warning does not tell me that either method is experimental. I also get the exact same error with `Range::is_empty`:

```rust
use std::ops::Range;
fn main() {
    let r = 1u16..10;
    println!("{:?}", Range::is_empty(&r));
}
```

Applying the suggested advice to use the `ExactSizeIterator` version produces the expected error (telling me that it's experimental and how to enable it), but the only way to get the expected error when trying to call the inherent impl is to disable the implicit prelude:

```rust
#![no_implicit_prelude]
extern crate std;
fn main() {
    let r = 1u16..10;
    std::println!("{:?}", r.is_empty());
}
```
Repository: flutter
Issue: Allow programatically maximizing windows in GLFW embedding
Labels: engine,a: desktop,e: glfw,P3,team-linux,triaged-linux

That could be useful to be able to set window icon, state (for example, start app maximized) and window start position.

As far as I found, currently only window width, height and title can be changed. Or I'm wrong?
Repository: opencv
Issue: JS: TypeScript type definitions
Labels: feature,category: javascript (js),effort: ∞

I didn't found any opencv typings in DefinitelyTyped and before I start writing some basic types I would like to know if there are any initiative towards this or what are the plans so we have typechecking for OpenCV.js project. Thanks
Repository: flutter
Issue: Flutter.gradle uses implementation instead of api, which may cause problems in some contexts
Labels: platform-android,tool,t: gradle,P2,team-android,triaged-android

See https://github.com/flutter/flutter/pull/27237 - which was closed because it fell out of date and lacked tests.

From that PR: 

>1. Use `flutter create -t module flutter_module` and `flutter make-host-app-editable` to create a project. 
>2. Add a flutter plugin dependency to pubspec.yaml. 

>For a simple plugin example:
```/** FlutterPlugin */
public class FlutterPlugin implements MethodCallHandler {
  /** Plugin registration. */
  public static void registerWith(Registrar registrar) {
    final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_plugin");
    channel.setMethodCallHandler(new FlutterPlugin());
  }

  // This method should be called in app module. Plugin don't know when to init.
  public static void init() {
      // dosth
  }

  @Override
  public void onMethodCall(MethodCall call, Result result) {
    if (call.method.equals("getPlatformVersion")) {
      result.success("Android " + android.os.Build.VERSION.RELEASE);
    } else {
      result.notImplemented();
    }
  }
}
```

/cc @blasten @zanderso @supsaiyajin
Repository: java-design-patterns
Issue: Store and Process pattern
Labels: epic: pattern,type: feature

**Description:**
The Store and Process design pattern focuses on decoupling data storage from data processing to allow for flexible and scalable data stream handling. This pattern is particularly useful in scenarios where data needs to be ingested, stored, and then processed asynchronously. The main elements of this pattern include:

1. **Data Store:** A storage component that receives and holds incoming data. This component should be capable of handling high-throughput data ingestion and provide reliable storage.
2. **Processor:** A processing component that retrieves data from the store, processes it, and outputs the results. This processor can work independently of the data ingestion process, allowing for flexible and scalable data handling.
3. **Decoupling:** By separating the storage and processing responsibilities, the system can scale each component independently, optimizing for performance and resource usage.

**References:**
- [Store and Process Design Pattern - Jenkov Tutorials](https://jenkov.com/tutorials/data-streaming/store-and-process.html)
- [Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)

**Acceptance Criteria:**
1. Implement a data storage component that can ingest and store high-throughput data reliably.
2. Implement a data processing component that retrieves data from the storage component and processes it asynchronously.
3. Ensure the data storage and processing components are decoupled to allow independent scaling and optimization.
Repository: pytorch
Issue: SyncBatchNorm error when using model.eval() with DistributedDataParallel
Labels: needs reproduction,oncall: distributed,module: autograd,triaged

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
```
Traceback (most recent call last):
  File "train.py", line 977, in <module>
    main()
  File "train.py", line 97, in main
    main_worker(ngpus_per_node, args, options)
  File "train.py", line 742, in main_worker
    total_loss.backward()
  File "/mnt/lustre/matao/anaconda3/envs/py36/lib/python3.6/site-packages/torch/tensor.py", line 107, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/mnt/lustre/matao/anaconda3/envs/py36/lib/python3.6/site-packages/torch/autograd/__init__.py", line 93, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [64]] is at version 1423; expected version 1420 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!
```
## To Reproduce

Steps to reproduce the behavior:

1. Use `nn.SyncBatchNorm.convert_sync_batchnorm(model)` to convert the nn.BatchNorm2d to SyncBatchNorm2d layer;
2. Use `torch.nn.parallel.DistributedDataParallel(model.cuda(args.gpu), device_ids=[args.gpu], find_unused_parameters=True)` to wrap the model;
3. Start training, e.g., 100 epochs;
4. At 40th epoch, I use `model.eval()` to fix the parameters of Batchnorm layer, and continue to train other parameters of model, and the error happens now.

Brief code for the clear representation:
```
import torch.multiprocessing as mp
import torch.distributed as dist
import torch.nn as nn

dist.init_process_group(backend='nccl', init_method=args.dist_url,
                                world_size=world_size, rank=rank)

model = nn.SyncBatchNorm.convert_sync_batchnorm(model)

model = torch.nn.parallel.DistributedDataParallel(model.cuda(args.gpu), device_ids=[args.gpu], find_unused_parameters=True)

train_sampler = torch.utils.data.distributed.DistributedSampler(train_dset)

model.train()
for epoch in range(0, epochs):
    if epoch >= 40 and model.training:
        model.eval()
    loss.back_ward()

```

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

 - PyTorch Version: 1.1
 - OS: Linux
 - How you installed PyTorch: conda
 - Python version: 3.6
 - CUDA/cuDNN version: 9.0
 - GPU models and configuration:
 - Any other relevant information:

## Additional context

<!-- Add any other context about the problem here. -->
I fix batchnorm layer at 40th epoch for the better performance of my model's training. And this will work when I use `nn.Dataparallel()` on single node multi gpus, but it doesn't work as I mentioned above on multi nodes multi gpus. And I'm sure the error is caused by setting `model.eval()`, is this the conflict between `SyncBatchNorm` and `model.eval()`?