sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: react
Issue: Bug: Hydration mismatch error due to plugins generating script tag on top
Labels: Component: Server Rendering,Resolution: Backlog

<!--
  Please provide a clear and concise description of what the bug is. Include
  screenshots if needed. Please test using the latest version of the relevant
  React packages to make sure your issue has not already been fixed.
-->

React version: 18.0.0, 18.1.0-next-fc47cb1b6-20220404 (latest version in codesandbox)

## Steps To Reproduce

1. Install a plugin that creates a script tag at the top(ex: [Apollo Client Devtools](https://chrome.google.com/webstore/detail/apollo-client-devtools/jdkknkkbebbapilgoeccciglkfbmbnfm))
2. Go to the [demo](https://codesandbox.io/s/kind-sammet-j56ro?file=/src/App.js) in the [new SSR suspense guide](https://github.com/reactwg/react-18/discussions/37)
3. Open preview in a new window
4. UI mismatch error occurs at hydration time

  <img width="600" alt="스크린샷 2022-04-24 오전 11 02 34" src="https://user-images.githubusercontent.com/4126644/164952677-06618e72-3343-4b92-9eaa-b45bce11c3ab.png">

<!--
  Your bug will get fixed much faster if we can run your code and it doesn't
  have dependencies other than React. Issues without reproduction steps or
  code examples may be immediately closed as not actionable.
-->

Link to code example: https://codesandbox.io/s/kind-sammet-j56ro?file=/src/App.js

<!--
  Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a
  repository on GitHub, or provide a minimal code example that reproduces the
  problem. You may provide a screenshot of the application if you think it is
  relevant to your bug report. Here are some tips for providing a minimal
  example: https://stackoverflow.com/help/mcve.
-->

## The current behavior

If a script tag is inserted before the head tag due to the user's browser environment such as a plugin, it is judged as a hydration mismatch and the screen is broken.

https://user-images.githubusercontent.com/4126644/164953071-14546c74-d9ab-4a6f-8f99-6712f29c6dd6.mov




## The expected behavior

This problem may be a part that each third party needs to solve, but I'm wondering if it's possible to handle an exception in the hydration matching logic of React.
Repository: godot
Issue: TileMap collision position went wrong which is set after setting  shape offset
Labels: bug,topic:editor,topic:2d

### Godot version

3.4.4.stable.mono

### System information

MacOs 11.6.5

### Issue description

When you set Tileset collision  after the collision shape offset is set. the collision position goes wrong.

you should reset the offset of shape and tex to 0 and then it became correct, then you can set it to your desired offset

### Steps to reproduce

1. setup the tilemap
2. set tex offset and shape offset
3. set the collision shape
<img width="536" alt="截屏2022-04-24 下午2 12 52" src="https://user-images.githubusercontent.com/579129/164959407-323af380-9cd7-45ac-acb1-a19c785ae90d.png">
<img width="175" alt="截屏2022-04-24 下午2 10 36" src="https://user-images.githubusercontent.com/579129/164959412-5105f8bc-3256-4a46-b24f-eb98421ab7fa.png">



### Minimal reproduction project

_No response_
Repository: godot
Issue: Use of Json.NET crashes the game when exported to Mac OSX
Labels: bug,topic:dotnet,crash

### Godot version

3.4.4.stable.mono

### System information

macOS Catalina 10.15.7, GLES3

### Issue description

I'm trying to deserialise a json file currently. The game does not crash when not exported, but it quit with `terminating with uncaught exception of type std::__1::system_error: recursive_mutex lock failed: Invalid argument`:
[maclog.txt](https://github.com/godotengine/godot/files/8549170/maclog.txt)

The code causing the error is tracked down to `Serializer.Deserialize`, which is
[This line](https://github.com/QiuFeng54321/GodotProjForIssueReport/blob/master/GlyphTextureConfiguration.cs#L40) in sample project


### Steps to reproduce


+ Make a new godot project
+ Set up export template for macOS
+ Add Json.NET nuget package
+ Make a data class for deserialization
+ Create a file following the data type desc in user directory
+ Make a script for node, trying to deserialize from the file
+ Get error

### Minimal reproduction project

[This repo](https://github.com/QiuFeng54321/GodotProjForIssueReport) is an example. 
Export to macOS and run to see errors.
Repository: pytorch
Issue: `torch.cuda.amp.GradScaler` may skip parameter synchronization required by post localSGD optimizer
Labels: oncall: distributed,module: amp (automated mixed precision)

### 🐛 Describe the bug

The following two designs may not work very well together.

-  When mixed precision is enabled by `torch.cuda.amp.GradScaler`, as noted in this [line](https://github.com/pytorch/pytorch/blob/bbc3cc6718d841665ab2677477d458ed97b75609/torch/cuda/amp/grad_scaler.py#L68) and this [line](https://github.com/pytorch/pytorch/blob/bbc3cc6718d841665ab2677477d458ed97b75609/torch/cuda/amp/grad_scaler.py#L86), if gradients contain infs/NaNs, then `optimizer.step()` can be skipped.
- Some [distributed optimizers](https://github.com/pytorch/pytorch/tree/77f23d64607142c0cba47f5148ebc1959c9de366/torch/distributed/optim) often run certain communications besides `step()` of the local optimizer.

A prominent example is [post_localSGD_optimizer](https://github.com/pytorch/pytorch/blob/77f23d64607142c0cba47f5148ebc1959c9de366/torch/distributed/optim/post_localSGD_optimizer.py#L78), which runs parameter averaging after `step()` of local optimizer. Since parameter/model averaging paradigm (e.g., local SGD, hierarchical SGD, SlowMo) does not synchronize parameters at every iteration, even if gradients have infs/NaNs and the local trainable parameters are not updated at the current iteration, it is still better to average the parameters than have such averaging skipped. Otherwise the parameters might become too stale (e.g., the last synchronization could be `2*T` iterations ago, where `T` denotes the averaging period). IMO, this might even cause the loss of NaN might occur for some cases.

Furthermore, this behavior of silently skipping `optimizer.step()` can also be a risk for some other (future) distributed optimizers if certain states (e.g., optimizer state, buffer) still need to be updated. For example, the internal step counter [here](https://github.com/pytorch/pytorch/blob/77f23d64607142c0cba47f5148ebc1959c9de366/torch/distributed/optim/functional_rmsprop.py#L91) can be less than the # of steps in a training loop, and same as the step counter in this [RFC](https://github.com/pytorch/pytorch/issues/74556). Additionally, not sure if any other optimizer wrapper may need to run certain communications even if no local optimizer step.

One relevant feature request is https://github.com/pytorch/pytorch/issues/67590, which proposes to signal that the scaler has been stepped and `optimizer.step()` has been actually called.

_Note that this issue may not be very serious for some cases in practice, because [such step skipping is expected to occur rarely after the first few iterations](https://github.com/pytorch/pytorch/blob/bbc3cc6718d841665ab2677477d458ed97b75609/torch/cuda/amp/grad_scaler.py#L93-L95)._

### Versions

PyTorch 1.11

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @SciPioneer @H-Huang @mcarilli @ptrblck
Repository: opencv
Issue: V4.5.1: use cv2.findCirclesGrid will cause exception:OpenCV(4.5.1) /tmp/pip-req-build-7m_g9lbm/opencv/modules/core/src/matmul.dispatch.cpp:439: error: (-215:Assertion failed) scn == m.cols || scn + 1 == m.cols in function 'transform'
Labels: question (invalid tracker),category: calib3d

this is my code:
```python
    image = cv2.imread("debug.png", cv2.IMREAD_UNCHANGED)
    params = cv2.SimpleBlobDetector_Params()
    params.filterByArea = True
    params.filterByCircularity = True
    params.filterByConvexity = False
    params.filterByInertia = True
    params.filterByColor = True
    params.minArea = 100
    params.maxArea = 10000
    params.minCircularity = 0.3
    params.minInertiaRatio = 0.01
    params.minRepeatability = 6
    params.minDistBetweenBlobs = 1

    params.minThreshold = 50
    params.maxThreshold = 200
    params.thresholdStep = 3
    params.blobColor = 255

    detector = cv2.SimpleBlobDetector_create(params)

    pattern_rows = 4
    pattern_cols = 11

    ret, pts = cv2.findCirclesGrid(image, (pattern_rows, pattern_cols),
                                   flags=(cv2.CALIB_CB_ASYMMETRIC_GRID),
                                   blobDetector=detector)
```
and image:
![debug](https://user-images.githubusercontent.com/63587878/164966833-8ad668a8-0d86-434d-a7a9-5d52f72c1ca8.png)
Repository: ant-design
Issue: [React18] Menu组件子菜单的异常显示问题
Labels: Inactive,React 18

### Reproduction link

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/antd-reproduction-template-forked-85vunx?file=/index.js)

### Steps to reproduce

1. 开启React并发模式
2. 选中导航栏层级最深的选项
3. 触发导航栏的响应式断点 or 展开收起子菜单选项

### What is expected?

1. 当触发响应式断点时，不应当出现子菜单闪烁出现的问题

### What is actually happening?

1. 当触发响应式断点时，出现子菜单闪烁出现的问题（层级越深越为明显）

| Environment | Info |
| --- | --- |
| antd | 4.20.0 |
| React | >= 18.0.0 |
| System | macOS 12.3.1 (21E258) |
| Browser | 100.0.4896.127 (Official Build) (x86_64) |

---
1. 用户调整页面窗口大小时。
2. 用户调整横竖屏时。
3. 响应式调整导航栏菜单宽度时。

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: go
Issue: proposal: x/sync/singleflight: add generic API
Labels: Proposal,generics

* singleflight is a great library, but the return value of the argument function uses `interface{}`. If you use generics, you can make it a flexible function by simply passing a type.
* For compatibility, define it with a different name than `singleflight.Group`, e.g. `singleflight.GroupGenerics`.
* `singleflight.GroupGenerics` has exported functions `Do()`, `DoChan()` and `Forget()` as well as singleflight.
  * `singleflight.GroupGenerics` has the following types, arguments, and return values.

```go
type GroupGenerics[V any] struct {
	mu sync.Mutex          // protects m
	m  map[string]*call[V] // lazily initialized
}

func (g *GroupGenerics[V]) Do(key string, fn func() (V, error)) (v V, err error, shared bool)
func (g *GroupGenerics[V]) DoChan(key string, fn func() (V, error)) <-chan Result
func (g *GroupGenerics[V]) Forget(key string)
```


I changed the existing API to try it out. Please refer to it.

https://github.com/catatsuy/sync/pull/1/files
Repository: PowerToys
Issue: Power toys and Apples Boot Camp F15 and F16 remapping with side effects...
Labels: Issue-Bug,Help Wanted,Needs-Team-Response,Area-App Compat

### Microsoft PowerToys version

V 057.2

### Running as admin

- [ ] Yes

### Area(s) with issue?

Keyboard Manager

### Steps to reproduce

Hi,
i am very happy to use Power toys to map an Apple Keyboard to keep some of my habits working on Windows.
It works brilliantly (like Karabiner works on macOS) on a PC.

However I had some headaches on a Mac running Windows 10 with Boot Camp.
Boot Camp seems to hard-map F14-F16 that way:

F14 -> Print Screen
F15 -> Scroll Lock
F16 -> Pause

This mapping is not overridden by Power Toys, so the F15 -F16 keys provide the mapped output, plus additionally a parasitic Scroll Lock / Pause respectively.

Since I don't expect any effort from Apple to change that behaviour, could you change your precedence process to catch the keystrokes _before_ the boot-camp driver?



### ✔️ Expected Behavior

F15, F16 being remapped without side effects 

### ❌ Actual Behavior

Scroll Lock, Pause persists after remapping

### Other Software

Apple Boot Camp drivers 6.0.6136
Repository: flutter
Issue: [Flutter drive] cannot find relative imports to parent directory when running on web
Labels: framework,dependency: dart,t: flutter driver,platform-web,f: integration_test,has reproducible steps,P3,found in release: 3.0,found in release: 3.1,team-web,triaged-web

Repro:

1. clone https://github.com/cedvdb/flutter_repros/tree/integration_test_failing_imports (integration_test_failing_imports branch)
2. run pub get
3. Run test in web `flutter drive --driver=test/integration_test_driver.dart --target=test/acceptance/tests/feature/feature_acceptance_test.dart --no-pub --device-id=web-server --no-headless`

(optionally run test on android)
Run test in android `flutter drive --driver=test/integration_test_driver.dart --target=test/acceptance/tests/feature/feature_acceptance_test.dart --no-pub`

# Result

```
org-dartlang-app:/feature_acceptance_test.dart:6:8: Error: Error when reading 'org-dartlang-app:/utils/add.dart': File not found
import '../../utils/add.dart';
```

# Expected  Result

For it to run like on android, allowing us to execute our acceptance tests on all platforms.

# version

$ flutter --version
Flutter 2.13.0-0.0.pre.618 • channel master • https://github.com/flutter/flutter.git
Framework • revision ef5a6da35a (5 days ago) • 2022-04-19 19:19:08 +0800
Engine • revision acd27a4b58
Tools • Dart 2.18.0 (build 2.18.0-30.0.dev) • DevTools 2.12.2
Repository: rust
Issue: Missing rust-gdb pretty printer for cdylib shared objects
Labels: A-debuginfo,T-compiler,C-bug

### Problem
Debugging in `rust-gdb` with a shared object library does not activate pretty-printers supplied by `rustup`.

Running `cargo build` with  `crate-type` of `bin` or `lib` results in a `.debug_gdb_scripts` section on the target or library, allowing [`rust-gdb`](https://github.com/rust-lang/rust/blob/5cdab3a8db1dc2326737c1a1d48e838a8b8e55d7/src/etc/rust-gdb) to [auto-load](https://sourceware.org/gdb/onlinedocs/gdb/dotdebug_005fgdb_005fscripts-section.html) the [Python pretty printers](https://github.com/rust-lang/rust/blob/5cdab3a8db1dc2326737c1a1d48e838a8b8e55d7/src/etc/gdb_load_rust_pretty_printers.py#L3) dynamically during debugging. The pretty printers are great!
https://github.com/rust-lang/rust/blob/91a0600a5c22b9d159e3c57526af83e71d1120f8/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs#L39-L40

However, for `crate-type` of `cdylib`, the `.debug_gdb_scripts` section is not written. This results in a lack of pretty printing in `rust-gdb`, and makes it more challenging to use `rust-gdb` to best effect. I'm seeing this when working with Python bindings of Rust code with [pyo3](https://github.com/PyO3/pyo3). Is there a reason `cdylib` did not receive this pretty-printer support?

### Workaround

I've confirmed that manually adding the `.debug_gdb_scripts` section to a `.so` library generated with `crate-type=cdylib` activates the pretty printers. I did noticed some Python exceptions in the pretty printers, but have not investigated further.
```bash
$ objcopy --add-section .debug_gdb_scripts=<(echo -ne "\x01gdb_load_rust_pretty_printers.py\0") ./libmytest_lib.so
$ objdump -sj .debug_gdb_scripts libmytest_lib.so

libmytest_lib.so:     file format elf64-x86-64

Contents of section .debug_gdb_scripts:
 0000 01676462 5f6c6f61 645f7275 73745f70  .gdb_load_rust_p
 0010 72657474 795f7072 696e7465 72732e70  retty_printers.p
 0020 7900                                 y.      
```
### Version information
rustc 1.60.0 (7737e0b5c 2022-04-04)
cargo 1.60.0 (d1fd9fe 2022-03-01)
Repository: godot
Issue: False positive of GDScript UNSAFE_PROPERTY_ACCESS warning
Labels: enhancement,discussion,topic:gdscript,confirmed

### Godot version

v3.4.4.stable.official [419e713a2]

### System information

Linux

### Issue description

The language is GDScript.

If a variable has been asserted to be a certain type in an `if` statement (e.g. `if event is InputEventMouse`), accessing that variable's properties still triggers the `UNSAFE_PROPERTY_ACCESS` warning in the editor.

Logically, the variable has already been asserted to be of a certain type and does not need to be cast with the `as` keyword to achieve type safety as it has already been effectively achieved.

This can just as well be considered a feature proposal rather than a bugfix. In any case, it is still an oversight.

### Steps to reproduce

```
func _input(event: InputEvent) -> void:
	if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
		# "relative" is a property of InputEventMouseMotion
		rotate_x(event.relative.y * mouse_sensitivity * -1)
```
`event` has been asserted to be an `InputEventMouseMotion`, but the editor doesn't recognize that.
This results in _two_ warnings:
```
Line 7 (UNSAFE_PROPERTY_ACCESS):The property 'relative' is not present on the inferred type 'InputEvent' (but may be present on a subtype).
Line 7 (UNSAFE_PROPERTY_ACCESS):The property 'relative' is not present on the inferred type 'InputEvent' (but may be present on a subtype).
```
As a sidenote, the second warning might be because the `y` property is getting accessed on an already unsafe property `relative`. Still, the warnings shouldn't be identical.

### Minimal reproduction project

[Strategy.zip](https://github.com/godotengine/godot/files/8550473/Strategy.zip)
Repository: go
Issue: cmd/link, embed: store only one copy of an embedded []byte
Labels: NeedsInvestigation

I am using the `caire` package: https://github.com/esimov/caire/blob/master/process.go#L26
It embeds a file called `facefinder` required for a common dependency called `pigo`.

My application also uses the `pigo` package and independently needs to embed the same file.

Currently the same file's data is being embedded twice. Perhaps as an optimisation, it can calculate the hashes of each embedded file (including inside all the dependencies), and store the data only once for duplicates.

**This proposal is only for single file embeds and not directories.**
Repository: rust
Issue: Tracking Issue for `ops::Yeet` (`feature(try_trait_v2_yeet)`)
Labels: T-libs-api,C-tracking-issue

<!--
Thank you for creating a tracking issue!

Tracking issues are for tracking a feature from implementation to stabilization.

Make sure to include the relevant RFC for the feature if it has one.

If the new feature is small, it may be fine to skip the RFC process. In that
case, you can use use `issue = "none"` in your initial implementation PR. The
reviewer will ask you to open a tracking issue if they agree your feature can be
added without an RFC.
-->

Feature gate: `#![feature(try_trait_v2_yeet)]`

This is a tracking issue for standard library additions related to https://github.com/rust-lang/rust/issues/96373, which for now means the `ops::Yeet` struct and related `impl`s.

It currently exists **experimentally**.  [Per the lang process](https://lang-team.rust-lang.org/how_to/propose.html), this cannot go further than experimenting without an approved RFC -- and will certainly not stabilize under the name `Yeet`.  Please try this out and give experience reports, but be aware that it may well change drastically or be removed entirely.

### Public API

<!--
For most library features, it'd be useful to include a summarized version of the public API.
(E.g. just the public function signatures without their doc comments or implementation.)
-->

```rust
// core::ops
pub struct Yeet<E>(pub E);

impl<T> ops::FromResidual<ops::Yeet<()>> for Option<T>;
impl<T, E, F: From<E>> ops::FromResidual<ops::Yeet<E>> for Result<T, F>;
```

### Steps / History

<!--
For larger features, more steps might be involved.
If the feature is changed later, please add those PRs here as well.
-->

- [ ] Implementation: #96376
- [ ] Final comment period (FCP)
- [ ] Stabilization PR

<!--
Once the feature has gone through a few release cycles and there are no
unresolved questions left, the feature might be ready for stabilization.

If this feature didn't go through the RFC process, a final comment period
(FCP) is always needed before stabilization. This works as follows:

A library API team member can kick off the stabilization process, at which point
the rfcbot will ask all the team members to verify they agree with
stabilization. Once enough members agree and there are no concerns, the final
comment period begins: this issue will be marked as such and will be listed
in the next This Week in Rust newsletter. If no blocking concerns are raised in
that period of 10 days, a stabilzation PR can be opened by anyone.
-->

### Unresolved Questions

<!--
Include any open questions that need to be answered before the feature can be
stabilised. If multiple (unrelated) big questions come up, it can be a good idea
to open a separate issue for each, to make it easier to keep track of the
discussions.

It's useful to link any relevant discussions and conclusions (whether on GitHub,
Zulip, or the internals forum) here.
-->

- [ ] The name, of course.
Repository: pytorch
Issue: torch._remove_batch_dim is interceptable by __torch_function__ / batch tensors don't print correctly
Labels: triaged,module: vmap,module: __torch_function__

### 🐛 Describe the bug

`_add_batch_dim` and `_remove_batch_dim` are supposed to be internal functions that are not user visible. However, `__torch_function__` makes it possible to observe these functions as well as their inputs/outputs, as they are defined in `native_functions.yaml` and correspondingly overrideable via `__torch_function__`. To avoid leaking in this way, I think we probably should have put a torch function handler on `vmap`, the higher order function, itself.

This being said, there is another problem: batch tensors don't print correctly.

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/users/ezyang/pytorch-tmp/torch/_vmap_internals.py", line 271, in wrapped
    batched_outputs = func(*batched_inputs)
  File "<stdin>", line 1, in <lambda>
  File "/data/users/ezyang/pytorch-tmp/torch/_tensor.py", line 338, in __repr__
    return torch._tensor_str._str(self)
  File "/data/users/ezyang/pytorch-tmp/torch/_tensor_str.py", line 443, in _str
    return _str_intern(self)
  File "/data/users/ezyang/pytorch-tmp/torch/_tensor_str.py", line 418, in _str_intern
    tensor_str = _tensor_str(self, indent)
  File "/data/users/ezyang/pytorch-tmp/torch/_tensor_str.py", line 264, in _tensor_str
    formatter = _Formatter(get_summarized_data(self) if summarize else self)
  File "/data/users/ezyang/pytorch-tmp/torch/_tensor_str.py", line 112, in __init__
    if value != torch.ceil(value):
RuntimeError: Batching rule not implemented for aten::is_nonzero. We could not generate a fallback.
>>> torch.vmap(lambda x: print(x))(torch.randn(2, 2))
```

which makes debugging problems involving batched tensor inputs quite irritating.

@zou3519 this is partially why I added a way of sniffing out batched tensors; random stuff doesn't work with them so I can't treat them uniformly as dense tensors.

### Versions

master

cc @zou3519 @hameerabbasi @rgommers @peterbell10