sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: proposal: go/build: add API to pick out cgo flags
Labels: Proposal,Proposal-Hold

While most Go programmers use the go tool, there are alternative build systems such as Bazel.  In order to build existing Go code, those build systems have to analyze [build constraints](https://pkg.go.dev/cmd/go#hdr-Build_constraints) in the same way as the go tool does.  For most purposes that can be done by calling [go/build.*Context.MatchFile](https://pkg.go.dev/go/build#Context.MatchFile).  However, there is a case that is not handled by that API: `#cgo` directives in file that use cgo.  A [`#cgo` directive](https://pkg.go.dev/cmd/cgo) appears in the special comment ad looks like `#cgo`, an optional build constraint, a flag name, a colon, a list of flags.  A build tool like Bazel needs a mechanism to take a file that uses cgo and return any `#cgo` flags appropriate for the current  environment.  Currently those tools must do this by recreating the build constraint evaluation process themselves.  The go/build package already contains the code that does this for the go tool, but it is not exposed in a usable form; it is only exposed as part of creating a `go/build.Package`, but that assumes that directory layout used by the go tool but not by Bazel.

I propose that we add a new exported method to go/build similar to the existing `saveCgo` method.

```Go
// CgoFlags extracts #cgo flags from an import "C" comment that has already been parsed by the caller.
// Each element of the resulting slice will contain a flag name followed by the arguments for that flag.
// For example, given a comment containing
//
//     #cgo CFLAGS: -DDEBUG
//     #cgo linux CFLAGS: -DLINUX
//
// then on a Linux system the result will be [][]string{[]string{"CFLAGS", "-DDEBUG", "-DLINUX"}}.
//
// This method does not validate the #cgo flag names in any way, it simply returns them.
// It will return an error for a malformed #cgo line.
func (ctx *Context) CgoFlags(filepath string, cg *ast.CommentGroup) ([][]string, error)
```
Repository: electron
Issue: [Feature Request]: support IME under native Wayland
Labels: enhancement :sparkles:,wayland

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

[Chrome](https://bugs.chromium.org/p/chromium/issues/detail?id=1183262) doesn't support IME under native Wayland before ver 98, and IME only works if `gtk-version=4` is enabled after. However when I pass that flag to electron, it would crash saying `GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported`

### Proposed Solution

No idea

### Alternatives Considered

No idea too

### Additional Information

_No response_
Repository: flutter
Issue: Make Platform Channels responses fulfillable from any thread.
Labels: c: new feature,engine,c: proposal,P3,customer: huggsy (g3),team-engine,triaged-engine

As part of our work for Background Platform Channels we made replies threadsafe for Host->Flutter messages.  We should make it thread safe for sending messages too.  So, for example, a callback in Java on a background thread could directly call the platform channel invocation instead of dispatching it to the main thread first.

b/228506442

cc @math1man
Repository: pytorch
Issue: Placing model on bfloat16 on CPU make it freeze/hang
Labels: needs reproduction,triaged,module: deadlock,module: bfloat16,module: intel

### 🐛 Describe the bug

Note : 
I know that bfloat16 should obviously not be used on a CPU model.
Maybe it's a better practice to do `to(self.device).to(bfloat16)` than `.to(bfloat16).to(self.device)`...
But there will be dummy guys like me who will also hit the same error. 

Maybe instead of hanging forever, we could have an Exception or some warning.
 
```python
my_big_model = load_my_model()  # Model is on CPU
my_big_model.to(torch.bfloat16)
my_big_model.inference(my_input) # Hang forever
```

Those are the happy cases one should do to run either on GPU or CPU (also to check that my model worked in all other possible cases, only the top one hang).
```python
my_big_model = load_my_model()  # Model is on CPU
my_big_model.inference(my_input) # Works perfectly
```

```python
my_big_model = load_my_model()  # Model is on CPU
if want_to_run_on_gpu:
    my_big_model.to(some_torch_device) # Model is on GPU
my_big_model.inference(my_input) # Works perfectly if flag is True or False
```

```python
my_big_model = load_my_model()  # Model is on CPU
if want_to_run_on_gpu:
    my_big_model.to(bfloat16).to(self.device) # Model is on GPU and casted to bfloat16 (twice less memory)
my_big_model.inference(my_input) # If model on CPU then it run, if model on GPU then it run in bf16 and everything works
```

Thanks, 
Have a great day :)

### Versions

PyTorch version: 1.11.0+cu113
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.3 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.31

Python version: 3.9.10 (main, Jan 15 2022, 18:17:56)  [GCC 9.3.0] (64-bit runtime)
Python platform: Linux-5.13.0-37-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 11.1.105
GPU models and configuration: 
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 3090

Nvidia driver version: 470.103.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.22.2
[pip3] pytorch-pretrained-bert==0.6.2
[pip3] torch==1.11.0+cu113
[conda] Could not collect

cc @ezyang @gchanan @zou3519
Repository: electron
Issue: [Bug]: persistent defaultSession is created and written when not needed, making the app multi-instance unsafe
Labels: platform/windows,bug :beetle:,18-x-y,19-x-y,windows 7

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

18.0.1 x64

### What operating system are you using?

Windows

### Operating System Version

win7 sp1 x64

### What arch are you using?

x64

### Last Known Working Electron version

4.2

### Expected Behavior

since user_data_dir is not multi-instance safe

https://github.com/electron/electron/pull/22772#issuecomment-611689138

and per the intent expressed here:

https://github.com/electron/electron/pull/22772#issuecomment-610494980
https://github.com/electron/electron/pull/22772#pullrequestreview-391016382

if the defaultSession is not needed by the app (when it uses a memory or persisted partition) the defaultSession should not be created, but more importantly persisted (which makes the app multi-instance unsafe)


### Actual Behavior

the defaultSession is always created and persisted

run the following app

```js
'use strict';

const {app, BrowserWindow, session} = require('electron'),
      path = require('path');

let win;

app.setPath('userData', path.join(__dirname, `user_data_${process.versions.chrome.split('.')[0]}`));

app.once('ready', () => {

  win = new BrowserWindow({
    webPreferences: {
      partition: 'memory_partition_1',
    },
  });

});
```

the user_data dir is filled with the persisted defaultSession not used by the app

### Testcase Gist URL

_No response_

### Additional Information

_No response_
Repository: pytorch
Issue: NotImplemented confusion between __torch_function__ and __rpow__ (and other dunder magic methods)
Labels: triaged,module: __torch_function__

### 🐛 Describe the bug

There are two levels of multiple dispatch for an operator like `__pow__`:

* If you return NotImplemented from `__pow__`, Python will attempt `__rpow__` on the other argument if the types are different, raising a TypeError if nothing is supported
* If you return NotImplemented from a `__torch_function__` implementation that is hit when processing `__pow__`, PyTorch will attempt `__torch_function__` on other arguments, raising a TypeError if nothing is supported

This interaction is pretty goofy. The implication is that we must catch a TypeError from a `__pow__` handler and convert it into NotImplemented, e.g.,

```
def _wrap_type_error_to_not_implemented(f):
    # functools.wraps doesn't work well with methods in python 2
    method_assignments = ('__name__', '__doc__')
    assigned = functools.WRAPPER_ASSIGNMENTS

    @functools.wraps(f, assigned=assigned)
    def wrapped(*args, **kwargs):
        # NB: not outside of the try!
        try:
            if has_torch_function(args):
                return handle_torch_function(wrapped, args, *args, **kwargs)
            return f(*args, **kwargs)
        except TypeError:
            return NotImplemented
    return wrapped
```

But it would be better if we could just directly report that things were NotImplemented in this case (to avoid the exception throw)

### Versions

master

cc @hameerabbasi @rgommers @peterbell10
Repository: godot
Issue: Import failure for files with a double quote (`"`) or `\n` characters in their path
Labels: bug,topic:import

### Godot version

4.0.dev (5a912b0444ad44b27e51cb1ac7ddde1abd651816)

### System information

Linux, Mageia 9 x86_64

### Issue description

While working on #59998, I noticed that the import system fails on files with either `"` or `\n` (the `\` and `n` characters, not an actual newline) in their names.

Those are actually two different bugs with slightly different symptoms, but they're both related to not properly escaping characters for paths so I'm reporting them together.

### Path with `\n`

With a file named `ic\non.png`, I get this spam of errors:
```
Failed to get modified time for: res://ic\non.png
ERROR: Can't find file 'res://ic\non.png'.
   at: _reimport_file (editor/editor_file_system.cpp:1826)
ERROR: Can't find file 'res://ic\non.png'.
   at: _reimport_file (editor/editor_file_system.cpp:1826)
ERROR: Can't find file 'res://ic\non.png'.
   at: _reimport_file (editor/editor_file_system.cpp:1826)
```
Ad lib.

### Path with `"`

Testing with a file named `ic"on.png`.
This actually imports fine, but then the imported file can't be loaded because the `.import` file has a truncated path:
```
ERROR: Resource file not found: res://.godot/imported/ic.
   at: _load (core/io/resource_loader.cpp:210)
ERROR: Failed loading resource: res://ic"on.png. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:205)
```

Indeed, the `ic"on.png.import` file (which can be written and read fine, no path problem here) has:
```
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bbgni03s4qttg"
path="res://.godot/imported/ic"on.png-fce67098bfe0809314a688c358dbb285.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://ic\"on.png"
dest_files=["res://.godot/imported/ic\"on.png-fce67098bfe0809314a688c358dbb285.ctex"]
```

The `dest_files` is correctly escaped, but the `path` field is not, so it gets truncated when parsing.

### Steps to reproduce

- Create a new project
- Rename `icon.png` to `ic\non.png` to see the first issue
- Rename `icon.png` to `ic"on.png` to see the second issue
- Might be Linux or Unix specific

### Minimal reproduction project

[TestImportPathBugs.zip](https://github.com/godotengine/godot/files/8447080/TestImportPathBugs.zip)
Repository: pytorch
Issue: torch.package: log.info when loading packages w/ externed modules + documentation
Labels: oncall: package/deploy,imported

### 🚀 The feature, motivation and pitch

Follow up from [T116586096](https://www.internalfb.com/intern/tasks/?t=116586096)

We should improve the user experience around externing and make it more obvious when something is externed.

We should update torch.package documentation to highlight that the packaged models aren't fully immutable/hermetic and there are backwards compatibility issues that they need to be aware of when using it.

The tagline is "creating hermetic packages" but that's not quite the case since underlying externed libraries like torch may be updated.

### Alternatives

_No response_

### Additional context

_No response_
Repository: godot
Issue: lightmap of GridMap breaks when item is added programmatically
Labels: topic:rendering,documentation,topic:3d

### Godot version

v3.4.4.stable.official [419e713a2]

### System information

macOS 12.1 (21C52)

### Issue description

Changing a cell programmatically in a script while the game is running breaks the lightmap of existing items on the grid.

### Steps to reproduce

When the attached project is started, another cell is changed in _ready() which breaks the lightmap of the pre-existing item.

### Minimal reproduction project

[bug_grid_light.zip](https://github.com/godotengine/godot/files/8447324/bug_grid_light.zip)
Repository: pytorch
Issue: [NVFuser] call kernels with informative names (e.g. pow_mul_add)
Labels: triaged,module: nvfuser

### 🚀 The feature, motivation and pitch

NNC Generates kernel names using [GenerateNameForGraph](https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/passes/utils/subgraph_utils.h#L68-L71) which improves profiling and debugging generated fusions. NVFuser should do the same

cc @jjsjann123 @kevinstephano @ngimel 

### Alternatives

_No response_

### Additional context

_No response_
Repository: youtube-dl
Issue: download twitch stream when stream didnt ended 
Labels: clarification-needed,question


- [ x] I'm asking a question
- [ x] I've looked through the README and FAQ for similar questions
- [ x] I've searched the bugtracker for similar questions including closed ones


I want to download twitch VOD but there is a problem. The VOD is not visssible in the twitch previous broadcasting so I cant just put the regular vod URL. Like this -  youtube-dl.exe -f 720p60 https://www.twitch.tv/videos/1297056505 . Whats the another similiar command for this ?
Repository: PowerToys
Issue: Shortcut not always working
Labels: Issue-Bug,Product-Keyboard Shortcut Manager,Priority-2

### Microsoft PowerToys version

"0.57.0"

### Running as admin

- [X] Yes

### Area(s) with issue?

Keyboard Manager

### Steps to reproduce

1. Go to PowerToys, on Keyboard Manager, add a new shortcut just like this:
![image](https://user-images.githubusercontent.com/62415471/162338707-aecf61ab-b990-4726-84b9-96d928e2450b.png)

2.  This shortcut is intended to be used to close any app (just like the normal alt+F4), so try to use it for a while, It will work for some minutes but it will suddenly stop working

### ✔️ Expected Behavior

This shortcut is intended to close any app

### ❌ Actual Behavior

This will work for a while and then it will stop working

### Other Software

_No response_
Repository: pytorch
Issue: IndexError: Caught IndexError in replica 0 on device 0.
Labels: oncall: distributed,triaged

### 🐛 Describe the bug

This error occurs when I train my model with 8-gpu, and I don't know how to fix it.

Traceback (most recent call last):
  ...
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 161, in forward
    outputs = self.parallel_apply(replicas, inputs, kwargs)
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 171, in parallel_apply
    return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 86, in parallel_apply
    output.reraise()
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/_utils.py", line 428, in reraise
    raise self.exc_type(msg)
IndexError: Caught IndexError in replica 0 on device 0.
Original Traceback (most recent call last):
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 61, in _worker
    output = module(*input, **kwargs)
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/root/hxi/Gait Recognition/SSGait0.4/models/vgg_c3d.py", line 187, in forward
    feature = feature.matmul(self.fc_bin[0])
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/nn/modules/container.py", line 426, in __getitem__
    idx = self._get_abs_string_index(idx)
  File "/root/anaconda3/envs/SSGait/lib/python3.7/site-packages/torch/nn/modules/container.py", line 409, in _get_abs_string_index
    raise IndexError('index {} is out of range'.format(idx))
IndexError: index 0 is out of range


I guess this error might be related to this statement in my model, but I don't know how to fix it:
def __init__(self):
      self.fc_bin = nn.ParameterList([
                  nn.Parameter(
                      nn.init.xavier_uniform_(
                          torch.zeros(sum(self.bin_numgl), _set_channels[2], _set_channels[2])))
                          ])
def forward(self, x):
      feature = feature.matmul(self.fc_bin[0])

When this code is commented out, it runs successfully: feature = feature.matmul(self.fc_bin[0])




### Versions

cuda ==11.0  cudatoolkit== 11.0   pytorch==1.7.1

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @SciPioneer @H-Huang
Repository: youtube-dl
Issue: Remove duplicated lines from subtitles
Labels: request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.12.17. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Search the bugtracker for similar feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a feature request
- [x] I've verified that I'm running youtube-dl version **2021.12.17**
- [x] I've searched the bugtracker for similar feature requests including closed ones


## Description

<!--
Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
-->

Auto-generated subtitles downloaded from YouTube usually have duplicated lines. Removing such lines is more or less easy with additional scripts. But wouldn't it be great to have this feature integrated in youtube-dl with a separate option to activate it?

( [an example of mentioned scripts](https://gist.github.com/davidcortesortuno/64723e4262889f592def55c1927db651) )
Repository: next.js
Issue: Ordering of request query being changed in production
Labels: bug,Pages Router

### Verify canary release

- [X] I verified that the issue exists in Next.js canary release

### Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:07 PST 2021; root:xnu-7195.141.14~1/RELEASE_X86_64
    Binaries:
      Node: 14.8.0
      npm: 6.14.7
      Yarn: N/A
      pnpm: N/A
    Relevant packages:
      next: 12.1.4
      react: 18.0.0
      react-dom: 18.0.0

### What browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

vercel

### Describe the Bug

Next.js hosted on Vercel is manipulating request URL.

Actual request: GET /api/test?hmac=123&host=123&sell=123&t=123

Value accessible from req.url: /api/test?host=123hmac=123&t=123sell=123

It only changes the value on production, hosted on Vercel. On local development, req.url is the exact same value as the actual request.


### Expected Behavior

query string isn't manipulated

### To Reproduce

1. Create next.js app
2. Create API route
3. Make GET request to route with some query parameters
4. Deploy to Vercel
5. Check req.url from API route and compare with the actual query string in GET request
Repository: pytorch
Issue: Forward AD convolution fails for the empty backend 
Labels: module: convolution,triaged,module: forward ad

### 🐛 Describe the bug

Repro: `python test/test_nn.py -k test_conv_backend` and remove the condition `if backend_actual != torch._C._ConvBackend.Empty`

```
File "/local/pytorch/torch/autograd/__init__.py", line 275, in grad
    return Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
RuntimeError: Trying to set a forward gradient that has a different size than that of the original Tensor, this is not supported. Tensor is of size [12] while the given forward gradient is of size [0].
```

### Versions

main