sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: str::match_indices documentation is misleading re overlaps
Labels: A-docs

### Location

https://doc.rust-lang.org/std/primitive.str.html#method.match_indices

### Summary

"An iterator over the disjoint matches of a pattern"

It's weird to say "_the_ disjoint matches" as if this uniquely identifies a set of matches. It's certainly _a_ set of disjoint matches, and even _a maximal_ set of disjoint matches, but it isn't always the only such set.

"For matches of pat within self that overlap, only the indices corresponding to the first match are returned."

This also isn't quite right. It's more like matches are skipped if they overlap _an index that was returned earlier_.

### Clarifying the text

For the first quoted sentence, perhaps: "An iterator over matches of the pattern, skipping overlaps as necessary for e.g. doing a search-and-replace"

For the second quoted sentence, describing the algorithm would be clearer: "When a match is found, it skips to after the match (so matches that overlap the found-match are omitted)".

### Clarifying the examples

For `match_indices`, I suggest replacing the last example with:

```rust
fn main() {
    let v: Vec<_> = "ababababa".match_indices("aba").collect();
    // This example demonstrates what happens when matches overlap.
    // The "aba" starting at index 2 is skipped due to the "aba" starting at index 0 being included.
    // The "aba" starting at index 6 is skipped due to the "aba" starting at index 4 being included.
    assert_eq!(v, [(0, "aba"), (4, "aba")]);
}
```

and for `rmatch_indices`, I suggest:

```rust
fn main() {
    let v: Vec<_> = "ababababa".rmatch_indices("aba").collect();
    // The "aba" starting at index 4 is skipped due to the "aba" starting at index 6 being included.
    // The "aba" starting at index 0 is skipped due to the "aba" starting at index 2 being included.
    assert_eq!(v, [(6, "aba"), (2, "aba")]);
}
```

(I chose "ababababa" instead of "abababa" because I wanted to ensure it remains clear that `rmatch_indices` does not just return the reversed output from `match_indices`.)
Repository: PowerToys
Issue: Option to group Windows
Labels: Idea-Enhancement,Needs-Triage

### Description of the new feature / enhancement

In most cases i have multiple Explorer Windows open at the same time. Alt-Tabbing through them to get all those windows visible is annoying. Is it possible to introduce an option to group certain windows together or to group fancy zones to always be visible together?

### Scenario when this would be used?

e.g. having multiple explorer windows grouped to show up together when alt-tabbing. or scenarios where you group outlook mail window and outlook calendar window to show up at the same time.

### Supporting information

_No response_
Repository: pytorch
Issue: torch.save throws ValueError: ctypes objects containing pointers cannot be pickled
Labels: module: serialization,triaged

### 🐛 Describe the bug

