WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
trait Foo {
type Bar;
fn bar(&self) -> Option<<Self as Foo>::Bar>;
}

Gives:

<anon>:7:32: 7:34 error: expected `;` or `{`, found `<<`
<anon>:7 fn bar(&self) -> Option<<Self as Foo>::Bar>;

Adding a space so it becomes < < fixes it.

Issue 2:
STR

#![feature(associated_types)]

trait Trait {
type Type;

// OK
fn method() -> <Self as Trait>::Type;
// Can't parse
fn method() -> Box<<Self as Trait>::Type>;
}

fn main() {}

Output

ai.rs:9:23: 9:25 error: expected `;` or `{`, found `<<`
ai.rs:9 fn method() -> Box<<Self as Trait>::Type>;

Version

rustc 0.12.0-pre (9508faa22 2014-09-17 23:45:36 +0000)

cc @pcwalton
Issue 1:
I don't see what version of tsc you support so this might be a version problem:

error.ts

/// <reference path="node.d.ts" />

tsc error.ts

node.d.ts(101,36): error TS1005: ';' expected.

node.d.ts(690,23): error TS1005: ';' expected.

node.d.ts(702,23): error TS1005: ';' expected.

node.d.ts(1228,36): error TS1005: ';' expected.

tsc

Version 1.0.3.0

Issue 2:
A definition file for the small color library chroma.js would be quite useful.
Issue 1:
Migrated issue, originally created by Michael Bayer (@zzzeek)

ML thread https://groups.google.com/forum/?hl=en#!topic/sqlalchemy/t8a6SLTYrIc

even though all the docs show string names being sent to insert.values(), you can use columns as keys inside a dictionary as well, just as we need to do with UPDATE some times. It doesn't work for multi-values though:

from sqlalchemy import MetaData, String, Integer, Table, Column
from sqlalchemy.dialects.postgresql.base import PGDialect

m = MetaData()

t = Table('mytable', m,
Column('int_col', Integer),
Column('str_col', String),
)

print("Case 1")

print(t.insert().values(
{t.c.str_col:"string", t.c.int_col:2}
).compile(dialect=PGDialect()))

print("Case 2")

print(t.insert().values(
[
{t.c.str_col:"str", t.c.int_col:1}
]
).compile(dialect=PGDialect()))

print("Case 3")

print(t.insert().values(
[
{t.c.str_col:"string", t.c.int_col:1},
{t.c.str_col:"text", t.c.int_col:2}
]
).compile(dialect=PGDialect()))

gerrit at https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/626 fixes.

Issue 2:
Migrated issue, originally created by Michael Bayer (@zzzeek)

even though columns-as-keys is de-emphasized in the documentation for insert, it does work, except for multi-values:

from sqlalchemy import *
from sqlalchemy.dialects import sqlite

t = table('t', column('a'), column('b'))

print t.insert().values([
{"a": 1, "b": 2},
{"a": 2, "b": 2},
{"a": 3, "b": 2}
]).compile(dialect=sqlite.dialect())

print t.insert().values([
{t.c.a: 1, t.c.b: 2},
{t.c.a: 2, t.c.b: 2},
{t.c.a: 3, t.c.b: 2},
]).compile(dialect=sqlite.dialect())

output:

#!

INSERT INTO t (a, b) VALUES (?, ?), (?, ?), (?, ?)
Traceback (most recent call last):
...
File "/home/classic/dev/sqlalchemy/lib/sqlalchemy/sql/crud.py", line 419, in _process_multiparam_default_bind
"a Python-side value or SQL expression is required" % c)
sqlalchemy.exc.CompileError: INSERT value for column t.a is explicitly rendered as a boundparameter in the VALUES clause; a Python-side value or SQL expression is required
Issue 1:
Electron version: 1.3.5

Operating system: Windows 10

It seems like certain menu accelerators don't work when the app is running in Windows, but they do work in macOS. In the example below, none of the accelerators work in Windows, but clicking the menu item does log the correct message. But CmdOrCtrl+B does work in Windows.

