sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: opencv
Issue: Custom built opencv 4.7.0 python import problem
Labels: question (invalid tracker),category: python bindings,category: build/install

### System Information

OpenCV version: 4.7.0
Operating System / Platform: Ubuntu 20.04
Compiler & compiler version: GCC 7.5.0
Python version: 3.6.9

### Detailed description

Q: what is a proper way to import `cv2.so` lib into python module since opencv 4.6.0?

I've built opencv 4.7.0 from source and now I have `cv2` folder with all `*.so` libs and cetera. 

When I did it I last time, with Opencv 4.5.5, everything what I needed to do is put next strings in `__init__.py`:

```
# __init__.py
import importlib
from .cv2 import *

# wildcard import above does not import "private" variables like __version__
# this makes them available
globals().update(importlib.import_module('cv2.cv2').__dict__)
```

Now it does not work, I can `import cv2` within `cv2` dir, but not without (all things like `from cv2 import cv2`, which is appropriate way of python importing)

Moreover, opencv-python project since opencv 4.6.0 has 3 python scripts just to import opencv lib. Not sure why and what changed.

I tried to seek help in opencv forums and stackoverflow, but I did not prevail:
- https://forum.opencv.org/t/custom-built-opencv-4-7-0-python-import-problem/11469/3
- https://stackoverflow.com/questions/74977869/custom-built-opencv-4-7-0-python-import-problem

Probably it is linked to https://github.com/opencv/opencv-python/issues/676

### Steps to reproduce

Here is python package folder (unzipped wheel) with empty `__init__.py`:
```
bkaba@bkaba:~/Downloads/tmp$ tree cv2
cv2
├── cv2.so
├── __init__.py
├── libavcodec.so
├── libavformat.so
├── libavutil.so
├── libformat_reader.so
├── libOpenCL.so
├── libopencv_c_wrapper.so
├── libopenvino_auto_batch_plugin.so
├── libopenvino_auto_plugin.so
├── libopenvino_c.so
├── libopenvino_hetero_plugin.so
├── libopenvino_intel_cpu_plugin.so
├── libopenvino_intel_gpu_plugin.so
├── libopenvino_intel_myriad_plugin.so
├── libopenvino_ir_frontend.so
├── libopenvino_onnx_frontend.so
├── libopenvino_paddle_frontend.so
├── libopenvino.so
├── libopenvino_template_extension.so
├── libopenvino_tensorflow_fe.so
├── libswscale.so
├── libtbb.so.2
├── libtemplate_extension.so
├── pcie-ma2x8x.mvcmd
├── plugins.xml
└── usb-ma2x8x.mvcmd
```

```python
>>> from from cv2 import cv2 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: Bindings generation error. Submodule name should always start with a parent module name. Parent name: cv2.cv2. Submodule name: cv2
```

```
cd cv2
python

>>> import cv2   # all works
```

### 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: go
Issue: proposal: os: Provide the inverse of DirFS(string)
Labels: Proposal

Just as `os.DirFS(string)` returns an fs.FS implementation based on the path passed, the inverse operation (fs.FS -> string) should be provided.

## Possible use case

Suppose we have a repository-like struct. This repo returns a different path depending on whether the fs.FS is a real OS file system, or any other "virtual" file systems (e.g. a testing one, or a network fs like S3).

```golang
type Repo struct {
    fs fs.FS
}

func (r Repo) Files() (string, error) {
    switch {
        case aRealPath:
            return "/the/actual/path", nil
        default:
            // Copy or download files in /tmp, for example.
            return "/tmp/randomPath", nil
    }
}
```

## Possible solution

Simply export the `os.dirFS`. This way, we can `path, ok := fs.(os.DirFS)`.
Repository: pytorch
Issue: LBFGS wolfe exceeds the maximum allowed iterations
Labels: module: optimizer,triaged,actionable

### 🐛 Describe the bug

