sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: ESNext emits optional class members
Labels: Suggestion,In Discussion

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->
optional class members

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about optional class members

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?useDefineForClassFields=true&target=99#code/MYGwhgzhAEDC0G8BQ1oA8D8AuaA7ArgLYBGApgE4DcK0AntALzQDM1AvkA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
// Consider this class
class C { 
  x?: number; 
}
```

### 🙁 Actual behavior

```ts
// This is the emitted JS if you target ESNext and have --useDefineForClassFields
class C {
  x;
}
```

`x` is emitted as a class member, even though it was optional. 
This feels wrong, but to make a stronger point consider `--exactOptionalPropertyTypes`.
With this compiler option, we should have the typing invariant `!("x" in c) || typeof c.x == "number"`; but with this emit, a new instance has the opposite `"x" in c && typeof c.x == "undefined"`.

### 🙂 Expected behavior

Optional members should probably not be emitted:
```ts
class C { }
```
I am not sure / have not thought about what the implications with respect to `useDefineForClassFields` semantics are.
Repository: godot
Issue: BakedLightmap always bakes direct light shadows (for fully baked lights), even for lights that have shadows disabled
Labels: bug,discussion,topic:rendering,topic:3d

`master` version of this issue: https://github.com/godotengine/godot/issues/56611

### Godot version

3.4.2.stable, 3.x (0b54b3d05)

### System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

### Issue description

BakedLightmap (CPU lightmapper) always bakes direct light shadows, even for lights that have shadows disabled. I don't know whether this is a bug or a design decision, but this should either be fixed or documented (both in the class reference and [Baked lightmaps](https://docs.godotengine.org/en/stable/tutorials/3d/baked_lightmaps.html) page).

*Orange lights have shadows disabled, blue lights have shadows enabled. Lights on the left are OmniLights, lights on the right are SpotLights.*

### Fully baked lighting

![2022-01-08_02 12 36](https://user-images.githubusercontent.com/180032/148625969-d196b38c-b345-4b7b-9ca7-4685eddc8021.png)

### Real-time lighting

![2022-01-08_02 12 50](https://user-images.githubusercontent.com/180032/148625970-c6b40dd6-b58e-4d8c-a453-775e482c36d8.png)



### Steps to reproduce

- Import a glTF scene. Set the light bake mode to **Gen Lightmaps** in the Import dock and click **Reimport**.
- Add a BakedLightmap node and configure its extents to fit the imported scene.
- Add an OmniLight node with shadows disabled. Add a second OmniLight node with shadows enabled. Move them so you can clearly see the difference between shadows being enabled and not. Set both lights' bake mode to **All (Direct + Indirect)**.
- Repeat the above steps with two SpotLight nodes.
- Bake lightmaps. Look at the result; both lights will cast shadows.

### Minimal reproduction project

[test_baked_lightmap_no_shadows.zip](https://github.com/godotengine/godot/files/7832132/test_baked_lightmap_no_shadows.zip)
Repository: godot
Issue: Vulkan: LightmapGI always bakes direct light shadows (for fully baked lights), even for lights that have shadows disabled
Labels: bug,discussion,topic:rendering,topic:3d

- *Related to https://github.com/godotengine/godot/issues/98684.*

`3.x` version of this issue: https://github.com/godotengine/godot/issues/56610

### Godot version

4.0.dev (8f6cba3a4)

### System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

### Issue description

LightmapGI (GPU lightmapper) always bakes direct light shadows, even for lights that have shadows disabled. I don't know whether this is a bug or a design decision, but this should either be fixed or documented (both in the class reference and [Using Lightmap global illumination](https://docs.godotengine.org/en/latest/tutorials/3d/global_illumination/using_lightmap_gi.html) page).

*Orange lights have shadows disabled, blue lights have shadows enabled. Lights on the left are OmniLights, lights on the right are SpotLights.*

### Fully baked lighting

![2022-01-08_02 05 17](https://user-images.githubusercontent.com/180032/148625939-9aadf2d1-dc05-443f-93fc-c070d4a8c7e8.png)

### Real-time lighting

![2022-01-08_02 05 25](https://user-images.githubusercontent.com/180032/148625945-0d819260-1d81-478c-83c3-a96ab5f7f252.png)



### Steps to reproduce

- Import a glTF scene. Set the light bake mode to **Static Lightmaps** in the Import dock and click **Reimport**.
- Add a LightmapGI node.
- Add an OmniLight3D node with shadows disabled. Add a second OmniLight3D node with shadows enabled. Move them so you can clearly see the difference between shadows being enabled and not. Set both lights' global illumination mode to **Static**
- Repeat the above steps with two SpotLight3D nodes.
- Bake lightmaps. Look at the result; both lights will cast shadows.

### Minimal reproduction project

[test_lightmapgi_no_shadows.zip](https://github.com/godotengine/godot/files/7832134/test_lightmapgi_no_shadows.zip)
Repository: godot
Issue: Exported variables do not call _set method
Labels: bug,topic:core,topic:gdscript,confirmed

### Godot version

3.4.stable

### System information

Windows 10

### Issue description

When I export a script property with `export` keyword or the `_get_property_list` method, this does not call `_set` method. In the case of using `_get_property_list`, if the property name does not match a script property, it calls the `_set` method, but it cannot set this property. 


### Steps to reproduce

I let a minimal project where there is a resource file with Number property.

1. Open test.tres file in the inspector.
2. For example, if Local To Scene property is changed, it is printed `changed`.
3. If Number property is changed, it does nothing.

### Minimal reproduction project

[Test.zip](https://github.com/godotengine/godot/files/7832509/Test.zip)
Repository: yt-dlp
Issue: Can I change the sort order within a field only ?
Labels: 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

Is there a way to change ONLY the sort order _**within**_ a field (rather than the sort order **_of_** the fields) ?

I am asking, because I would like to (for example) set AV1 as the best video codec, but without touching the rest of the sort order.

Yet, from my understanding, if I set `-S vcodec:av1`, I don't only reorder the sort order of the video codes themselves, but reorder the sort order of ALL fields by putting the video codec at the #1 position (which I want to avoid).

Another example would be a user who wants to tell yt-dlp to prefer webm over mp4 but _without_ giving the container format a higher priority in the sort order.
Repository: TypeScript
Issue: Array concat has wrong types
Labels: Bug,Help Wanted,Domain: lib.d.ts

# Bug Report

A not-uncommon JS idiom is `[].concat(x || [], y || [], z || [])` as a faster, simpler, more backwards-compatible `[x, y, z].flatMap(x => x || [])`. However, when I try, I get type errors.

### 🔎 Search Terms

array concat
concat overload

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about array concat

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?#code/MYewdgzgLgBAhjAvDA2gXQHSjMOUAUAUDCTFAE4CuApjAPwwDkcjMAXKmgDTGkBmcADYRaDRgCNWHdDwCUAbkKFs0GAA8knLOFwFeJAcNFNJ7Tj1Jkqx5lPOEFQA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
const a = [].concat(
    true ? 'a' : [],
    false ? 'b' : [],
);

const x = [].concat(
    false ? 'b' : [],
    true ? 'a' : [],
);
```

