WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
julia> function f()
const a = 1;
a = 2;
return a;
end
f (generic function with 1 method)

julia> f()
2

Although it is not that important for the compiler/optimizer to declare a local constant variable as it can probably figure out itself, it is still useful as a hint/constraint for the user to avoid stupid error or breakage sometimes.

IMHO, as long as local const variable is a valid syntax, it should at least give a warning if the value/binding changes (just as the global one). It might even make sense to be more restrictive and make that an error instead of a warning.

Issue 2:
Not sure what's going on here – this runs but no .mem file appears. The same issue may affect measuring coverage (the logging logic is shared). It might be good to add some testing for this and run those tests under CI on Travis and AppVeyor.
Issue 1:
Bug report

Bug summary

The scale on the y-axis is missing in some logarithmic plots.

Code for reproduction:

import matplotlib.pyplot as plt

x = [1, 2]
y = [3.7, 3.8]

plt.plot(x,y)
plt.yscale("log")
plt.show()

Actual outcome

Expected outcome

There should be a scale on the y-axis. Without the scale, you can't tell what the value of y is.

Matplotlib version

Operating system: Linux

Matplotlib version: 2.2.2

Matplotlib backend (print(matplotlib.get_backend())): TkAgg

Python version: 3.5.2

Jupyter version (if applicable):

Other libraries:

Issue 2:
Bug report

For the data in a small range, there is just on tick in the default log scale axis, which means nothing.

Code for reproduction

import matplotlib.pylab as plt
plt.loglog([ 0.53, 0.41],[ 0.53, 0.41] )
plt.show()

Actual outcome

Expected outcome

Give at least two ticks for each axis.

Matplotlib version

Operating System: Ubuntu 16.04

Matplotlib Version: 2.02

Python Version: 3.6.0

I install the library by conda.
Issue 1:
Hi,

Can you make a seperate folder where all you store the shortcuts of PT Run as

sometimes it shows two search results due to the same shortcut being in two location.

Issue 2:
Environment

Windows build number: 10.0.18362.295
PowerToys version: 0.11.0
PowerToy module for which you are reporting the bug (if applicable): FancyZones

Steps to reproduce

My main language is Dutch with US (International) keyboard layout and as second language English (United States) with US keyboard. With none of the language setting Win + ~ is working.

Expected behavior

When using US (International) keyboard ~ is a dead key so I think that would not work. But with US keyboard it should work.

Actual behavior

FancyZone editor is not launched.
Issue 1:
OS: Ubuntu 14.10 x86-64

Atom: 0.168.0

line 92: 5289 세그멘테이션 오류 (core dumped) nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$DOT_ATOM_DIR/nohup.out" 2>&1

