WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Suppose we wish to classify some examples where one class is relatively rare.

import pandas as pd,numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
from random import choice

df0=pd.DataFrame(np.random.normal(size=(100,3)))
df1=pd.Series([choice([-1,1]) for i in xrange(df0.shape[0])])
df1.iloc[-1]=0
df2=pd.Series(np.ones(df0.shape[0])/df0.shape[0])

clf=RandomForestClassifier(n_estimators=10)
score=cross_val_score(clf,X=df0,y=df1,cv=10,scoring='neg_log_loss',fit_params={'sample_weight':df2.values}).mean()

This will spit the error:

*** ValueError: y_true and y_pred contain different number of classes 3, 2. Please provide the true labels explicitly through the labels argument. Classes found in y_true: [-1 0 1]

This is a known problem for log_loss, which was fixed by adding an argument labels to that function: #4033

The problem above is, cross_val_score invokes that function, but does not allow us to pass the labels. Ideally, cross_val_score should be able to infer the true labels from y=df1.

sklearn version '0.18.1'

Issue 2:
Moving the discussion with @amueller from pydata/patsy#77 (comment).

Proposing to:

add an optional 'labels' argument to log_loss

add an argument to make_scorer to enable passing labels argument to the custom loss function

Related to this - perhaps also allow make_scorer's need_threshold = True to be used for non-binary classification problems. Not sure why it's limited to binary. Totally meaningful for multi-class situations, where the metric might use the decision function to evaluate based on the rank order or something (for example, SVC doesn't have a cheap predict_proba, but has a cheap decision_function, so it would allow it to be used with rank-based metris). From make_scorer perspective, it just seems like a completely arbitrary restriction because it shouldn't care about what the custom loss function does with the decision_function output.
Issue 1:
Greg Wiley opened SPR-3519 and commented

Using the AspectJ annotation configuration method.

If two advice apply to the same join point and the lower-priority advice has (non JP) parameters, those parameters will not be bound.

This occurs in Spring 2.0.5 but not in Spring 2.0.2.

Only jars on the CP are those in the -with-dependencies Spring distribution.

\spring-framework-2.0.5\lib\aspectj\aspectjrt.jar

\spring-framework-2.0.5\lib\aspectj\aspectjweaver.jar

\spring-framework-2.0.5\lib\asm\asm-2.2.3.jar

\spring-framework-2.0.5\dist\spring-aspects.jar

\spring-framework-2.0.5\dist\spring.jar

\spring-framework-2.0.5\lib\jakarta-commons\commons-logging.jar

\spring-framework-2.0.5\lib\asm\asm-commons-2.2.3.jar

\spring-framework-2.0.5\lib\asm\asm-util-2.2.3.jar

Demonstration spike attached.

Note that in the demonstration, the exception can be eliminated by either:

removing one of the advice classes from the configuration

re-ordering the advice (so that the non-arg advice is lower priority)

switching to Spring 2.0.2

This problem has been documented by others in the Spring forums.

-dub

Affects: 2.0.5

Attachments:

eg.zip (2.04 kB)

Issue Links:

#8155 Bad interactions betwen advice when one binds the original method parameters and one does not. ("duplicates")

Issue 2:
Tom DeWire opened SPR-3472 and commented

Repeated from my original forum post: (http://forum.springframework.org/showthread.php?t=38619)

We have two pieces of advice that we would like to execute "around" a service method. The service method takes a single parameter.

The first piece of advice (AdviceA in this example) wants to capture all of the methods in the class. It does not care about the parameters passed into those methods.

The second piece of advice (AdviceB in this example) wants to capture a specific method. It does care about the parameter. It wants to record this transaction into the logs if certain criteria are met.

This was all working fine in spring 2.0.2. We recently attempted to upgrade to 2.0.5, and we ran into some failures. We backed off the versions and determined the root cause appears to be a change introduced with 2.0.3.

Specifically, we're receive this error immediately after calling proceed() from the first piece of advice:

Exception in thread "main" java.lang.IllegalStateException: Required to bind 2 arguments, but only bound 1 (JoinPointMatch was NOT bound in invocation)

It seems worth noting that either of these pieces of advice will execute just fine if they are allowed to execute alone. It is only when both pieces of advice are applied that we run into this issue.

I've managed to replicate this behavior in a very small test. I'll attempt to attach that to this bug (if i'm allowed to do that sort of thing).

Affects: 2.0.3, 2.0.4, 2.0.5

Attachments:

aop-test.zip (12.96 kB)

aop-test-dependencies-corrected.zip (13.13 kB)

Issue Links:

#8202 around advice does not bind parameters if another advise is active on same join point ("is duplicated by")
Issue 1:
although VS Code recognize that the markup is indeed handlebars, it is unable to format it.

So format code option does nothing

Issue 2:
VSCode Version: 111

OS Version: OSX current

Hello,

are there any reliable way to use auto format code on templates such as handlebars or ejs ?

I see that there is in user settings an indent setting support for handlebars, but this is not accessible in handlebars mode, only in html mode. This is inconsistent.

Also if I try a template language like EJS (for which there is an extension), in ejs mode there is no auto format, and in html mode every <% is considered as opening html tag which produce catastrophic auto format code. And we have no intellisense for js code in ejs templates (html or ejs mode).

All in all, unless I miss something, I find it hard to work with templates in vscode and I suggest an improvement on this.
Issue 1:
Hi, when using it, simple switch the button up to xl one. When you try to generate a prediction of words; it will simply never load regardless of what all the other setting are on. Every other gpt2 model size works; expect the xl one. Tried it on Android and Linux same problem and different browsers Firefox and Google Chrome same problem nothing to with addons cause the same problem occurs with them all off.

Issue 2:
When setting the model size to gpt2/xl, WwT gets stuck on loading the autocomplete.

Checking Chrome's console tells me

"Failed to load resource: the server responded with a status of 502 (Bad Gateway)"

Having a quick look through the older tickets, I saw that this has happened before. #2121
Issue 1:
After upgrading to React 15.0.1 or 15.1.0 I'm not able to use printWasted from Perf tools.

React 15.0.1 throws error:

ReactDefaultPerfAnalysis.js:177 Uncaught TypeError: Cannot read property 'forEach' of undefined(…)

React 15.1.0

warning.js:44 Warning: There is an internal error in the React performance measurement code. We did not expect componentDidMount timer to stop while no timer is still in progress for another instance. Please report this as a bug in React

I discovered that error is connected with returning null. A lot of my components have something like that

render: function() {
if (!this.props.visible) {
return null;
}
// ...
}

And when I try to measure one of those components I will get above error. Removing conditions from components fixes problem.

Issue 2:
After upgrading to 15.1.0 I'm having trouble using the React Perf tools. I've done the following:

Added to one of my files:

import Perf from 'react-addons-perf';
window.Perf = Perf;

I then launch my app in Chrome. Open the Dev Tools and run this in the console:

Perf.start();
Perf.stop();
Perf.printWasted();

And I get:

TypeError: Cannot read property 'forEach' of undefined
getWasted @ 7.7.js:149515
printWasted @ 7.7.js:149666
(anonymous function) @ VM508:1

The failure is on this line: flushHistory.forEach(function (flush) {.

The same behaviour occurs for all other print* method such as printInclusive() and printExclusive().

The same behaviour occurs if I put the commands into my code (ie. NOT running in the Chrome Console).
Issue 1:
Describe the workflow you want to enable

Like in R, can we add an option of offset in sklearn so that we can fix the value of some coefficients for logistic regression?

For those who don't know offset, offset is defined as a fixed feature with coefficient being 1. Therefore, if $y=g(x\beta + z\alpha)$ and we want to choose some pre-determined value $\alpha_0$, we can just pass $z\alpha_0$ to offset.

Describe your proposed solution

I feel this might be straightforward but, as someone who doesn't know the original code/module that well, it would be great if someone can give any advice on if this is feasible. Also any suggestions on its functionality would be helpful.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Issue 2:
Describe the workflow you want to enable

As described at #24155, GLM should also support the offset option.

Describe your proposed solution

For example

from sklearn.linear_model import PoissonRegressor

glm = PoissonRegressor(
alpha=0,
fit_intercept=False,
max_iter=300,
offset=A # offset option
)
glm.fit(X_train, y_train)

Describe alternatives you've considered, if relevant

No response

Additional context

No response
Issue 1:
When generating URLs, named parameters are usually passed like this:

$uri = $router->generate('blog_show', array('slug' => 'my-blog-post'));

It would be cool if one could pass an object that implements the ArrayAccess interface, too. That would make generating routes for models incredibly easy (and allow for changing the URL parameters without changing the places where the URLs are generated).

Something like this:

$uri = $router->generate('blog_show', $post);

Quite possibly the current implementation loops through the array and then tries to replace the appropriate placeholder if it exists. For this to work, that implementation would obviously have to be reversed - take the route, search for placeholders and then look for the corresponding parameters.

Not sure, maybe this is already possible, I wasn't very successful digging through the code.

Issue 2:
For Symfony2 Router with the help of standart bundle (sensio extra) we can write ParamConverters to convert request param=>object. Is there any standart way to use reversed convertion?

Now we must do something like this:

path('DevBlogBundle_post_show',{'post':post.id})

While a better way would be:

path('DevBlogBundle_post_show',{'post':post})

I've found even example jist:

https://gist.github.com/stevelacey/3226510

Maybe, we should think about adding such functionality to future releases of, for example, sensioFrameworkExtra bundle?

If there is no such functionality, is bundle providing such extension would be needed?

Thanks.
Issue 1:
(*** This section is for bug reports and feature requests only. This is NOT a help site. Do not ask help questions here. If you need help, please use stackoverflow. ***)

Description of the problem

It seems like the standard geometries have faces as indices/elements. But it appears like gl.drawArrays is being used. I'm assuming that there is a way for drawElements to be used instead, to minimize the attribute buffer sizes, using the face element/index values.

Also, as I get into ShaderMaterials, I'd prefer to have attribute arrays the size of the number of unique vertices, with color, positions etc the same size as well, using drawElements to manage duplications .. i.e. 4 vertices per rectangle, with 6 elements for its two triangles.

What is the method used to have WebGLRenderer use drawElements? Possibly WebGLIndexedBufferRenderer?

Three.js version

Dev

r84

...

Browser

All of them

Chrome

Firefox

Internet Explorer

OS

All of them

Windows

Linux

Android

IOS

Hardware Requirements (graphics card, VR Device, ...)

Issue 2:
It would be great if derived Materials (e.g. Phong, Normal, etc.) allowed the user to pass an existing instance of a material to the Clone() method, as you can with base materials.

I think this would just require (Phong for example):

if ( material === undefined ) material = new THREE.MeshPhongMaterial();
Issue 1:
# routes.yml

app_index:
pattern: /

vendor_bundle_index:
alias: app_index

Issue 2:
I'm writing a code that implements a serializer interface but I dont want (dont need) to include all Symfony Serializer implementation code to my project, therefore I've just copied SerializerInterface.php to my project to use it.

Then my question is to create a packagist library for SerializerInterface to use as standard (like PSR-7) and add this "new" library as dependency of symfony/serializer.

Regards.
Issue 1:
Any chance of adding this? I noticed the meshes have a visibility property, but I couldn't find a method to calculate visibility to the camera.

Issue 2:
(dev/examples/js/loaders/ObjectLoader.js from commit e3290e3f09)

The ObjectLoader actually relies on the order of geometries to assign (child-) objects to geometries. would it be possible to use unique id's instead? I am just experimenting with a php backend, that is converting Objects to ObjectLoader compatible json. Having a lot of objectgroups with children, keeping the geometries idx in sync with the order of geometries is quite complicated. Using a unique ID instead would be much cleaner.

in Line 249 it fetches the geometry by data.geometry:

object = new THREE.Mesh( geometries[ data.geometry ], materials[ data.material ] );

this code could also access the geometry with a uuid in data.geometry, but the length method in line 55 won't work if json contains a geometries object instead of an array:

for ( var i = 0, l = json.geometries.length; i < l; i ++ ) {

same for the code that is adding the json geometris to the geometries array on line 157:

if ( data.name !== undefined ) geometry.name = data.name;
geometries.push( geometry );

changing this to

if ( data.name !== undefined ) geometry.name = data.name;
if (data.uuid !== undefined) geometries[data.uuid] = geometry;
else geometries.push( geometry );

seems to work when I pass a json gemotries-array with uuid in every geometry.

Cheers,

Björn
Issue 1:
When I use %matplotlib notebook it creates bigger plots like #4853 but also offsets the entire image.

%matplotlib inline
sns.palplot(sns.color_palette("cubehelix", n_colors=50))

%matplotlib notebook
sns.palplot(sns.color_palette("cubehelix", n_colors=50))

Issue 2:
Is this a bug or intended behavior?

I'm using matplotlib 1.4.3 and IPython 3.2.0 on OS X via conda.

Here's an example of what I see:
Issue 1:
I click in the block of code where I need to make an edit, but when I begin typing it appears randomly somewhere else in the block of code.

Problem on many pages. Mac/Chrome

Thanks.

Challenge Use the Bootstrap Grid to Put Elements Side By Side has an issue.

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36.

Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
</style>

<div class="container-fluid">
<h2 class="red-text text-center">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

<img src="https://bit.ly/fcc-running-cats" class="img-responsive">
<button class="btn btn-block btn-primary">Like</button>
<button class="btn btn-block btn-info">Info</button>
<button class="btn btn-block btn-danger">Delete</button>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>

Issue 2:
Style Text Inputs as Form Controls

https://www.freecodecamp.com/challenges/style-text-inputs-as-form-controls

Issue Description

My cursor will not move through the code editor properly. I will try to select a spot in the code and I just can't. This has been an issue through multiple challenges. A hard refresh fixes it some of the time but it just keeps happening. It isn't my equipment either. I have tried restarting my computer. I have a mouse, touchscreen, and keyboard and none of them work properly while trying to move through.

Browser Information

Browser Name, Version: Firefox, 45.0.2

Operating System: Windows !0

Mobile, Desktop, or Tablet: Desktop.
Issue 1:
VSCode Version:

OS Version:

Steps to Reproduce:

Launch app and Open any CSS file

Try to add some color property to any css class

Press # to get color options.

Actual:

It is displaying only few color options.

When user insert some value with #code (like : #00) and then intellisense is not guiding.

Expected:

When user press # or #00 then it should display all the available color options.

I tried with Visual Studio 2015 and Visual studio is showing correct options and guiding properly to choose color with # code.

Issue 2:
It could be great have a color picker to update color.

For example, when you have a CSS file like this :

A color picker could be generated when you click on the colored element.
Issue 1:
My screen resolution is 2k, dpi zoom 200%

For example:

This is the picture displayed after running

And this is an image saved with dpi = 300

My point is that gui applications are not ideal for displaying on high-resolution screens.

Issue 2:
Bug report

The plots done with "TkAgg" backend look blurry on retina screen of my Mac Book Pro. The plots look good when I'm using the default "MaxOSX" backend. It would be nice to have retina-friendly output for "TkAgg" since I'm using the plots into a tkinter GUI app.

Code for reproduction

import matplotlib
matplotlib.use('TkAgg') # Remove this to compare with MacOSX backend
import matplotlib.pyplot as plt

f = plt.figure(figsize=(6, 4))
a = f.add_subplot(111)
a.plot([1,2,3,4])
plt.show()

Actual outcome

The plots and toolbar look blurry on "TkAgg" backend.

Expected outcome

The plots and toolbar look sharp, just like on "MaxOSX" backend.

Matplotlib version

Operating system: MacOS 10.13.2

Matplotlib version: 2.1.2

tkinter.TkVersion: 8.5

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

Python version: 3.6.4

I've installed python from https://www.python.org/downloads/mac-osx/, clicking on Download menu and selecting Python 3.6.4 for MacOS.

If I create a tkinter app, other elements like labels, menus are sharp as well, only the plot is blurry. This indicates that tkinter is capable of showing sharp graphics, the question is how to do it.
Issue 1:
Related to #3714.

With the changes to emitting modules with the "use strict"; prolog, TypeScript is not applying the appropriate level of code checking to catch block scoped function declaration.

TypeScript Version:

1.8.2+

Code

Playground Link

export function foo() {
return 'foo';
}

if (true) {
function bar() { /* should throw error that functions must be declared at the top level */
return 'bar';
}
}

Expected behavior:

Error at block level function declaration.

Actual behavior:

No error and an invalid emit.

Issue 2:
From the kangax compatibility table (related test):

14 Note that prior to ES6, it was recommended that ES5 implementations forbid block-level declarations in strict mode.

In ES6, block-level function declarations have block scoping in strict mode. Currently the following is a compiler error in TypeScript:

"use strict";
function f() { // error TS2393: Duplicate function implementation.
return 1;
}

{
function f() { // error TS2393: Duplicate function implementation.
return 2;
}
console.log(f() === 2);
}

console.log(f() === 1);

We should consider the following changes:

Allow the above in ES6 when in strict mode, with the function declaration f being block-scoped with respect to name resolution.

For ES5 strict-mode, allow the above with the following emit:

"use strict";
function f() {
return 1;
}

{
function f_1() {
return 2;
}
console.log(f_1() === 2);
}

console.log(f() === 1);
Issue 1:
Hi,

I'm having some troubles with setting up a simple angular2 app with routing, when it's served directly through the server root. Example:

@RouteConfig([
{ path: '/', component: Workbench },
{ path: '/login', component: Auth },
{ path: '/home', component: Home }
])
export class App{

}

Where / is the root url of the http server.

Right now, navigating to /home or /login results in the same as navigating to /. After some investigation the problem seems to be the result of normalize: (inside location.ts)

normalize: function(url) {
return stripTrailingSlash(this._stripBaseHref(stripIndexHtml(url)));
},

Besides the url being set to "/login" the result of this._stripBaseHref(stripIndexHtml(url)) is "" (empty string). This happens because url and _baseHref (using HTML5LocationStategy) are exactly the same.

Looking at the getBaseHref function on the last version of browser_adapter (https://github.com/angular/angular/blob/011fab37af626535c1d5af7091d72e27d93f4391/modules/angular2/src/dom/browser_adapter.ts)

function relativePath(url) {
if (isBlank(urlParsingNode)) {
urlParsingNode = document.createElement("a");
}
urlParsingNode.setAttribute('href', url);
return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname;
}
(...)
getBaseHref: function() {
return relativePath(document.baseURI);
}

If we call getBaseHref("http://localhost:8000/login") what should be the expected outcome?

With the current implementation we are getting "/login", but it seems to me that we should get only "/" instead.

@btford can you please let me know your thoughts on this? If the change is on getBaseHref, the fix seems quite simple, I can submit a PR, I'm only checking with you guys the expected behaviour before doing anything.

Best regards,

Issue 2:
When you use <a router-link="foo">Link</a> with an accompanying <router-outlet></router-outlet>, the proper component's template appears in the outlet. The issue is when the user refreshes (on the proper URL extension, i.e., localhost:8080/foo), no templates are loaded (including the original app's template), leaving the page blank. As far as I can tell, what's happening is that as that URL only is marked to use the template of foo, so there is no outlet for it to show up in. There is the chance I am doing this wrong, but everything else is working properly.