sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: module 'torch.mps' has no attribute 'device'
Labels: triaged,actionable,module: mps

### 🐛 Describe the bug

I'm getting the error `module 'torch.mps' has no attribute 'device'` trying to train a `sentence-transformer model (which uses the huggingface transformers trainer).

The error is raised on this line -> https://github.com/pytorch/pytorch/blob/7ef7c265d4361691dc4cf54152db083de3215fbf/torch/utils/checkpoint.py#L183

Because the mps model doesn't have a `device()` method

https://github.com/pytorch/pytorch/blob/7ef7c265d4361691dc4cf54152db083de3215fbf/torch/mps/__init__.py

### Versions

Collecting environment information...
PyTorch version: 2.3.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 14.5 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: Could not collect
Libc version: N/A

Python version: 3.10.14 (main, May 25 2024, 13:44:20) [Clang 15.0.0 (clang-1500.3.9.4)] (64-bit runtime)
Python platform: macOS-14.5-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M3 Pro

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] torch==2.3.0
[conda] Could not collect

cc @kulinseth @albanD @malfet @DenisVieriu97 @jhavukainen
Repository: java-design-patterns
Issue: Rate Limiting pattern
Labels: info: help wanted,epic: pattern,type: feature,Stale

**Description:**
The Rate Limiting design pattern is crucial in a microservices architecture to prevent abuse and ensure fair usage of resources. This pattern restricts the number of requests a service can handle within a specified timeframe, thereby enhancing reliability and performance by preventing overloading. This implementation will involve creating a mechanism to count and limit the number of incoming requests to a service, and take appropriate actions when the limit is exceeded.

**Main Elements of the Pattern:**
1. **Rate Limiter:** A component responsible for tracking the number of requests and enforcing the rate limit.
2. **Policy Configuration:** Defines the rate limit rules, such as the number of requests allowed per time unit and what actions to take when the limit is exceeded.
3. **Client Identification:** Mechanism to identify clients (e.g., IP address, API key) to apply rate limits individually.
4. **Throttling:** Delaying or rejecting requests when the rate limit is exceeded.
5. **Monitoring and Logging:** Tools to monitor and log rate-limiting activities for analysis and tuning.

