sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: in operator typeguard precision loss
Labels: Suggestion,Help Wanted,Experience Enhancement

# Bug Report

### 🔎 Search Terms

### 🕗 Version & Regression Information

v4.9.0 v4.9.1 5.0.0-dev.20221101

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.9.0-dev.20221025#code/GYVwdgxgLglg9mABAQwCaoE4FMDOODyGAKgBYZwDuAFAG7IA2IWAXIuANZiVgCUiA3gChEiGMERUoATwAOWOOLqMsiAIQBedYgBEcAEYArLNG2IAPmcRKmiTYjAh69PlDKV7WCoiKysAUQxyDCoeAG5BYVFxKlUqbRwobCwoUxgkayw+C0RpOQUrBiYAOgSkqDU7eMS0gHNtHkiRV3IvME9vXwCgkPDIsQlY7RI4EBwsADkQAFs9LAxU9MLM80tc+UUlouHRienZjAqtbQcZufrGnLdW9p85LrhgsIiRbCgQDEXlcIBfCNBIWAIFDobB4QikFpEADitCWrA4XAovFYGVEOEQAEEQbh0UIRGhMDjwVdYconi9ku8kIkmD8-uBoPAkHIMDgEMSWqSmPCwJxuHw8VEJGt8qiNEd9EYTCsCspbFoHE4XFcPF5bv5Ag8es8hTE4sAYKyoONkFMsAtZUwsqtfKLNgajSazYcdKVaucRE0VW01Z1NY9eiJ+nrtPRkAknebRJ8rTKRRtlEUwxHTSpxa7qmA6g1PZcWqqOnd-dq+tFtFMYOh6BNUxbUQAyes5W0J4oVqs153pqoYd05z3Ndw+wsa7pPUsDOIE0FjHB1pbWtQYwLIKRFGA4ZcYVdcrBFac43A8fte-PD9X3AM64OqDL77F4XBFLA0OZSKgHsHEK7Q48XQfXL6RZjoGiCvFSlpYHSghrJiD7oloABKlIfOqAA88bAoSX4QpQAB8vSwQACnMbJIEhKFgOhmEsmRHL4aEQA)

### 💻 Code

```ts
function addressOrThrow(value: unknown) {
  if (typeof value !== "object" || value == null) throw new TypeError();

  if (!("street" in value) || typeof value.street !== "string")
    throw new TypeError();

  if (!("houseNumber" in value) || typeof value.houseNumber !== "number")
    throw new TypeError();

  return value;
}

function addressOrThrowTG(value: unknown): value is Address {
  addressOrThrow(value);
  return true;
}

function personOrThrow(value: unknown) {
  if (typeof value !== "object" || value == null) throw new TypeError();

  if (!("firstName" in value) || typeof value.firstName !== "string")
    throw new TypeError();

  if (!("lastName" in value) || typeof value.lastName !== "string")
    throw new TypeError();

  if ("middleName" in value && typeof value.middleName !== "string")
    throw new TypeError();

  if (!("addresses" in value) || !Array.isArray(value.addresses))
    throw new TypeError();

  if (!value.addresses.every(addressOrThrowTG))
    throw new TypeError();

  return value;
}

type Address = ReturnType<typeof addressOrThrow>;

type Person = ReturnType<typeof personOrThrow>;
```

### 🙁 Actual behavior

`type Address = object & Record<"street", unknown> & Record<"houseNumber", unknown>`
`type Person = object & Record<"firstName", unknown> & Record<"lastName", unknown> & Record<"addresses", unknown>`

### 🙂 Expected behavior

`type Address = object & Record<"street", string> & Record<"houseNumber", number>`
`type Person = object & Record<"firstName", string> & Partial<Record<"middleName", string>> & Record<"lastName", string> & Record<"addresses", Address[]>`
Repository: vscode
Issue: GitHub authentication fails when running Code as admin
Labels: bug,windows,workbench-os-integration

Type: <b>Bug</b>

When I'm running Code as an Administrator and attempt to sign-in to GitHub, the authentication flow fails with an unhelpful message on how to resolve.

