WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
The following occurs when using pandas.merge for an (left) outer join with the left_index=True and right_on="something" options. The index of the resulting DataFrame contains duplicate values and the "something" column contains new (compared to before) values that look suspiciously like what the index should be.

Is this expected behavior, or could this be a bug?

A minimal illustration is:

In [2]: pandas.__version__
Out[2]: '0.14.0'

In [3]: df1 = pandas.DataFrame(zeros(8).reshape(4,2), columns=['A', 'B'])

In [4]: df2 = pandas.DataFrame(arange(4).reshape(2,2), columns=['C', 'D'])

In [5]: df1
Out[5]:
A B
0 0 0
1 0 0
2 0 0
3 0 0

In [6]: df2
Out[6]:
C D
0 0 1
1 2 3

In [7]: pandas.merge(df1, df2, left_index=True, right_on='C', how='left')
Out[7]:
A B C D
0 0 0 0 1
1 0 0 1 NaN
1 0 0 2 3
1 0 0 3 NaN

What I would expect as the result is the following and can be constructed by adding an extra column carrying the left index, doing the join with left_on instead of left_index, and dropping the extra column again:

In [8]: df1['i'] = pandas.Series(df1.index)

In [9]: pandas.merge(df1, df2, left_on='i', right_on='C', how='left').drop(['i'],axis=1)
Out[9]:
A B C D
0 0 0 0 1
1 0 0 NaN NaN
2 0 0 2 3
3 0 0 NaN NaN

Issue 2:
python uses 32 bytes for every int.

numpy uses 4 bytes for an int32 (with which you can index billion of keys).

We currently have a hardwired if preventing single-level multi-indexes,

which would allow us to take advantage of factorization to reduce memory

consumption by ~8x for indices which have lots of duplicates.

Indexes tend to be unique (by their nature). But the same principle goes

for string columns which are often highligh degenerate.

Basically, if we store catagorical data as catagorical, we can

reduce memory footprint drastically. If we do the factorization