We can specify the maximum amount of evaluations lbfgs can use every step. It is passed by `max_eval`.
When using strong wolfe, a call to `_strong_wolfe` is made and return the amount of evaluations done during the call. After that, a condition is checked if the amount of evaluations is below `max_eval`. Note that if `max_eval=3`, `_strong_wolfe` can still run 25 iterations and return 25. In theory `_strong_wolfe` has a parameter `max_ls` to limit exactly that. But LBFGS doesn't pass it and return the default value of 25.
It makes `max_eval` inaccurate and for small values almost useless.

Interestingly, if you install `1.10.1+cu113` from `https://download.pytorch.org/whl/torch_stable.html` you can see a fix was done:
```python
                    loss, flat_grad, t, ls_func_evals = _strong_wolfe(
                        obj_func, x_init, t, d, loss, flat_grad, gtd, max_ls=min(25, max_eval - current_evals)
                    )
```
In version 1.12 we don't see the usage of `max_ls` and we see:
```python
                    loss, flat_grad, t, ls_func_evals = _strong_wolfe(
                        obj_func, x_init, t, d, loss, flat_grad, gtd)
```
I don't find any commit with the fix I mentioned above but somehow it was released and then reverted(?).
Moving to commit `302ee7bfb6` which is tagged as `1.10.1` doesn't show this change either.

### Versions

PyTorch version: 1.12.0+cu116
Is debug build: False
CUDA used to build PyTorch: 11.6
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.22.3
Libc version: glibc-2.31

Python version: 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:56:21)  [GCC 10.3.0] (64-bit runtime)
Python platform: Linux-5.15.0-1019-aws-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: 
GPU models and configuration: GPU 0: NVIDIA A10G
Nvidia driver version: 510.73.08
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.0
[pip3] torch==1.12.0+cu116
[pip3] torch-model-archiver==0.5.3b20220226
[pip3] torch-workflow-archiver==0.2.4b20220513
[pip3] torchaudio==0.12.0
[pip3] torchfile==0.1.0
[pip3] torchserve==0.6.0b20220513
[pip3] torchtext==0.13.0
[pip3] torchvision==0.13.0
[conda] No relevant packages

cc @vincentqb @jbschlosser @albanD @janeyx99
Repository: godot
Issue: Unexpected return value of some ClassDB methods when run without debug
Labels: topic:core,topic:gdscript,documentation,topic:export

### Godot version

3.5.1 stable

### System information

Linux

### Issue description

Some methods of ClassDB do not return the expected result in a project exported without debug.

Examples are ClassDB.class_get_enum_constants() and ClassDB.class_get_enum_list() return empty arrays instead of the non-empty arrays returned with debug on. If this is intended behavior I think it should be mentioned in the documentation.

### Steps to reproduce

```
print(ClassDB.class_get_enum_constants("Time", "Month"))
print(ClassDB.class_get_enum_list("Time"))
```

Compare when run with and without debug.

### Minimal reproduction project

N/A
Repository: vscode
Issue: Two extensions with conflicting custom semantic tokens cause vscode to crash
Labels: bug,semantic-tokens

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: No

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.74.2
- OS Version: Windows_NT x64 10.0.19044

Two extensions that define custom semantic token types can create an infinite loop that causes vscode to crash almost immediately after both extension load. vscode terminates with: `(reason: 'crashed', code: '-36861')`.

Steps to Reproduce:

1. Have one extension which defines the following semantic token types:
```json
"semanticTokenTypes": [
    {
        "id": "operator",
        "description": "Style for operators",
        "superType": "punctuation"
    },
    {
        "id": "punctuation",
        "description": "Style for generic punctuation"
    },
]
```
2. Have a second extension which defines the following semantic token types:
```json
"semanticTokenTypes": [
    {
        "id": "punctuation",
        "superType": "operator",
        "description": "Style for punctuation symbols that are not operators"
    },
]
```
3. Load both extensions and see the crash.

The top snippet is taken directly from the `rust-analyzer` extension.