Here's the code:

const electron = require('electron');
const app = electron.app;
const Menu = electron.Menu;
const BrowserWindow = electron.BrowserWindow;
app.on('ready', function() {
let mainWindow = new BrowserWindow({width: 800, height: 600});
mainWindow.loadURL(`file://${__dirname}/index.html`);

let menu = Menu.buildFromTemplate([
{
label: 'Edit',
submenu: [
{
label: 'Cut',
accelerator: 'CmdOrCtrl+X',
click: () => console.log('cut'),
},
{
label: 'Copy',
accelerator: 'CmdOrCtrl+C',
click: () => console.log('copy'),
},
{
label: 'Paste',
accelerator: 'CmdOrCtrl+V',
click: () => console.log('paste'),
},
{
label: 'Select All',
accelerator: 'CmdOrCtrl+A',
click: () => console.log('select all'),
},
],
},
]);
Menu.setApplicationMenu(menu);
});
app.on('window-all-closed', function() {
app.quit();
});

Issue 2:
Electron version: All

Operating system: Windows vs Mac

When I define a custom undo behaviour I found it become different between Windows and Mac devices.

This is what I did:

// the main menu I overwrite:
let menuTemplate = [
// Edit
{
label: 'Edit',
submenu: [
{
label: 'Undo',
accelerator: 'CmdOrCtrl+Z',
click () {
console.log('Undo');
}
},

{
label: 'Redo',
accelerator: 'Shift+CmdOrCtrl+Z',
click () {
console.log('Redo');
}
},
]
}
];

As you can see, I overwrite the Undo behaviour and use the same shortcuts from the Browser. When I press ctrl/cmd+z on Mac, things goes fine, the menu click go first and take over it. But in Windows, it seems like the original webContents.undo() will be executed first, if the undo stack have states (which means you should typing some letters on a <input> first).

This makes me have no chance to overwrite the undo for Windows platform. Is this expect in Windows? If we can not change the menu behaviour, is there a way to disable/stop webContents.undo when pressing ctrl+z so that the Main Menu can receive it?
Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Electron Version

13.1.17

What operating system are you using?

Windows

Operating System Version

win10 20H2

What arch are you using?

x64

Last Known Working Electron version

9.0.0

Expected Behavior

const options = {

deviceName: "233B",
silent: true,
printBackground: true,
margins: {
marginsType: 'custom',
top: 0,
bottom: 0,
left: 0,
right: 0
},
pageSize: {
width: curTagBaseSet.printSet.width * 1000 - 1000,
height: curTagBaseSet.printSet.height * 1000,
}
}

Actual Behavior

webview print is not working with deviceName

Testcase Gist URL

No response

Additional Information

No response

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Electron Version

12.0.5,11.3.0,12.0.7

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

12.0.7

Expected Behavior

Window Set printer dynamically

code:

let printCon = { silent: true, printBackground: false, ...printOptions }
log.log('url = ' + strUrl + '\n printCon=' + JSON.stringify(printCon))