at the stage where data is read in (perhaps in conjuction with the iterator based

reader planned for 0.14 #2193) we can drastically reduce the peak memory usage as well.

Update: #5313
Issue 1:
Julia 0.4 gets subtype relation wrong inside a function scope with tuple types:

immutable FakeMethod
sig::Type{Tuple} # no error below if leaving the type declaration off!
end

fmm = methods(sin, (Complex{Float16},))[1]
_sin(::String) = Float64()
tmm = methods(_sin, (String,))[1]
@assert !( tmm.sig<:fmm.sig)

tm = FakeMethod(tmm.sig)
fm = FakeMethod(fmm.sig)
# In global scope all works:
@show tmm.sig, fmm.sig
@show tm.sig, fm.sig
@show tm.sig<:fm.sig # true
@show fm.sig<:tm.sig # true
@show fm.sig==tm.sig # false
@show fm.sig===tm.sig # false
@assert !( tm.sig<:fm.sig )

function f(tmm, fmm)
println("\nInside function:")
tm = FakeMethod(tmm.sig)
fm = FakeMethod(fmm.sig)

@show tmm.sig, fmm.sig
@show tm.sig, fm.sig
@show tm.sig<:fm.sig # true!!!!!!!!!
@show fm.sig<:tm.sig # true!!!!!!!!!
@show fm.sig==tm.sig # false (true before #10380)
@show fm.sig===tm.sig # false
@assert !( tm.sig<:fm.sig ) # throws an error here
end
f(tmm,fmm)

Note that it works fine if the type is declared as:

immutable FakeMethod
sig
end

Issue 2:
typeassert is sometimes removed incorrectly for arguments of inline functions.

julia> function f(::Int)
return 1
end
f (generic function with 1 method)

julia>

julia> function f(::Float64)
return 2
end
f (generic function with 2 methods)

julia>

julia> function g(x)
a = x > 0 ? 1.0 : 1
if !isa(a, Int)
return f(a::Int)
else
return f(a::Float64)
end
end
g (generic function with 1 method)

julia>

julia> println(@code_typed g(1))
Any[:($(Expr(:lambda, Any[:x], Any[Any[:a],Any[Any[:x,Int64,0],Any[:a,Any,2]],Any[]], :(begin # none, line 2:
unless (top(slt_int))(0,x::Int64)::Bool goto 0
a = 1.0
goto 1
0:
a = 1
1: # line 3:
unless (top(box))(Bool,(top(not_int))(isa(a::Union(Int64,Float64),Int)::Bool)) goto 2 # line 4:
return 1
goto 3
2: # line 6:
return 2
3:
end::Int64))))]

julia> println(g(1))
1

julia> println(g(-1))
2

P.S. As recently brought up on the dev list, it would be nice to have a @inbounds equivalent for typeassert to be used (correctly) in this case.
Issue 1:
When I provide dataSource values in form of array with objects instead of strings with duplicated text values, for example:

[
{ text: 'Some Text', value: <span>{someFirstValue}</span> },
{ text: 'Some Text', value: <span>{someSecondValue}</span> }
]

AutoComplete component renders only one item in Menu because Menu children keys are not unique. It also logs a React error with flattenChildren(...) warning.

I know that providing duplicated text values to dataSource is not something normal but I believe that it should be possible. For example I discovered this bug when trying to implement AutoComplete for searching for Facebook fanpages, there could be several fanpages with the same name and I would like to show them all in Menu and provide some additional context for helping user to find desired fanpage. By additional context I mean something like id, photo, maybe link to fanpage.

I've tracked down fragment of AutoComplete component code that causes this error link:

if (typeof request.text === 'string') {
return React.cloneElement(request.value, {
key: request.text,
disableFocusRipple: this.props.disableFocusRipple,
});
}

And I would be more than happy to provide a PR with fix.

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

There seems to be a problem with the typings for TableCellClassKey. In TableCell.d.ts the classname for compact cells is paddingCompact, but in TableCell.js, I see paddingDense being used.

This results in the following warning when trying to override the compact padding:

Warning: Material-UI: you are trying to override a style that does not exist.
Fix the `paddingCompact` key of `theme.overrides.MuiTableCell`.

theme.overrides.MuiTableCell = {
paddingCompact: {
padding: '8px 4px',
},
};

Version: latest beta version
Issue 1:
This is all I see when right clicking on the task bar icon.

Issue 2:
VSCode Version: 0.10.12-alpha

OS Version: MAC OS X EI captian (Version 10.11.2)

Steps to Reproduce:

launch app and play around help menu to make application to be crashed (current behavior) or try to perform any action which makes VSCode to be crashed on MAC.

Once you get the alert window for crash click on "Reopen" button and verify application behavior.

Actual:

VSCode re-launched successfully but it is not displaying in the active program list at the bottom right corner where all the active programs are listed.

Menu bar at the top is not changing according to VSCode so MAC is unable to recognize VSCode active session. Menu bar items are displaying for the last active window though the focus is on VScode. In my case it was "Safari".

Note: I am not certain if this is the common behavior on MAC for crashed app.

3. When I try to uninstall app, it is keep throwing pop-up that the app is running and can't trash. But there is no active session anywhere. I observed that the app stuck with Finder and user has to forcefully close finder first. After forcefully closing finder and re-launching VSCode , it is working as expected.
Issue 1:
Hi,

I was trying to profile the code provided in this OpenBLAS issue.

It was a simple modification that wraps the code inside a function and then calls it

function f()
tic()
for ii in 1:1e4
# BD
W_bd, S, U = bd_precoding(H, antennas_tx, antennas_rx)
p_tx_bd = equal_power_assignment(W_bd, antennas_tx, antennas_rx, p_max)
....
stream_rate_bd = log2(1 + p_tx_bd .* S / sigma_n)
....
# ZF
W_zf = zf_precoding(H)
p_tx_zf = equal_power_assignment(W_zf, antennas_tx, antennas_rx, p_max)
stream_rate_zf = log2(1 + p_tx_zf * ones(number_of_bs * antennas_rx) / sigma_n)
end
toc()
end

@profile f()

However, when I ran this code, in the first 2 instances I got a segmentation fault 11. After that the code just went into an non-terminating state, and I had to stop processing after around 5 mins of execution.

htop was showing cores being used, so it's possible that the code was running but was terribly slowing down due to the profiler, or it entered some kind of infinite loop.

I ran this code a couple of times (in original) without the @profile and it completed comfortable after about 80 seconds.

Issue 2:
If I fully specify the type parameters for a constructor and the arguments are compatible, I expected it to work. However, I'm seeing errors from the default constructor:

julia> struct Struct1{T,S>:T}
x::S
end

julia> Struct1{Int,Real}(0)
ERROR: UndefVarError: S not defined
...

julia> struct Struct2{T,S>:T}
x::S
Struct2{T,S}(x) where {T,S} = new{T,S}(x) # no bound for S
end

julia> Struct2{Int,Real}(0)
Struct2{Int64, Real}(0)

I can also get the same error with a manual constructor with the same bound:

julia> struct Struct3{T,S>:T}
x::S
Struct3{T,S}(x) where {T,S>:T} = new{T,S}(x)
end

julia> Struct3{Int,Real}(0)
ERROR: UndefVarError: S not defined
...

But, interestingly, it doesn't happen with the upper bound T<:S

julia> struct Struct4{S,T<:S}
x::S
end

julia> Struct4{Real,Int}(0)
Struct4{Real, Int64}(0)

julia> struct Struct5{S,T<:S}
x::S
Struct5{S,T}(x) where {S,T<:S} = new{S,T}(x)
end

julia> Struct5{Real,Int}(0)
Struct5{Real, Int64}(0)

I wonder if this is a symptom of what @JeffBezanson described in #39280 (comment)

It helps here to understand that two different processes are happening: (1) picking a method to call, and (2) once inside the method, determining the value of T (#39277 has a similar concern).

But, since Struct1{Int,Real}(0) specifies the type, would it be possible to use the specified types as-is in the method body?
Issue 1:
Challenge Factorialize a Number has an issue.

User Agent is: Mozilla/5.0 (Windows NT 5.1; rv:47.0) Gecko/20100101 Firefox/47.0.

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

My code:

var count=1;
function factorialize(num) {
for(var i=1; i<=num;i++){

count= count * i;

}
return count;

}

factorialize(0);

Issue 2:
Challenge Name

Mainly JavaScript challenges

Issue Description

We've had many coding issues made on GitHub (a list of some from the past few months: #9532, #9137, #9118, #8940, #9058, #8436, #8266, #8156, #8092 [comment within this issue], #7655, #7441, #7629, #7470, #7453, #7442, #5290, #4819, #4733, #4686, #4187, #3755, #1345) on why their code doesn't work, which turn out to be because they have a global variable they mutate with their function.

Proposed Fix (Updated)

Somewhere early in the JavaScript challenges have a note on how the tests work, in that they will only run your function and any global variables mutated in the process will keep their state.

Detect unsafe global variable code and wrap them in isolated blocked scope.

Display a notification in such cases if applicable and tests fail to run.

cc/ @freeCodeCamp/moderators
Issue 1:
Challenge http://www.freecodecamp.com/challenges/waypoint-make-images-mobile-responsive has an issue. Please describe how to reproduce it, and include links to screenshots if possible.

My code is correct according to the challenge, but this piece still is marked as undone:

Add a second image with the src of http://bit.ly/fcc-running-cats.

Screenshot is attached.

Issue 2:
Not sure what caused it, and I can't duplicate it.

Also, a pink notice popped up saying I had completed all the waypoints and was ready to work on non-profits, which is obviously erroneous.
Issue 1:
ROC-AUC SVM classification results for random, normally distributed data does not produce a symmetric distribution around 0.5. A tail of high ROC-AUC scores can be observed:

You can find more information in the Discussion thread (link). Here is the code to reproduce the result:

import numpy as np
from sklearn.datasets import make_classification
from sklearn.feature_selection import SelectKBest
from sklearn.model_selection import GridSearchCV, RepeatedStratifiedKFold
from sklearn.metrics import roc_auc_score
from sklearn.pipeline import Pipeline
from sklearn.svm import SVC
import matplotlib.pyplot as plt
import itertools

r = 1
# Data-set dimensions and imbalance to match original data.
X, y = make_classification(n_samples = 105, n_features = 24, weights = [27/105], random_state = r)
scores = list()
for rng in range(100):
X = np.random.normal(size = X.shape)
clf = Pipeline([('anova', SelectKBest()), ('svc', SVC(kernel = 'linear'))])

# Reduced grid-search for convenience
K = [1, 2, 5]
C = [0.1, 1]

space = dict()
space['anova__k'] = K
space['svc__C'] = C

scores_ = list()
cv_out = RepeatedStratifiedKFold(n_splits = 10, n_repeats = 10, random_state = r)
for train_indx, test_indx in cv_out.split(X, y):
X_train, y_train = X[train_indx, :], y[train_indx]
X_test, y_test = X[test_indx, :], y[test_indx]

cv = RepeatedStratifiedKFold(n_splits = 5, n_repeats = 5, random_state = r)
search = GridSearchCV(clf, space, scoring = 'roc_auc', cv = cv, refit = True, n_jobs = -1)
result = search.fit(X_train, y_train)
best_model = result.best_estimator_

y_pred = best_model.decision_function(X_test)

scores_.append(roc_auc_score(y_test, y_pred))

scores.append(scores_)
print('Rng iteration:', rng + 1, '/ 100')

plt.hist(np.mean(np.array(scores), axis = 1))
plt.xlabel('ROC-AUC')
plt.show()

I am not sure whether this result is to be expected, is due to a flaw in my code, or something else altogether. It might just as well be a trivial matter and I apologize if this is not the right place to ask: prior to here and in addition to the Discussion thread linked above, I have also asked this question in Stack Overflow (link), r/learnpython (link) and r/scikit_learn (link) over the past week, receiving no answer.

Please let me know if there is anything I can do to help receiving an answer.

Issue 2:
LSHForest should be deprecated and scheduled for removal in 0.21. It should also warn about having bad performance. cc @ogrisel
Issue 1:
I read that there is/was a problem on tray right-clicked event. It is/was triggering clicked as well. I'm not sure it's fixed or not.

I'm trying to show the contextMenu only on right-clicked to tray icon in Mac.

I tried to preventDefault from click and right-clicked events, no luck. If there is a contextMenu on a tray, It anyway shows the context menu and doesn't run the code i have in the clicked event (I'm showing/hiding the window by single click)

I'm looking a way/workaround to show the contextMenu when only right clicked.

Tev.

Issue 2:
I'm not sure what the API would look like, nor am I confident how this would work cross-platform, however the current implementation of the tray context menu is force-bound to the primary click action (at least on Mac).

Would rather the ability to perform a different primary action on click but display the context menu on right click.

Would it be possible and make sense to expose this kind of configuration? Perhaps exposing the underlying mechanisms (menu + positioning? Not a native dev so ¯\_(ツ)_/¯) to recreate a tray context menu without setContextMenu?
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

我在ProviderConfig.setDispatcher()里面发现了如下代码：

I found the following code in ProviderConfig.setDispatcher()：

public void setDispatcher(String dispatcher) {
checkExtension(Dispatcher.class, Constants.DISPATCHER_KEY, exchanger);
checkExtension(Dispatcher.class, "dispather", exchanger);
this.dispatcher = dispatcher;
}

我不明白为什么需要在这里做这个检查。

I don't understand why this method needs to do this check here.

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

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.7

Operating System version: windows 10

Java version: 14

Steps to reproduce this issue

in configuration file, we add: dubbo.protocol.codec=exchange

Startup the server, it throws an exception: No such extension exchange for codec/org.apache.dubbo.remoting.Codec

I think this is caused by the Codec is Deprecated, while, SPI related code still use Codec, not Codec2
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

"asPath" information should be present in url objects that are passed as

properties to components, as documented in:

https://github.com/zeit/next.js/blob/master/readme.md#with-link

Each top-level component receives a url property with the following API:

...

asPath - String of the actual path (including the query) shows in the browser

...

Current Behavior

"asPath" is not present in url objects

Steps to Reproduce (for bugs)

Check out the "url" properties of page components to see that "asPath" is missing

Notes

I'm aware that I can get "asPath" from the router object, but it looks like I should be able to get it from the url object as well.

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

Expected Behavior

Want to use Next.js in a mobile webapp, OnsenUI component is very rich. Want to use it with Next.js.

Current Behavior

OnsenUI can't SSR. window is not defined error.

ReferenceError: window is not defined
at window (/Users/chris/Projects/my-projects/home_seek/frontend/node_modules/core/src/ons/styler.js:27:18)
at /Users/chris/Projects/my-projects/home_seek/frontend/node_modules/core/src/ons/styler.js:26:16
at onsElements (/Users/chris/Projects/my-projects/home_seek/frontend/node_modules/onsenui/js/onsenui.js:4:82)
at Object.<anonymous> (/Users/chris/Projects/my-projects/home_seek/frontend/node_modules/onsenui/js/onsenui.js:7:2)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at /Users/chris/Projects/my-projects/home_seek/frontend/node_modules/react-onsenui/dist/react-onsenui.js:4:145
at Object.<anonymous> (/Users/chris/Projects/my-projects/home_seek/frontend/node_modules/react-onsenui/dist/react-onsenui.js:7:2)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)

