sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: stable-diffusion-webui
Issue: [Feature Request]: Python formatting, type checking, etc.
Labels: enhancement

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

Would you be open to changes that:

* Removed Windows formatting (^Ms) from Python and shell files
* Used https://github.com/psf/black to standardize formatting (and had a GitHub Actions job to check)
* Started to add Python type hints and type checking via mypy.readthedocs.io
* Used flake8 / [ruff](https://github.com/charliermarsh/ruff) to find Python errors.
* Used pyupgrade to upgrade the code to a minimum supported version of Python (looks like 3.7)

Thanks!

### Proposed workflow

See above description.

### Additional information

_No response_
Repository: opencv
Issue: Expose cv::initWideAngleProjMap for python bindings.
Labels: feature,category: python bindings

### Descripe the feature and motivation

I'm trying to undistort a wide angle camera image with parameters generated using the pinhole camera model calibration functions. I would like to try out this function to see if it improves the undistortion for the lens. I think I could write a pybind11 binding to the function I need, but it would be easier to have it exposed via opencv-python. My understand is that for this to happen the function need the macro `CV_EXPORTS_W` annotation. Currently it has `CV_EXPORTS` only. 

### Additional context

_No response_
Repository: opencv
Issue: `cv2.VideoCapture` does not raise exception immediately after an error occurs
Labels: question (invalid tracker)

### System Information

OpenCV python version: 4.6.0.66
Operating System: Windows 11
Python version: 3.11

### Detailed description

If a camera stream is not found or a camera is offline (unreachable IP address) opencv will throw an connection error connection of `-138` and softlock the main thread for around 30 seconds until an exception is thrown. 
For some reason after the error is encountered it takes opencv a very long time before realizing this and actually throwing an exception. 
At times no exception is even thrown even with `cv2.VideoCapture.setExceptionMode(True)` set
![image](https://user-images.githubusercontent.com/49711232/215896217-ae11b028-faac-4350-b7b7-63f7de8b0645.png)


### Steps to reproduce

```python
import cv2
from datetime import datetime
while True:
    try:
        print(f"{datetime.now().strftime('%H:%M:%S')} || Trying to connect to camera")
        camera = cv2.VideoCapture("http://10.0.0.114")
        camera.setExceptionMode(True)
        if camera.isOpened():
            print("Camera connected!")
            break
        print(f"{datetime.now().strftime('%H:%M:%S')} || Failed to connect to camera, no exception was thrown")
    except:
        print(f"{datetime.now().strftime('%H:%M:%S')} || Failed to connect to camera, exception was thrown")  # wont run
```

### 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: godot
Issue: godot crashed more than one time when I use csg shapes
Labels: bug,topic:core,needs testing,topic:3d

### Godot version

godot 4 beta 15

### System information

windows 10 , gtx 1060 3gb , intel  i5 10400

### Issue description

godot crashed more than one time when I use csg shapes

### Steps to reproduce

I add CSGCombiner3D then add a child CSGBox3D then I played I enabled  CSGCombiner3D use collision and I duplicate CSGBox3D then  play with size , rotation and change position of CSGBox3D then godot crash and

ERROR: Condition "!_ptrnew" is true. Returning: ERR_OUT_OF_MEMORY
   at: resize (./core/templates/cowdata.h:297)

is printed in the cmd


### Minimal reproduction project

[csg bug.zip](https://github.com/godotengine/godot/files/10551751/csg.bug.zip)
Repository: rust
Issue: Confusing error messages by using double variable name
Labels: A-diagnostics,T-compiler

### Code

```Rust
let number one = 1;
```


### Current output

```Shell
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `one`
  --> src\main.rs:14:17
   |
14 |      let number one = 1;
   |                 ^^^ expected one of `:`, `;`, `=`, `@`, or `|`
```


### Desired output

```Shell
error: expected only one variable name, found `one`
  --> src\main.rs:14:17
   |
14 |      let number one = 1;
   |                 ^^^ delete `one`
```


### Rationale and extra context

_No response_

### Other cases

_No response_

### Anything else?

Its a simple error but for new programmers it will be very helpful to have a better error message. I think it will be easy to fix, because it can be checked if there is a space after the variable name and then more letters. If this is the case, then my error message can be output.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"chenyukang"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: rust
Issue: Tracking Issue for BTreeMap cursors
Labels: T-libs-api,C-tracking-issue,T-libs

Feature gate: `#![feature(btree_cursors)]`

ACP: https://github.com/rust-lang/libs-team/issues/141

This is a tracking issue for the `Cursor` and `CursorMut` types for `BTreeMap`.

A Cursor is like an iterator, except that it can freely seek back-and-forth, and can safely mutate the tree during iteration. This is because the lifetime of its yielded references is tied to its own lifetime, instead of just the underlying tree. A cursor either points to an element in the tree, or to a "ghost" non-element that is logically located after the last element and before the first element.

### Public API

```rust
impl<K, V> BTreeMap<K, V> {
    fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
    where
        K: Borrow<Q> + Ord,
        Q: Ord;
    fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V>
    where
        K: Borrow<Q> + Ord,
        Q: Ord;
    fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
    where
        K: Borrow<Q> + Ord,
        Q: Ord;
    fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V>
    where
        K: Borrow<Q> + Ord,
        Q: Ord;
}

struct Cursor<'a, K: 'a, V: 'a>;

impl<'a, K, V> Cursor<'a, K, V> {
    fn move_next(&mut self);
    fn move_prev(&mut self);

    fn key(&self) -> Option<&'a K>;
    fn value(&self) -> Option<&'a V>;
    fn key_value(&self) -> Option<(&'a K, &'a V)>;

    fn peek_next(&self) -> Option<(&'a K, &'a V)>;
    fn peek_prev(&self) -> Option<(&'a K, &'a V)>;
}

struct CursorMut<'a, K: 'a, V: 'a>;

impl<'a, K, V> CursorMut<'a, K, V> {
    fn move_next(&mut self);
    fn move_prev(&mut self);

    fn key(&self) -> Option<&K>;
    fn value(&self) -> Option<&V>;
    fn value_mut(&mut self) -> Option<&mut V>;
    fn key_value(&self) -> Option<(&K, &V)>;
    fn key_value_mut(&self) -> Option<(&K, &mut V)>;

    unsafe fn key_mut_unchecked(&mut self) -> Option<&mut K>;

    fn peek_next(&self) -> Option<(&K, &V)>;
    fn peek_prev(&self) -> Option<(&K, &V)>;

    fn as_cursor(&self) -> Cursor<'_, K, V>;

    fn insert_after(&mut self, key: K, value: V);
    fn insert_before(&mut self, key: K, value: V);

    unsafe fn insert_after_unchecked(&mut self, key: K, value: V);
    unsafe fn insert_before_unchecked(&mut self, key: K, value: V);

    fn remove_current(&mut self) -> Option<(K, V)>;
    fn remove_current_and_move_back(&mut self) -> Option<(K, V)>;
}
```

### Steps / History

- [x] Implementation: #105641
- [ ] Final comment period (FCP)[^1]
- [ ] Stabilization PR

### Unresolved Questions

- None yet.

[^1]: https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html
Repository: PowerToys
Issue: Typos in milestone descriptions
Labels: Issue-Docs,Needs-Triage

### Provide a description of requested docs changes

This is not directly related to the documentation, but I thought it'd fit best here.

"Help Wanted"

**_if_** you feel you want to work on a roadmap item, **_please lets_** have a conversation in the tracking issue.

-> If you feel you want to work on a roadmap item, let's have a conversation in the tracking issue.

![image](https://user-images.githubusercontent.com/81419612/215914353-700bf1b0-5062-4c8c-ab5f-b79b7b7eb9f9.png)

"Suggested ideas"

Larger bucket of uncommitted to suggestions for new ideas and enhancements

Don't really know what this is supposed to say xD

![image](https://user-images.githubusercontent.com/81419612/215914990-1c64b6e2-374f-40b7-8208-029c1452538f.png)

Backlog and Stability Release both have only one sentence as the description, however, one has a period at the end and one doesn't. This should be consistent.
Repository: opencv
Issue: Consider releasing persistent tarballs of source code for each OpenCV version
Labels: feature

### Descripe the feature and motivation

Currently OpenCV doesn't provide for each version an official & persistent tarball of its source code, but implicitly relies on the automated github service based on git-archive which can generate on demand .tar.gz & .zip archives:

![image](https://user-images.githubusercontent.com/30052553/215915525-fac5fb81-cb59-4184-a0ce-5ecb762c39aa.png)

Even OpenCV homepage advises the autogenerated zip flavor:

![image](https://user-images.githubusercontent.com/30052553/215917750-d0b2bd8a-6f58-4f18-8d2c-bcc512e3f702.png)

These archives are not persistent (they are cached x hours), github doesn't even guarantee a reproducible checksum, and they never include submodules.
In practice hash of these archives have been reproducible for years. But yesterday github updated git on their server, and this new git version included a modification of the compression algorithm leading to different hash of these non-persistent tarballs. It broke almost all package managers until microsoft decided to roll back: https://github.com/orgs/community/discussions/45830

Even though they reverted, it doesn't mean that it won't break again. Therefore I believe it would be safer to create proper tarballs of each release instead of reying on some ephemeral tarball generated on demand.

### Additional context

_No response_
Repository: flutter
Issue: [camera_android] Revert temporary fix for null EncoderProfiles
Labels: platform-android,p: camera,P2,team-android,triaged-android

https://github.com/flutter/plugins/pull/7073 will provide/provides a temporary fix for https://github.com/flutter/flutter/issues/109769, an Android issue that is currently only fixed in recent builds. Once the Android fix is present in older release builds, the changes in that PR should be reverted back to rely on non-deprecated behavior.
Repository: pytorch
Issue: torchdynamo is not properly setting up input tracking (e.g., for symbolic shape guards) for view bases
Labels: triaged,needs design,bug,oncall: pt2,module: dynamic shapes

### 🐛 Describe the bug

When we convert a real tensor to a fake tensor, if the original tensor was a differentiable view we will also convert its base to a fake tensor, so we can construct a fake tensor that also looks like a view. In dynamic shapes, this means that we will allocate symbolic sizes for both the base as well as the view, and it turned out that in some circumstances we could end up producing guards on the base! This is problematic, because dynamo only considers the view as a new tensor inputs and only tracks its symints. The assert that fails is typically:

```
        assert expr_found, f"Failed to find {expr}"
```

in DynamoGuardPrinter in this case.

In [92ef26b96bf0c36e4b8ad87dc0419f46dfc65c69](https://github.com/pytorch/pytorch/pull/84246/commits/92ef26b96bf0c36e4b8ad87dc0419f46dfc65c69) we make this problem less likely to occur by suppressing guards that occur when creating fake tensors, since the naughty guard we observed in practice was caused by the `as_strided` call we use to setup the view performing a bounds check. But it would be better to fix this properly, especially since we still have "failed to find sX" in our tests.

The general idea is that whenever we allocate symbolic integers for a tensor, we should ALWAYS set it up in the environment. However, it is difficult to tell how many inputs a tensor will actually be (there is not only the _base field, but also the grad field); so it may be easiest if fake tensor converter communicates this information via a callback that has also says the attribute path, so we can make an appropriate source for the tensor.

cc @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang @wconstab @soumith @ngimel @voznesenskym 

### Error logs

_No response_

### Minified repro

_No response_
Repository: pytorch
Issue: [dynamic shapes] detectron2 dynamic shapes fails
Labels: triaged,oncall: pt2,module: dynamic shapes

- Install dynamo
- Install D2 (full instruction is [here](https://docs.google.com/document/d/1iOXyMHAkfWw0eKOV-E0yzvMNLIUB0sBRacvEfDNJC88/edit?usp=sharing))

```bash
pip3 install opencv-python
pip3 install scipy
pip3 install shapely
sudo apt install ninja-build  # make compilation faster
git clone git@github.com:facebookresearch/detectron2.git
cd detectron2 
TORCH_CUDA_ARCH_LIST="Pascal;Volta" pip3 install -e .
Add dynamo model optimization after this line https://github.com/facebookresearch/detectron2/blob/main/tools/lazyconfig_train_net.py#L73
cd projects/ViTDet
```

```bash
python lazy_train_net.py --config-file configs/sanity_check.py --num-gpus 2 dataloader.train.total_batch_size=2
```

It will throw error here https://github.com/facebookresearch/detectron2/blob/main/detectron2/structures/image_list.py#L122

cc @ezyang @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang @wconstab @ngimel
Repository: pytorch
Issue: Accuracy minifier can find spurious accuracy failures involving uninitialized memory
Labels: triaged,small,bug,oncall: pt2,module: minifier

### 🐛 Describe the bug

Suppose you have a graph like

```
y = x.new_empty(10)
y.fill_(0)
```

Suppose you are accuracy minifying. Removing the fill_ will cause an accuracy failure, because the uninitialized memory will trigger a difference. Oops.

Here is a quick and dirty way to remove non-determinism from uninitialized CUDA memory

```
diff --git a/c10/cuda/CUDACachingAllocator.cpp b/c10/cuda/CUDACachingAllocator.cpp
index 9876259522..f54e66138b 100644
--- a/c10/cuda/CUDACachingAllocator.cpp
+++ b/c10/cuda/CUDACachingAllocator.cpp
@@ -2140,6 +2140,7 @@ class NativeCachingAllocator : public CUDAAllocator {
       if (C10_UNLIKELY(interp)) {
         (*interp)->trace_gpu_memory_allocation(reinterpret_cast<uintptr_t>(r));
       }
+      cudaMemset(r, 0, size);
       return {r, r, &uncached_delete, Device(DeviceType::CUDA, device)};
     }
     if (size != 0) {
@@ -2147,6 +2148,7 @@ class NativeCachingAllocator : public CUDAAllocator {
       const_cast<NativeCachingAllocator*>(this)->malloc(
           &r, device, size, cuda::getCurrentCUDAStream(device));
     }
+    cudaMemset(r, 0, size);
     return {r, r, &local_raw_delete, Device(DeviceType::CUDA, device)};
   }
   DeleterFnPtr raw_deleter() const override {
```

Need some sort of proper fix.

### Error logs

_No response_

### Minified repro

_No response_

cc @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang @soumith @wconstab @ngimel
Repository: pytorch
Issue: [accuracy] [aot_eager] mobilenet_v2_quantized_qat fails accuracy 
Labels: triaged,bug,oncall: pt2,module: dynamic shapes,module: aotdispatch,module: pt2-dispatcher

### 🐛 Describe the bug

I am expecting `aot_eager` to be really close to pytorch native for any model. But, `mobilenet_v2_quantized_qat` fails accuracy. Minifier is not helping here (I am going to dive deeper into this). So, a couple of questions

1) Is something special about this model that can affect the accuracy?
2) Long time ago - I relaxed the accuracy check for another similar model `resnet50_quantized_qat`, and used cosine similarity. But, I think its too relaxed. If I tighten the check back, this model fails accuracy as well.

`python benchmarks/dynamo/torchbench.py --training --accuracy --device cuda --backend=aot_eager --float32 --only=mobilenet_v2_quantized_qat`

### Error logs

_No response_

### Minified repro

_No response_

cc @ezyang @msaroufim @wconstab @bdhirsh @zou3519 @soumith @ngimel
Repository: pytorch
Issue: Dynamo is over-guarding on Tensor locals
Labels: triaged,bug

### 🐛 Describe the bug

two for one example:

```
import torch
import torch._dynamo

def g(x, y, z):
    return x * 2 + 1

@torch._dynamo.optimize("eager")
def f(x, y, z):
    print("woof")
    z = x * 2
    z = x + 1
    print("warf")
    return g(z, y, z)

f(torch.randn(2), torch.randn(3), 4)
```

The graph between woof and warf generates a TENSOR_MATCH guard on y. The function call to g generates a TENSOR_MATCH guard on y. In both cases, this guard is completely unnecessary.

The extra guards here are especially pernicious because if you have a long function body with some graph breaks, the intermediate fragments will guard on ALL of the inputs, even if the broken up subgraphs only deal with a subset of variables.

### Error logs

_No response_

### Minified repro

_No response_
Repository: pytorch
Issue: Way to run accuracy minifier on only one particular subgraph
Labels: triaged,enhancement,bug

### 🐛 Describe the bug

Accuracy minifier may get stuck on an early subgraph. In this case, it may be helpful to ask the minifier to not run on those subgraphs, and only run on the one that you suspect is problematic (or you can do some sort of ablation and find all the subgraphs that are failing accuracy, so you can then discard the ones that are just because the accuracy minifier doesn't work.)

### Error logs

_No response_

### Minified repro

_No response_
Repository: pytorch
Issue: minified code can not produce fp64_ref result
Labels: triaged

Minified code:
```
import torch._inductor.overrides
import torch
from torch import tensor, device
import torch.fx as fx
from torch._dynamo.testing import rand_strided
from math import inf
from torch.fx.experimental.proxy_tensor import make_fx
# torch version: 1.14.0a0+fb
# torch cuda version: 11.4.0
# CUDA Info: 
# nvcc not found
# GPU Hardware Info: 
# NVIDIA A100-PG509-200 : 8 
from torch.nn import *
class Repro(torch.nn.Module):
    def __init__(self):
        super().__init__()


    def forward(self, arg147_1, arg149_1, arg151_1, arg153_1, add_37, permute_62, permute_63, permute_64, permute_65):
        convert_element_type_11 = torch.ops.prims.convert_element_type.default(add_37, torch.float32);  add_37 = None
        addmm_60 = torch.ops.aten.addmm.default(arg147_1, convert_element_type_11, permute_62);  arg147_1 = permute_62 = None
        addmm_61 = torch.ops.aten.addmm.default(arg149_1, addmm_60, permute_63);  arg149_1 = addmm_60 = permute_63 = None
        mul_54 = torch.ops.aten.mul.Tensor(convert_element_type_11, addmm_61);  addmm_61 = None
        add_38 = torch.ops.aten.add.Tensor(mul_54, convert_element_type_11);  mul_54 = convert_element_type_11 = None
        addmm_62 = torch.ops.aten.addmm.default(arg151_1, add_38, permute_64);  arg151_1 = add_38 = permute_64 = None
        addmm_63 = torch.ops.aten.addmm.default(arg153_1, addmm_62, permute_65);  arg153_1 = addmm_62 = permute_65 = None
        return (addmm_63,)

args = [((256,), (1,), torch.float32, 'cuda'), ((7616,), (1,), torch.float32, 'cuda'), ((256,), (1,), torch.float32, 'cuda'), ((7616,), (1,), torch.float32, 'cuda'), ((8, 7616), (7616, 1), torch.float32, 'cuda'), ((7616, 256), (1, 7616), torch.float32, 'cuda'), ((256, 7616), (1, 256), torch.float32, 'cuda'), ((7616, 256), (1, 7616), torch.float32, 'cuda'), ((256, 7616), (1, 256), torch.float32, 'cuda')]
args = [rand_strided(sh, st, dt, dev) for (sh, st, dt, dev) in args]
mod = make_fx(Repro().to(device="cuda"))(*args)
from torch._inductor.compile_fx import compile_fx_inner
from torch._dynamo.debug_utils import same_two_models
compiled = compile_fx_inner(mod, args)
assert same_two_models(mod, compiled, args, only_fwd=True), "Accuracy failed"                                                                            
```

Warning:
```
[WARNING] Could not generate fp64 outputs
```

The problem is likely coming from `torch.ops.prims.convert_element_type.default(add_37, torch.float32)` and it is not a bug, but not being able to compare with `fp64_ref` sometimes can lead minifier to a wrong direction when minifying accuracy errors.
Repository: pytorch
Issue: Support getattr/setattr user properties on Tensor
Labels: triaged,bug

### 🐛 Describe the bug

Tensor subclasses typically make use of storing properties on Tensor. This is not supported at all by TensorVariable and will cause graph breaks, making most applications of tensor subclasses not actually work.

### Error logs

_No response_

### Minified repro

_No response_
Repository: pytorch
Issue: Get the error: AttributeError: Can't pickle local object 'convert_frame.<locals>._convert_frame'
Labels: triaged,bug,oncall: pt2,module: dynamo,module: startup-tracing-compile

### 🐛 Describe the bug

When adding the line:
`model = torch.compile(model)` after loading the model, this error occurs. When removing the line, the script functions as intended. 

### Error logs

  File "/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/opt/anaconda3/envs/ml1/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'convert_frame.<locals>._convert_frame'


### Minified repro

_No response_

cc @ezyang @gchanan @zou3519 @kadeng @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @Xia-Weiwen @ipiszy @soumith @ngimel
Repository: pytorch
Issue: Umbrella issue for only populate real_value_cache in export test suite fails
Labels: triaged,bug,oncall: pt2,module: dynamo

### 🐛 Describe the bug

See https://github.com/pytorch/pytorch/pull/90468 for the list of introduced skips

### Error logs

_No response_

### Minified repro

_No response_

cc @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @soumith @wconstab @ngimel