The crash must be happening because the second extensions, by defining `punctuation` to be a subtype of `operator`, creates a loop due to the definition of `operator` in the first extension. Obviously, this should not result in a crash, but furthermore, it doesn't make much sense that an extension can define a custom token of name `operator`, considering that `operator` is a pre-defined semantic token type as specified in the LSP.
Repository: opencv
Issue: Java OpenCV does not work with URLClassLoader
Labels: feature,category: java bindings

### System Information

OpenCV version: 4.5.3
Operating System: Windows 10/CentOS 7.9
Java 8/17

### Detailed description

The application uses URLClassLoader(s). There is no problem to load the native library using System.loadLibrary("opencv_java453")
The library is successfully loaded.

However, during use of APIs nothing happens as library is expected under SystemClassLoader.

With Java 8 using reflection it was possible to get reference of loaded library and add it to the list of loaded libraries SystemClassLoader.

With Java 17 there is no way to use this workaround.



### Steps to reproduce

Use URLClassLoader.
I the class loaded by an instance of URLClassLoader load library.
Implement logic to use any OpenCV native library method.

Expected result:
everything works

Actual result:
Failure - native library is not loaded.

### 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
- [ ] I updated to the latest OpenCV version and the issue is still there
- [ ] There is reproducer code and related data files (videos, images, onnx, etc)
Repository: material-ui
Issue: [Autocomplete] `display` inconsistent with other form controls
Labels: package: material-ui,component: autocomplete,enhancement

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/pedantic-tamas-1kzrk5?file=/demo.js

Steps:

1. The example above shows that components inline with Autocomplete always get wrapped to a new line.
2. Place a component next to an Autocomplete and notice it always goes to the next line.


### Current behavior 😯

Buttons and components that follow the Autocomplete get wrapped to the next line.

### Expected behavior 🤔

I would expect if space allows that components would stay on the same line. For example if I would like to place a related button to the right of an Autocomplete it is always wrapped.

### Context 🔦

I am trying to place a button to the right of the Autocomplete.

### Your environment 🌎

<details>
  <summary><code>npx @mui/envinfo</code></summary>

```
  System:
    OS: macOS 12.5
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: Not Found
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Edge: Not Found
    Firefox: 108.0.1
    Safari: 15.6
  npmPackages:
    @emotion/react: ^11.10.5 => 11.10.5
    @emotion/styled: ^11.10.5 => 11.10.5
    @mui/base:  5.0.0-alpha.112
    @mui/core-downloads-tracker:  5.11.2
    @mui/icons-material: ^5.11.0 => 5.11.0
    @mui/material: ^5.11.1 => 5.11.2
    @mui/private-theming:  5.11.2
    @mui/styled-engine:  5.11.0
    @mui/system:  5.11.2
    @mui/types:  7.2.3
    @mui/utils:  5.11.2
    @types/react:  18.0.26
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript:  4.9.4
```
</details>
Repository: rust
Issue: Rustdoc JSON produces dangling ID's when linking to foreign methods
Labels: T-rustdoc,A-intra-doc-links,A-rustdoc-json

```rust
#![feature(intra_doc_pointers)]

//! [`read`][pointer::read]
```

Errors with

```
---- [rustdoc-json] src/test/rustdoc-json/intra-doc-links/pointer_method.rs stdout ----

error: jsondoclint failed!
status: exit status: 1
command: "/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondoclint" "/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/intra-doc-links/pointer_method/pointer_method.json"
stdout: none
--- stderr -------------------------------
2:2017:1833 not in index or paths, but refered to at '$.index["0:0:1571"].links["pointer::read"]'
Error: Errors validating json /home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/intra-doc-links/pointer_method/pointer_method.json
------------------------------------------
```

And produces