### 🙁 Actual behavior

```
No overload matches this call.
  Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type 'never[] | "a"' is not assignable to parameter of type 'ConcatArray<never>'.
      Type 'string' is not assignable to type 'ConcatArray<never>'.
  Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type 'never[] | "a"' is not assignable to parameter of type 'ConcatArray<never>'.
      Type 'string' is not assignable to type 'ConcatArray<never>'.(2769)
```

### 🙂 Expected behavior

No type errors (except perhaps that the variable may be `any` until i provide an explicit type for the resulting array), because this is valid JavaScript since at least ES3.
Repository: yt-dlp
Issue: handle subs and auto-subs separately
Labels: enhancement

# problem

Currently `--sub-langs all` users cannot download youtube auto-subs (in the same run or they end up with 100+ autosubs plus several hundred combinations of autosub-translations like _"yo-ro | Yoruba from Romanian"_ etc.).

# proposal

It would be helpful to control subs and auto-subs independently: 

subs|autosubs|thumbnails (for reference)
:---|:---|:---
--write-subs|--write-auto-subs|--write-thumbnail
--no-write-subs|--no-write-auto-subs|--no-write-thumbnail
--embed-subs|[--embed-auto-subs (#826)](https://github.com/yt-dlp/yt-dlp/issues/826)|--embed-thumbnail
--no-embed-subs|--no-embed-auto-subs|--no-embed-thumbnail
--list-subs|--list-auto-subs|--list-thumbnails
--sub-langs|[--auto-sub-langs (#2205)](https://github.com/yt-dlp/yt-dlp/issues/2205)
[--sub-format (#2276)](https://github.com/yt-dlp/yt-dlp/issues/2276)|--auto-sub-format|[--thumbnail-format (#237)](https://github.com/yt-dlp/yt-dlp/issues/237)
--convert-subs|--convert-auto-subs|--convert-thumbnails
-o "subtitle:"|[-o "auto-sub:" (#6833)](https://github.com/yt-dlp/yt-dlp/issues/6833) |-o "thumbnail:"

This is highly intuitive and makes the parameters of the different multimedia files consistent with each other.

It also solves the problem below elegantly: `--sub-langs all --auto-sub-langs en`

# use case

To download all subs + English auto-subs without running yt-dlp twice.

What parameters do I have to use to download ALL subtitles but only English automatic subtitles (instead of the myriad of automatic subtitles in all existing languages on youtube) ?

`--sub-langs` seems to control both `--write-subs` and `--write-auto-subs`
whereas I would need something like `--sub-langs all --auto-sub-langs en.*` which doesn't exist, right ?


# related

* #6264
* #826
* #2205
* #2276
* #3875
* #4178
* #6443
* #6833
Repository: yt-dlp
Issue: ERROR: 'int' object has no attribute 'get' when downloading free videos from tvp
Labels: geo-blocked,site-bug

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2021.12.27**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [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 read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

Poland

### Description

When downloading video which does not require logging in, error appears.

E:\YT>yt-dlp.exe "https://vod.tvp.pl/video/kolo-fortuny,odc-1182,57420860"
[tvp] 57420860: Downloading webpage
[tvp:embed] 57420860: Downloading webpage
ERROR: 'int' object has no attribute 'get'

### Verbose log

```shell
E:\YT>yt-dlp.exe -Uv "https://vod.tvp.pl/video/kolo-fortuny,odc-1182,57420860"
[debug] Command-line config: ['-Uv', 'https://vod.tvp.pl/video/kolo-fortuny,odc-1182,57420860']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2021.12.27 [6223f67] (win_exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.17763-SP0
[debug] exe versions: ffmpeg 4.4-full_build-www.gyan.dev (setts), ffprobe 4.4-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2021.12.27, Current version: 2021.12.27
yt-dlp is up to date (2021.12.27)
[debug] [tvp] Extracting URL: https://vod.tvp.pl/video/kolo-fortuny,odc-1182,57420860
[tvp] 57420860: Downloading webpage
[debug] [tvp:embed] Extracting URL: tvp:57420860
[tvp:embed] 57420860: Downloading webpage
ERROR: 'int' object has no attribute 'get'
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1353, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1423, in __extract_info
  File "yt_dlp\extractor\common.py", line 599, in extract
  File "yt_dlp\extractor\tvp.py", line 402, in _real_extract
AttributeError: 'int' object has no attribute 'get'
```
Repository: go
Issue: net/http: unexpectedly slow initialization
Labels: Performance,help wanted,NeedsInvestigation

Here is trivial program that makes GET request:

```go
import (
        "fmt"
        "io/ioutil"
        "log"
        "net/http"
)

func main() {
        resp, _ := http.Get("https://ifconfig.me")
        defer resp.Body.Close()
        body, err := ioutil.ReadAll(resp.Body)
        if err != nil {
                log.Fatal(err)
        }

        fmt.Print(string(body))
}
```

When compiled and run on Darwin system (using [binary distribution](https://go.dev/dl/go1.17.6.darwin-amd64.pkg)), it have more or less expected performance -- twice as slow compared to curl.

```
$ /usr/bin/time ./hello
173.66.169.194        0.25 real         0.05 user         0.01 sys
$ /usr/bin/time curl https://ifconfig.me
173.66.169.194        0.12 real         0.01 user         0.01 sys
```

But when I compile and run it on my Linux box (`Linux void-live 5.13.13_1 #1 SMP Fri Aug 27 13:28:13 UTC 2021 x86_64 GNU/Linux`),
also using [binary distribution](https://go.dev/dl/go1.17.6.linux-amd64.tar.gz), I get following results:

```
$ time ./hello
173.66.169.194
real      0m 1.03s
user    0m 1.30s
sys     0m 0.14s
$ time curl https://ifconfig.me
173.66.169.194
real      0m 0.16s
user    0m 0.06s
sys     0m 0.00s
```

Difference is much bigger. This time seems to come from some one-time initialization -- second request made in same program is fast. Here is annotated [strace](https://gist.github.com/9d2e4882c18de27da1199005d4bd6477). It looks like it is doing many "rt_sigreturn" calls, but this is just my guess.

I have access to another linux box, with unusual kernel (lacking madvise(2), for example), which have more of the same problem: first request takes around 4 seconds, any subsequent work as expected.
Repository: pytorch
Issue: `torch.Tensor.where` cannot work when `y` is float
Labels: triaged,module: type promotion

### 🐛 Describe the bug

Based on the [documentation](https://pytorch.org/docs/stable/generated/torch.Tensor.where.html?highlight=where#torch.Tensor.where) of `torch.Tensor.where`, `self.where(condition, y)` is equivalent to `torch.where(condition, self, y)`. However, `torch.where` will succeed when `y` is a float but `Tensor.where` will raise an error.

```python
import torch
condition= torch.randint(0,2,[2, 2], dtype=torch.bool)
x= torch.rand([2, 2], dtype=torch.float64)
y = 0.0
print( torch.where(condition, x, y) )
# tensor([[0.0000, 0.6290],
#        [0.0000, 0.0000]], dtype=torch.float64)
print( x.where(condition, y) )
# TypeError: where(): argument 'other' (position 2) must be Tensor, not float
```

### Versions

pytorch: 1.10.1

cc @nairbv @mruberry
Repository: youtube-dl
Issue: request for yhdmp.cc
Labels: site-support-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.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support 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 new site support request
- [x] I've verified that I'm running youtube-dl version **2021.12.17**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [x] I've checked that none of provided URLs violate any copyrights
- [x] I've searched the bugtracker for similar site support requests including closed ones


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

- Single video: https://m.yhdmp.cc/vp/22100-1-0.html
- Playlist: N/A


## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

free (anonymous) access to website
Repository: pytorch
Issue: `torch.scatter` will return random value when `input` is empty tensor
Labels: module: error checking,triaged,module: scatter & gather ops

### 🐛 Describe the bug

`torch.scatter` will return random value when `input` is empty tensor

```python
import torch
input = torch.rand([])
dim = 0
index = torch.tensor([]) # or torch.tensor([0])
src = torch.rand([])
torch.scatter(input, dim, index, src)
# random value like tensor(6.7333e+22)
```

### Versions

pytorch: 1.10.1
Repository: material-ui
Issue: Style override improvements (overriding child selectors in default styles)
Labels: discussion,customization: theme

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Description 💡

I have successfully and rather easily migrated my application from MUI 4 to 5. I'm consistently annoyed with the tediousness in overriding the default styles, though. It can be explained using the following example:

If I want to override the styles of the `ListItemIcon` in a `MenuItem`, I have to override some of the attributes like so:

```typescript
MuiMenuItem: {
    styleOverrides: {
        root: {
            ["& ." + listItemIconClasses.root]: {
                minWidth: 0,
            },
        },
    },
},
```

The following does not work, since the default styles for `MenuItem` has a child selector styles definition for `ListItemIcon` (see [MenuItem/MenuItem.js](https://github.com/mui-org/material-ui/blob/master/packages/mui-material/src/MenuItem/MenuItem.js)).

```typescript
MuiListItemIcon: {
        styleOverrides: { root: { minWidth: 0 } },
    },
},
```

Of course, the current implementation is logical, and it's still possible to override anything you wish, such as the way shown above. Though, I believe a more user-friendly implementation would be putting all style overrides above the default styles. This would obviously be complicated to implement, since the reason for the default styles definition overriding the style override is because of the CSS-specificity. That is, a `.MuiButtonBase-root-MuiMenuItem-root .ListItemIcon-root` definition has more specificity than a `.ListItemIcon-root` definition.

As for a solution, the child selector cannot be used in the default styles. Instead, all styles must be passed down in the tree as classes. In other words, the `MenuItem` component must for instance pass a `.MenuItem-listItemIcon` class to the ListItemIcon component. This would obviously require an enormous amount of refactoring, so I suspect this solution would be too hard to implement (and maybe lead to a major performance loss).

A different solution would be to omit properties in the default styles that are overridden. That would require some refactoring, of course, but would certainly be much easier to implement. The `overridesResolver` that is currently used for specifying overrides has to be changed to somehow omit child selector properties that are overridden in style overrides of the child component. That is, the style overrides shouldn't be assigned all child selector styles for the same component, but the overridden style keys should be omitted from all of the child selector styles. I'm sure there are many things that have to be taken into account here, but I believe something related to this would be a rather good solution.
Repository: opencv
Issue: "ImportError: dlopen: cannot load any more object with static TLS" solution
Labels: category: 3rdparty

-OpenCV => 4.5.4
- Operating System / Platform => CentOS 7.4
- - Compiler =>Anaconda3+Pytorch1.10.1+cu113

If you use pytorch and import the opencv package: "ImportError: dlopen: cannot load any more object with static TLS"
You should check whether the gcc and glibc packages of the current Linux/Unix system are the latest versions

Problem solved after upgrading gcc from 4.x to 9.3.0 and glibc from 2.17 to 2.31

However, I didn't find the requirement statement about gcc and glibc version in __init.py__ of cv2 (or maybe I just didn't find it), but I still hope to add a statement for the version requirement of gcc or glibc in the code file