Steps to Reproduce (for bugs)

import * as Ons from 'react-onsenui';
export default ({ handleClick }) => (
<div>
<Ons.Page>
<Ons.Button onClick={handleClick}>Tap me!</Ons.Button>
</Ons.Page>
</div>
);
Issue 1:
Challenge Create a Form Element has an issue.

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 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>

<h2 class="red-text">CatPhotoApp</h2>

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back. " src="https://bit.ly/fcc-relaxing-cat"></a>

<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"> <input type="text" placeholder="cat photo URL"></form>

Issue 2:
The "Go to my next Challenge button" is enabled without meeting the first two conditions :

-Your h2 element should degrade to the font "Monospace" when "Lobster" is not available.

-Your h2 element should degrade to the font "Monospace" when "Lobster" is not available.

Also the conditions are repeats; there should be only 1.
Issue 1:
my model:

class Test(db.Model):
__tablename__ = "Test"
STN = db.Column(db.String(3), nullable=False, info='')
BEG_DATE = db.Column(db.Date, nullable=False, info='')
END_DATE = db.Column(db.Date, nullable=False, info='')
PRICE = db.Column(db.String(3), nullable=False, info='')
REMARK = db.Column(db.String(255), nullable=True, info='')

when I run my flask app, its tips could not assemble any primary key columns for mapped table,Mysql database can create a database without a primary key, Why do I have to set the primary key?I don't want to set the primary key, how can I solve it?