```json
  "0:0:1571": {
      "crate_id": 0,
      "docs": "[`read`][pointer::read]",
      "id": "0:0:1571",
      "inner": {"is_crate": true, "is_stripped": false, "items": []},
      "kind": "module",
      "links": {"pointer::read": "2:2017:1833"},
      "name": "pointer_method"
    }
  ````
Repository: pytorch
Issue: Crashes of linalg.ldl_solve on different edge cases not coming from linalg.ldl_factor
Labels: module: crash,triaged,module: linear algebra,module: edge cases

## Double free on negative indices on CPU

```python
import torch
import numpy as np
arg_1_tensor = torch.neg(torch.rand([4, 5, 5], dtype=torch.float32))
arg_1 = arg_1_tensor.clone()
arg_2_tensor = torch.randint(-2048,1,[4, 5], dtype=torch.int32)
arg_2 = arg_2_tensor.clone()
arg_3_tensor = torch.rand([4, 5, 1], dtype=torch.float32)
arg_3 = arg_3_tensor.clone()
arg_4 = False
try:
  res = torch.linalg.ldl_solve(arg_1,arg_2,arg_3,hermitian=arg_4,)
except Exception as e:
  print("Error:"+str(e))
```

## Segfault on neg + CPU

```python
import torch
import numpy as np
arg_1_tensor = torch.neg(torch.rand([2, 2, 5, 5], dtype=torch.complex64))
arg_1 = arg_1_tensor.clone()
arg_2_tensor = torch.randint(-128,512,[2, 2, 5], dtype=torch.int32)
arg_2 = arg_2_tensor.clone()
arg_3_tensor = torch.rand([2, 2, 5, 1], dtype=torch.complex64)
arg_3 = arg_3_tensor.clone()
arg_4 = True
try:
  res = torch.linalg.ldl_solve(arg_1,arg_2,arg_3,hermitian=arg_4,)
except Exception as e:
  print("Error:"+str(e))
```
Repository: pytorch
Issue: Division by zero error when running torch.nn.functional.lp_pool1d
Labels: triaged,module: edge cases

### 🐛 Describe the bug

When I run torch.nn.functional.lp_pool1d with second argument as zero, it results in division by zero
```
import torch
import numpy as np
arg_1_tensor = torch.rand([3, 7], dtype=torch.float64)
arg_1 = arg_1_tensor.clone()
arg_2 = 0
arg_3 = 2
arg_4 = 3
arg_5 = False
try:
  res = torch.nn.functional.lp_pool1d(arg_1,arg_2,arg_3,arg_4,arg_5,)
except Exception as e:
  print("Error:"+str(e))
```

The log message is:

```
Error:float division by zero

```

### Versions

PyTorch version: 1.12.0
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.9.15 (main, Nov 24 2022, 14:31:59) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to:
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1660 Ti
Nvidia driver version: 525.60.11
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==1.12.0
[pip3] torchaudio==0.12.0
[pip3] torchvision==0.13.0
[conda] blas 1.0 mkl
[conda] cudatoolkit 11.3.1 h2bc3f7f_2
[conda] ffmpeg 4.3 hf484d3e_0 pytorch
[conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py39h7f8727e_0
[conda] mkl_fft 1.3.1 py39hd3c417c_0
[conda] mkl_random 1.2.2 py39h51133e4_0
[conda] numpy 1.23.5 py39h14f4228_0
[conda] numpy-base 1.23.5 py39h31eccc5_0
[conda] pytorch 1.12.0 py3.9_cuda11.3_cudnn8.3.2_0 pytorch
[conda] pytorch-mutex 1.0 cuda pytorch
[conda] torchaudio 0.12.0 py39_cu113 pytorch
[conda] torchvision 0.13.0 py39_cu113 pytorch
Repository: deno
Issue: Loading native Node module fails with "stream did not contain valid UTF-8"
Labels: needs investigation,node compat,node native extension

# Deno

- deno 1.29.1 (release, x86_64-pc-windows-msvc)
- v8 10.9.194.5
- typescript 4.9.4

# Output

```
error: Unable to load C:\Users\UserName\AppData\Local\deno\npm\registry.npmjs.org\node-mdaemon-api\22.0.3-alpha.19\node-mdaemon-api.node imported from file:///C:/tmp/test-native.ts