My expectation would be that if running as an Administrator that the authentication flow would fail, it would tell me pre-attempt so that I wouldn't be led along a path that would knowingly fail in the last step.

Extension version: 0.0.14
VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:15:18.074Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: No

https://user-images.githubusercontent.com/4821/198675251-1de95d12-fa13-41a1-8d67-d495bafd2f71.mp4


<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 9 3900X 12-Core Processor             (24 x 3793)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off|
|Load (avg)|undefined|
|Memory (System)|127.92GB (74.84GB free)|
|Process Argv|--crash-reporter-id d2c91f49-7cf5-4a88-bfb8-425825bf92ad|
|Screen Reader|no|
|VM|0%|
</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
vscccc:30566498
pyindex848:30577860
nodejswelcome1:30587005
fc301958:30595537
2e4cg342:30596373

```

</details>

<!-- generated by issue reporter -->
Repository: vscode
Issue: Solve merge conflict in git submodule update using new 3 way merge editor
Labels: bug,merge-editor

Type: <b>Bug</b>

On a repo that has at least 1 git submodule:
- merge a branch that will result in merge conflict on the used commit for a submodule
- in the Source Control tab > Merge Changes > click on the submodule with conflicts

=> the (by default new) 3 way merge editor appears but there are no buttons to accept the current or incoming changes. As a result you cannot resolve this merge conflict (in vscode). 

<img width="1353" alt="image" src="https://user-images.githubusercontent.com/42942096/198682316-980a7ea6-314e-46f2-bf10-0a1c60263cad.png">

VS Code version: Code 1.72.2 (Universal) (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:16:30.254Z)
OS version: Darwin arm64 21.6.0
Modes:
Sandboxed: No

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Apple M1 Pro (10 x 24)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off|
|Load (avg)|4, 5, 6|
|Memory (System)|32.00GB (2.59GB free)|
|Process Argv|--crash-reporter-id 4041a655-94fa-47b9-ba4e-4c24f8bcfdcb|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (21)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-bazel|Baz|0.6.0
markdown-preview-github-styles|bie|1.0.1
vscode-eslint|dba|2.2.6
gitlens|eam|13.0.3
prettier-vscode|esb|9.9.0
better-cpp-syntax|jef|1.16.3
svg|joc|1.4.22
nearley|kar|2.0.0
vscode-docker|ms-|1.22.2
python|ms-|2022.16.1
vscode-pylance|ms-|2022.10.40
remote-containers|ms-|0.255.4
remote-ssh|ms-|0.90.1
remote-ssh-edit|ms-|0.84.0
cpptools|ms-|1.12.4
cpptools-extension-pack|ms-|1.3.0
vsliveshare|ms-|1.0.5750
vscode-yaml|red|1.10.1
clang-format|xav|1.9.0
vscode-open-in-github|ziy|1.3.6
vscode-proto3|zxh|0.5.5

(1 theme extensions excluded)

</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes516:30244333
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
pyindex848:30577860
nodejswelcome1:30587005
fc301958:30595537
2e4cg342:30596373

```

</details>

<!-- generated by issue reporter -->
Repository: stable-diffusion-webui
Issue: [Bug]: ESRGAN output looks pixelated
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

When upscaling with ESRGAN, the images looks more pixalated than they should. I have another installation of the plain RealESRGAN project and it provides smooth outlines for anime-style images, where the ESRGAN integrated in the webui generates noisy lines.

### Steps to reproduce the problem

1. Create a image with clear outlines
2. Go to the extras tab and upscale it
3. ESRGAN (and some others, but I do not know reference results for them) have outputs that look pixelated at edges.

### What should have happened?

The results should be comparable to the upstream project, I think.

### Commit where the problem happens

737eb28

### What platforms do you use to access UI ?

Linux

### What browsers do you use to access the UI ?

Mozilla Firefox

### Command Line Arguments

_No response_

### Additional information, context and logs

I tried BSRGAN in the past and got much better results for anime-style anyway, but either it got removed or is not shown anymore for some other reason. I use https://github.com/xinntao/Real-ESRGAN for comparision to see that it produces smoother outlines, when run without any parameters.
Repository: vscode
Issue: Starving extension host can block file navigation
Labels: feature-request,search,papercut :drop_of_blood:

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 
- OS Version: 