Issue 2:
Migrated issue, originally created by Anonymous

Attaching a patch (for 0.6 and for 0.7) to support this:

u = table1.update().values(name=table2.c.othername)\
.where(table2.c.otherid == table1.c.myid)

compiling to:

UPDATE mytable SET name=myothertable.othername
FROM myothertable WHERE myothertable.otherid = mytable.myid

(i.e. the FROM clause is inferred from the extra from-objects in the WHERE clause and the SET columns)

Unit tests included. Doesn't break any existing tests in either 0.6 or 0.7 (and I think this doesn't modify behavior in any use case that wasn't broken anyway).

Attachments: sqlalchemy-support-update-from-0.6.patch | sqlalchemy-support-update-from-0.7.patch | 2166.patch
Issue 1:
When I try to upgrade npm via the suggested method in the console:

npm install -g npm@8.3.0

it fails with the following error:

npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/npm',
npm ERR! dest: '/usr/local/lib/node_modules/.npm-i9nnxROI'
npm ERR! }
npm ERR!

When I try to run it with sudo:

npm ERR! code EPERM
npm ERR! syscall lchown
npm ERR! path /usr/local/bin/sentinelctl
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, lchown '/usr/local/bin/sentinelctl'
npm ERR! [Error: EPERM: operation not permitted, lchown '/usr/local/bin/sentinelctl'] {
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'lchown',
npm ERR! path: '/usr/local/bin/sentinelctl'
npm ERR! }

