sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: FCD and tensor subclasses
Labels: triaged,tensor subclass,module: functorch,module: first class dims

### 🐛 Describe the bug

When using FCD, the order in which functorch.dim and a tensor subclass is created seem to matter in whether or not it will work or not. Here are some examples:

Works:
```python
# from tensordict.utils import Buffer
import torch

t = torch.randn(3, 4)
class SubTensor(torch.Tensor):
    pass
from functorch import dim
d0 = dim.dims(1)
s = SubTensor(t)
s[d0]
```

Does not work, throws `ValueError: dimension d0 is unbound`
```python
# from tensordict.utils import Buffer
import torch

t = torch.randn(3, 4)
from functorch import dim
class SubTensor(torch.Tensor): # importing functorch.dim before creating the subclass causes the error
    pass
d0 = dim.dims(1)
s = SubTensor(t)
s[d0]
```

Does not work, throws `RuntimeError: vmap: It looks like you're calling .item() on a Tensor `

```python
# from tensordict.utils import Buffer
import torch

t = torch.randn(3, 4)
from functorch import dim
d0 = dim.dims(1)
class SubTensor(torch.Tensor):
    pass
s = SubTensor(t)
t[d0] # this causes the error
s[d0]
```

Just a huge THANKS for FDC by the way! For model ensembling in RL we get a >2x speedup by swapping params with param stacks that are indexed with FCD on some toy examples, and now that it's backpropagable it's a compelling feature! 

cc @ezyang @msaroufim @albanD @zou3519 @Chillee @samdow @kshitij12345 @janeyx99 @zdevito 

### Versions

'2.3.0.dev20240222'
Repository: godot
Issue: Steamvr and Godot Editor causes freeze (only while both are running, may be radeon specific)
Labels: bug,topic:rendering,topic:xr,crash

### Tested versions

tested: godot 4.2.1; 4.1 had freezes too, but unknown if same.

### System information