Steps to Reproduce:

1. Open VS Code repository
2. While TS server is still initializing, try to navigate files through quick pick 
3. The file search will not work until TS server finishes initialization 

It feels wrong that any extension can block the file navigation. Maybe we should run the search extension in its one extension host (through extension affinity).
Repository: flutter
Issue: gen_l10n code for Number, Data and Currency should support overrides
Labels: c: new feature,framework,a: internationalization,c: proposal,P3,team-framework,triaged-framework

## Use case

Building on the excellent work in #47008

Hardcoding a formatter to a locale is too restrictive for apps that deal with single locales, but multiple currency values. Just because my locale is "en_US", doesn't mean that I want my currencies formatted to en_US. Perhaps my invoice contains amounts in Canadian dollars or Euros in addition to USD.

## Proposal

```json
{
  "@@locale": "en",
  "autopayAmount": "Rent amount: {amount}",
  "@autopayAmount": {
    "placeholders": {
      "amount": {
        "type": "double",
        "format": "currency",
        "example": "$1,250.00",
        "description": "The periodic rent amount",
        "optionalParameters": {
          "decimalDigits": 2,
          "name": "USD",
          "symbol": "$"
        }
      }
    }
  }
```

This currently generates code like this

```dart
  String autopayAmount(double amount) {
    final intl.NumberFormat amountNumberFormat = intl.NumberFormat.currency(
      locale: localeName,
      decimalDigits: 2,
      name: 'USD',
      symbol: '\$'
    );
    final String amountString = amountNumberFormat.format(amount);

    return '$amountString';
  }
```

### Proposal 
Keep the same pattern as today, but generate a function with placeholder overrides.

For example, Currency support would generate like so

ARB Context
```json
{
  "@@locale": "en",
  "autopayAmount": "Rent amount: {amount}",
  "@autopayAmount": {
    "placeholders": {
      "amount": {
        "type": "double",
        "format": "currency",
        "example": "$1,000.00",
        "description": "The periodic rent amount",
        "optionalParameters": {
          "name": "USD",
        }
      }
    }
  },
```
Would generate...

```dart
  String autopayPaymentAmountRentAmount(
    double amount, {
    String? locale,
    int? decimalDigits,
    String? name,
    String? symbol,
    String? customPattern,
  }) {
    final intl.NumberFormat amountNumberFormat = intl.NumberFormat.currency(
      locale: locale ?? localeName,
      decimalDigits: decimalDigits,
      name: name ?? 'USD',
      symbol: symbol,
      customPattern: customPattern,
    );
    final String amountString = amountNumberFormat.format(amount);

    return 'Rent amount: $amountString';
  }
```

This will allow the caller to override placeholder values using properties from their currency object.

```dart
var currency = Currency(name: 'BHD', value: 36);
MyLocalizations.of(context).autopayAmount(currency.value, name: currency.name),
```

Results in `BHD36.000`
Repository: PowerToys
Issue: FancyZones: Override/substitute Windows 'drag to the edge' function
Labels: Idea-Enhancement,Product-FancyZones,Needs-Triage

### Description of the new feature / enhancement

On Windows, if you have the native snap functions enabled, when you move a window to the left, right or top, it snaps to the left, right or fullscreen respectively. In fact, nowadays every corner of the screen is another available snap zone.

I would like to be able to map this gestures to a zone or a group of zones inside a custom layout of FancyZones. 

The setting could be attached to the layout configuration so in every screen it would work accordingly to the layout being used on that screen.

Each available snap zone could have a configuration button that lets you select a zone or a group of zones from your current layout.

Then, when you move a window to the trigger zone, it would be resized and placed on the corresponding place in the grid, same as if you move the Window manually to that section and select the group of zones holding Ctrl.

This could work overriding the main Windows functions for snapping windows (if the SO allows it) or as a complete replacement, requiring the user to disable the original Windows function.

### Scenario when this would be used?

