sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: neovim
Issue: tab drop: TabLeave and TabEnter are triggered unnecessary number of times 
Labels: bug-vim,events

<details><summary>`nvim --version`</summary>
<p>

```
NVIM v0.5.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-JcImo2/neovim-0.5.0+ubuntu2+git202105161736-dab6b08a1-d569569c9=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-JcImo2/neovim-0.5.0+ubuntu2+git202105161736-dab6b08a1-d569569c9/build/config -I/build/neovim-JcImo2/neovim-0.5.0+ubuntu2+git202105161736-dab6b08a1-d569569c9/src -I/build/neovim-JcImo2/neovim-0.5.0+ubuntu2+git202105161736-dab6b08a1-d569569c9/.deps/usr/include -I/usr/include -I/build/neovim-JcImo2/neovim-0.5.0+ubuntu2+git202105161736-dab6b08a1-d569569c9/build/src/nvim/auto -I/build/neovim-JcImo2/neovim-0.5.0+ubuntu2+git202105161736-dab6b08a1-d569569c9/build/include
Compiled by buildd@lgw01-amd64-050


Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
```
</p>
</details>
- Operating system/version: Linux _ 5.10.0-6-amd64 #1 SMP Debian 5.10.28-1 (2021-04-09) x86_64 GNU/Linux
- Terminal name/version:
- `$TERM`: xterm-256color

<!--
If this report is about different behaviour between Nvim and Vim, make sure to
read `:h vim-differences` first. Otherwise remove the next line.
-->
[ ] `vim -u DEFAULTS` (version: ) behaves differently
This is also present in Vim. 

