sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: react-native
Issue: VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc. {"contentLength": 3629.142822265625, "dt": 11464, "prevDt": 8699}
Labels: Component: VirtualizedList,Priority: Low,Platform: All,Tech: React Native Core,Type: Old Architecture,Impact: Performance

### Description

 function renderItem({ item, index }) {
    return (
      <GridShowCaseItem index={index} widget={item} />
    )
  };
  const memoizedValue = useMemo(() => renderItem, [props.widgets]);

  return (
    <>
      <FlatList
        removeClippedSubviews={true}
        style={{ marginBottom: 44 }}
        showsVerticalScrollIndicator={false}
        windowSize={30}
        data={props.widgets}
        renderItem={memoizedValue}
        maxToRenderPerBatch={4}
        keyExtractor={(item, index) => index.toString()}
      />
    </>
  );

GridShowCase.tsx

function renderItem({ item }) {
    return (
      <Product
        ratingShow={false}
        deliveryOptionElement={false}
        key={item.id}
        product={item}
      />
    )
  };
  const memoizedValue = useMemo(() => renderItem, [props.data]);
  return (
    <View>
      <FlatGrid
        itemDimension={130}
        spacing={10}
        style={styles.showCaseContainer}
        data={props.data || []}
        removeClippedSubviews={true}
        renderItem={memoizedValue}
        listKey={moment().valueOf().toString()}
      />
    </View>
  );
};


### Version

"react-native": "0.66.0",

### Output of `npx react-native info`

System:
    OS: Windows 10 10.0.22000
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 2.80 GB / 15.71 GB
  Binaries:
    Node: 16.5.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.4.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowAllTrustedApps: Disabled
      Versions: 10.0.18362.0, 10.0.19041.0
  IDEs:
    Android Studio: Version     2020.3.0.0 AI-203.7717.56.2031.7678000
    Visual Studio: 16.10.31321.278 (Visual Studio Community 2019)
  Languages:
    Java: 15.0.2 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
  npmPackages:
    @react-native-community/cli: ^6.1.0 => 6.1.0
    react: 17.0.2 => 17.0.2
    react-native: 0.66.0 => 0.66.0
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

### Steps to reproduce

//NA

### Snack, code example, screenshot, or link to a repository

_No response_
Repository: flutter
Issue: Dart/Flutter never release memory of "Dart/Flutter Native" leading to OOM crash
Labels: framework,engine,c: performance,f: scrolling,perf: memory,has reproducible steps,P2,found in release: 2.10,found in release: 2.13,found in release: 3.1,team-engine,triaged-engine

# Problem
Recently I encounter some crashs on an app because it was Out Of Memory. After some digging with DevTools I quickly found that a scrollable list of images was filling anormaly the memory.
After some testing I have the feeling that pictures are remove from "**Dart/Flutter**" cache but are never release from "**Dart/Flutter Native**" memory.

I've tried to use **cacheWidth** and **cacheHeight** parameters but same issue the memory never empty itself. I've tried **cached_network_image** package but the same issue occurs with the fact that it fills up faster the memory since the images are cached. I've tried also to download the content of pictures (Uint8List) to display with **Image.memory** but same issue occurs. This behaviors confort me that the problem is based on the ListView keeping rasterize children in memory or something like this.

On this graph we can see the evolution of the "**Dart/Flutter Native**" that increase constantly without decreasing in contrary of the "**Dart/Flutter**" that manage smarter the memory consumption.

