sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: opencv
Issue: cap_avfoundation.mm: crash after setting video width+height, before video is started, or after if size>starting size
Labels: bug,category: videoio(camera),platform: ios/osx,incomplete,needs reproducer

### System Information

OpenCV 4.6 on iOS 13 through EMGUCV

### Detailed description

So, using [VideoCapture](https://docs.opencv.org/4.6.0/d8/dfe/classcv_1_1VideoCapture.html) to capture video frames in an iOS app.
That do work correctly when the constructor is called without any params that sets the width/height (ie: CAP_PROP_FRAME_WIDTH 
 and HEIGHT).

But it's crashing as soon as those parameters are set.  

```[ERROR:0@510.834] global /Volumes/bb/cv_ios/build/opencv/modules/videoio/src/cap.cpp (299) open VIDEOIO(AVFOUNDATION): raised unknown C++ exception!```

It looks like the code in https://github.com/opencv/opencv/blob/5.x/modules/videoio/src/cap_avfoundation.mm tries to grab a new video frame on a null instance just after setting those width/height. Instead it should grab the new frame only if the video is already started.

One could think of a workaround to set the w/h only after the video is started. But AVFoundation is crashing when changing w/h to values greater than the w/h used when starting the video:

```NSInvalidArgumentException Reason: *** -[AVCaptureVideoDataOutput setVideoSettings:] Video settings dimensions must not be larger than the source device activeFormat's dimensions```

So there is currently no way to set a video size on iOS using opencv's VideoCapture class.

### Steps to reproduce

(using EMGU.CV)

```C#
        using var device = AVCaptureDevice.GetDefaultDevice(AVMediaTypes.Video);
        var videoSize= device.ActiveFormat.HighResolutionStillImageDimensions;

        var captureProperties = new Tuple<CapProp,int>[]
        {
             //Always crashes in C++: it looks like you can do this only after video is started
             Tuple.Create(CapProp.FrameWidth, videoSize.Width),
             Tuple.Create(CapProp.FrameHeight, videoSize.Height),
        };

        //Crashes in this call
        var videoCapture = new VideoCapture(0, VideoCapture.API.Any, captureProperties)
        {
            FlipType = null
        };
```

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)
Repository: rust
Issue: Unsafe block does not propagate into array length
Labels: A-array