Windows 10 - Godot 4.2.1 - Radeon RX 7900XTX - Vulkan - Forward+ - AMD Threadripper 1920x (in case it's more specific)

### Issue description

Using the editor while steamvr is open completely freezes PC. (may be radeon specific)


### Steps to reproduce

•Have the Godot Editor running while steamVR is running (tested with a brand new 3d scene.)
•Add, for example, a mesh node. Might already crash, but potentially not
•Try to set the mesh type (I never got farther, freezes pretty quick.)
Video for reference. still crashes whether or not Discord is running.
https://youtu.be/5bXcfyy6CbU

### Minimal reproduction project (MRP)

N/A
Repository: godot
Issue: Opening numerous scripts/docs in Script Editor slows down project loading and saving
Labels: bug,discussion,topic:editor,performance

### Tested versions

- Reproducible in: 4.2.1.stable, Reproducible in 4.3.dev3 [36e943b6b], 4.0.stable, and v3.5.3.stable

### System information

Godot v4.2.1.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 SUPER (NVIDIA; 31.0.15.4617) - AMD Ryzen 9 3900X 12-Core Processor (24 Threads)

### Issue description

Opening numerous scripts and/or documentation pages in the Script Editor slows down the editor's saving and loading of scenes.
Loading the project takes significantly longer, and saving scenes is slower depending on hardware or potentially the OS.
Additionally, switching scenes, closing them, or opening new elements in the Script Editor is slower.

### Steps to reproduce

- Open the SceneTest1 file in the Scenes directory.
- Drag and drop all scripts in the Scripts directory into the Script Editor, opening documentation pages seems to cause slowdown as well.
- Reload the current project.

### Minimal reproduction project (MRP)

[Script Editor Test.zip](https://github.com/godotengine/godot/files/14395038/Script.Editor.Test.zip)
Repository: TypeScript
Issue: TS does not support resolving paths with colons
Labels: Bug,Help Wanted

### 🔎 Search Terms

https://github.com/microsoft/TypeScript/issues?q=is%3Aissue+colon+exports+is%3Aclosed

`colon`, `exports`

### 🕗 Version & Regression Information


- This is the behavior in every version I tried



### ⏯ Playground Link

https://stackblitz.com/edit/stackblitz-starters-d2rfdx?description=Starter%20project%20for%20Node.js,%20a%20JavaScript%20runtime%20built%20on%20Chrome%27s%20V8%20JavaScript%20engine&file=package.json&title=node.new%20Starter

### 💻 Code

Consumer module:
```ts
import a from 'my-library';
import b from 'my-library/foo';
import c from 'my-library/foo:virtual';
import d from 'my-library/bar';
import e from 'my-library/colon:here';

console.log({ a, b, c, d, e });
```


package.json for my-library:
```js
{
  "name": "my-library",
  "version": "0.0.1",
  "type": "module",
  "exports": {
    ".": {
      "types": "./foo.d.ts",
      "default": "./foo.js"
    },
    "./foo": {
      "types": "./foo.d.ts",
      "import": "./foo.js"
    },
    "./foo:virtual": {
      "types": "./foo.d.ts",
      "default": "./foo.js"
    },
    "./*": {
      "types": "./*.d.ts",
      "default": "./*.js"
    }
  },
  "scripts": {
    "lint": "attw --pack; pnpm publint"
  },
  "dependencies": {
    "@arethetypeswrong/cli": "^0.14.1",
    "publint": "^0.2.7"
  }
}
```

every imported module is supposed to resolve, and then print:
```
{ a: 2, b: 2, c: 2, d: 2, e: 'two' }
```
(pnpm start in the `consumer` package in the repro link shows this)

### 🙁 Actual behavior

Errors, cannot find module
![image](https://github.com/microsoft/TypeScript/assets/199018/af6e5432-269c-408d-a9a9-7fe731a68a01)


### 🙂 Expected behavior

align with JS, resolve the module

### Additional information about the issue

_No response_
Repository: next.js
Issue: Non-interactive `create-next-app ` with `--src-dir` or `--app` flag still prompts question
Labels: create-next-app,bug

### Link to the code that reproduces this issue

https://github.com/nattui/next.js

### To Reproduce

**Case 1**: Source directory flag
```bash
# Note the `--src-dir` flag
npx create-next-app@latest my-app --typescript --tailwind --eslint --import-alias "@/*" --src-dir
```
Would you like to use App Router? (recommended) › No / Yes
 
The terminal asks the user to use app directory and it defaults to `Yes` when `--src-dir` flag exist.

![CleanShot 2024-02-24 at 21 22 26@2x](https://github.com/vercel/next.js/assets/31426677/2fc51f13-b4a0-4697-9f41-7930eaf52c7c)

---

**Case 2**: App directory flag 
```bash
# Note the `--app` flag
npx create-next-app@latest my-app --typescript --tailwind --eslint --import-alias "@/*" --app
```
Would you like to use `src/` directory? › No / Yes
 
The terminal asks the user to use source directory and it defaults to `No` when `--app` flag exist.

![CleanShot 2024-02-24 at 21 21 38@2x](https://github.com/vercel/next.js/assets/31426677/8e2c8653-fc8b-4f63-a313-31bbc84e6eda)

### Current vs. Expected behavior

**Current behavior**:
The terminal asks the user to use app directory and it defaults to `Yes` when `--src-dir` flag exist. Also, the terminal asks the user to use source directory and it defaults to `No` when `--app` flag exist.

**Expected behavior**:
When `--app`, `--no-app`, `--src-dir`, and `--no-src-dir` flag is included with `create-next-app`, the question about which directory to use should be skipped.

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000
Binaries:
  Node: 21.6.2
  npm: 10.2.4
  Yarn: 1.22.21
  pnpm: 8.15.3
Relevant Packages:
  next: 14.1.0
  eslint-config-next: 14.1.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

CLI (create-next-app)

### Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)

### Additional context

_No response_
Repository: godot
Issue: Crash on opening/creating a project -LINUX ARM64 (Godot 4.2.1)
Labels: discussion,platform:linuxbsd,topic:porting,needs testing,crash

### Tested versions

Found in: 4.1.2, 4.1.1 (box64) and so on, did not happen when running .exe version (wine)

### System information

Ubuntu 22.04 - Godot 4.1.2 - Forward(+) llvmpipe/virlgl arm64

### Issue description

So basically as title says, the app crashes whenever i create or open a project, this happens in every version ever since i reinstalled my OS, im mainly on arm64 so i tried Godot 4.1.2 where i first found this issue, then i tried other amd64 versions using box64 and got the same error, but using .exe by wine, i did not face this error, heres the error:
```
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  130 ()
  Minor opcode of failed request:  1
  Serial number of failed request:  121
  Current serial number in output stream:  165
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketLargeE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools12BucketMediumE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketSmallE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: BUG: Unreferenced static string to 0: TextServerDummy
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: IPUnix
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ResourceFormatImporterSaver
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: MovieWriterMJPEG
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: interface_added
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: TextServerAdvanced
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ImageFormatLoader
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ResourceFormatSaver
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: GDScriptEditorTranslationParserPlugin
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: MovieWriterPNGWAV
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ScriptLanguage
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ResourceFormatLoader
   at: unref (core/string/string_name.cpp:129)
```
Also i tried Virlgl and LLVMPipe, both do not work, on another device godot does work

### Steps to reproduce

Open godot > Create project > crash

### Minimal reproduction project (MRP)

N/A
Repository: PowerToys
Issue: "Find my mouse" unexpected triggered by Pen input
Labels: Issue-Bug,Needs-Triage,Product-Mouse Utilities

### Microsoft PowerToys version

0.78.0

### Installation method

Microsoft Store

### Running as admin

No

### Area(s) with issue?

Mouse Utilities

### Steps to reproduce

The feature that causes unexpected behavior is called "Shell Handwriting".
A picture from the Windows Insider blog:
![windows-ink](https://blogs.windows.com/wp-content/uploads/prod/sites/44/2023/06/windows-ink-settings-1024x667.png)
When I use this feature to input text, sometimes it triggers "shake mouse“ and activates "find my mouse", which is unexpected.


### ✔️ Expected Behavior

"shake mouse“ completely ignores Pen or Touch input, these inputs already have physical pens or fingers as position indicators.

### ❌ Actual Behavior

No matter what form of input it is, as long as it involves changing the mouse position, it is possible to trigger "shake mouse"

### Other Software

Windows 11 23H2 22631.3155 Home China - Single Language Version
not a version in any insider program channels, the only feature update in the update history is version 23H2.
Repository: godot
Issue: Script Editor: Highlighting custom classes stops working when statement is continued to the next line
Labels: bug,topic:gdscript,topic:editor

### Tested versions

v4.3.dev3.official [36e943b6b]

### System information

w10 64

### Issue description

Highlighting an custom object type does not work when what can be seen in the video occurs.
It doesn't matter if there are spaces after the function parentheses.
If you switch to a new line immediately after the function parenthesis, custom object types are not highlighted.


https://github.com/godotengine/godot/assets/19652075/059ca54f-1924-41eb-9d7b-e397ff6e45f1



### Steps to reproduce

See the video

### Minimal reproduction project (MRP)

...
Repository: transformers
Issue: Avoiding prompt injection using special tokens via `apply_chat_template`
Labels: Feature request

### Feature request

Chat templates should provide some kind of protection against prompt injection via special tokens. Possible remedies:
1. Make it clear [in the docs](https://huggingface.co/docs/transformers/main/en/chat_templating#what-template-should-i-use) that this should be implemented by the developer when writing a prompt template.
1. Add an additional filter `escape_content` that can clean content of special tokens. (The builtin `escape` wont work for code generation where html is involved)
1. Make that part of the `apply_chat_template` function itself but that would require standardizing the input messages format to stick to `[{role: ..., content: ...}...]` or something

I add some code to my chat templates for doing this at the moment but I am worried that without enough warning, this might become common and people would realize this in hindsight.

### Motivation

Chat templates are a great idea and they have become quite popular. However currently they blindly render any content coming directly from users even if contains special tokens in it (whether spurious or accidental). This would cause all kinds of unwanted behavior and possibly even security issues.

### Your contribution

Happy to make a PR if people think this is important to do and then we can decide which of the options to go with.

I personally add this to my tokenizer templates to combat this:
```jinja
{%- set escape_tokens = (
    [bos_token, eos_token, unk_token, pad_token] + additional_special_tokens
  ) | map('default', '<unk>') | list -%}

{% for message in messages %}
  {#- Escape content -#}
  {%- set content_ns = namespace(value=message.content) -%}
  {%- for escape_token in escape_tokens -%}
    {#- Replace '
' with '< |im_start|>' and so on -#}
    {%- set content_ns.value = content_ns.value | replace(
        escape_token,
        escape_token.replace(escape_token[0], escape_token[0]+' ', 1)
    ) -%}
  {%- endfor -%}
  
{#- Other stuff here -#}
{{ content_ns.value }}

{% endfor %}
```
Repository: godot
Issue: Setting a text that contains emojis to a textedit is slow
Labels: bug,topic:gui,performance

### Tested versions

- v4.2.stable.mono.official [46dc27791]
- v4.2.1.stable.mono.official [b09f793f5]

### System information

Godot v4.2.stable.mono - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4080 (NVIDIA; 31.0.15.5123) - AMD Ryzen 9 7950X3D 16-Core Processor (32 Threads)

### Issue description

I have a  `TextEdit` node that I pre-fill with some text that contains a range of emojis. In my example I set about 300 lines of text each line containing an emoji. Setting this text of 300 lines with emojis to the `text` property of the `TextEdit` takes about 16-18ms on my machine. If I remove the emojis from the text, the same operation only takes about 2-3ms on my machine.

### Steps to reproduce

In the example project I have this script which will produce a text at the start and then try to set it every frame:

```gdscript
extends Control

@onready var text_edit = $TextEdit

var text:String

func _ready():
	text = make_300_lines()

func _process(delta):
	text_edit.text = text


func make_300_lines():
	var emojis = ["🔴", "🟢", "⚡", "↪️"]
	var result:String = ""
	for i in 300:
		# use the following line to get a text without emojis
		# result += " this is a line " + "[c]" + "\n"
		
		# this will produce a text with emojis 
		# comment it to use the other line
		result += " this is a line " + emojis.pick_random() + "\n"
	
	return result

```

You can use the alternative line to produce a text without emojis. Profile each variant to see the difference in performance.

### Minimal reproduction project (MRP)

[emoji_reproducer.zip](https://github.com/godotengine/godot/files/14396079/emoji_reproducer.zip)
Repository: go
Issue: proposal: x/crypto/ssh: add deadlines support for channels
Labels: Proposal

### Proposal Details

Currently ssh channels does not support deadlines, so the only way to unblock reads/writes is to set a deadline on the underlying `net.Conn`, but this will affect all channels using the connection.

Channels are typically blocked on reads while waiting for data and on writes while waiting for window capacity.

I propose adding deadlines to channels to fix these typically use cases, I don't think we can unblock reads/writes blocked on the underlying `net.Conn`.

Proposed API

```
// ChannelWithDeadlines is a channel with deadlines support.
type ChannelWithDeadlines interface {
	Channel

	// SetDeadline sets the read and write deadlines associated with the
	// channel. It is equivalent to calling both SetReadDeadline and
	// SetWriteDeadline. Deadlines errors are not fatal, the Channel can be used
	// again after resetting the deadlines.
	SetDeadline(deadline time.Time) error

	// SetReadDeadline sets the deadline for future Read calls and unblock Read
	// calls waiting for data. A zero value for t means Read will not time out.
	SetReadDeadline(deadline time.Time) error

	// SetWriteDeadline sets the deadline for future Write calls and unblock
	// Write calls waiting for window capacity. A zero value for t means Write
	// will not time out.
	SetWriteDeadline(deadline time.Time) error
}
```

cc @golang/proposal-review
Repository: vscode
Issue: Show Comments in TextMate Scope Inspector
Labels: feature-request,grammar

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
In TextMate grammar, you can declare comments like so:

```json
[
  {
    "match": "^(!!!|doctype)(\\s*[a-zA-Z0-9-_]+)?",
    "name": "meta.tag.sgml.doctype.html",
    "comment": "Doctype declaration."
  },
]
```

It would be useful if VSCode showed the comments in some way, as currently they are only descriptive in the TextMate file, and do not provide any external help.

This could be used to provide basic documentation for TextMate scopes.

You can also declare names for token customisations.

## Proposal

Show comments in the TextMate scope inspector (access using <samp><kbd><kbd>Developer</kbd>: <kbd>Inspect Editor Tokens and Scopes</kbd></kbd> (editor.action.inspectTMScopes)</samp>)

![image](https://github.com/microsoft/vscode/assets/115815794/7464828e-46fa-4df5-b181-b989f9d5ff81)

![Views](https://komarev.com/ghpvc/?username=r-microsoft-vscode-issues-206192&label=Views:)
```[tasklist]
### Tasks
- [ ] https://github.com/microsoft/vscode-textmate/issues/227
```
Repository: vscode
Issue: Inspect Context Keys Should Open JSON File instead of logging to dev console
Labels: feature-request,context-keys

https://github.com/microsoft/vscode/blob/e8b96858ab9fbef2bf5b43a9bd60ac210c44a928/src/vs/workbench/browser/actions/developerActions.ts#L93

If that would open a JSON file in VS Code, that would allow for searching in that object.
It would also be a much nicer UX.
Repository: PowerToys
Issue: [Text Extractor] hope to have the option to set automatic sending of captured text to a specified application
Labels: Idea-Enhancement,Product-Text Extractor

### Description of the new feature / enhancement

(My native language is not English; the following is translated using ChatGPT.)

I hope it can be like the Capture2Text software, allowing users to set whether to automatically send captured text to a specified application (as shown below).

![image](https://github.com/microsoft/PowerToys/assets/117002409/3a89b66d-c632-488c-ad25-b5b5b1e564da)


### Scenario when this would be used?

For non-native English speakers (whose numbers far exceed the 367 million native English speakers, according to Wikipedia), the need to capture English words from the screen often arises for the purpose of pasting them into a dictionary for lookup. It would be much more convenient if the captured text could be automatically sent to a dictionary program. I use GoldenDict, a dictionary software that conveniently receives text from the clipboard.

Although Capture2Text can also translate the captured text, such translations are too brief and not as comprehensive as those provided by a dictionary.

![image](https://github.com/microsoft/PowerToys/assets/117002409/d8bc0aa1-0204-499d-8b1d-6f159eb69df4)

[edit: 2024/02/27]
Capture2Text is open-source software, with the project and source code available for download at the following links:
https://capture2text.sourceforge.net
https://sourceforge.net/projects/capture2text

### Supporting information

_No response_
Repository: go
Issue: proposal: cmd/vet: warn when shadowing variable with slices.Delete and friends
Labels: Proposal

### Proposal Details

When calling `slices.Delete`, shadowing the slice variable is [almost certainly a bug](https://go.dev/blog/generic-slice-functions#tests-failing):

```
s := slices.Delete(s, 2, 3)  // !! accidentally using := instead of = !!
```
[Playground](https://go.dev/play/p/KSpVpkX8sOi)

## Why

Shadowing comes with surprises when used accidentally. In general, vet cannot warn about it because it does not know if a specific use of shadowing is intentional and legit, or not. 

Shadowing keeps the original var intact, so it can be reused outside of the current inner scope where the new var is declared. In the specific case of Delete (and friends), we know that reusing the original value is not desirable:
"**_When calling these functions (Delete. etc.) we must consider the original slice invalid_**"

I am not aware of any such shadowing that would be legit and useful. If they do exist, the vet warning would be easy to work around by choosing a different var identifier (no shadowing).

On the other hand, I am very aware of the nasty bugs caused by accidental shadowing in general, and by accidental shadowing in the case of slices.Delete and friends.

## Suggestion

vet warning:

```
./prog.go:11:14: shadowing slice 's' on call to slices.Delete
```

Same for the friends DeleteFunc, Compact, CompactFunc, Replace.

Like #62729, the goal is to minimize the risks associated with incorrectly using the `slices` package API.