### Steps to reproduce:
1.  Run
```
nvim -u NORC  --clean --cmd 'autocmd! TabLeave * echom "Tab " . tabpagenr() . " left"' -p f1 f2 f3
```
2. After loading buffers execute
```
messages clear
tab drop f1
```
3. See the messages with `g<`.
### Actual behaviour
`TabLeave` was triggered without leaving the tab with `f1`.
![image](https://user-images.githubusercontent.com/11404453/118415401-67f90280-b6aa-11eb-9b36-4ee40c2a99f6.png)

### Expected behaviour
At most one `TabLeave` event. If the above example no `TabLeave` event.

In practice I would like to save the number of the recently used tab to be able to jump back to it. 

Please also run `tab drop f2` and type `g<TAB>` more than once. I get switching between `f2` and `f3` although `f3` has never been opened.
Repository: rust
Issue: Documentation for BufRead is confusing
Labels: C-enhancement,A-docs,T-libs

https://github.com/rust-lang/rust/blob/a55748ffe94e71f841c7b1d752779b0db138b342/library/std/src/io/mod.rs#L1886-L1926

The doc states that`fill_buf()` *needs* to be paired with `consume()` to function properly, which can be comprehended to imply that if `consume()` is not called immediately after `fill_buf()` it would cause undefined behavior.

Also, it is said that later calling `read` **may** return the same contents. It's confusing that **may** is used instead of **will** here, and this confuses the reader to a deeper level.
Repository: three.js
Issue: Using TransformControls to move an object along the axis, the path is not correct
Labels: Needs Investigation

<!-- Ignoring this template may result in your bug report getting deleted -->

**Describe the bug**

Using TransformControls to move an object along the axis, the path is not correct

**To Reproduce**

Use TransformControls to move the object along the axis. When the following three conditions are met, the path is not correct

1. This object has a parent object that has been rotated

2. The coordinate space is 'world'

3. The translationSnap is a a numeric value

***Code***
TransformControls.js  line 421
```
if ( space === 'world' ) {
  // if ( object.parent ) {
  // object.position.add( _tempVector.setFromMatrixPosition( object.parent.matrixWorld ) );
  // }
  // if ( axis.search( 'X' ) !== - 1 ) {
  // 	object.position.x = Math.round( object.position.x / this.translationSnap ) * this.translationSnap;
  // }
  // if ( axis.search( 'Y' ) !== - 1 ) {
  // 	object.position.y = Math.round( object.position.y / this.translationSnap ) * this.translationSnap;
  // }
  // if ( axis.search( 'Z' ) !== - 1 ) {
  // 	object.position.z = Math.round( object.position.z / this.translationSnap ) * this.translationSnap;
  // }
  // if ( object.parent ) {
  // 	object.position.sub( _tempVector.setFromMatrixPosition( object.parent.matrixWorld ) );
  // }
  var vector_temp = new Vector3();
  object.getWorldPosition(vector_temp);
  if ( axis.search( 'X' ) !== - 1 ) {
    vector_temp.x = Math.round( vector_temp.x / this.translationSnap ) * this.translationSnap;
  }
  if ( axis.search( 'Y' ) !== - 1 ) {
    vector_temp.y = Math.round( vector_temp.y / this.translationSnap ) * this.translationSnap;
  }
  if ( axis.search( 'Z' ) !== - 1 ) {
    vector_temp.z = Math.round( vector_temp.z / this.translationSnap ) * this.translationSnap;
  }
  object.position.copy(object.parent.worldToLocal(vector_temp))
}
```

***Live example***


**Expected behavior**

Using TransformControls to move an object along the axis, the path is correct.

**Screenshots**

![5f5b9b60161e38e6d8e23cadc066b62](https://user-images.githubusercontent.com/50942700/118438797-7f220980-b717-11eb-9aad-3be40e27eafb.png)
![40fbe4deb93aa81fe1da913d23ebedf](https://user-images.githubusercontent.com/50942700/118438830-8c3ef880-b717-11eb-98d7-cf79bef541aa.png)



**Platform:**

 - Device: [Desktop]
 - OS: [Windows]
 - Browser: [Chrome]
 - Three.js version: [dev, r123]
Repository: ant-design
Issue: type definition for FormInstance.setFieldsValue is not working properly when using generic type
Labels: Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### Reproduction link
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/quirky-glade-qowmr?file=/src/Login.tsx)

### Steps to reproduce
```jsx
// Login.tsx

export default class Login<
  F extends IFormValue = IFormValue
> extends React.Component {
  formRef = React.createRef<FormInstance<F>>();
...

 setName = () => {
    // line 24 throws ts error: Argument of type '{ username: string; }' is not assignable to parameter of type 'RecursivePartial<F>'
    this.formRef.current?.setFieldsValue({ username: "default name" });
  };
```

### What is expected?
should not throw ts error for line 24

### What is actually happening?
There is a ts error for line 24

| Environment | Info |
|---|---|
| antd | 4.15.5 |
| React | 17.0.2 |
| System | OSX |
| Browser | Chrome |

---
Am I using FormInstance's generic type in a wrong way? Could you kindly offer a working example, thx.


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: flutter
Issue: [webview_flutter]Expose a method to inject bridgeCodeJs template when WebView initial
Labels: c: new feature,p: webview,package,c: proposal,team-ecosystem,P3,triaged-ecosystem

## Use case

When work with the `flutter_webview` we need call the bridge service that bind with the WebKit.messageHandlers as soon as possible to get the app information, such as token, app theme. as the `flutter_webview`does not support inject user scripts before the webview started to loaded, so it  causes delay in bridge object access.


Suggest expose a property to the `WebView` in flutter end, so it could inject the bridge code template as soon as possible 

## Proposal

- inject the js code template  Inject the script after the document element has been created, but before any other content has been loaded.

- Here is the sample code 
```
- (instancetype)initWithFrame:(CGRect)frame
               viewIdentifier:(int64_t)viewId
                    arguments:(id _Nullable)args
              binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger {
  if (self = [super init]) {
    _viewId = viewId;

    NSString* channelName = [NSString stringWithFormat:@"plugins.flutter.io/webview_%lld", viewId];
    _channel = [FlutterMethodChannel methodChannelWithName:channelName binaryMessenger:messenger];
    _javaScriptChannelNames = [[NSMutableSet alloc] init];

   // inject the codeTemplateJs as soon as possible
    if (arg[@"codeTemplateJs"] != nil) {
          WKUserScript* wrapperScript =
          [[WKUserScript alloc] initWithSource:arg[@"codeTemplateJs"]
                               injectionTime:WKUserScriptInjectionTimeAtDocumentStart
                               forMainFrameOnly:NO];
         [userContentController addUserScript:wrapperScript];
    }

    WKUserContentController* userContentController = [[WKUserContentController alloc] init];
    if ([args[@"javascriptChannelNames"] isKindOfClass:[NSArray class]]) {
      NSArray* javaScriptChannelNames = args[@"javascriptChannelNames"];
      [_javaScriptChannelNames addObjectsFromArray:javaScriptChannelNames];
      [self registerJavaScriptChannels:_javaScriptChannelNames controller:userContentController];
    }
```
Repository: pytorch
Issue: Clarity of error message in einsum regressed in performance improvements
Labels: module: error checking,triaged,module: linear algebra

## 🐛 Bug

From [Sohrab Samimi on the forums](https://discuss.pytorch.org/t/problem-with-einsum/121476):

```python
first = torch.rand(12,8192,2)
weights1 = torch.rand(12,8192,2)
torch.einsum('bix,iox->box',first,weights1)
```
gives

```
einsum() operands do not broadcast with remapped shapes [original->remapped]: [12, 8192, 2]->[12, 1, 2, 8192] [12, 8192, 2]->[1, 8192, 2, 12]
```

To which they say:
> Can someone explain to me what I am doing wrong?

Clearly, the `i`-dimensions don't match, but the error message sounds relatively opaque to me.

## Expected behavior

In my opinion, it would be better to print the letter/dimension and term number where the size mismatch happens. I think the old version did this, at least sometimes...

@heitorschueroff 

cc @jianyuh @nikitaved @pearu @mruberry @heitorschueroff @walterddr @IvanYashchuk @xwang233 @Lezcano
Repository: svelte
Issue: Feature Request: Use transitions without removing the element from the DOM
Labels: transition/animation

**Is your feature request related to a problem? Please describe.**

It seems like Svelte transitions require that the element be removed from the dom when it fades out and re-attached when it fades in.

I guess it's probably fine if the element is very simple, but usually, it's not. For example, whenever I just want to show/hide a complex sidebar menu, the dom contents of that menu have to be recreated every time it's displayed (and some other stuff like event listeners, js logic has to re-run, etc.).

**Describe the solution you'd like**
Extending Svelte transition API to allow to fade an element in/out of view without removing/re-attaching it. So for example, instead of removing the element, set a `display: none;` style, or control the zIndex. (The latter would also be very nice, while we are at it, as in some extreme scenarios it's better performance if the element is already visible).

The ideal, most universal solution would be to let the user decide what should happen to the element on transitionStart / transitionEnd and allow that the element to stay without being removed.

So for example, this is how it's done now - the element will be removed:
```
{#if visible}
	<p transition:fly="{{ y: 200, duration: 2000 }}">
		Flies in and out
	</p>
{/if}
```

This is how it could look like with controlling the display property - which would be done by supplying `visible` property to transition properties:
```
<!--Supplying the `visible` property will make the element appear / disappear
      using 'display: none' visibility-->
<p transition:fly="{{ visible, y: 200, duration: 2000 }}">
	Flies in and out
</p>
```

Advanced usage: define the way in which the element should be shown/hidden.
```
<script>
const show = (el) => { el.style.zIndex = 10; }
const hide = (el) => { el.style.zIndex = -1; }
</script>

<!--Using show, hide properties means that the visibility of the element
      is to be handled by the user (`display: none;` will not be applied)-->
<p transition:fly="{{ visible, show, hide, y: 200, duration: 2000,  }}">
	Flies in and out
</p>
```

**Describe alternatives you've considered**
Doing it manually, perhaps Svelte animations API could help (I haven't gotten to it yet).

**How important is this feature to you?**
Of medium importance.  It means that I cannot use Svelte transitions API (which seems awesome). It also seems to be one of those rare cases where Svelte could use some performance optimization.
Repository: godot
Issue: VisualScriptSubCall not working
Labels: bug,topic:visualscript

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
<!-- Specify commit hash if using non-official build. -->
Godot 3.3.0

**OS/device including version:**
<!-- Specify GPU model, drivers, and the backend (GLES2, GLES3, Vulkan) if graphics-related. -->
Win10 GLES3

**Issue description:**
<!-- What happened, and what was expected. -->
There is no way to get SubCall working 

**Steps to reproduce:**
Create new VisualScript
Add SubCall Node
Atach resource script
```
tool #optional
extends VisualScriptSubCall #optional

func _subcall(a=5, b=7)->RigidBody2D: # be sure to use function.name "_subcall"
#func _subcall(_a,_b):
    print("subcall")
    return RigidBody2D.new()
```


**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->
Repository: rust
Issue: Type inference for function-traits is different from other traits if an argument is a reference
Labels: T-compiler,A-inference,C-bug

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

### I tried this code:

```rust
pub struct Hello<F>(F);

// The error is fixed by adding a bound here:
// F: Fn(&mut ())
impl<F> Hello<F> {
    pub fn new(f: F) -> Self {
        Self(f)
    }
}

impl<F: Fn(&mut ())> Hello<F> {
    pub fn hello(&self) {}
}

fn main() {
    Hello::new(|_| ()).hello();
}
```
(does not work with `Fn`, `FnMut` or `FnOnce`)

### I expected to see this happen:

It should have compiled, because for example the following compiles:
```rust
use core::fmt;

pub struct Hello<F>(F);

impl<F> Hello<F> {
    pub fn new(f: F) -> Self {
        Self(f)
    }
}

impl<F: fmt::Display> Hello<F> {
    pub fn hello(&self) {}
}

fn main() {
    Hello::new("").hello();
}
```

### Instead, this happened:
```
   Compiling playground v0.0.1 (/playground)
error[E0599]: the method `hello` exists for struct `Hello<[closure@src/main.rs:16:16: 16:22]>`, but its trait bounds were not satisfied
  --> src/main.rs:16:24
   |
1  | pub struct Hello<F>(F);
   | ----------------------- method `hello` not found for this
...
16 |     Hello::new(|_| ()).hello();
   |                ------  ^^^^^ method cannot be called on `Hello<[closure@src/main.rs:16:16: 16:22]>` due to unsatisfied trait bounds
   |                |
   |                doesn't satisfy `<_ as FnOnce<(&mut (),)>>::Output = ()`
   |                doesn't satisfy `_: Fn<(&mut (),)>`
   |
   = note: the following trait bounds were not satisfied:
           `<[closure@src/main.rs:16:16: 16:22] as FnOnce<(&mut (),)>>::Output = ()`
           `[closure@src/main.rs:16:16: 16:22]: Fn<(&mut (),)>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `playground`

To learn more, run the command again with --verbose.
```

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.52.1 (9bc8c42bb 2021-05-09)
binary: rustc
commit-hash: 9bc8c42bb2f19e745a63f3445f1ac248fb015e53
commit-date: 2021-05-09
host: x86_64-unknown-linux-gnu
release: 1.52.1
LLVM version: 12.0.0
```

This bug exists in nightly, beta and stable.
Repository: TypeScript
Issue: Cannot bracket-index into an object after checking it's existence on that object.
Labels: Breaking Change

# Bug Report

Cannot bracket-index into an object after checking it's existence on that object. 

The same failure was reported in #43651, but I couldn't find a separate discussion or a ticket for this.

### 🔎 Search Terms

- implicitly has an 'any' type
- bracket indexing

### 🕗 Version & Regression Information

Worked in 4.2.4. Starts to break since 4.3.0-beta

### ⏯ Playground Link

[Playground link](https://www.typescriptlang.org/play?ts=4.3.0-beta#code/JYOwLgpgTgZghgYwgAgILIN4F8CwAoGAVxATGAHsRkZzyAKOALlQEpN9lPlgZk6ByOACME-blThsMHLrISUAzmGQAvZAF5kcANwzZnKBDCEoVFQG1BI-gF1deWbjxOgA)

### 💻 Code

```ts
interface A {}
function foo(a:A) {
    if ('abc' in a) {
        const z = a;
        // Element implicitly has an 'any' type because expression of type '"abc"' can't be used to index type 'A'.
        // Property 'abc' does not exist on type 'A'.
        return z['abc']; 
    }
}
```

### 🙁 Actual behavior
Compiler gives an error that you cannot index into type 'A', since 'abc' does not exist in type 'A'


### 🙂 Expected behavior
Compiler recognizes the existence check and does not give an error.

### Observation

This seems to be caused by the improvement in the control flow analysis/type inference. Before the type of `z` in the below example was 'never' prior to TS4.3, but now the compiler recognizes z being type `A` 

**Question** : I have one question though, is it by design that it's allowed to index into `never` types?
Repository: ant-design
Issue: rc-tree draggable option does not allow drop
Labels: Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### Reproduction link
[https://stackblitz.com/edit/react-tcimgg-lpxvkv?file=index.js](https://stackblitz.com/edit/react-tcimgg-lpxvkv?file=index.js)

### Steps to reproduce
Just drag the draggable-child to non-draggable-child. You will see, that even allowDrop is true, the non-draggable-child does not allow drop in itself.

### What is expected?
Non draggable elements must not prevent dropping, as this logic is related to allowDrop function

### What is actually happening?
If draggble returns false, the allowDrop is somehow ignored and the element can never have a child to be dropped in it

| Environment | Info |
|---|---|
| antd | 4.15.4 |
| React | 17.0.2 |
| System | Windows 10 19042.985 |
| Browser | Chrome 90.0.4430.212 (Latest) |

---
Documentation states: "draggable	Specifies whether this Tree or the node is draggable (IE > 8)", and nothing about dropping, so why it's prohibited?


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: pytorch
Issue: A "sanitizer" mode for the CUDA caching allocator?
Labels: feature,module: cuda,triaged,oncall: profiler

## 🚀 Feature
ASAN (a.k.a., Address SANitizer) is a tool for CPU memory that allows to find common errors such as use-after-free. I wonder if we have thought of introducing some similar (opt-in) checks for CUDA through the caching allocator?

## Motivation

One specific use case I have in mind is catching cases where we forget to record a data ptr with the caching allocator when switching streams. This has happened over and over in RPC, and it's very hard to detect in tests because (1) the "only" effect is that the data might become corrupted (hence causing a _silent_ correctness error) and (2) this only starts happening when under heavy memory pressure.

One way to make this issue pop out more in tests would be for the caching allocator to for example "poison" each block that is returned to it immediately, with garbage data, so that these issues start appearing even without memory pressure, and would have a characteristic "signature" which makes them easier to pin down.

cc @ngimel @ilia-cher @gdankel @nbcsm @guotuofeng @guyang3532 @gaoteng-git
Repository: pytorch
Issue: Better shared memory allocation under Docker
Labels: module: memory usage,triaged,enhancement,module: docker

## 🚀 Feature
Use the `memfd_create` syscall (when available) instead of `shm_open` to allocate shared memory to evade the system limits on how much shared memory can be allocated.

## Motivation

From "empirical" experience, it seems that CPU tensors backed by shared memory are allocated as files inside `/dev/shm`. (Not sure if this happens "directly", through `open`, or indirectly, through `shm_open`). The problem is that `/dev/shm` has a limited capacity, and this is particularly pronounced inside Docker containers, which sets it by default to a few megabytes total. While Docker's config can be changed, many users don't know this. We've gotten reports about this over and over in [PyTorch-BigGraph](https://github.com/facebookresearch/PyTorch-BigGraph), which can sometimes allocate several GBs in shared memory.

Instead, we could use `memfd_create`, which allocates "regular" memory (not subject to those capacity limits), while still giving us a file descriptor that can be passed among processes thus allowing to effectively share it. The `memfd_create` syscall is rather new (~6-7 years ago), so we would still have to fallback to `shm_open` when it's not available.

Note: TensorPipe already uses `memfd_create` to allocate its shared-memory buffers for IPC.
Repository: create-react-app
Issue: not getting public,src folders when ruuning create react-app
Labels: stale

i am trying to install react as per the details ,i am using 1.npm install -g create-react-app and then create raect-app 'app_name'
but i am noy getting src and public folders,please me the issue