The lang team [indicated](https://github.com/rust-lang/rust/pull/104087#issuecomment-1324173328) that the following code should compile:
```rust
const unsafe fn test() -> usize { 42 }

fn main() { unsafe {
    let x = [0; test()];
} }
```
However currently the array length does not "inherit" unsafety from the surrounding block.
```
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
 --> src/main.rs:4:17
  |
4 |     let x = [0; test()];
  |                 ^^^^^^ call to unsafe function
  |
  = note: consult the function's documentation for information on how to avoid undefined behavior
```
Repository: pytorch
Issue: documentation need to be as per python version
Labels: module: docs,triaged

### 📚 The doc issue

something like this,

python 3.9
```
def init_weights(m):
    if isinstance(m, nn.Linear):
        nn.init.normal_(m.weight)
        nn.init.normal_(m.bias)

model = nn.Sequential(nn.Linear(2, 2))
model.apply(init_weights)
```

python 3.10
```
def init_weights(m):
    match m:
        case nn.Linear():
            nn.init.normal_(m.weight)
            nn.init.normal_(m.bias)

model = nn.Sequential(nn.Linear(2, 2))
model.apply(init_weights)
```
motivation -
docs of FastAPI https://fastapi.tiangolo.com/tutorial/body/, 
pydantic https://pydantic-docs.helpmanual.io/usage/dataclasses/ 
follow a similar strategy

### Suggest a potential alternative/fix

no

cc @svekars @carljparker
Repository: tauri
Issue: [feat] Allow to completely sandbox WebViews from network access
Labels: type: feature request

### Describe the problem

I want to create Tauri windows (WebViews) that run user supplied code ("apps"). I enabled a custom protocol handler (via [`register_uri_scheme_protocol`](https://docs.rs/tauri/latest/tauri/struct.Builder.html#method.register_uri_scheme_protocol)). However, currently the WebViews can still access the other by-default enabled protocols (e..g. `http`, `https`, and `tauri`) and, for example, change the window location or issue fetch requests.


### Describe the solution you'd like

I'd like these WebViews to be completely sandboxed and disallow all communication but the custom protocol handler that I registered. Ideally, I want to allow-list protocols for the WebView and disallow everything that is not in the allowlist, for all means of communication (`window.location`, `fetch`, `XmlHttpRequest`, `<script scr="...">` etc).

Ideally, I want a WebView that defaults to *no* protocols, then specifically allow protocols, and additionally have a simple hook (in rust) that is run for all network/protocol requests that can abort or disallow the request.

### Alternatives considered

There are a few ways to reduce communication surface for a WebView currently:

* Setting a strict `CSP` policy. This already, I think, allows to disallow most communication for a WebView.
* The `isolation` feature provides a way to intercept and disallow IPC communication for WebViews
* The `WebViewBuilder` in `wry` has a [`with_navigation_handler`](https://docs.rs/wry/latest/wry/webview/struct.WebViewBuilder.html#method.with_navigation_handler) that, I think, would allow to disallow navigating away from the allowed protocol, however I don't think this is currently exposed in tauri?

It might be possible to completely sandbox a WebView this way. If that is a case, a documentation guide for a completely sandboxed and secured WebView would be useful. However, it feels a bit hacky to get a sandboxed webview by tying together multiple hooks to disallow things. I'd prefer to enable a "sandbox" mode or something once that would disallow all network communication by default, and then selectively enable things. This would, I think, be the better security primitive to run user-supplied code without having to fear information extraction attacks. 

### Additional context

_No response_
Repository: godot
Issue: Implement automatic translation for Label3D
Labels: enhancement,topic:core,topic:3d

### Godot version

3.5.1 Stable

### System information

Windows 11

### Issue description

I would like to report about the problem of not being able to translate Godot's new label3D with the TranslationServer. Godot version 3.5.1

### Steps to reproduce

Put a label3D type node and try to do an automatic translation with the TranslationServer

### Minimal reproduction project

N/A
Repository: neovim
Issue: Treesitter language injections can enter infinite loop
Labels: bug,treesitter

### Neovim version (nvim -v)

v0.9.0-dev, 1f6d36c2c

### Vim (not Nvim) behaves the same?

-

### Operating system/version

ubuntu18.04

### Terminal name/version

alacritty

### $TERM environment variable

alacritty

### Installation

unstable ppa

### How to reproduce the issue

`nvim --clean`, run the script:
```lua
vim.treesitter.get_string_parser([[
#define TEST \
  0
]], 'c'):parse()
```

### Expected behavior

don't enter infinite loop

### Actual behavior

Enters infinite loop here: https://github.com/neovim/neovim/blob/fba0562723a1af143c9e9509920d03d8231b8bf7/runtime/lua/vim/treesitter/languagetree.lua#L166
Repository: pytorch
Issue: Couldn't install pytorch 2.0
Labels: needs reproduction,module: binaries,triaged

### 🐛 Describe the bug

 Using the command in V100 cuda 11.7 with py3.8: 
```bash
pip3 install numpy --pre torch[dynamo] torchvision torchaudio --force-reinstall --extra-index-url https://download.pytorch.org/whl/nightly/cu117
```

but got following information while installing torchaudio and torchvision:
```bash
Collecting torchaudio
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221202%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 270 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221201%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 668 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221130%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 665 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221129%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 906 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221128%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 694 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221127%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 694 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221126%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 674 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221125%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 685 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221124%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 693 kB/s
  Downloading https://download.pytorch.org/whl/nightly/cu117/torchaudio-0.14.0.dev20221123%2Bcu117-cp38-cp38-linux_x86_64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 689 kB/s
  
..........

NFO: pip is looking at multiple versions of torchvision to determine which version is compatible with other requirements. This could take a while.
Collecting torchvision

.........

INFO: pip is looking at multiple versions of torchtriton to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of torch[dynamo] to determine which version is compatible with other requirements. This could take a while.
```


### Versions

torch.1.14

cc @ezyang @seemethere @malfet
Repository: deno
Issue: `npm:` imported packages run slower than ones imported from cdn's
Labels: needs investigation,node compat

Packages imported using npm specifier not only import (expected) but run (not expected) slower than ones imported from CDN's.

AFAIK Chalk and Kleur don't use any node-specific API's so it shouldn't be caused by polyfills of any sorts.

Benchmark code:
```ts
import npmChalk from "npm:chalk@5.1.2";
// @deno-types="npm:chalk@5.1.2"
import jsDelivrChalk from "https://cdn.jsdelivr.net/npm/chalk@5.1.2/+esm";

import npmKleur from "npm:kleur@4.1.4";
import skypackKleur from "https://cdn.skypack.dev/kleur@4.1.4?dts";

Deno.bench({ name: "first one out" }, () => {})

Deno.bench({ name: "Chalk (NPM)", group: "chalk" }, () => {
	npmChalk.bgBlue.green.bold.italic("Hello");
});

Deno.bench({ name: "Chalk (jsDelivr)", group: "chalk" }, () => {
	jsDelivrChalk.bgBlue.green.bold.italic("Hello");	
});


Deno.bench({ name: "Kleur (NPM)", group: "kleur" }, () => {
	npmKleur.bgBlue().green().bold().italic("Hello");
})

Deno.bench({ name: "Kleur (Skypack)", group: "kleur" }, () => {
	skypackKleur.bgBlue().green().bold().italic("Hello");
})
```

Output on my machine:
![image](https://user-images.githubusercontent.com/47059999/205447581-5ffb3628-8d83-4ad1-af3a-24d3dbea142a.png)

The `"first one out"` is there to break JIT bias to optimize first benchmark entry.
Repository: TypeScript
Issue: In target: ES5, Base class constructor's primitive return value should be ignored
Labels: Suggestion,Awaiting More Feedback

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

class, extends, constructor, return primitive

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about class constructors

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?target=1#code/HYUw7gBAxgNghgZwREAPALiYATZtHIDeAUBNAPbALoBOArlOuTQBQCUEJZZNI6dNYBACMAblIQAvsUmcJUStXqNm7OdwgI6ABxCs24jQqrkYIAHQxyAcxboAnrvIAzCOgAWASwQGJ06UA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
new class extends class {
  constructor() {
    return 1;
  }
} {
  constructor() {
    super();
    console.log(typeof this);
  }
}
```

### 🙁 Actual behavior

Logs "number"

### 🙂 Expected behavior

Logs "object"
Repository: go
Issue: x/crypto/argon2: Update recommended parameters
Labels: Documentation,NeedsInvestigation

https://github.com/golang/crypto/blob/2c476679df9a5c6279ec05b48165f4bed48b792e/argon2/argon2.go#L86
> // The draft RFC recommends[2] time=1, and memory=64*1024 is a sensible number.

The current document recommends time=1 based on the [RFC draft](https://github.com/golang/crypto/blob/2c476679df9a5c6279ec05b48165f4bed48b792e/argon2/argon2.go#L34),
but [RFC 9106](https://datatracker.ietf.org/doc/html/rfc9106#section-7.4) published in September 2021 recommends time=3.

> The Argon2id variant with t=3 and 64 MiB memory is the SECOND
> RECOMMENDED option and is suggested as a default setting for memory-
> constrained environments.
Repository: deno
Issue: Deno has panicked
Labels: bug,cli

So I'm trying to change Deno version from 1.28.3 to 1.26.2 with command "deno upgrade --version 1.26.2". 
After running for a while, I get this output.

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the       
reproduction steps and re-run with the RUST_BACKTRACE=1 env 
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.28.3
Args: ["C:\\Users\\Me\\Desktop\\New File\\deno.exe", "upgrade", "--version", "1.26.2"]

thread 'main' panicked at 'assertion failed: output.status.success()', cli\tools\upgrade.rs:546:3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Repository: godot
Issue: Textures and Sprites doesn't scale the position right when "rect_size" is added in AnimationPlayer
Labels: topic:gui,topic:animation

### Godot version

3.5.1

### System information

Windows (GLES 2.0)

### Issue description

When you're adding a texture or sprite without any animation players, everything seems fine but when you intend to animate them especially animating their sizes, the position of the texture / sprite gets a little carried away and not correct

for example: if the texture is in the middle, it gets more to the left or right or even to the top

### Steps to reproduce

N/A

### Minimal reproduction project

[Scaling problem.zip](https://github.com/godotengine/godot/files/10147272/Scaling.problem.zip)
Repository: rust
Issue: FP unreachable-pub, breaks the code
Labels: A-diagnostics,T-compiler,D-invalid-suggestion

<!--
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.

If you cannot produce a minimal reproduction case (something that would work in
isolation), please provide the steps or even link to a repository that causes
the problematic output to occur.
-->

Given the following code: <!-- Please provide a link to play.rust-lang.org -->

```rust
#![feature(auto_traits)]
#![feature(negative_impls)]

pub trait PubPrincipal {}
auto trait PrivNonPrincipal {}

pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
//~^ WARN private trait `PrivNonPrincipal` in public interface
//~| WARN this was previously accepted

#[deny(missing_docs)]
fn container() {
    impl dyn PubPrincipal {
         fn check_doc_lint() {} //~ ERROR missing documentation for an associated function
    }
    impl dyn PubPrincipal + PrivNonPrincipal {
        pub fn check_doc_lint() {} // OK, no missing doc lint
    }
}

fn main() {}
```
The suggestion breaks the build:
````

after fixes were automatically applied the compiler reported errors within these files:

  * src/main.rs

This likely indicates a bug in either rustc or cargo itself,
and we would appreciate a bug report! You're likely to see
a number of compiler warnings after this message which cargo
attempted to fix but failed. If you could open an issue at
https://github.com/rust-lang/rust/issues
quoting the full output of this command we'd be very appreciative!
Note that you may be able to make some more progress in the near-term
fixing code with the `--broken-code` flag

The following errors were reported:
error[E0445]: private trait `PrivNonPrincipal` in public interface
 --> src/main.rs:7:1
  |
5 | auto trait PrivNonPrincipal {}
  | --------------------------- `PrivNonPrincipal` declared as private
6 |
7 | pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait

error: aborting due to previous error

For more information about this error, try `rustc --explain E0445`.
Original diagnostics will follow.

warning: unreachable `pub` item
  --> src/main.rs:17:9
   |
17 |         pub fn check_doc_lint() {} // OK, no missing doc lint
   |         ---^^^^^^^^^^^^^^^^^^^^
   |         |
   |         help: consider restricting its visibility: `pub(crate)`
   |
   = note: requested on the command line with `--force-warn unreachable-pub`

````
Repository: flutter
Issue: Document why KeyboardListener needs a FocusNode
Labels: a: text input,framework,d: api docs,P2,team-framework,triaged-framework

The documentation could be a bit more explicit about why KeyboardListener needs a FocusNode and what is the expected interaction between them.
Repository: youtube-dl
Issue: Can't download Iqiyi.com 
Labels: broken-IE

```
C:\Users\XXXXXi>C:\Users\XXXX\Desktop\youtube-dl.exe https://www.iqiyi.com/w_19rrzixid9.html --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.iqiyi.com/w_19rrzixid9.html', '--verbose']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: none
[debug] Proxy map: {}
[iqiyi] temp_id: download video page
ERROR: Can't find any video; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 534, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\iqiyi.py", line 352, in _real_extract
youtube_dl.utils.ExtractorError: Can't find any video; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
```
Repository: go
Issue: cmd/compile: statically remove type switch in instantiated generic code
Labels: Performance,NeedsInvestigation,compiler/runtime

Using Go1.19

Consider [this benchmark, which has three functions](https://go.dev/play/p/FEImrX2huzB):
* `lessUTF16` is a generic function that operates on either `[]byte` or `string`. It relies on  a type switch to call either `utf8.DecodeRune` or `utf8.DecodeRuneInString`.
* `lessUTF16Bytes` is identical to `lessUTF16` but is manually instantiated for `[]byte`.
* `lessUTF16String` is identical to `lessUTF16` but is manually instantiated for `string`.

The diff from `lessUTF16` to `lessUTF16Bytes` is:
```diff
-		var rx, ry rune
-		var nx, ny int
-		switch any(x).(type) {
-		case string:
-			rx, nx = utf8.DecodeRuneInString(string(x))
-			ry, ny = utf8.DecodeRuneInString(string(y))
-		case []byte:
-			rx, nx = utf8.DecodeRune([]byte(x))
-			ry, ny = utf8.DecodeRune([]byte(y))
-		}
+		rx, nx := utf8.DecodeRune(x)
+		ry, ny := utf8.DecodeRune(y)
```

Similarly, the diff from `lessUTF16` to `lessUTF16String` is:
```diff
-		var rx, ry rune
-		var nx, ny int
-		switch any(x).(type) {
-		case string:
-			rx, nx = utf8.DecodeRuneInString(string(x))
-			ry, ny = utf8.DecodeRuneInString(string(y))
-		case []byte:
-			rx, nx = utf8.DecodeRune([]byte(x))
-			ry, ny = utf8.DecodeRune([]byte(y))
-		}
+		rx, nx := utf8.DecodeRuneInString(x)
+		ry, ny := utf8.DecodeRuneInString(y)
```


I would expect `lessUTF16[[]byte]` to perform identically to `lessUTF16Bytes` and `lessUTF16[string]` to perform identically to `lessUTF16String` since the compiler can prove that only one of the cases are possibly executable. However, that is not what the benchmarks show:
```
BenchmarkString           	 1752459	       686.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkBytes            	 1573508	       765.1 ns/op	       0 B/op	       0 allocs/op
BenchmarkGenericString    	 1595708	       744.2 ns/op	       0 B/op	       0 allocs/op
BenchmarkGenericBytes     	 1527207	       793.7 ns/op	       0 B/op	       0 allocs/op
```

\cc @randall77