sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: storybook
Issue: [Bug]: CSP - unsafe-eval. SB7 with angular library shows CSP error
Labels: bug,help wanted,has workaround,angular,addon: a11y,security

### Describe the bug

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".

CSP error appears in story Documentation page when there is more than 1 story.
CSP error does not appear in a Documentation page when there is only 1 story.
Both examples are in reproduction.

Old issue is here: https://github.com/storybookjs/storybook/issues/24355
This was not fixed properly.



### To Reproduce

https://stackblitz.com/edit/github-m6jtth-rjkp49

1. Open dev console.
2. Go to Button/Documentation page.
3. Error appears in console

### System

```bash
Storybook Environment Info:

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm <----- active
    pnpm: 8.10.5 - /usr/local/bin/pnpm
  npmPackages:
    @storybook/addon-a11y: ~7.6.4 => 7.6.4 
    @storybook/addon-actions: ~7.6.4 => 7.6.4 
    @storybook/addon-essentials: ~7.6.4 => 7.6.4 
    @storybook/addon-links: ~7.6.4 => 7.6.4 
    @storybook/addon-storyshots: ~7.6.4 => 7.6.4 
    @storybook/angular: ~7.6.4 => 7.6.4 
    @storybook/testing-library: ~0.2.2 => 0.2.2 
    @storybook/theming: ~7.6.4 => 7.6.4 
    eslint-plugin-storybook: ^0.6.15 => 0.6.15 
    storybook: ~7.6.4 => 7.6.4
```


### Additional context

_No response_
Repository: flutter
Issue: [pigeon] Update documentation/example app for Flutter plugin with Objective-C used for iOS
Labels: d: api docs,package,team-ecosystem,p: pigeon,P3,triaged-ecosystem

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Use case

Hello! Thanks for providing pigeon package. 
My case includes creating plugin which uses Objective-C for ios section. I've browsed through the documentation, and though it does contain information on how to enable obj-c options for configuring Pigeon, it lacks most crucial examples on how to implement HostApi or add Flutter api to native code. 
Being a novice in obj-c, it required a lot of additional research to understand how to implement given examples, basing only on Swift code from the docs.

### Proposal

It would be great if you could update the documentation for mentioned issues and/or add an example app, which would use obj-c as main ios language.
Thanks!
Repository: pytorch
Issue: Allow `input` tensor to have arbitrary tailing extra dimensions than `index` tensor in `torch.gather()` / `torch.scatter()`
Labels: triaged,module: scatter & gather ops

### 🚀 The feature, motivation and pitch