[5289:0109/072204:ERROR:browser_main_loop.cc(163)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.

App load time: 111ms

[5319:0109/072204:INFO:renderer_main.cc(207)] Renderer process started

[5289:0109/072205:INFO:CONSOLE(58)] "No deserializer found for", source: /opt/atom/resources/app/src/deserializer-manager.js (58)

[5289:0109/072205:INFO:CONSOLE(64)] "Window load time: 1102ms", source: file:///opt/atom/resources/app/static/index.js (64)

Crash dump id: 0cd1948e-e980-4867-a381-c03d6d2ef221

Issue 2:
OS: Ubuntu 14.04

Atom: 0.167.0-8f4555b

Steps to Reproduce

Open Atom with --safe

File > Open Folder...

Select a project

Open a file

Right-click Paste

Here is the crash dump of running it in --safe mode: http://pastebin.com/eKHMHCfq
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

There should be an intuitive Multiple Select component that has the correct items selected in the popup list. Maybe it would be better to use a list with additional checkboxes in it, something like in this demo (when you click the struck through eye. An alternative would be like it is solved in this pull request, but I am not sure if this is the right way, as I like how Single Select components behave. That`s why I opened an own issue for Multiple Select components.

Current Behavior

When creating a Select field with the multiple option and then clicking that initially empty Select field the first item in the popped up list is automatically highlighted.

Steps to Reproduce (for bugs)

Go to the official component demo of the multiple Select and click it. The first item stays the selected in the popped up list even if you move the mouse pointer elsewhere.

Context

Your Environment

Tech
Version

Material-UI
1.0.0-beta.25

React
16.2

Chrome
63.0.3239.108

etc

Issue 2:
Problem description

After initial open of menu, first item remains highlighted even after hovering off.

Steps to reproduce

next branch, menus demo http://localhost:3000/#/component-demos/menus

click to open

hover to a lower item

Versions

next branch a38068f

Browser: Mac Chrome 52.0.2743.116

Browser: Mac Firefox 48.0.2

Browser: Mac Safari 9.1.2

Images
Issue 1:
I am new to Glide, i started to use it today because the support for Gif.

but some images were not displayed int the list(see the attachment), which got 200 http code while captured by Fiddler, while displayed well when using Picasso.

Any idea how to solve this, Thannks a lot.

These are where and how i used Glide:

Code in the adapter:

Glide.with(Application.getInstance()).load(url).into(threeImagesHolder.image0);

Code int the layout file:

<ImageView
android:id="@+id/iv_image0"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="3dp"
android:background="@drawable/img_holder_bg"
android:scaleType="centerCrop" />

<ImageView
android:id="@+id/iv_image1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="3dp"
android:background="@drawable/img_holder_bg"
android:scaleType="centerCrop" />

<ImageView
android:id="@+id/iv_image2"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_vertical"
android:background="@drawable/img_holder_bg"
android:scaleType="centerCrop" />
</LinearLayout>

Issue 2:
java.lang.IndexOutOfBoundsException: index=6, limit=6, size of type=2
at java.nio.Buffer.checkIndex(Buffer.java:165)
at java.nio.HeapByteBuffer.getShort(HeapByteBuffer.java:203)
at com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$RandomAccessReader.getInt16(ImageHeaderParser.java:315)
at com.bumptech.glide.load.resource.bitmap.ImageHeaderParser.parseExifSegment(ImageHeaderParser.java:199)
at com.bumptech.glide.load.resource.bitmap.ImageHeaderParser.getOrientation(ImageHeaderParser.java:140)
at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:116)

Because of the exif data is only 6 bytes which equals to jpeg preamble.

Perhaps we can use the Throwable instead of IOException to ignore it.

try {
orientation = new ImageHeaderParser(stream).getOrientation();
} catch (IOException Throwable e) {
if (Log.isLoggable(TAG, Log.WARN)) {
Log.w(TAG, "Cannot determine the image orientation from header", e);
}
}
Issue 1:
From the docs on static HTML export:

So, you could only use pathname, query and asPath fields of the context object passed to getInitialProps. You can't use req or res fields.

Does static export entirely negate the ability to use the _error.js component for error handling, which is dependent on res? How would I go about creating a 404 page?

The current behavior is that any unknown routes redirect to /index.js.

One possible solution I can think of is to maintain a list of all routes and check against it to see if pathname is found. However this seems especially onerous to run on every page load for a site/blog that generates 100s of routes.

Is there a way to do this?

Or is it possible to define a custom error route and redirect to that instead?

Or even better, catch all routes within subfolders? eg

{
...routes,
'/*': { page: '/_error.js' },
'/blog/*': { page: '/blog/_error.js' },
}

I have searched the issues of this repository and believe that this is not a duplicate.

Issue 2:
Bug report

Describe the bug

Building nextjs app throws an error:

Failed to compile.

chunk c8f7fe3b0e41be846d5687592cf2018ff6e22687
static/css/030f3c81fcf6deab04e9.css
Cannot read property 'pop' of undefined

To Reproduce

add some [name].module.css and build the app

Expected behavior

App builds without errors

Screenshots

If applicable, add screenshots to help explain your problem.

System information

OS: Tried on MacOS (nodejs v10 and nodejs v12) and Linux (Docker container node:12)

Version of Next.js: 9.0.2

Additional context

adding next snippet in my next.config.js solves the issue but I don't think it is the best way

if (config.optimization.splitChunks) {
config.optimization.splitChunks.cacheGroups.shared.enforce = true;
}
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 an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

Operating System:

Last Known Working Electron version:

Expected Behavior

Actual Behavior

To Reproduce

Screenshots

Additional Information

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 an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

6.0.x , 7.0.x

Operating System:

macOS 10.14 , macos 10.15

Last Known Working Electron version:

*4.x.x

Expected Behavior

The function {browserwindow}.setContentProtection(true) , should make the app unrecordable for "Electron desktopCapturer" module.

Actual Behavior

It does not work .

To Reproduce

Make a simple blank app, setContentProtection of the browserWindow, capture the desktop stream using the desktopCapturer module and show it on a canvas.
Issue 1:
TypeScript Version:

1.8.0-beta (Visual Studio 2015 Community)

Code

According to this StackOverflow question, I have checked and double-checked that all files in question have been set, unset, and reset to Build Action: TypeScriptCompile. Code is arranged as follows:

src

| - modules

| | - config.d.ts

| | - config.ts

config.d.ts

interface Configuration {
debug?: boolean;
}

config.ts

export var config: Configuration = { // "Cannot find name 'Configuration'."
debug: true
};

tsconfig.json (for reference)

{
"compilerOptions": {
"rootDir": "src/",
"outDir": "dist/",
"target": "es5",
"module": "system",
"diagnostics": true,
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"exclude": [
"typings/main.d.ts",
"typings/main",
"node_modules"
]
}

Expected behavior:

Visual Studio should discover the d.ts file and expose the interface to all other TypeScript modules.

Actual behavior:

Visual Studio does not expose the interface to any other module unless the reference is explicitly declared using /// <reference path="config.d.ts" />.

Issue 2:
TypeScript Version:

1.8.9

To reproduce use VSCode from Insider Channel (https://code.visualstudio.com/Download#insiders)

create workspace

create tsconfig.json with content

{
"compilerOptions": {
"module": "commonjs"
}
}

create test.ts with content

class A {
}

create folder libs

create folder libs\superLib

create file libs\superLib\lib.d.ts with content

export function foo();

start VSCode

open test.ts

try to rename libs to libs2

Observer: you can't the directory is locked.

Use for example handle.exe from SysInternals or a process explorer to check who is holding a lock on the .\libs directory. It is the tsserver.
Issue 1:
Bug Report

I would like to work on a fix!

Input Code

const babel = require('@babel/parser');
babel.parse(
'class Foo { get test() {} }',
{
plugins: ['estree', 'typescript']
}
);

Actual behaviour

Thrown:
TypeError: Cannot read property '0' of undefined
at Object.getGetterSetterExpectedParamCount (/Users/bradzacher/github/typescript-eslint/packages/typescript-estree/node_modules/@babel/parser/lib/index.js:7318:37)
at Object.checkGetterSetterParams (/Users/bradzacher/github/typescript-eslint/packages/typescript-estree/node_modules/@babel/parser/lib/index.js:11022:29)
at Object.parseClassMemberWithIsStatic (/Users/bradzacher/github/typescript-eslint/packages/typescript-estree/node_modules/@babel/parser/lib/index.js:12600:12)
at Object.parseClassMemberWithIsStatic (/Users/bradzacher/github/typescript-eslint/packages/typescript-estree/node_modules/@babel/parser/lib/index.js:6851:11)
at Object.parseClassMember (/Users/bradzacher/github/typescript-eslint/packages/typescript-estree/node_modules/@babel/parser/lib/index.js:12501:10)
at callParseClassMember (/Users/bradzacher/github/typescript-eslint/packages/typescript-estree/node_modules/@babel/parser/lib/index.js:6815:13)
at Object.parseClassMember (/Users/bradzacher/github/typescript-eslint/packages/typescript-estree/node_modules/@babel/parser/lib/index.js:6821:7)

Environment

System:
OS: macOS 10.15.7
Binaries:
Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
npmPackages:
@babel/parser: ^7.12.5 => 7.12.5
@babel/types: ^7.12.6 => 7.12.6

Possible Solution

Additional context

Issue 2:
Bug Report

I would like to work on a fix!

Current behavior

TypeError is TypeError: Cannot read property '0' of undefined is thrown.

Input Code

({set [x](v) {}});

Expected behavior

No TypeError is thrown.

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

Use @babel/parser directly

const { parse } = require("@babel/parser");
const result = parse(`({set [x](v) {}});`, {
plugins: ["estree", "typescript"],
});

Environment

Possible Solution

Additional context

Probably this is a regression of 7.12
Issue 1:
Running the following command

flutter create -akotlin --org="in.company.domain" flutter_app

is problematic.

MainActivity.kt is created with the following package

package in.company.domain

instead of

package `in`.company.domain

Which results in failed compilation

Issue 2:
in is a reserved keyword in kotlin, and thus we have to write package names like this -

pagkage `in`.championswimmer.myapp

(Taking my example here, as I usually use 'in.championswimmer' as company domain.

Android Studio escapes it when generating default project. Flutter does not.

I believe other kotlin keywords need to be escaped similarly from the package name

List of keywords to escape by language

Kotlin

in

when
Issue 1:
Hi there, I come from a C# background and it has something great call Object Initializer. Which allows you to initialize an object inline, without specifying the object everytime.

C# docs:

https://msdn.microsoft.com/en-us/library/bb397680.aspx

I would be cool if the compiler could do something like this:

new MyClass { Field1 = "ASD", Field2 = "QWE" };

Issue 2:
TypeScript Version:

1.7.5 / 1.8.0-beta / nightly (1.9.0-dev.20160217)

Code

{
let foo = 'bar';
}

console.log(foo)

Expected behavior:

I would expect let foo = 'bar'; to be emitted as var foo_1 = 'bar';

When running the emitted code I would expect to get a Reference Error for foo

Actual behavior:

{
var foo = 'bar';
}
console.log(foo);

There is no Reference Error in emitted code and bar is printed to the console.
Issue 1:
When trying to achieve this import functionality according to atomic design:

import { Button, Avatar, ...etc } from '~/components/atoms'

I use an index.js file @ src/components/atoms/index.js which contains this:

const req = require.context(".", true, /\.\/[^/]+\/index\.js$/);

req.keys().forEach(key => {
const componentName = key.replace(/^.+\/([^/]+)\/index\.js/, "$1");
module.exports[componentName] = req(key).default;
});

I know it looks crazy ha! All it does is go through all the components in the src/components/atoms dir and exports them so I don't have to do it manually (because it gets annoyingly tedious when you have lots of components) in the index.js file like:

import Button from "./Button";
import Avatar from "./Avatar";

export { Avatar, Button };

I have searched the issues of this repository and believe that this is not a duplicate.

Here are some similar issues that deal with absolute imports: #342 #714

Expected Behavior

I expect the components to resolve correctly.

Current Behavior

It is throwing a TypeError: require.context is not a function error.

I expect this is due to the fact that require.context is not available in node because components are being server rendered.

Your Environment

Tech
Version

next
2.0.0

node
9.1.0

OS
Ubuntu 17.10

browser
Chrome 62

Issue 2:
When using <Head> on a page, as well as specifying the <title> in _document.js inside <Head>, both create duplicate titles.

<head>
<title class="next-head">Homepage - Welcome</title>
<meta charset="utf-8" class="next-head">
<meta name="viewport" content="initial-scale=1.0, width=device-width" class="next-head>
<title>Homepage</title>
<link href="/static/styles/sanitize.css" rel="stylesheet">
</head>
Issue 1:
Describe the workflow you want to enable

As a user of Scikit-learn, I want to be able to calculate the McFadden's pseudo R-squared for a binary logistic regression model for that we need log-likelihood and null log-likelihood.

Describe your proposed solution

I use the following functions and I propose to add them in the library as well.

For Log Likelihood -

import numpy as np
from sklearn.linear_model import LogisticRegression

def log_likelihood(model, X, y):
"""Calculate the log-likelihood of a binary logistic regression model.

Parameters
----------
model : sklearn.linear_model.LogisticRegression
A trained binary logistic regression model.
X : array-like, shape (n_samples, n_features)
Feature matrix.
y : array-like, shape (n_samples,)
Binary class labels.

Returns
-------
log_likelihood : float
The log-likelihood of the model.
"""

# Get predicted probabilities
pred_probs = model.predict_proba(X)[:, 1]

# Calculate log-likelihood
log_likelihood = np.sum(y * np.log(pred_probs) + (1 - y) * np.log(1 - pred_probs))

return log_likelihood

For Null Log Likelihood -

import numpy as np
from sklearn.metrics import log_loss

def null_log_likelihood(y):
"""Calculate the null log-likelihood of a binary logistic regression model.

Parameters
----------
y : array-like, shape (n_samples,)
Binary class labels.

Returns
-------
null_log_likelihood : float
The null log-likelihood of the model.
"""

# Calculate the proportion of positive class labels
p0 = y.mean()

# Create an array of predicted probabilities equal to the proportion of positive class labels
probs = p0 * np.ones_like(y)

# Calculate the null log-likelihood using the log_loss function from scikit-learn
null_log_likelihood = -log_loss(y, probs, normalize=False)

return null_log_likelihood

Describe alternatives you've considered, if relevant

One alternative to adding these functions to Scikit-learn would be for users to use statsmodels.

However, adding these functions to Scikit-learn would make it easier for users to calculate log-likelihood and null log-likelihood within the Scikit-learn ecosystem and would provide a standardized implementation.

Additional context

No response

Issue 2:
Describe the workflow you want to enable

I'd like to evaluate models by "percentage of reduction in metric X", where X is:

LogLoss

absolute error

pinball loss

As d2_tweedie_score #17036, these are generalizations of the r2_score.

Describe your proposed solution

Add

d2_log_loss_score

d2_absolute_error_score

d2_pinball_loss_score

Describe alternatives you've considered, if relevant

No response

Additional context

See #17036 (comment).
Issue 1:
System info

Playwright Version: [v1.XX]

Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.]

Browser: [All, Chromium, Firefox, WebKit]

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

// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
globalSetup: require.resolve('./global-setup'),
use: {
testIdAttribute: 'data-test-id',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
},
});

Test file (self-contained)

// global-setup.ts
import { chromium, expect } from '@playwright/test';

async function globalSetup() {
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
try {
await context.tracing.start({ screenshots: true, snapshots: true });
await page.setContent(
`<input id='checkbox' data-test-id="test" type='checkbox'></input>`
);
await expect(page.getByTestId('test')).toBeVisible(); //unable to find it
await context.tracing.stop({
path: './test-results/setup-trace.zip',
});
await browser.close();
} catch (error) {
await context.tracing.stop({
path: './test-results/failed-setup-trace.zip',
});
await browser.close();
throw error;
}
}

export default globalSetup;

Steps

[Run the test]

[...]

Expected

The global setup should respect the testIdAttribute set in the config file.

Actual

The global setup does not pick up the testIdAttribute set in the config file.

Issue 2:
use case: in sapui5 applications, there's usually a duplicated invisible version of every element on the page, meaning that to interact with most fields we need to add additional logic to make sure it's getting the right selector:

const handle = (await page.querySelectorAll(selector).find(element => element.isVisible())
await page.click(handle)

it would be nice if there was an option in the methods that take selectors to filter out invisible ones, ie:

await page.click(selector, {includeInvisible: false})

or alternatively, if #9153 is implemented it would be as simple as adding :not(:matches-css(display: none)) to the selector