Everywhere, would be like a main function of the software, complementing the current layout options.

### Supporting information

N/A
Repository: angular
Issue: Typed ValidatorFn and AsyncValidatorFn for typed forms
Labels: area: forms,P3

### Which @angular/* package(s) are relevant/related to the feature request?

forms

### Description

`ValidatorFn` and ` AsyncValidatorFn` accept a parameter of type `AbstractControl`.
If an app is generated with `--strict` flag or `"strict": true` is manually added to tsconfig compilerOptions, following code reports an error:

```ts
// TS2322: Type '(control: FormControl<string>) => ValidationErrors | null' is not assignable to type 'ValidatorFn'.
//   Types of parameters 'control' and 'control' are incompatible.
//     Type 'AbstractControl<any, any>' is missing the following properties from type 'FormControl<string>': defaultValue, registerOnChange, registerOnDisabledChange
const userNameValidator: ValidatorFn = (
    control: FormControl<string>
): ValidationErrors | null => null;

const ctrl: FormControl<string> = new FormControl<string>('', {
    nonNullable: true,
    validators: [userNameValidator],
});
```

This would be especially useful when adding a validator to the whole form:

```ts
interface User {
    name: string;
    age: number;
}

type UserFormType = {
    [K in keyof User]: FormControl<User[K]>;
};

const formValidator: ValidatorFn = (
    form: FormGroup<UserFormType>
): ValidationErrors | null => null;

const userNameValidator: ValidatorFn = (
    control: FormControl<string>
): ValidationErrors | null => null;

const ageValidator: ValidatorFn = (form: FormControl<number>): ValidationErrors | null =>
    null;

const form: FormGroup<UserFormType> = new FormGroup<UserFormType>(
    {
        name: new FormControl<string>('', {
            nonNullable: true,
            validators: [userNameValidator],
        }),
        age: new FormControl<number>(0, {
            nonNullable: true,
            validators: [ageValidator],
        }),
    },
    {
        validators: [formValidator],
    }
);
```

### Proposed solution

`ValidatorFn` and `AsyncValidatorFn` should be typed to accept the type of the control they'll get, e.g.

```ts
interface ValidatorFn<T extends AbstractControl = AbstractControl> {
  (control: T): ValidationErrors | null;
}

interface AsyncValidatorFn<T extends AbstractControl = AbstractControl> {
  (control: T): Observable<ValidationErrors | null> | Promise<ValidationErrors | null>;
}
```

### Alternatives considered

Casting custom validator functions to `ValidatorFn`:
```ts
const formValidator: ValidatorFn = ((
    form: FormGroup<UserFormType>
): ValidationErrors | null => null) as ValidatorFn;
```

Accepting `AbstractControl` and casting it internally:
```ts
const formValidator2: ValidatorFn = (
    _form: AbstractControl
): ValidationErrors | null => {
    const form: FormGroup<UserFormType> = _form as FormGroup<UserFormType>;
    // ...
    return null!
};
```
Repository: pytorch
Issue: multi-node distributed training rank0 hang at dataloader after a few epochs
Labels: oncall: distributed,module: dataloader

### 🐛 Describe the bug

I am using pytorch to do multi-GPU distributed training. When I use 1-node 8-GPUs, the training works well. However, when I used 4-nodes 32-GPUs, after N epochs (N can be 1 to 3), the training will freeze. From the debugger, it shows that rank0 is stuck at dataloader place with the following stack. And all other 31 ranks are waiting for rank0.  For this hang case, dataloader uses num_workers=8. When I changed num_workers=4, the job can run longer before hang. When I changed num_workers=0, the job won't hang.

This is 100% reproducible. I ran the same tests about 20 times.

Each time it will stuck at the same code place: rank0 will hang at dataloader, all other ranks will wait because of all_reduce(). When this hangs, rank0 already finished several steps (e.g. X is 5).
It always stuck at rank0.