![Graph](https://user-images.githubusercontent.com/38684083/163982250-da09f6c8-0190-4b3f-af36-15af1cb90da7.png)

On the **Analysis** and **Allocations** tab we can see that the **_List** class is instantiate a large number of times causing to use a lot's of bytes.
![Analysis](https://user-images.githubusercontent.com/38684083/163982726-6ccab558-7019-4b39-9b97-5b94193d4117.png)
![Allocations](https://user-images.githubusercontent.com/38684083/163982828-4bc2a3d7-598c-4825-ba45-9ba5c2c101be.png)

# How to reproduce
In order to reproduce, just create a ListView that contains images. After scrolling for a bunch of minutes, take a look of the analysis tab of Devtool memory page. After poping the screen containing the ListView, memory is never releaseed.

```dart
ListView.builder(
  scrollDirection: Axis.horizontal,
  itemBuilder: (context, index) {
    return Padding(
      padding: const EdgeInsets.all(6),
      child: ClipRRect(
        borderRadius: BorderRadius.circular(12),
        child: AspectRatio(
          aspectRatio: 1,
          child: Container(
            decoration: BoxDecoration(color: Colors.grey[200]),
            child: Image.network(pictures[index % pictures.length], fit: BoxFit.cover),
          ),
        ),
      ),
    );
  },
)
```
I have created a blank flutter project that reproduce this issue : [Complete demo code](https://github.com/NeroThroN/flutter-oom-crash)

# Questions
- What's the solution to this issue ?
- What would be a good alternative to avoid this problem ?
- Is Flutter team aware of this behavior and can create a discussion to view the evolution of a potential solution ?
Repository: pytorch
Issue: __torch_function__ and generator input hazard
Labels: triaged,module: __torch_function__

### 🐛 Describe the bug

Generators in Python are a one-shot business: you can iterate through them once, and then that's it; they'll silently return an empty list upon subsequent iterations. Generators cause trouble for `__torch_function__`, where we may need to iterate through a list multiple times to detect Tensor subclass arguments.

In general, list-accepting PyTorch functions that are bound from C don't accept iterable arguments. However, poorly written userland code can accidentally iterate over iterable arguments multiple times. I committed this mistake with the implementation of torch.autograd.grad:

```
    t_outputs = cast(Tuple[torch.Tensor, ...], (outputs,) if is_tensor_like(outputs) else tuple(outputs))
    t_inputs = cast(Tuple[torch.Tensor, ...], (inputs,) if is_tensor_like(inputs) else tuple(inputs))
    overridable_args = t_outputs + t_inputs
    if has_torch_function(overridable_args):
        return handle_torch_function(
            grad,
            overridable_args,
            outputs,
            inputs,
            grad_outputs=grad_outputs,
            retain_graph=retain_graph,
            create_graph=create_graph,
            only_inputs=only_inputs,
            allow_unused=allow_unused,
            is_grads_batched=is_grads_batched,
        )
```

It is necessary to iterate over the inputs/outputs to detect tensor subclasses, but doing so will destroy an iterator. Thus, we must use the result of the iterator to actually implement the function in question; we cannot preserve the arguments as is.

### Versions

master

cc @hameerabbasi @rgommers @peterbell10
Repository: pytorch
Issue: [RFC] NPU device for PyTorch
Labels: oncall: distributed

### 🚀 The feature, motivation and pitch

NPU is device abstraction of Ascend Neural Networks Process Units.
NPU works as a normal torch device like CPU, GPU and XPU, so PyTorch users can easily migrate model scripts to perform model training/inference on NPU.

The enabling of NPU contains two parts:
1. registering a new 'NPU' device type to PyTorch, which is the focus of this RFC;
2. implementation of PyTorch ops and runtime of NPU, which has be supported via a PyTorch extension, i.e. Ascend extension for PyTorch(https://github.com/Ascend/pytorch). PyTorch users can load this extension to enable the full functionality of NPU, similar to what other PyTorch extensions do.

### Alternatives

_No response_

### Additional context

Work with NPU: 
PyTorch users interface the NPU device as a normal device but need to import torch_npu for full functionality.

```
import torch 
import torch_npu # Ascend Extension for PyTorch 

npu = torch.device('npu') 

input = torch.randn([100]).to(npu) 

model.to(npu) 

output = model(input)
```

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @SciPioneer @H-Huang
Repository: pytorch
Issue: SSL certificate error: urlopen error [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1091)>
Labels: triaged

### 🐛 Describe the bug

I'm facing SSL error while downloading the 'resnext101_32x16d_swsl'  model from torch.hub.load('facebookresearch/semi-supervised-ImageNet1K-models', 'resnext101_32x16d_swsl') 

```
error message: URLError: <urlopen error [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1091)>
```

### Versions


[pip3] numpy==1.21.5
[pip3] torch==1.10.0
[pip3] torchaudio==0.10.0+cu111
[pip3] torchsummary==1.5.1
[pip3] torchtext==0.11.0
[pip3] torchvision==0.11.1+cu111
Repository: pytorch
Issue: RuntimeError: bucket_count == per_bucket_sizes.size() INTERNAL ASSERT FAILED
Labels: module: cuda,triaged,module: ddp

### 🐛 Describe the bug

When training with 4GPUs by using DDP, my program have the following errors: 
```
  File "anaconda3/envs/tnt2/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 993, in forward
    if torch.is_grad_enabled() and self.reducer._rebuild_buckets():
RuntimeError: bucket_count == per_bucket_sizes.size() INTERNAL ASSERT FAILED at "../torch/csrc/distributed/c10d/reducer.cpp":963, please report a bug to PyTorch
```
Other information:
1. If I train the model with batch size 1 on each GPU, the model will throw the above error
2. If I train the model with batch size 10 on each GPU, the model will be blocked at `loss.backward()` with 100% CPU utilization.
3. If I do not use DDP, the model can be trained successfully with 1 single GPU. 


### Versions

Collecting environment information...
PyTorch version: 1.12.0.dev20220419+cu113
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux 10 (buster) (x86_64)
GCC version: (Debian 8.3.0-6) 8.3.0
Clang version: 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
CMake version: version 3.13.4
Libc version: glibc-2.28

Python version: 3.8.0 (default, Nov  6 2019, 21:49:08)  [GCC 7.3.0] (64-bit runtime)
Python platform: Linux-5.4.173.1.amd64-smp-x86_64-with-glibc2.10
Is CUDA available: True
CUDA runtime version: 11.2.67
GPU models and configuration: 
GPU 0: Quadro RTX 8000
GPU 1: Quadro RTX 8000
GPU 2: Quadro RTX 8000
GPU 3: Quadro RTX 8000

Nvidia driver version: 470.86
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.19.5
[pip3] torch==1.12.0.dev20220419+cu113
[pip3] torchaudio==0.12.0.dev20220419+cu113
[pip3] torchvision==0.13.0.dev20220419+cu113
[conda] numpy                     1.19.5                   pypi_0    pypi
[conda] torch                     1.12.0.dev20220419+cu113          pypi_0    pypi
[conda] torchaudio                0.12.0.dev20220419+cu113          pypi_0    pypi
[conda] torchvision               0.13.0.dev20220419+cu113          pypi_0    pypi


cc @ngimel
Repository: PowerToys
Issue: [FancyZones] Unsnap window when it's maximized
Labels: Idea-Enhancement,Product-FancyZones

### Microsoft PowerToys version

v0.57.2

### Running as admin

- [X] Yes

### Area(s) with issue?

FancyZones

### Steps to reproduce

1. Open some Application ( _for me this happens at least with Photoshop and Modo_)  
2. Drag application window to some Fancy Zone
3. Maximize application Window ( so it is not "Fancy Zoned" anymore) 
4. Close the App   
5. Reopen the App 

---> App will open in last used Fancy Zone, not Maximized as it was when closed.  

If you close Power Toys before closing the application, then the Window will open in right size, in the size that it was when closed. 

It is not big problem to maximize window after opening, but it gets a bit tedious... specially if you work with software that is prone to crash 

### ✔️ Expected Behavior

Application windows should be opened in the size they were closed. 

### ❌ Actual Behavior

Applications open in last used Fancy Zone, even if it was not active when the application was closed. 

### Other Software

Photoshop (newest) 
Modo from 14 to 16.0
Repository: go
Issue: x/tools: TestCgoNoSyntax doesn't seem to be passing -compiled when NeedTypes is set
Labels: NeedsInvestigation,Tools

Context: https://go-review.googlesource.com/c/tools/+/393017/comments/b58b52f4_30beeb0f

Getting types for cgo requires CompiledGoFiles because we need to run cgo preprocessing on the Go files before running the typechecker on them. We don't request compiled files by default when doing typechecking because for non-cgo files we can check types without .go files, but TestCgoNoSyntax relies on CompiledGoFiles being present on the output of the go command to properly check types. 

It seems like either the test should need to explicitly request compiled files, or specify that it uses cgo (there's currently a non-exported bit for this), or maybe there should be some way for go/packages to upgrade to requesting compiled go files in certain circumstances where cgo is present?

cc: @bcmills
Repository: deno
Issue: fetch redirect issue with non-standard utf8 header locations
Labels: bug,upstream,ext/fetch

`fetch` should be able to handle `utf8` encoded location headers in order to behave like web browsers.
I know HTTP header values are supposed to be encoded in ASCII, but seems major web browsers like chrome can also process utf8 encoded header values. 

Look at this code from got:
https://github.com/sindresorhus/got/blob/53513ce3ca09258b575496a3f9899c7d0f6ab6ea/source/core/index.ts#L772

See also:
https://github.com/curl/curl/issues/473
Repository: go
Issue: os/exec: Cmd fails to enforce that Env entries are of the documented "key=value" form
Labels: NeedsDecision

(Noticed while investigating #49886 in the context of #50599.)

The documentation for the `Env` field of the `exec.Cmd` struct says:
```
$ go1.18 doc exec.Cmd.Env
package exec // import "os/exec"

type Cmd struct {
    // Env specifies the environment of the process. Each entry is of the form
    // "key=value". If Env is nil, the new process uses the current process's
    // environment. If Env contains duplicate environment keys, only the last value
    // in the slice for each duplicate key is used. As a special case on Windows,
    // SYSTEMROOT is always added if missing and not explicitly set to the empty
    // string.
    Env []string

    // ... other fields elided ...
}
```

That is consistent with `os.Environ()`, which is documented as:
```
$ go1.18 doc os.Environ
package os // import "os"

func Environ() []string
    Environ returns a copy of strings representing the environment, in the form
    "key=value".
```

Unfortunately, the implementation of `os/exec.Cmd` violates both of those documented behaviors.

As demonstrated in https://go.dev/play/p/qdlwGaJg1_f:
* Windows-internal keys beginning with `=` are erroneously deduplicated. (The key `=C:` collapses with the key `=D:`, dropping the `=C:` entry entirely.)
* Malformed key-value pairs are neither diagnosed nor dropped. (The string `"garbage"` is passed through to `os.Environ()` without producing an error.)

<details>

```go
package main

import (
	"fmt"
	"log"
	"os"
	"os/exec"
)

func main() {
	if os.Getenv("SUBPROCESS") != "" {
		for _, kv := range os.Environ() {
			fmt.Printf("%q\n", kv)
		}
		os.Exit(0)
	}

	exe, err := os.Executable()
	if err != nil {
		log.Fatal(err)
	}

	cmd := exec.Command(exe)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	cmd.Env = []string{
		"SUBPROCESS=1",
		"FOO=bar",
		"",
		"garbage",
		"garbage=bananas",
		`=C:=C:\golang`,
		`=C:=C:\tmp`,
		`=D:=D:\other`,
		"FOO=baz",
	}
	if err := cmd.Run(); err != nil {
		log.Fatal(err)
	}
}
```

```
$ go1.18 run .
"SUBPROCESS=1"
"FOO=baz"
"garbage"
"garbage=what"
"=D:=D:\\other"
```

</details>
Repository: go
Issue: proposal: text/template: allow callers to handle errors
Labels: Proposal

Currently, if you do:

```htmlbars
{{ $value := .Foo }}
```
And `.Foo` returns an error or panics, the template has no way to recover.

There are several good reasons why one might want to to handle this in the template, but mostly situations where the error situation is temporary (e.g. a remote server is failing) and some default content could be inserted.

The obvious solution would be to allow this:

```htmlbars
{{ $value, $err := .Foo }}
```

Where `$err` would contain any error returned by or from a panic in `.Foo`. Any construct on the form `{{ $value := .Foo }}` would panic as before.

You could argue that `.Foo` could be rewritten to wrap any error, so you would get:

```htmlbars
{{ $value:= .Foo }}
{{ if .Err }}
{{ else }}
   {{ .Value }}
{{ end }}
```

But that means that all existing APIs needs to be duplicated/wrapped – and the above does not resemble idiomatic Go code. It would also not handle runtime errors (e.g. `invalid memory address or nil pointer dereference`).
Repository: yt-dlp
Issue: [iq.com] Downloading a different dub audio tracks?
Labels: site-enhancement

### Checklist

- [X] I'm asking a question and **not** reporting a bug/feature request
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions including closed ones

### Question

Hi, I'm wondering if there currently is a supported way to specify the audio language to download? As you can see here: https://www.iq.com/play/it-s-a-drink-it-s-a-bomb-1985-19rwfk6z60?lang=en_us there is an option for a Cantonese or Mandarin audio track. Using yt-dlp I seem to only be able to download the Mandarin track. 

I'd thought that maybe if I set my language in my cookies differently it would affect the default dub, however that doesn't seem to have any effect. 

### Verbose log

_No response_
Repository: kubernetes
Issue: [FG:InPlacePodVerticalScaling] Tracking TODO items to address pre-beta, at beta, GA, and GA+1
Labels: sig/node,kind/feature,triage/accepted

### What would you like to be added?

This enhancement tracks various TODO items from alpha to GA for the In-Place Pod Vertical Scaling feature.
To find pending TODO items in the k/k repo, do:
```bash
git grep TODO | grep InPlacePodVerticalScaling
```

TODOs not tracked in code:
- [ ] Add and expose a helper function to get a pod's resource requirements and allocations for use by metrics, kubectl describe, etc


### Why is this needed?

These were TODO items found during review of PR https://github.com/kubernetes/kubernetes/pull/102884/ and it was agreed they should not block alpha. Most need to be handled before Beta, and a few need to be addressed at GA/GA+1.

```[tasklist]
### Tasks
- [ ] pkg/apis/core/validation/validation.go:5071 - Drop this var once InPlacePodVerticalScaling goes GA and featuregate is gone.
- [ ] pkg/kubelet/container/helpers.go:128 - Remove this in GA+1 and make HashContainerWithoutResources to become Hash.
- [ ] pkg/kubelet/container/runtime.go:301 - Remove this in GA+1 and make HashWithoutResources to become Hash.
- [ ] pkg/kubelet/kubelet.go:1962 - Investigate doing this in HandlePodUpdates + periodic SyncLoop scan
- [ ] pkg/kubelet/kubelet.go:2588 - Can we recover from checkpoint failure in some way? Investigate
- [ ] pkg/kubelet/kubelet.go:2847 - Can we recover from checkpoint update failure in some way? Investigate
- [ ] pkg/kubelet/kubelet.go:2855 - Can we recover from resize status checkpoint failure in some way? Investigate
- [ ] pkg/kubelet/kubelet_pods.go:2107 - Update this to include extended resources in addition to CPU, memory, ephemeral storage. Add test case for extended resources.
- [ ] pkg/kubelet/kuberuntime/helpers_linux.go:63 - Address issue that sets min req/limit to 2m/10m before beta ( See: https://github.com/kubernetes/kubernetes/pull/102884#discussion_r662552642 )
- [ ] pkg/kubelet/kuberuntime/kuberuntime_container_linux_test.go:867 - Add unit tests for cgroup v1 & v2
- [ ] pkg/kubelet/kuberuntime/kuberuntime_manager.go:662 - Figure out best way to get enforceMemoryQoS value (parameter kubelet should know which containers it is managing #4 below) in platform-agnostic way
- [ ] pkg/scheduler/internal/queue/scheduling_queue.go:1074 - Fix this to determine when a pod is truly resized down (might need oldPod if we cannot determine from Status alone)
- [ ] test/e2e/node/pod_resize.go:85 - Can we optimize this?
- [ ] test/e2e/node/pod_resize.go:334 - Is there a better way to determine this?
- [ ] test/e2e/node/pod_resize.go:500 - Remove this check once base-OS updates to containerd>=1.6.9
- [ ] pkg/kubelet/cm/cgroup_manager_linux.go:645 - Support memory request in getCgroupMemoryConfig
- [ ] pkg/kubelet/cm/cgroup_manager_linux.go:731 - Support memory request in setCgroupMemoryConfig
```
Repository: material-ui
Issue: [Snackbar] Text is flickering after Snackbar opens in Firefox
Labels: bug 🐛,component: snackbar,browser: Firefox

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Current behavior 😯

While using the firefox browser, when the snackbar opens, the text starts a few pixels down, then jumps to the correct position. When closing the snackbar, the text lowers again, then the snackbar closes.

### Expected behavior 🤔

The text should be centered vertically in the snackbar, and not move. 

### Steps to reproduce 🕹

Steps:

1. Use firefox browser
2. Trigger snackbar open
3. Observe the text starting lower, then moving up
4. Close the snackbar
5. Observe the text moving down, the snackbar close


### Context 🔦

Trying to build a visually pleasing site, with minimal visual bugs.
Repository: godot
Issue: Crash renaming file from outside the project when referencing files located within symlinked folders
Labels: bug,topic:editor,needs testing,crash

### Godot version

3.4.4.stable

### System information

Windows 10, macOS

### Issue description

The editor crashes when renaming files that are not directly under the project root.
For example, my shared code is linked to the project via symlinks and therefore does not live inside the godot `res://` path.
Renaming a script will crash the editor each time.

The crash only seems to happen when the project explorer is in `Split Mode` with the folder and files separated (see screenshot attached)

![screenshot](https://user-images.githubusercontent.com/11413364/164085871-63459245-010f-4ab3-a78a-b48ffd04342a.PNG)


### Steps to reproduce

To reproduce the crash:
1. Open the project
1. Make sure the solution explorer is in Split Mode (see screenshot above).
1. Search for a file (ex: `Scrip`, see screenshot above)
1. Rename that file
1. Editor will crash



### Minimal reproduction project

The zip contains:
1) A folder with external source files
1) A Godot project with a symlink to the external source folder

[rename_bug.zip](https://github.com/godotengine/godot/files/8516175/rename_bug.zip)

*Bugsquad edit (keywords for easier searching): filesystem dock, file system*