**References:**
1. [Rate Limiting Pattern - Microservices.io](https://microservices.io/patterns/observability/rate-limiter.html)
2. [API Rate Limiting - Amazon API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html)
3. [Rate Limiting Strategies and Techniques](https://cloud.google.com/architecture/rate-limiting-strategies-techniques)
4. [Project Contribution Guidelines](https://github.com/iluwatar/java-design-patterns/wiki)

**Acceptance Criteria:**
1. Implement a rate limiter that can be configured with different policies.
2. Provide configuration options to define rate limit rules (e.g., requests per second).
3. Ensure the rate limiter can identify different clients and apply rate limits accordingly.
4. Implement mechanisms to throttle or reject requests exceeding the limit.
5. Include logging to capture rate-limiting events for monitoring purposes.
6. Provide comprehensive documentation and examples demonstrating how to use the rate limiter.
7. Write unit and integration tests to ensure the rate limiter works as expected under various scenarios.
Repository: PowerToys
Issue: Fancy Zones, some applications won't snap, and some applications will snap but won't save! PLEASE HELP!
Labels: Issue-Bug,Needs-Triage

### Microsoft PowerToys version

0.81.1

### Installation method

GitHub, Microsoft Store

### Running as admin

Yes

### Area(s) with issue?

FancyZones

### Steps to reproduce

Steps I use: 
I hold shift and drag or windows button left, on the desired app it either works for some apps or is able to snap but not save or it can't snap at all!

### ✔️ Expected Behavior

I expect it to Snap to the position and save the position. If I close it or decide to move to a new position(not snapping it out of fancy zones) and close it, it should open back up in the saved fancy zone position. It does work as I expect for some apps, but other apps have problems with it working. 

### ❌ Actual Behavior

Well depending on the application it either **_snaps to the position and does not save_** or **_it won't snap at all!_** which means (it won't move or even show fancy zones while I hold shift and drag).

Please help me solve this issue! If it's possible, which I'm hoping it is!

### Other Software

_No response_
```[tasklist]
### Tasks
```
Repository: rust
Issue: False compile error on associated type bounds
Labels: C-bug,F-associated_type_bounds,T-types,fixed-by-next-solver

I tried this code with rustc 1.79.0-beta.7 ([playground](https://play.rust-lang.org/?version=beta&mode=debug&edition=2021&gist=7baa76078716165213650d356f1c272a)):

```rust
use std::ops::Add;

trait R {
    type S;
}

trait Trait {
    type I: R<S: Add<Output: Add>>;
}

fn main() {}
```

I expected a successful compilation for this code as Associated Type Bounds has been stabilized (https://github.com/rust-lang/rust/pull/122055). However, I got the following compile error:

```
   Compiling playground v0.0.1 (/playground)
error[E0277]: cannot add `<<Self as Trait>::I as R>::S` to `<<Self as Trait>::I as R>::S`
 --> src/main.rs:8:18
  |
8 |     type I: R<S: Add<Output: Add>>;
  |                  ^^^^^^^^^^^^^^^^ no implementation for `<<Self as Trait>::I as R>::S + <<Self as Trait>::I as R>::S`
  |
  = help: the trait `Add` is not implemented for `<<Self as Trait>::I as R>::S`
help: consider further restricting the associated type
  |
7 | trait Trait where <<Self as Trait>::I as R>::S: Add {
  |             +++++++++++++++++++++++++++++++++++++++

For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` (bin "playground") due to 1 previous error
```

The code compiles if `Trait` is replaced with one of the following:
```rust
trait Trait {
    type I: Add<Output: Add>;
}
```
```rust
fn f<T: R<S: Add<Output: Add>>>(){}
```
```rust
trait Trait: R<S: Add<Output: Add>> {}
```
```rust
trait Trait {
    type I: R<S = Self::S_Desugar>;
    type S_Desugar: Add<Output: Add>;
}
```
or `Add` is replaced with user-defined `Op`:
```rust
trait Op<Rhs = Self> {
    type Output;
}
```

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc +beta --version --verbose`:
```
rustc 1.79.0-beta.7 (d9e85b56e 2024-05-25)
binary: rustc
commit-hash: d9e85b56e7f85f7fdabff71f217b7bb2cee0ef68
commit-date: 2024-05-25
host: aarch64-apple-darwin
release: 1.79.0-beta.7
LLVM version: 18.1.6
```
Repository: godot
Issue: Tilemap colliders have inconsisent behavior with move_and_slide() Max Angle (see pictures)
Labels: discussion,documentation,topic:physics,topic:2d

### Tested versions

Reproducible in: v4.3.dev4.official [df78c0636]

### System information

Godot v4.3.dev4 - Windows 10.0.19041 - Vulkan (Mobile) - dedicated AMD Radeon RX 5600 XT (Advanced Micro Devices, Inc.; 31.0.21029.6002) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)

### Issue description

Max Angle as a property for move_and_slide() doesn't work in a very specific condition where a slope doesn't register (and is treated as a wall) unless there is a contiguous collider setup. It's hard to describe in words, but the images should do it justice. Basically--if a slope is attached to a flat "plane", but there is an empty square connecting them, the Max Angle doesn't work. If there is an arbitrary square collider that connects the slope to an existing flat plane it works fine. It's an easy fix in-engine to take into account, but I suspect people will have issues with this in 2D games

In this image the empty square tile of collision is the issue--Max Angle does not work properly--and this slope will be treated as a wall.
![bug_report A](https://github.com/godotengine/godot/assets/25797518/4204aa15-dd32-429d-a34a-b2df509e236f)

In this image, with an added arbitrary square box collider to this tile, max angle DOES work as expected. Without this tile to make the entire tilemap collider a contiguous polygon,  max angle will not work and the incline will be treated as a wall. In tilemaps--all tiles should form a contiguous polygon collider without gaps. This should be made well known in documentation or fixed so that it doesn't matter if the tilemap colliders are contiguous or not.
![bug_report B](https://github.com/godotengine/godot/assets/25797518/31f35cda-f37e-4224-bb51-70990e2cb059)


### Steps to reproduce

As per above--just make a tile map with various slope colliders that don't create a contiguous polygon at the vertices

### Minimal reproduction project (MRP)

n/a
Repository: PowerToys
Issue: Text decoding issue in SVG preview.
Labels: Issue-Bug,Product-File Explorer,Needs-Triage

### Microsoft PowerToys version

0.81.1

### Installation method

PowerToys auto-update

### Running as admin

Yes

### Area(s) with issue?

File Explorer: Preview Pane, File Explorer: Thumbnail preview

### Steps to reproduce

Create a SVG file containing some non-ASCII texts, save it, and see preview on preview pane and thumbnail.

### ✔️ Expected Behavior

Texts should be decoded in UTF-8. (Same SVG in Chrome.)
![image](https://github.com/microsoft/PowerToys/assets/73067578/bd300def-8818-4c0d-873c-936a8a07bffa)


### ❌ Actual Behavior

Texts are decoded in Windows-1252.
![image](https://github.com/microsoft/PowerToys/assets/73067578/85cca67d-b0cb-410c-90e0-7b1787449c10)


### Other Software

My SVG is created by Inkscape 1.2.2 (732a01da63, 2022-12-09).
Repository: godot
Issue: External Editor Output sometimes combines two different print statements (Jetbrains Rider / C#) 4.3 beta 1
Labels: bug,topic:core,regression

### Tested versions

- tested in 4.3 Beta1

### System information

Godot v4.3.beta1.mono - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Ti (NVIDIA; 31.0.15.5222) - 13th Gen Intel(R) Core(TM) i9-13900KF (32 Threads)

### Issue description

The Output Console combines two different print statements. As far as I can say it only happens when GD.PrintErr() and GD.Print() are called.

I think it might have been introduced in https://github.com/godotengine/godot/pull/92158. This was a fix of my earlier issue https://github.com/godotengine/godot/issues/91603

<img width="558" alt="image" src="https://github.com/godotengine/godot/assets/52577744/d57226cb-c0c4-4a17-a131-d5493f98e9c5">
<img width="306" alt="image" src="https://github.com/godotengine/godot/assets/52577744/279ae83b-51b1-4a99-bd66-d430aac4d5f1">
<img width="296" alt="image" src="https://github.com/godotengine/godot/assets/52577744/547b90f5-34ec-4864-bd64-d248370af278">


### Steps to reproduce

Use GD.Print() and GD.PrintErr() in the process method

Screenshot is from MRP
<img width="271" alt="image" src="https://github.com/godotengine/godot/assets/52577744/0b1c71f9-5ace-4892-877f-f8ae094ec649">


### Minimal reproduction project (MRP)

[Outputtest.zip](https://github.com/user-attachments/files/15521096/Outputtest.zip)
Repository: godot
Issue: Viewport DEBUG_DRAW_UNSHADED wrong rendering with metallic materials
Labels: bug,topic:rendering,confirmed,topic:3d

### Tested versions

Tested on Godot 4.2.2 stable and 4.3.beta 1

### System information

Godot v4.3.beta1 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1660 Ti (NVIDIA; 31.0.15.5244) - Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (4 Threads)

### Issue description

When in Viewport debug draw is set to Viewport.DEBUG_DRAW_UNSHADED materials with high metallic property are rendered black. I'm not sure If that should be happening since when I set material shading mode to unshaded it rendered the albedo color correctly

Here is an example of what I mean.
![obraz](https://github.com/godotengine/godot/assets/103317718/87a8bab0-f7ab-42ef-b694-225f9c1f668c)

Left Editor 3D viewport is set to "Display Normal" and the right one is set to "Display Unshaded"

### Steps to reproduce

Switch debug draw in viewport to Viewport.DEBUG_DRAW_UNSHADED and place any mesh on scene and add very metallic material on to it. Or download the MRP

### Minimal reproduction project (MRP)

[debugDrawUnshadedMRP.zip](https://github.com/user-attachments/files/15521161/debugDrawUnshadedMRP.zip)
Repository: godot
Issue: Previously freed objects shown as `<null>` in the debugger
Labels: bug,topic:editor

### Tested versions

- Reproducible in v4.3.beta1.official [a4f2ea91a]

### System information

Godot v4.3.beta1 - Windows 10.0.22631 - Vulkan (Forward+) - integrated AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.; 31.0.22013.1007) - AMD Ryzen 7 7735U with Radeon Graphics (16 Threads)

### Issue description

With #73896, freed objects do not equal null anymore. When converting a project from 4.2 to 4.3 a lot of people who didn't pay attention to the changelogs and relied on this behavior might be confused why their project is broken.
What might make it more confusing though is that in the debugger's stack tree variable view, freed objects are shown as having a `<null>` value instead of something like `<Previously freed>`. 
This behavior is also inconsistent with the remote scene view, where any freed objects will be shown as `<empty>`.

![image](https://github.com/godotengine/godot/assets/78657554/4d73cab2-4066-46e1-89d3-043f015be364)
![image](https://github.com/godotengine/godot/assets/78657554/a8c99dda-76ba-4c3d-acda-1cd6c968dcb4)

Idealy both should be shown as `<Previously freed>` to make it more clear.

### Steps to reproduce

1. Make a variable containing any sort of object.
2. use object.free()
3. Make a breakpoint at any point after that
4. Look at the Stack tree and remote view for that variable

### Minimal reproduction project (MRP)

N/A
Repository: next.js
Issue: [Bug][Next.js13]: renderError does not follow the err info of __NEXT_DATA__ when hytrate in client
Labels: bug,Runtime

### Link to the code that reproduces this issue

https://github.com/henrycjchen/nextjs-13-bug-reproduction

### To Reproduce

1. start the application in production(`next build && next start`)
2. visit `http://localhost:3000/page1?error=1`
3. you will see the page render `500` first, and then render `error`

### Current vs. Expected behavior

I expectd only render `500`, but it render `500` first and then render `error`.

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.3.0: Wed Dec 20 21:31:00 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6020
Binaries:
  Node: 16.20.2
  npm: 8.19.4
  Yarn: 1.22.21
  pnpm: 7.33.1
Relevant Packages:
  next: 13.5.6
  eslint-config-next: 13.5.6
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Runtime

### Which stage(s) are affected? (Select all that apply)

next start (local), Vercel (Deployed), Other (Deployed)

### Additional context

Problem related code: [link](https://github.com/vercel/next.js/blob/next-13/packages/next/src/client/index.tsx#L808)

This bug was fixed in Next.js 14([link](https://github.com/vercel/next.js/blob/14-2-1/packages/next/src/client/index.tsx#L814)), but hopefully it could be fixed in Next.js 13, which is still used in our production.
Repository: vscode
Issue: Searching dropdown menus breaks navigation with arrow keys
Labels: bug,quick-pick

<!-- ⚠️⚠️ 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: `v1.89.1` and `v1.90.0-insider`
- OS Version: macOS Sonoma 14.5

After entering text into quick pick menus, it becomes impossible to move focus back to the text input with the arrow keys:


https://github.com/microsoft/vscode/assets/2207980/7c98d077-7421-4e5f-ab34-f94269bf9560


Steps to Reproduce:

1. Open a quick pick menu that allows you to filter a dropdown list with a text input and check/uncheck items. For instance: "Settings Sync: Configure..."
2. Enter filter text. In Settings Sync, try <kbd>extensions</kbd>.
3. Focus the dropdown menu and use the spacebar to toggle a match.
4. Press <kbd>↑</kbd> to return focus to the filter text input.
5. :boom:

This worked in past versions. I'm not sure when it stopped working. Not a showstopper by any means: It's still possible to focus the text input with <kbd>⌘+Shift+Tab</kbd>.
Repository: java-design-patterns
Issue: Fix busy-waiting loops
Labels: info: good first issue,epic: code quality

### Description

Busy-waiting, or spinning, is a technique where a process repeatedly checks to see if a condition is true, such as whether keyboard input or a lock is available. While it might seem like a good idea, it has several significant drawbacks:  

1. CPU Usage: Busy-waiting can consume a lot of CPU time. While a process is busy-waiting, it keeps the CPU busy. This can prevent other processes from running and can lead to high CPU usage, especially if the condition being checked doesn't become true for a long time.  
2. Performance: Busy-waiting can lead to performance issues. If a process is busy-waiting, it's not doing any useful work. This can slow down the overall performance of your application.  
3. Responsiveness: Busy-waiting can make your application less responsive. If a process is busy-waiting, it might not be able to respond to user input or other events in a timely manner. 
4. Power Consumption: Busy-waiting can lead to increased power consumption, especially on battery-powered devices. This is because the CPU is kept busy and is not allowed to enter a low-power state.  

Instead of busy-waiting, it's generally better to use some form of event-driven programming or blocking. This allows your process to sleep until the condition it's waiting for becomes true, which can save CPU time, improve performance, and make your application more responsive.

Busy-waiting loops are at least in these locations:

1. Server Session / App.java
2. Twin / BallThread.java
3. Log Aggregation / LogAggregator.java
4. Commander / Retry.java
5. Retry / Retry.java
6. Retry / RetryExponentialBackoff.java
7. Queue-Based Load Leveling / ServiceExecutor.java

### Acceptance Criteria

- Busy-waiting loops refactored
- README.md of the affected patterns revised as needed
Repository: PowerToys
Issue: FancyZones windows cycle to an invisible windows
Labels: Issue-Bug,Needs-Triage

### Microsoft PowerToys version

0.81.1

### Installation method

GitHub, PowerToys auto-update

### Running as admin

Yes

### Area(s) with issue?

FancyZones, FancyZones Editor

### Steps to reproduce

Put any windows (even just a single application window) to the first zone, in whichever layout (stack/grid/custom) doesn't matter, then cycle through windows. Video included in link.
https://imgur.com/a/gRX2C86

### ✔️ Expected Behavior

If there's 1 window, nothing will happen.
If there's 2 or more windows, it will cycle between the windows.

### ❌ Actual Behavior

FancyZones windows will cycle to an/several invisible, untargetable windows. This only happens in the first zone. Second zone onward or if you put windows in multi zone (zone 1 + zone 2) don't suffer from this behavior.

This only happens with the first zone, I've tested all default layout and my custom layout, I have no idea why. I have to cycle 2 or 3 times until it return to the first windows. Indicated in the screen recording at the moment the chrome window defocusing, the other windows aren't showing up immediately as it has to cycle through some invisible windows.

### Other Software

Same behavior with most applications.
Repository: flutter
Issue: [Web] Flutter Web app squeezes text in mobile browsers and html renderer
Labels: framework,engine,a: typography,platform-web,e: web_html,has reproducible steps,P3,team-web,triaged-web,found in release: 3.22,found in release: 3.23

### Steps to reproduce

Run Flutter Web app in mobile Chrome, Safari or any other browser 

### Expected results

Text rendered normally on mobile browsers

### Actual results

If you use dynamic fonts with `fontVariations`, text is squeezed, letters are rendered on each other, when launching on mobile browsers.

There were similar issues here, but they were close due to inactivity:
#145140
#146473

However the problem persists

### Code sample

<details open><summary>Code sample</summary>

```dart
void main() {
  runApp(
    const MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text(
            'Hello, World!',
            style: TextStyle(
              fontSize: 50,
              fontVariations: [
                FontVariation.weight(600),
                FontVariation.width(112.5),
              ],
            ),
          ),
        ),
      ),
    ),
  );
}
```

</details>

### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

mobile (html is default renderer here):
![simulator_screenshot_FB841F86-46F4-4784-861D-673D5DB2D095](https://github.com/flutter/flutter/assets/82471392/b58fa91d-6ab3-4f19-a7ad-80b524545e1e)

desktop (html-renderer):
![Снимок экрана 2024-06-01 в 10 26 47](https://github.com/flutter/flutter/assets/82471392/8ae0dc8e-e3a9-4293-beb3-4c31dd28c0b9)

</details>


### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.5 23F79 darwin-arm64, locale ru-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1)
[✓] IntelliJ IDEA Community Edition (version 2022.2)
[✓] VS Code (version 1.89.1)
[✓] Connected device (5 available)
    ! Error: Browsing on the local area network for iPhoneK. Ensure the device is
      unlocked and attached with a cable or associated with the same local area network as
      this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!
```

</details>