The stack for rank0:
```
Thread 0x7FA6E7C01740 (idle): "MainThread"
    wait (threading.py:302)
    get (queue.py:170)
    __next__ (fairseq/data/iterators.py:648)
    __iter__ (fairseq/data/iterators.py:59)
    _chunk_iterator (fairseq/data/iterators.py:528)
    __iter__ (fairseq/data/iterators.py:59)
    __iter__ (fairseq/logging/progress_bar.py:256)
    train (fairseq_cli/train.py:274)
    inner (contextlib.py:75)
    main (fairseq_cli/train.py:165)
    distributed_main (fairseq/distributed/utils.py:326)
    call_main (fairseq/distributed/utils.py:352)
    cli_main (fairseq_cli/train.py:499)
    <module> (train.py:14)
```
The stack for other ranks:
```
Thread 0x7F6F32481740 (active): "MainThread"
    _all_reduce_dict (fairseq/distributed/utils.py:661)
    all_reduce_dict (fairseq/distributed/utils.py:667)
    _fast_stat_sync_sum (fairseq/trainer.py:1195)
    _aggregate_logging_outputs (fairseq/trainer.py:1135)
    train_step (fairseq/trainer.py:708)
    inner (contextlib.py:75)
    train (fairseq_cli/train.py:278)
    inner (contextlib.py:75)
    main (fairseq_cli/train.py:165)
    distributed_main (fairseq/distributed/utils.py:326)
    call_main (fairseq/distributed/utils.py:352)
    cli_main (fairseq_cli/train.py:499)
    <module> (train.py:14)
```

### Versions

pytorch 1.11
OS: Linux Ubuntu 20.4
Python version: 3.8
CUDA: 11.5
GPU: A100 80GB
fairseq: 1.0.0a0


cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @SsnL @VitalyFedyunin @ejguan @NivekT
Repository: flutter
Issue: [image_picker] Provide parameter to "name" the returned photo or video.
Labels: c: new feature,p: image_picker,package,c: proposal,team-ecosystem,P3,triaged-ecosystem



## Use case

I currently don't have a straightforward and simple way to name the photos and videos returned from:

`final video = await picker.pickVideo(source: ImageSource.camera);`
or
`final photo = await picker.pickImage(source: ImageSource.camera);`

Names currently look like: 6e196cf9-7606-4178-acc6-5dd62092c7d8

## Proposal

XFile has an optional `String? name` parameter, which appears to be unused by ImagePicker.

Recommendation example:

```
Future<XFile?> pickVideo({
  required ImageSource source,
  CameraDevice preferredCameraDevice = CameraDevice.rear,
  Duration? maxDuration,
  String? name,
}) {
  return platform.getVideo(
    source: source,
    preferredCameraDevice: preferredCameraDevice,
    maxDuration: maxDuration,
    name: name,
  );
```
Repository: next.js
Issue: Duplication of CSS rules
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

    Operating System:
      Platform: linux
      Arch: x64
      Version: #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022
    Binaries:
      Node: 16.17.0
      npm: 8.15.0
      Yarn: 1.22.19
      pnpm: 7.13.0
    Relevant packages:
      next: 14.2.0-canary.21
      eslint-config-next: 14.1.3
      react: 18.2.0
      react-dom: 18.2.0

### What browser are you using? (if relevant)

Chrome 106.0.5249.119

### How are you deploying your application? (if relevant)

Vercel

### Describe the Bug

Page has different styling depending on HOW we get to the page.

When we go to the page from other page - we get one style.
When we refresh page we have different color.

The only difference is "Does link to the `/lazy` page was rendered before rendering `/to` page or not"

When link to `/lazy` page **is not** rendered before. `/to` page has appropriate styles with red background.
When link to `/lazy` page **is** rendered before. `/to` page will have inappropriate styles.

### Expected Behavior

`/to` page should have exact same styles regardless of how we go to this page

### Link to reproduction

https://github.com/whiteand/next-js-css-order-bug

### To Reproduce

Steps to reproduce:
- Go to https://next-js-css-order-bug.vercel.app/from
- Click on "Page without link to Lazy"
- You will be redirected to the "/to" page
- There you will see "Red background" text on the white background
- Refresh page
- You see the same page but background become Red.

I expect that regardless of the ways we go to the `/to` page background will be red.