Caused by:
    stream did not contain valid UTF-8
```

# How to reproduce

Command

```cmd
deno run --unstable --allow-all test-native.ts
```
Script `test-native.ts` is

```typescript
import { getModuleInfo } from 'npm:node-mdaemon-api'; 

const moduleInfo = getModuleInfo();

console.dir(moduleInfo);
```
Repository: terminal
Issue: Local tests are failing again - seemingly due to a race initializing the page/control
Labels: Issue-Bug,Product-Terminal,Area-CodeHealth

### Windows Terminal version

Commit 547349af77df16d0eed1c73ba3041c84f7b063da

### Windows build number

10.0.19044.2364

### Other Software

_No response_

### Steps to reproduce

1. Check out a recent version of the project.
2. Build it.
3. Run the unit tests.


### Expected Behavior

All tests should pass.

### Actual Behavior

A number of the local tests are failing:

    TerminalAppLocalTests::TabTests::TryInitializePage [Failed]
    TerminalAppLocalTests::TabTests::TryDuplicateBadTab [Failed]
    TerminalAppLocalTests::TabTests::TryDuplicateBadPane [Failed]
    TerminalAppLocalTests::TabTests::TryZoomPane [Failed]
    TerminalAppLocalTests::TabTests::MoveFocusFromZoomedPane [Failed]
    TerminalAppLocalTests::TabTests::CloseZoomedPane [Failed]
    TerminalAppLocalTests::TabTests::SwapPanes [Failed]
    TerminalAppLocalTests::TabTests::NextMRUTab [Failed]
    TerminalAppLocalTests::TabTests::VerifyCommandPaletteTabSwitcherOrder [Failed]
    TerminalAppLocalTests::TabTests::TestWindowRenameSuccessful [Failed]
    TerminalAppLocalTests::TabTests::TestWindowRenameFailure [Failed]
    TerminalAppLocalTests::TabTests::TestPreviewCommitScheme [Failed]
    TerminalAppLocalTests::TabTests::TestPreviewDismissScheme [Failed]
    TerminalAppLocalTests::TabTests::TestPreviewSchemeWhilePreviewing [Failed]
    TerminalAppLocalTests::TabTests::TestClampSwitchToTab [Failed]
    SettingsModelLocalTests::SerializationTests::CascadiaSettings [Failed]
Repository: pytorch
Issue: `mul(CSC, CSC)` fails with layout mismatch between the inputs and the output.
Labels: module: sparse,triaged

### 🐛 Describe the bug

```python
In [1]: import torch

In [2]: x = torch.rand(3, 3).to_sparse_csr()
<ipython-input-2-a111f877c399>:1: UserWarning: Sparse CSR tensor support is in beta state. If you miss a functionality in the sparse tensor support, please submit a feature request to https://github.com/pytorch/pytorch/issues. (Triggered internally at /home/nik/git/Quansight/pytorch/aten/src/ATen/SparseCsrTensorImpl.cpp:54.)
  x = torch.rand(3, 3).to_sparse_csr()

In [3]: x * x
Out[3]: 
tensor(crow_indices=tensor([0, 3, 6, 9]),
       col_indices=tensor([0, 1, 2, 0, 1, 2, 0, 1, 2]),
       values=tensor([0.7678, 0.0257, 0.1134, 0.4288, 0.0411, 0.0229, 0.3167,
                      0.1143, 0.1028]), size=(3, 3), nnz=9,
       layout=torch.sparse_csr)

In [4]: x_csc = x.to_sparse_csc()

In [5]: x_csc * x_csc
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Input In [5], in <cell line: 1>()
----> 1 x_csc * x_csc

RuntimeError: Expected result Tensor to be of format CSR

```

### Versions

Current master.

cc @pearu @cpuhrsch @amjames @bhosmer