sentinelctl is control panel for Sentinel One antivirus, I guess its one of their security measures to make it not chown-able.

OS: OSX 11.6.1

npm --version

7.20.3

Issue 2:
Is there an existing issue for this?

I have searched the existing issues

This issue exists in the latest npm version

I am using the latest npm

Current Behavior

After running sudo npm i -g foo files under /usr/bin that were owned by root are now owned by the current user.

I ran sudo npm i -g typescript and it was installed correctly I think. Then I ran sudo npm i -g vscode-langservers-extracted and I got sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set.

I think the packages I installed are irrelevant because I still get the same errors after installing other packages globally with sudo.

This looks similar to #19883 but as far as I can see, only /usr/bin/ files are affected.

Expected Behavior

npm should not change ownership of files under /usr/bin

Steps To Reproduce

In this environment...

Linux

npm v8.1.3

With this config...

Default

Run 'sudo npm i -g typescript' (the package doesn't matter)

See: files under /usr/bin changing ownership

In this video, you can see what happens. When I stop writing is because I'm going to another tty as root to execute chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo. The video also shows npm with version v8.0.0 but I updated to v8.1.3 and the same thing happens.

2021-11-07.14-39-43.mov

Environment

npm: 8.1.3

Node: 16.11.0

OS: Linux 5.10.70-1-MANJARO

platform: Desktop amd64

npm config:

; node bin location = /usr/bin/node
; cwd = /home/emi2k01/Documents/facu/tecmul/proyectofinal
; HOME = /home/emi2k01
; Run `npm config ls -l` to show all defaults.