The [`torch.gather()`](https://pytorch.org/docs/stable/generated/torch.gather.html) function is very useful to select elements in the `input` according to the given `index` tensor.

According to the documentation:

> [`torch.gather(input, dim, index, *, sparse_grad=False, out=None) → Tensor`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)
>
> Gathers values along an axis specified by dim.
>
> For a 3-D tensor the output is specified by:
>
> ```python
> out[i][j][k] = input[index[i][j][k]][j][k]  # if dim == 0
> out[i][j][k] = input[i][index[i][j][k]][k]  # if dim == 1
> out[i][j][k] = input[i][j][index[i][j][k]]  # if dim == 2
> ```
>
> `input` and `index` must have the same number of dimensions. It is also required that `index.size(d) <= input.size(d)` for all `dimensions d != dim`. `out` will have the same shape as `index`. Note that `input` and `index` do not broadcast against each other.

The `index` tensor needs to have the same dimension as `input`.

------

Now I have a use case that the index has a smaller dimension than the `input` tensor. For example:

```python
input: 3-dim tensor
index: 2-dim tensor

out[i][j][k] = input[index[i][j]][j][k]  # if dim == 0
out[i][j][k] = input[i][index[i][j]][k]  # if dim == 1
```

Currently, I have to work around this by expanding the dimension manually:

```python
import torch

input  # size = (B, L, E)
index  # size = (B, 1)

expanded_index = index.unsqueeze(dim=-1).expand(-1, -1, input.size(-1))  # size = (B, 1, E)

out = torch.gather(input, dim=1, index=expanded_index)  # size = (B, 1, E)
```

It would be nice to automatically broadcast the tailing dimensions from `input` to `index` (the tailing dimension `E` in the above example).

### Alternatives

There is also an alternative to using `bool` masks. However it is not efficient while the tailing dimension is very large.

```python
import torch
import torch.nn.functional as F

input  # size = (B, L, E)
index  # size = (B, 1)

mask = F.one_hot(index, num_classes=input.size(1))  # size = (B, L)
out = input[mask.bool()]  # size = (B, E)
```

### Additional context

_No response_

cc @mikaylagawarecki
Repository: neovim
Issue: Parse keycode into dictionary
Labels: enhancement,lua,mappings

### Problem

As I know, there are no ways to parse a keycode into a dictionary.

### Expected behavior

A function that can parse a keycode into a dictionary, examples:
`<C-a>` -> `{mod={'ctrl'},key='A'}`
`<Home>` -> `{mod={},key='Home'}`
`<char-65>` -> `{mod={},key='A'}`

Maybe even support parsing multiple keycodes at once, for example:
`<C-a>B<char-67>` -> `{{mod={'ctrl'},key='A'},{mod={},key='B'}.{mod={},key='C'}}`
Repository: pytorch
Issue: Question  on XNNPACK support for PowerPC
Labels: triaged,module: third_party,module: POWER,module: xnnpack

Hi,
 We are starting to work on XNNPACK support for PowerPC. Aa an initial step the support for PowerPC in XNNPACK is enabled with scalar kernels and is submitted to XNNPACK repo. Later we want to integrate this XNNPACK with PyTorch.   
I have a question regarding the PyTorch and XNNPACK. 
The XNNPACK version in PyTorch uses is a bit old. Do you have a plan to  upgrade the XNNPACK  ? 

Regards,
Vinitha
Repository: deno
Issue: feat: hideable doc comment codeblock lines
Labels: suggestion

Like in rust: https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html#hiding-portions-of-the-example

The code is still run, however a documentation generator can ignore the lines.
Repository: pytorch
Issue: [BUG] missing automatic dtype promotion for out-of-place `torch.scatter_*()` functions
Labels: triaged,module: scatter & gather ops

### 🐛 Describe the bug

For most torch functions, the result tensor dtype can be inferred from the operands via automatic dtype promotion. The dtypes for the operands are not required to be the same.

```python
import torch

x = torch.randn(64, 50, dtype=torch.float64)
y = torch.randn(64, 50, dtype=torch.bfloat16)

torch.add(x, y)  # dtype=torch.float64
```

However, `torch.scatter_add` and `torch.scatter_reduce` require the input tensors to have the same `dtype`. This behavior is not documented.

```python
import torch

x = torch.randn(64, 50, dtype=torch.float64)
y = torch.randn(64, 50, dtype=torch.bfloat16)
index = torch.randint(x.size(1), size=x.size())

torch.scatter_add(x, dim=1, index=index, src=y.to(x.dtype))  # OK

torch.scatter_add(x, dim=1, index=index, src=y)  # RuntimeError: scatter(): Expected self.dtype to be equal to src.dtype
```

The underlying implementation of `scatter_add` is rely on `scatter_add_`:

```python
def scatter_add(self: Tensor, dim: int, index: LongTensor, src: Tensor) -> Tensor:
    out = self.clone()
    out.scatter_add_(dim=dim, index=index, src=src)
    return out
```

https://github.com/pytorch/pytorch/blob/6500ccebd7ca64ea30506d56dab35d82007d1cc8/aten/src/ATen/native/TensorAdvancedIndexing.cpp#L1813-L1824

There is also not documented that [`Tensor.scatter_add_`](https://pytorch.org/docs/stable/generated/torch.Tensor.scatter_add_.html#torch-tensor-scatter-add) needs the same `dtype`s for input tensors. And it does not make sense for the out-of-place version of `scatter_*()` functions. We can enhance the out-of-place version to do dtype promotion before calling the inplaced implementation.

For other functions like `add` and `add_`, they do not require the input tensors to have the same dtype:

```python
import torch

x = torch.randn(64, 50, dtype=torch.float64)
y = torch.randn(64, 50, dtype=torch.bfloat16)

torch.add(x, y)  # dtype -> auto dtype promotion
x.add(y)         # dtype -> auto dtype promotion
x.add_(y)        # dtype -> same as x
y.add_(x)        # dtype -> same as y
```

### Versions

main branch

cc @mikaylagawarecki
Repository: next.js
Issue: Next.js returns HTML instead of JSON for _next/data requests
Labels: bug,Navigation,Runtime

### Link to the code that reproduces this issue

https://github.com/arichard-info/next-rewrite-middleware

### To Reproduce

1. Clone the repo
2. `npm run build`
3. `npm run start`
4. Open the network tab and rollover the link
5. Open the _next/data request in a new tab (for example `http://localhost:3000/_next/data/Wyr4K4y9f6V6FjKlwRrH5ee/fr/nice-public-path.json`) => you get the page JSON
6. Change the buildId in the request (for example `http://localhost:3000/_next/data/test/fr/nice-public-path.json` => you get the page HTML

Conditions to reproduce : 
- Having rewrite rules in the middleware
- Having `i18n` configuration in `next.config.js`

### Current vs. Expected behavior

When using middleware rewrites + i18n, mismatches of buildId are not well catched for _next/data requests.

On client-side navigation, the _next/data requests with invalid buildId returns the page HTML instead of a 404. The expected behavior is to get a 404. The _next/data requests should never return HTML content

This causes issues for example when you have a custom cache configuration : 
When you are behind a CDN cache and navigate between two pages, if _next/data calls contains the previous buildId, you're getting a broken page

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64
Binaries:
  Node: 18.19.0
  npm: 10.2.3
  Yarn: 1.22.19
  pnpm: 8.6.9
Relevant Packages:
  next: 14.0.4
  eslint-config-next: 14.0.4
  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)

Middleware / Edge (API routes, runtime), Routing (next/router, next/navigation, next/link)

### Additional context

_No response_
Repository: three.js
Issue: Custom key bindings for pan / rotate
Labels: Addons

### Description

Currently, shift, ctrl and meta allow the user to toggle the mouse behavior between pan and rotate. It would be great to add custom bindings to that. Space, for example, is a common UX expectation for such behavior to be able to pan.

### Solution

Expose these key bindings as a customizable object at the links below (and wherever else makes sense):
event.ctrlKey || event.metaKey || event.shiftKey 

https://github.com/mrdoob/three.js/blob/09fe0527a9aa5aaca7aaf17531e6c0d0efaa8c59/examples/jsm/controls/OrbitControls.js#L1085

https://github.com/mrdoob/three.js/blob/09fe0527a9aa5aaca7aaf17531e6c0d0efaa8c59/examples/jsm/controls/OrbitControls.js#L1107

### Alternatives

Create a method that would just add new custom key bindings on top of the existing ones, rather than expose the existing ones.

### Additional context

Love you guys
Repository: vscode
Issue: Multi file diff editor ignores smooth scrolling setting
Labels: feature-request,multi-diff-editor

1. Launch VSCode with `--disable-smooth-scrolling` cli option
2. Have settings:
```js
"multiDiffEditor.experimental.enabled": true,
"editor.smoothScrolling": false,
"workbench.list.smoothScrolling": false,
```
3. Multi diff editor still has smooth scrolling

---

Version: 1.85.1
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.85.1 Chrome/114.0.5735.289 Electron/25.9.7 Safari/537.36
Repository: rust
Issue: `impl fmt::Display for u32` compiles to large binary
Labels: I-heavy,T-libs

My target is `wasm32-unknown-unknown` but I think it can be applied to any embedded systems. I just want to define panic handler, but formatting `core::panic::Location` costs amlost 3 KiB in binary. This is because inefficient `impl Display for u32`. Also see: <https://github.com/dtolnay/itoa>

```toml
[package]
name = "demo"
version = "0.1.0"
edition = "2021"

[lib]
name = "demo"
crate-type = ["cdylib"]

[dependencies]
arrayvec = { version = "0.7.4", default-features = false }

[profile.release]
opt-level = "z"
codegen-units = 1
lto = true
strip = true
```

```rust
#![no_std]
#![feature(panic_info_message)]

#[allow(improper_ctypes)]
extern "C" {
    pub fn sc_panic(msg: &str) -> !;
}

#[panic_handler]
fn panic(panic_info: &core::panic::PanicInfo) -> ! {
    use core::fmt::Write;

    let mut msg = arrayvec::ArrayString::<1024>::new();

    // 2_009 bytes binary:
    /*let _ = write!(&mut msg, "{}", unsafe {
        panic_info.message().unwrap_unchecked()
    });*/

    // 5_076 bytes binary:
    let _ = write!(&mut msg, "{}", unsafe {
        panic_info.location().unwrap_unchecked()
    });
    // ^^^ +3 KiB to print location in format {file}:{line}:{column}???

    // exit from smart contract with msg
    unsafe { sc_panic(&msg) }
}

#[no_mangle]
extern "C" fn entry_point() {
    panic!("msg");
}
```

This is mostly because this line: https://github.com/rust-lang/rust/blob/1aa6aefdc92555b3fbc5ae4c99365df9845a3e31/library/core/src/fmt/num.rs#L277
Could we have something like specialization for more simpler `impl Display for $num`?
Repository: deno
Issue: Side effect free dynamically imported modules are not garbage collected
Labels: needs investigation

Version: Deno 1.38.2

In the browser console, I can run the following code and it will keep on running for what seems like forever:
```js
let str = "";
for (let i=0; i<1_000_000; i++) {
    str += "0";
}
let script = `"${str}"`;

let i = 0;
while (true) {
    const blob = new Blob([script], {type: "text/javascript"});
    const url = URL.createObjectURL(blob);

    await import(url);

    URL.revokeObjectURL(url)
    console.log(i++);
}
```

But with Deno, the process quickly crashes:
```<--- Last few GCs --->

[95394:0x150008000]    13024 ms: Mark-Compact (reduce) 1399.5 (1423.8) -> 1399.4 (1423.8) MB, 1.08 / 0.00 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 11 ms) (average mu = 0.986, current mu = 0.946)[95394:0x150008000]    13035 ms: Mark-Compact (reduce) 1400.4 (1424.8) -> 1400.4 (1424.8) MB, 1.04 / 0.00 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 11 ms) (average mu = 0.976, current mu = 0.903)

<--- JS stacktrace --->


#
# Fatal JavaScript out of memory: Reached heap limit
#
```

In the example above I am using `URL.createObjectURL()` (which I think is tracked in #12248) but the same issue also happens when importing modules from files:

```js
#!/bin/env -S deno run -A

let str = "";
for (let i=0; i<1_000_000; i++) {
    str += "0";
}
let script = `"${str}"`;
await Deno.writeTextFile("./foo.js", script);

let i = 0;
while (true) {
    await import("" + "./foo.js?foo=" + Math.random());

    console.log(i++);
}
```
Repository: flutter
Issue: [Camera] add ability to override media sensor orientation
Labels: c: new feature,p: camera,package,team-ecosystem,P2,triaged-ecosystem

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Use case

I'm trying to replicate a camera app. The issue I'm having is I want my whole app(the camera screen included) to be locked in portrait up orientation but this implies with the current version of the camera package that when I turn my phone horizontally the resulting image/video will be portrait up and not landscape as it should be.

I tried to override the orientation of the controller to no avail even though the widget reacts, the resulting image itself is always portrait up. If I unlock the auto rotate of the app it gives the expected orientation

### Proposal

I'd like to have a parameter in the controller or the CameraPreview app to override the resulting media orientation
Repository: go
Issue: x/vuln: add fingerprinting for binary mode
Labels: vulncheck or vulndb

### govulncheck version

govulncheck@v0.0.0-53a5385d13db-20231213181115

### Does this issue reproduce at the latest version of golang.org/x/vuln?

yes

### What operating system and processor architecture are you using (`go env`)?

```shell
not platform specific
```


### What did you do?

code organization related

### What did you expect to see?

fingerprinting should ideally be used when choosing how to parse an input to the binary mode. This would make the code cleaner and logic more precise, especially if we add more formats in the future.

### What did you see instead?

We currently try to parse the input to a Go binary and, if that does not work, we try to parse the blob. If that fails, then we say that we don't recognize the input. This is not exactly clean and it won't cover precisely the (very rare) cases where, say, the input is a blob or a Go binary but parsing fails due to system issues.
Repository: godot
Issue: .godot folder corrupted after being recreated when several PCK files are included into Main-PCK at build in DotNet C#
Labels: needs testing,topic:dotnet,topic:export

### Tested versions

reproduceable with all Godot 4.x versions - I used 4.1.3 and 4.2.1


### System information

Windows 11 - Godot 4.2.1 and Godot 4.1.3 stable C# DotNet

### Issue description

when I add .godot to gitignore, I can build, but the exe file shows error messages when I try to include the PCKGreeting.pck file that lives within the executable's .pck file.

I need to have several pck files inside of my project (and thus also inside of the exported main.pck file) as I will have some "standard components" and others that a modder could add to the project from the harddrive.

I also have some github actions that will build the whole project manually and I have provided a buildManually.ps1 file that simulates that, so we can see the issue.

![image](https://github.com/godotengine/godot/assets/18228325/5972e1de-cd19-4680-9b7e-ac8d6620d21d)


### Steps to reproduce

# Steps Using the repo

* clone this git [repo](https://github.com/aignermax/GodotPCKDemo)
* rename the .godot folder
* run the "buildManually.ps1" (right click -> run or use powershell)
* open the folder "Release"
* run the exe and see the error (on other projects you see different behaviours - usually no error, but the software fails to load most scripts)
![image](https://github.com/godotengine/godot/assets/18228325/97f15f9c-262e-4b16-b06b-b63ef673ca08)


# how it should be

*then again when you use the original .godot folder 
* (delete the newly created one and 
* rename the original one back), it can build properly (still showing some error messages) 
* start the exe in the Release folder and it works just fine showing "PCK successfully loaded"
![image](https://github.com/godotengine/godot/assets/18228325/8d5ac707-f633-4b40-9477-9dcc5ba804d5)


# Manual Steps
* ok so first you have to export some project as an PCK file using the exporter and "export as PCK" 
* enter a name withe the `.PCK` extension
* save it into you project folder
* export your whole project for Windows once
* open the export_presets.cfg file and override the line include_filter like so:
   * `include_filter="*.pck"`
* build the project again 
* then rename the .godot folder and build again and start the built exe to see the error.

### Minimal reproduction project (MRP)

it is funny btw. that the description here even asks me to not provide the .godot folder, but without it you cannot test this, so I will provide the .godot as well, please don't do any harm. 
![image](https://github.com/godotengine/godot/assets/18228325/24772ad5-e990-44bc-8a82-3aff482b1d9b)


[Godot PCK Demo Project](https://github.com/aignermax/GodotPCKDemo)
Repository: flutter
Issue: Equivalent to Num for Fractional vs LP Offsets
Labels: c: new feature,framework,d: api docs,c: proposal,P3,team-framework,triaged-framework

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Use case

For just about any use case where you might want to specify an offset in fractional terms or pixel terms, there are two different versions of the widget (often with completely unrelated naming schemes) for fractional vs pixel offsets.

One (of many) examples:
`Transform.translate` - takes in pixel denominated values via `Offset offset`
`FractionalTranslation` - takes in fractionally denominated values via `Offset translation`
This is really confusing. The type is the same even though the units are different, the constructor arguments are named differently without communicating the different units, and the two widgets are separate even though their external API is basically the same.

### Proposal

TBH, I find navigating `Alignment`, `FractionalOffset` and `Offset` to be really confusing. It feels like these three classes are highly overlapping with poor separations of concerns and divergent APIs.

I think unifying them and/or giving them more clear separations of concerns would be extremely helpful-most importantly the typing of various widget constructors would self-document the expected units. My proposal below isn't fully baked, but I'll put it here to hopefully get a conversation going:
1. Offset should be a unitless base class and developers should interact with it via unit-specific subclasses.
ie `PixelOffset` and `FractionalOffset` (the latter already exists, but confusingly is an `Alignment` not an `Offset` and it doesn't really seem to be used anywhere?)
2. Make `Offset` an abstract class (maybe creating an entirely new base class and deprecating `Offset` would be a better rollout plan?)
3. Widgets and classes that take in an `Offset` should either handle both unit-based subclasses properly or should be changed to only take one of the subclasses.
ie `FractionalTranslation` is deprecated and its logic is moved into `Transform.translate`. `Transform.translate` will decide to apply a pixel translation or a fractional translation depending on what unit was implied by the provided `Offset` subclass.