try {
// did-finish-load
printWindow.webContents.on('did-finish-load', () => {
log.log('did-finish-load')
printWindow.webContents.print(
printCon,
(success, failureReason) => {
log.log('success=' + success + ' failureReason =' + failureReason)
if (callback) {
callback(success ? null : failureReason)
}
}
)
})

Actual Behavior

Windows Error: webContents.print(): Invalid deviceName provided!

mac is working

Testcase Gist URL

No response

Additional Information

code:

let printCon = { silent: true, printBackground: false, ...printOptions }
log.log('url = ' + strUrl + '\n printCon=' + JSON.stringify(printCon))

try {
// did-finish-load
printWindow.webContents.on('did-finish-load', () => {
log.log('did-finish-load')
printWindow.webContents.print(
printCon,
(success, failureReason) => {
log.log('success=' + success + ' failureReason =' + failureReason)
if (callback) {
callback(success ? null : failureReason)
}
}
)
})
Issue 1:
System info

Playwright Version:1.32.2

Operating System: linux

Browser: [All, Chromium, Firefox, WebKit]

Other info:

Source code

docker-compose up --exit-code-from e2e--build e2e

Steps

Run a test in a container in circleCI

Expected

Delay exit code after the report generation might solve the issue

Actual

In order to show step failure we have to pass --exit-code-from flag, but this flag will case to terminate the container right away once test is done and playwright return exit code 1, this will case container to terminate before report generating

Issue 2:
System info

Playwright Version: [v1.0.0]

Operating System: [Windows 10]

Browser: [Chromium]

Other info:

Source code

I provided exact source code that allows reproducing the issue locally.

Link to the GitHub repository with the repro

[https://github.com/your_profile/playwright_issue_title]

or

Config file

readonly msgContainer: Locator;

this.msgContainer = page

.locator(

".ContextContainer.activeTab #MessagesContainerId .scil_label.messageHeaderValue.selectable.messageEmail"

)

.first();

await expect(this.msgContainer).toHaveText(global.grabEmail);

Steps

[Run the test]

[...]

Expected

The text of msgContainer should grabbed as as it is.

Actual

The value of msgContainer took grabbed with some additional '/'. The real value is ""Spider Man" spider.man@gmail.com" . But grabbed as ""Spider Man" spider.man@gmail.com"
Issue 1:
class FooError extends Error {
constructor(message:string) {
super(message);
}
}
console.log((new FooError('foo')).message); // <nothing>
console.log((new Error('bar')).message); // bar

Am I missing something obvious or is there a bug with 1.8.9?

Issue 2:
Test case:

myError.ts

class MyError extends Error {
constructor(message: string) {
super(message);
}
}

let error = new MyError('Error Message');
console.log(error.message);

tsconfig.json

{
"compilerOptions": {
"target": "ES5",
"module": "commonjs"
}
}

compile and run using node:

node myError.js

Observe: nothing is printed to the console. Debugging it shows that the message passed to super is not recorded. Something seems very strange with the prototype chain in this case.

I was under the impression from #3516 that this should work now even if generating ES5 code. If not possible for ES5 then the compiler should produce an error.
Issue 1:
"var" is not more highlighted in blue in javascript file!

Issue 2:
Windows 10 is half baked one IE and now this editor.

I was surprised with the built in extensions, but I'm feeling terrible after experiencing this issue.

I was working with this editor, and suddenly my system became very slow and I'm forced to shut down my system. After the restart my current working file (see the attachment), got changed in to some other encoding. I lost my 3 hours of work :(.

Bala

global.txt
Issue 1:
Version

2.6.10

Reproduction link

https://github.com/wxkcoder/bugs_demo

Steps to reproduce

vue version：2.6.10

ios version：10.3.3 or 11.4

use wxchat webview

page A use 'this.$router.push({name:B})' Jump to Page B

Page B import component C

Component C bind a touchstart event

the problem is Component C use slot label Input content，click that content is dose not trigger C's touchstart event

Direct access to page B can trigger C‘s touchstart event

change ios version to 12.3.1 can trigger C‘s touchstart event

change vue version to 2.5.22 can trigger C‘s touchstart event

pleace try to run this demo https://github.com/wxkcoder/bugs_demo on ios 10.3.3

What is expected?

no trigger

What is actually happening?

trigger

Issue 2:
Version

2.6.10

Reproduction link

https://github.com/wxkcoder/bugs_demo

Steps to reproduce

vue version：2.6.10

ios version：10.3.3 or 11.4

use WeChat webview

page A use 'this.$router.push({name:B})' Jump to Page B

Page B import component C

Component C bind a touchstart event

the problem is Component C use slot label Input content，click that content is dose not trigger C's touchstart event

Direct access to page B can trigger C‘s touchstart event

change ios version to 12.3.1 can trigger C‘s touchstart event

change vue version to 2.5.22 can trigger C‘s touchstart event

pleace try to run this demo https://github.com/wxkcoder/bugs_demo on ios 10.3.3

What is expected?

trigger C's touchstart event

What is actually happening?

no trigger C's touchstart event
Issue 1:
hi, all

when i use the scipy.optimize.linprog for a simple LP

how can i get the value of dual variant （in a simple way）?

cuz in my problem, the dual variant has some practical significance

Issue 2:
I have a huge linprog problem of almost 1k variables and restrictions. I can calculate the solution with scipy.optimize.linprog(method='simplex') but I need shadow prices (or opportunity costs / duals) of ~100 inequalities.

I'm able to calculate them by adding 1 to the right side of the inequality and then solving that problem. Then I get the shadow price substracting the objective functions values for both solutions: shadow_price_i = f_max_original - f_max_i. Then repeat 100 times. This method works but it's painfully slow (1h). Note: I could also pose the dual problem and solve it

It's a shame that scipy does not return duals, so I'm opening a feature request. I'm new contributing to open projects, but I'm a CS graduate and have experience with both python and the simplex method, so I may be able to do so with some guidance.
Issue 1:
Set user lockout after X amount of failed logins to protect against bruteforce attacks.

Feature toggle in config

Configurable number of logins in config

Admin can reset user (Is Active true/false)

Email recovery link

Issue 2:
Is your feature request related to a problem? Please describe.

In its default state, the Superset login page permits any number of failed login attempts. This has been flagged as a security issue by our sysadmin team, and I agree with them. I have only tested users created in the database and have not tried other authentication methods.

Describe the solution you'd like

The login page should permit, say, 3 incorrect login attempts and should ask the user to try again after a period of time. This time should be customizable from the config file.

Describe alternatives you've considered

I am not sure if this already works for other authentication methods.

Additional context

None.
Issue 1:
TypeScript Version:

1.8.9

Code

// A self-contained demonstration of the problem follows...
export interface IHiddenColumns {
hiddenColumns: string;
}

export class HiddenColumnsLoader {

public loadHiddenColumns(): Promise<void> {

return new Promise<void>((resolve, reject) => {

let promises: Promise<IHiddenColumns>[] = [];

// push promises
// .forEach(structureContent => {
// promises.push(this.loadStructureHiddenColumns(structureContent.rowSectionDefinition, structureContent.columnSectionDefinition, provider));
// });

Promise
.all(promises)
.then((results) => {

// results should be typeof IHiddenColumns[] and not Promise<IHiddenColumns[]>. See stack below
this.resolveResults(results);

resolve();
})
});
}

private resolveResults(loadPageResults: IHiddenColumns[]) {
// resolve
}
}

Expected behavior:

Compilation succeeded in Typescript 1.8.7.

Failed in 1.8.9

'results' inside Promise.all().then() should be considered typeof IHiddenColumns[]. Seems to be instead : Promise<IHiddenColumns[]>. See trace below.

Actual behavior:

Compilation failed in 1.8.9 whereas it worked in 1.8.7 (and still works if I backward to 1.8.7).

Here is the stacktrace :

[11:39:07]

42 this.resolveResults(gridModel, results);

~~~~~~~

.../HiddenColumnsLoader.ts(42,37): error TS2345: Argument of type 'Promise[]' is not assignable to parameter of type 'IHiddenColumns[]'.

Type 'Promise' is not assignable to type 'IHiddenColumns'.

Issue 2:
TypeScript Version:

1.8.9

Code

Promise.all([Promise.resolve('')]); // has type Promise<Promise<string>[]>

Expected behavior:

The expression has type Promise<string[]> as in 1.8.7

Actual behavior:

The expression has type Promise<Promise<string>[]>
Issue 1:
In my project I have:

"devDependencies": {
"babel-cli": "~6.1.2",
"babel-preset-es2015": "~6.1.2",
…

When I run babel-doctor I see this:

❯ babel-doctor

Babel Doctor
Running sanity checks on your system. This may take a few minutes...

✔ Found config at /Users/tema/Dropbox/Projects/_Repos/sweet2/.babelrc
✔ No duplicate babel packages found

✖ We found some outdated packages:

- babel-runtime - Latest is 6.0.14. Local version is 5.8.29

✔ You're on npm >=3.3.0

Found potential issues on your machine :(

But the latest version of babel-cli depends on babel-runtime ^5.0.0 so I can’t fix this warning. It’s very confusing.

Issue 2:
bug report

Input Code

This is only an issue when using both the react and typescript presets.

interface I {
<T>(p: T): T
}

Repl Link

Babel/Babylon Configuration (.babelrc, package.json, cli command)

{
"presets": [
"@babel/react",
"@babel/typescript"
],
}

Expected Behavior

It should not throw and error.

Current Behavior

It throws:

{ SyntaxError: ./src/test.tsx: Unexpected token (2:4)

1 | interface I {
> 2 | <T>(p: T): T
| ^
3 | }
4 |

Possible Solution

Similar issue with generic methods: #6665

Similar fix for generic methods: #7225

Duplicate but closed Issue: #7158

Context

Your Environment

software
version(s)

Babel
7.0.0-beta.40

preset-react
7.0.0-beta.40

preset-typescript
7.0.0-beta.40

node
8.9.0

npm
5.5.1

Operating System
OSX
Issue 1:
I think it should be computed in terms of zero_one_loss to avoid code duplication.

Issue 2:
Hi, I would like to report what seems to be a bug in the treatment of the copy_X parameter of the LassoLarsIC class. Because it's a simple bug, it's much easier to see in the code directly than in the execution, so I am not posting steps to reproduce it.

As you can see here, LassoLarsIC accepts a copy_X parameter.

scikit-learn/sklearn/linear_model/least_angle.py

Line 1487
in
7389dba

self.copy_X = copy_X

However, it also takes a copy_X parameter a few lines below, in the definition of fit.

def fit(self, X, y, copy_X=True):

Now there are two values (potentially contradicting each other) for copy_X and each one is used once. Therefore fit can have a mixed behaviour. Even worse, this can be completely invisible to the user, since copy_X has a default value of True. Let's assume that I'd like it to be False, and have set it to False in the initialization, my_lasso = LassoLarsIC(copy_X=False). I then call my_lasso.fit(X, y) and my choice will be silently overwritten.

Ideally I think that copy_X should be removed as an argument in fit. No other estimator seems to have a duplication in class parameters and fit arguments (I've checked more than ten in the linear models module). However, this would break existing code. Therefore I propose that fit takes a default value of None and only overwrites the existing value if the user has explicitly passed it as an argument to fit. I will submit a PR to that effect.
Issue 1:
Bug report

Bug summary

Attempting to IMPORT matplotlib under Python 3.7.x on a Win10Pro results in error: "ImportError: DLL load failed: The specific module could not be found".

DLL name not given.

However, first importing PyQt5, and only then importing matplotlib works as it should.

Code for reproduction

install Python 3.7.x (tested both 3.7.2 and 3.7.3) on Win10Pro

install matplotlib (version 3.1.0) with pip - installs fine, no issues

install PyQt5 (version 5.12.2) with pip - installs fine, no issues

start Python

under Python, enter command: "import matplotlib"

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python37\lib\site-packages\matplotlib\__init__.py", line 200, in <module>
_check_versions()
File "C:\Program Files\Python37\lib\site-packages\matplotlib\__init__.py", line 194, in _check_versions
module = importlib.import_module(modname)
File "C:\Program Files\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
>>>
>>>
# importing matplotlib works fine when PyQt5 imported first
>>> import PyQt5
>>> import matplotlib
>>> import serial
>>>
>>> ^Z

Actual outcome

# see above

Expected outcome

using matplotlib should not depend on importing PyQt5 first; but when done, code works fine

Matplotlib version

Operating system: Win10Pro

Matplotlib version: 3.1.0

Matplotlib backend (print(matplotlib.get_backend())): TkAgg right after importing; in the full code using qt5agg

Python version: 3.7.2, 3.7.3, 64 bit

Jupyter version (if applicable): n.a.

Other libraries:

Python installed from Win installer

matplotlib and PyQt5 installed with pip

Issue 2:
Documentation Link

https://matplotlib.org/devdocs/api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D.html#mpl_toolkits.mplot3d.axes3d.Axes3D.scatter

Problem

Note that both scatter() and scatter3D() appear, although they are strict aliases of one another, duplicating much content. (I'm not suggesting to get rid of the alias, just to dedupe them in the docs.) Quite a few other methods exhibit the same duplication.

Suggested improvement

No response

Matplotlib Version

3.4.2.post1559+g3a46327c9c

Matplotlib documentation version

3.4.2.post1559+g3a46327c9c
Issue 1:
Bug Report

I would like to work on a fix!

Current Behavior

I created my porject with CRA.

I tried to import React-Navigation to my project. After the import, babel started throwing me an error for "@babel/plugin-proposal-export-default-from" plugin every time i tried to run my code. So I added it and also updated my babel configuration, but it still keeps throwing me this error. What am I missing?

SyntaxError: .../node_modules/react-native-gesture-handler/DrawerLayout.js: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (30:8):

28 | const SETTLING = 'Settling';
29 |
> 30 | export type PropType = {
| ^
31 | children: any,
32 | drawerBackgroundColor?: string,
33 | drawerPosition: 'left' | 'right',

Add @babel/plugin-proposal-export-default-from (https://git.io/vb4yH) to the 'plugins' section of your Babel config to enable transformation.

Input Code

REPL or Repo link if applicable:

https://github.com/FrediArro/babel-error

Expected behavior/code

No errors

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

Filename: package.json

"babel": {
"plugins": [
"@babel/plugin-proposal-export-default-from"
]
}

Environment

System:
OS: Linux 5.3 Ubuntu 18.04.4 LTS (Bionic Beaver)
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.21.1 - /usr/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
npmPackages:
@babel/plugin-proposal-export-default-from: ^7.8.3 => 7.8.3
@babel/plugin-proposal-export-namespace-from: ^7.8.3 => 7.8.3

Possible Solution

Additional context/Screenshots

Add any other context about the problem here. If applicable, add screenshots to help explain.

Issue 2:
Bug Report

I would like to work on a fix!

Current behavior

@babel/eslint-parser gives false positive (shows error) for no-unused-vars rule with TypeScript types:

error 'Rubik' is defined but never used no-unused-vars

Input Code

import Rubik from './Rubik';

export default class Arranger {
private readonly rubik: Rubik;
}

Expected behavior

When run eslint, no errors/warnings should arise.

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

Filename: babel.config.js

{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
],
"plugins": [
"@babel/proposal-class-properties"
]
}

Filename: .eslintrc.json

{
"parser": "@babel/eslint-parser",
"rules": {
"no-unused-vars": ["error"]
}
}

Environment

System:
OS: Linux 4.19 Alpine Linux
Binaries:
Node: 12.18.3 - /usr/bin/node
Yarn: 1.22.4 - /usr/bin/yarn
npmPackages:
@babel/core: ^7.10.2 => 7.11.4
@babel/eslint-parser: ^7.11.4 => 7.11.4
@babel/eslint-plugin: ^7.11.3 => 7.11.3
@babel/plugin-proposal-class-properties: ^7.8.3 => 7.10.4
@babel/preset-env: ^7.10.2 => 7.11.0
@babel/preset-typescript: ^7.9.0 => 7.10.4
eslint: 7.2.* => 7.2.0
webpack: ^4.43.0 => 4.44.1

Note

This issue already existed before switching to Babel monorepo (in babel/babel-eslint) so the switch is not the cause.