I have tried saving my dataloader object, but it throws me ValueError: ctypes objects containing pointers cannot be pickled
Here is the code:
```
batch_size = 16

do_flip = True
flip_vert = True 
max_rotate = 90 
max_zoom = 1.1 
max_lighting = 0.2
max_warp = 0.2
p_affine = 0.75 
p_lighting = 0.75 

tfms = get_transforms(do_flip=do_flip,
                      flip_vert=flip_vert,
                      max_rotate=max_rotate,
                      max_zoom=max_zoom,
                      max_lighting=max_lighting,
                      max_warp=max_warp,
                      p_affine=p_affine,
                      p_lighting=p_lighting)
train, valid,test = ObjectItemListSlide(train_images) ,ObjectItemListSlide(valid_images),ObjectItemListSlide(test_images)
item_list = ItemLists(".", valid, test)
lls = item_list.label_from_func(lambda x: x.y, label_cls=SlideObjectCategoryList)
lls = lls.transform(tfms, tfm_y=True, size=patch_size)
data_test= lls.databunch(bs=batch_size, collate_fn=bb_pad_collate,num_workers=0).normalize()
torch.save(data_test.valid_dl,"test_dl.pt")
```
ValueError                                Traceback (most recent call last)
[<ipython-input-18-91b8a8dc1f71>](https://localhost:8080/#) in <module>
----> 1 torch.save(data_test.valid_dl,"test_dl.pt")

1 frames
[/usr/local/lib/python3.7/dist-packages/torch/serialization.py](https://localhost:8080/#) in save(obj, f, pickle_module, pickle_protocol, _use_new_zipfile_serialization)
    378         if _use_new_zipfile_serialization:
    379             with _open_zipfile_writer(opened_file) as opened_zipfile:
--> 380                 _save(obj, opened_zipfile, pickle_module, pickle_protocol)
    381                 return
    382         _legacy_save(obj, opened_file, pickle_module, pickle_protocol)

[/usr/local/lib/python3.7/dist-packages/torch/serialization.py](https://localhost:8080/#) in _save(obj, zip_file, pickle_module, pickle_protocol)
    587     pickler = pickle_module.Pickler(data_buf, protocol=pickle_protocol)
    588     pickler.persistent_id = persistent_id
--> 589     pickler.dump(obj)
    590     data_value = data_buf.getvalue()
    591     zip_file.write_record('data.pkl', data_value, len(data_value))

ValueError: ctypes objects containing pointers cannot be pickled


### Versions

torch-1.11.0 torchvision-0.12.0

cc @mruberry
Repository: neovim
Issue: treesitter/extmarks: add folding support
Labels: enhancement,marks,treesitter,folds

Like conceal and spelling, add folding support to extmarks and implement treesitter folding using it.

- integrate with `foldmethod=syntax`.

Ref: #19226
Repository: vscode
Issue: Custom Editor wan't activated if open the file without any running vscode app
Labels: bug,custom-editors

<!-- ⚠️⚠️ 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?: Yes/No
Yes
<!-- 🪓 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.72.2 (user setup)
- OS Version: Windows_NT x64 10.0.22000

Steps to Reproduce:

1.  build and install the extension of https://github.com/microsoft/vscode-extension-samples/tree/main/custom-editor-sample
2.  close all running vscode (important!)
3.  open file with command:  code test.pawdraw
4.  the custom editor won't activate, it shows the text editor instead
5.  keep the vscode open, and open the same file again: code test.pawdraw
6.  this time, the custom editor is activated
Repository: godot
Issue: The ExportAttribute is now sealed
Labels: discussion,topic:dotnet

### Godot version

4.0 beta3

### System information

Windows

### Issue description

So in godot 3.X the export attribute was not sealed allowing to do neat things, drastically reducing the amount of code needed to be written.

As as example:
```csharp
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class ExportEnumFlagsAttribute : ExportAttribute
{
   public ExportEnumFlagsAttribute(Type enumType) : 
      base(PropertyHint.Flags, enumType.IsEnum ? string.Join(",", Enum.GetValues(enumType).Cast<int>()) : "Invalid Enum Type")
      { }
}
```
Would it be possible to remove the sealed modifier? Or it was put there because of now godot uses source generators and doing such things are no longer possible, in such approach.

### Steps to reproduce

Try to extend the ExportAttribute type

### Minimal reproduction project

-
Repository: PowerToys
Issue: Expect a function to measure the distance between any two points on the screen in the "screen ruler".
Labels: Idea-Enhancement,Needs-Triage,Product-Screen Ruler

### Description of the new feature / enhancement

Expect a function to measure the distance between any two points on the screen in the "screen ruler".The current screen ruler function only includes distance measurement in rectangular, vertical and horizontal directions, but not in diagonal lines, or the distance between two points.

### Scenario when this would be used?

This function is required for graphic design related work.Unfortunately, we have not been able to find any screen ruler on the web that does this, whether it is free or paid.

### Supporting information

_No response_
Repository: rust
Issue: Terse diagnostic "unexpected end of macro invocation" when misusing `assert_eq!`
Labels: A-diagnostics,T-compiler

Given the following code ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a0807cc00e6a0104575403051e049b9f)):

```rust
fn main() {
    assert_eq!(1 + 2 == 3);
}
```

### Current output: terse

```
error: unexpected end of macro invocation
 --> src/main.rs:2:26
  |
2 |     assert_eq!(1 + 2 == 3);
  |                          ^ missing tokens in macro arguments
```

### Better output: show macro correspondence

```
note:          This expression was treated as the $left argument to assert_eq!
  |
2 |     assert_eq!(1 + 2 == 3);
  |                ^^^^^^^^^^

note:          Following $left, assert_eq! expects ","
```

(See also #97108, which also asks for more verbose "missing tokens in macro arguments" errors.)

### Ideal output: fix my mistake

```
help: To assert equality, separate the two expressions with a comma:
  |
2 |     assert_eq!(1 + 2, 3);
  |                     ^
```

(See also #57507, which asks for specific diagnostics when making a similar mistake with the `assert!` macro.)

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

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

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: godot
Issue: Monodevelop
Labels: discussion,topic:editor,topic:dotnet

### Godot version

Beta 3

### System information

Linux

### Issue description

In the editor settings, under the last section, Mono, is the option to set an external editor. 

First, its not really clear, how that integration works, a tooltip could be handy. 

Secondly, and thats the point of this issue; one of the three options is MonoDevelop, which is abandoned since [quite some while](https://github.com/mono/monodevelop#readme). 

There is a community fork, which may replace it. https://github.com/dotdevelop/dotdevelop

 
![Screenshot_37](https://user-images.githubusercontent.com/6344099/196673447-772120b9-a0d0-46a7-81d6-51148c349ccd.png)
Repository: vscode
Issue: window.zoomLevel causing blurry canvas
Labels: feature-request,zoom

<!-- ⚠️⚠️ 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?: Yes

<!-- 🪓 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.72.2
- OS Version: Arch Linux, GNOME 42.4

Steps to Reproduce: See https://github.com/James-Yu/LaTeX-Workshop/issues/3509
1. Set "window.zoomLevel" to 2 in VSCode settings.
2. Start a page with canvas. (For example vscode-pdf uses pdf-js, which uses canvas to render a page)
3. Toggle developer tools and run `window.devicePixelRatio` in the console.


Screenshot:
You can see the second 123 is clearer than the first one.
`ZoomLevel=2`
![image](https://user-images.githubusercontent.com/28442838/196675511-10e6d2a7-296c-4d91-a6a4-a7c07b0839c8.png)
`ZoomLevel=log(1.5,1.2)`
![image](https://user-images.githubusercontent.com/28442838/196676061-90ca3ab9-8872-4fe4-8128-faf607d19edc.png)



Problem this is causing:
From what I observed, VSCode is likely using a exponential scaling `window.devicePixelRatio = power(1.2, window.zoomLevel)`. While this makes zooming intuitive, it is likely to cause roundup issue. With zoomLevel=2, devicePixelRatio is 1.44 (up to some floating rounding issue). When one set canvas size using the common `width * window.devicePixelRatio` way, it is more likely to miss a few pixels and cause Chrome to downscale or upscale the canvas.

Possible workaround:
Set `window.zoomLevel` to `log(1.5,1.2)`. So `window.devicePixelRatio` will be exactly 1.5.

Possible solution:
Chrome only provides fixed page zoom ratio. Maybe we can round the exponential zoom level to one of the fixed zoom level. (1.44 rounds to 1.5) 
![image](https://user-images.githubusercontent.com/28442838/196674541-9aa423d3-770b-4141-9c73-c7faabed140b.png)
Repository: material-ui
Issue: Cant create variant for SVG icon
Labels: package: system,customization: theme

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Steps to reproduce 🕹

Use WebStorm & try to create custom `color` variant for SvgIcon like `default` and it is `#434A54`

```tsx
export const muiTheme = createTheme({
    palette: {
      default: {
        main: '#434A54',
      },
    },
    components: {
      MuiIcon: {
        variants: [
          {
            props: {
              // TODO
              // color: 'default',
            },
            style: {
              color: theme.black,
            },
          },
        ],
      },
    },
    plPL,
  },
);

declare module '@mui/material/styles' {
  interface Palette {
    default: Palette['primary'];
  }

  interface PaletteOptions {
    default: PaletteOptions['primary'];
  }
}

declare module '@mui/material/Icon' {
  interface IconPropsColorOverrides {
    default: true;
  }
}

declare module '@mui/material/SvgIcon' {
  interface SvgIconPropsColorOverrides {
    default: true;
  }
}

```

### Current behavior 😯

Cant add color named `default` to MuiSvgIcon; & I have no tips in component or anything else (only default colors are avilable).

### Expected behavior 🤔

There should not be any errors in theme & custom color should be visible in tips

### Context 🔦

My friend dosent have such issue on VSCODE only I have it in webstorm :|

### Your environment 🌎

_No response_
Repository: pytorch
Issue: Missing string parsing for some parameter types in python arg parsing logic
Labels: high priority,triaged,module: pybind

### 🐛 Describe the bug

This bug was uncovered while working on https://github.com/pytorch/pytorch/pull/87095. We were accessing garbage value for the default symint argument while directly calling into python bindings code (`torch._C`). Unfortunately symint and symintlist weren't the only parameter types that weren't handled properly in `set_default_str`, which scans the string and sets the default value as well as throws an error if it sees something unexpected (e.g., `None` for device).
Currently, the following argument types are not handled:
```
ParameterType::TENSOR_LIST
ParameterType::GENERATOR
ParameterType::PYOBJECT
ParameterType::MEMORY_FORMAT
ParameterType::DIMNAME
ParameterType::DIMNAME_LIST
ParameterType::SCALAR_LIST
ParameterType::STORAGE
ParameterType::QSCHEME
 ``` 
This was only discovered with the above PR because before, we weren't throwing error by default if a parameter type wasn't handled. 
Granted that most of them probably don't need to store anything in the default case because they usually default to empty containers, but we should have a hard check for this in `set_default_str`. (added a fallthrough for now: https://github.com/pytorch/pytorch/pull/87095/files#diff-bb8fc823d2ddc10e38cabfc113c4aa0682b6082089079209abab27b7715d1e3eR1062-R1086)

### Versions

Master

cc @ezyang @gchanan @zou3519
Repository: bitcoin
Issue: Add per message stats to getnettotals rpc
Labels: Feature

**Is your feature request related to a problem? Please describe.**

It is not possible to get per message stats accumulated since the node has started. This would make analyzing network traffic in details easier.

**Describe the solution you'd like**

Extend `getnettotals` with a data similar to what is present in `getpeerinfo` per peer.

**Describe alternatives you've considered**

Looking at `getpeerinfo` gives some approximation, but it is only for currently connected peers and the stats are lost when a peer disconnects. It is possible to derive/interpolate from that and the time the peer has been connected, but that is cumbersome and prone to errors due to temporary traffic glitches (if the traffic is not uniform over time). E.g. if this peer has been connected for 10 seconds and transferred 5 bytes for INV messages and `bitcoind` is up for 1000 seconds, then 500 * number_of_peers bytes have been transferred for INV messages since startup, assuming number of connected peers does not change.

**Additional context**

Suggested additions to `getnettotals`:

```diff
{
  "totalbytesrecv": 304173500,
  "totalbytessent": 291919674,
+ "bytessent_per_msg": {
+   "addrv2": 8215,
+   "feefilter": 32,
+   "getaddr": 24,
+   "getdata": 9542,
+   "getheaders": 1053,
+   "headers": 1696,
+   "inv": 1536387,
+   "notfound": 61,
+   "ping": 3584,
+   "pong": 3616,
+   "sendaddrv2": 24,
+   "sendcmpct": 33,
+   "sendheaders": 24,
+   "tx": 1446525,
+   "verack": 24,
+   "version": 127,
+   "wtxidrelay": 24
+ },
+ "bytesrecv_per_msg": {
+   "addrv2": 52611,
+   "feefilter": 32,
+   "getdata": 15413,
+   "getheaders": 1053,
+   "headers": 3604,
+   "inv": 444758,
+   "notfound": 183,
+   "ping": 3616,
+   "pong": 3584,
+   "sendaddrv2": 24,
+   "sendcmpct": 66,
+   "sendheaders": 24,
+   "tx": 506127,
+   "verack": 24,
+   "version": 126,
+   "wtxidrelay": 24
+ },
  "timemillis": 1666181842031,
  "uploadtarget": {
    "timeframe": 86400,
    "target": 0,
    "target_reached": false,
    "serve_historical_blocks": true,
    "bytes_left_in_cycle": 0,
    "time_left_in_cycle": 0
  }
}
```
Repository: rust
Issue: Divergent suggestions to "borrow" when I actually need to path to the method via the reference type
Labels: A-diagnostics,T-compiler

Given the following code ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=df5c66b96626da8c8ca63b5969f4494f)):

```rust
struct S;

trait T {
    fn g(self: Self) -> u32;
}

impl T for &S {
    fn g(self: Self) -> u32 { 3 }
}

fn main() {
    let s = S;
    let f = S::g;
    assert_eq!(f(&s), 3);
}
```

### Current output

```
error[E0277]: the trait bound `S: T` is not satisfied
  --> src/main.rs:13:13
   |
13 |     let f = S::g;
   |             ^^^^ the trait `T` is not implemented for `S`
   |
help: consider borrowing here
   |
13 |     let f = &S::g;
   |             +

error[E0308]: mismatched types
  --> src/main.rs:14:18
   |
14 |     assert_eq!(f(&s), 3);
   |                - ^^ expected struct `S`, found `&S`
   |                |
   |                arguments to this function are incorrect
   |
note: associated function defined here
  --> src/main.rs:4:8
   |
4  |     fn g(self: Self) -> u32;
   |        ^
help: consider removing the borrow
   |
14 -     assert_eq!(f(&s), 3);
14 +     assert_eq!(f(s), 3);
   |
```

Neither of these suggestions gets me any closer to a working program:
* The first suggestion doesn't solve the problem, because it just tries to borrow the function that can't be found.
* The first suggestion diverges. The compiler will keep suggesting to add more `&` in the same place.
* The second suggestion, on its own, makes the second error go away (somehow). But it has to be reverted once I apply the actual fix for the first error.

### Suggested output

```
error[E0277]: the trait bound `S: T` is not satisfied
  --> src/main.rs:13:13
   |
13 |     let f = S::g;
   |             ^^^^ the trait `T` is not implemented for `S`
   |
note: required because `g` is a method of trait `T`
help: the trait `T` is implemented for the reference type, `&S`
help: consider finding the method `g` via the reference type, `&S`
   |
13 |     let f = <&S>::g;
   |             ++ + 
   |
```

* The note explains why the error message refers to`T`.
* The suggestion fixes the path, and adds the angle brackets required to write a path segment that starts with `&`.

There are several alternatives here: `<&S>::g`, `T::g`, and the fully qualified path `<&S as T>::g` all work. I figure `<&S>::g` is the best suggestion because it is closest to the original code.

### About that second error

Where is that second error coming from? Would it make sense to silence it? It's weird to see a type error regarding a function that doesn't exist (which is how I interpret the first message).
Repository: opencv
Issue: Provide binaries as ZIP along with the current EXE installation
Labels: feature

### Descripe the feature and motivation

The current download option for OpenCV's binaries on Windows is a self-extracting 7zip SFX archive, which is an EXE. Please provide a ZIP file as an option (I couldn't find one at least on the main page, where the downloads are listed) in order to allow e.g. easier integration with CMake `FetchContent`.



### Additional context

The lack of ZIP download option creates the following problems:

 * Executing an unknown (from IT administrative perspective) executable might be disabled by company's group policies
 * Adds unnecessary overhead when integrating with CMake `FetchContent` module

Let's imagine that the first point does not apply and the company's policies are perfectly fine with people executing arbitrary EXEs on their local computers.

CMake offers a very nice module called `FetchContent` (probably used in OpenCV's own project structure). Normally one can simply do

```
...
include(FetchContent)
# Create target directory where the downloaded ZIP archive will be unpacked
set(TARGET_SOURCE_DIR "...")
FetchContent_Declare(
    some_dependency
    SOURCE_DIR "${TARGET_SOURCE_DIR }"
    URL https://.../some_dependency.zip
)
# Fetch ZIP archive. This will also automatically extract the archive in the respective dependency sub-folder
FetchContent_Populate(some_dependency)
```

After that it's very easy (especially if a proper CMake configuration file is provided, which is the case with OpenCV) to integrate the dependency (e.g. `find_package(...)`).

```
set(CMAKE_PREFIX_PATH "${TARGET_SOURCE_DIR}/x64/vc15/lib/"}
find_package(OpenCV)
...
```

While, as far as I know, the self-extracting archive [provides command line arguments](https://stackoverflow.com/a/18911864/1559401), it adds an additional step that requires executing a process (e.g. `execute_process()` in CMake). If we are unlucky to have the first point I mentioned above group policies, this will create issues. Also on needs to either specify the exact name of the downloaded 7zip SFX EXE to execute it or iterate in the directory where it was downloaded and fetch it via regular expression or similar).