WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
REPOST of #14403 because closed prematurily and not sure the other question I just posted could be reopened (newbie here) but I certainly could not and I think this is an important thing that needs to be sorted out, but if rules entails to continue the conversation on the other post, please delete this one and we will do so.

_OLD_

I just discovered a bug that has been giving me a headache.

Basically I was using a jqvmap and when clicking on a country I would create a popup with some info.

So I initialize the popup as follows:

$('.jvectormap-region').popover({
placement: 'left',
container: '#vmap',
html: 'true',
title: ' ',
});

and onClick I would do this:

$('#vmap').bind('regionClick.jqvmap',
function(event, code, region) {
var baseRegionId = "#jqvmap1_";
baseRegionId = baseRegionId + code;

if ($('#vmap [id^="popover"]').length > 1) {
$('#vmap [id^="popover"]').first().remove();
}

var snapshot_url = "http://www.business-anti-corruption.com/country-profiles/europe-central-asia/" + region + "/snapshot.aspx";

$(".popover-title").html(region);
$(".popover-content").html('<a href=' + snapshot_url + ' target="_blank">Snapshot</a></br><a href="#">page 2</a></br><a href="#">page 3</a></br><a href="#">page 4</a></br>');

}
);

So basically if there was already a popup on screen I would delete it so that the newly created popup will be alone in the page. Problem is that exactly the 6th time I was clicking on a country a popup would not be created!

I ran this multiple times and ALWAYS happened.

I solved it by triggering it manually and the issue is then resolved, but this is something that needs to be fixed..

_NEW_

UPDATE:

You can see this I just uploaded to a site of mine:

http://alufadminpanel.azurewebsites.net/tmpResource/jvmapCustom/samples/world.html using bootstrap 3.

or jsfiddle updated to bootstrap 3: http://jsfiddle.net/0pc5qzfa/42/

Issue 2:
I see that with a list-group (non-linking) you use a <ul> but then when you want to add a link to the item, you remove the list and instead just put a series a <a href> elements all bundled together in a parent <div>.

This approach is not inline with how you treat other lists that have links (like pagination, navs, navbars etc).

Also, semantically, this seems incorrect. A list is a list, regardless of whether it has links or not.

I looked in previous issues to see if this was already raised but couldn't see anything. Sorry if it's a duplicate.

Bootstrap 3 is AWESOME by the way!!!!!!!!!!!!
Issue 1:
Background

I am the developer of an a new framework for writing Telegram bots (ref, but the purpose is irrelevant here). The core framework is extensible by plugins that can be published by other authors. As a result, I publish one core package to deno.land/x, and other people and me publish other packages around it.

Problem Description

While it would be desirable that plugins do not depend on the core module, this is not always possible. Some plugins rely on different parts of the core package (both runtime code and some complicated type transformations) that are also exposed to users, and it makes little sense to duplicate this logic into each plugin.

Even if it is possible to achieve duplicate only some parts of the core library, and let maybe users pass in the missing components, this is not always practical and can lead to unnecessarily complex code.

Right now, some of the plugins specify the grammY core package as a direct dependency, but this can lead to users downloading multiple versions of the same package.

How Node Solves It

For an npm package, this would be solved by making the core package a peer dependency with specified semver ranges that are supported. This pattern can be seen a lot in the npm ecosystem, and while peer deps are generally to be avoided, they sometimes have their place.

One of the Solutions

It would be nice to be able to specify semver ranges in import URLs, à la

import { Bot } from 'https://deno.land/x/grammy@v^0.4.0||^1.0.0/mod.ts'

but I don't mind the exact syntax being different.

I am by far not the first person to mention this, and it is neither flawless nor the only solution. However, despite some people commenting on the problem, I cannot find a promising suggestion on how to overcome this issue. I looked into ways of restructuring the plugin architecture, but I always ended up at the point that at least one of the plugin packages needed to refer to the core package in some way or another, or at least parts of it.

Please let me know if I overlooked a GitHub issue somewhere that discusses this. If that does not exist, what are you suggesting how to handle these situations?

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

Currently the incomplete elliptic integrals function in scipy.special do not support complex arguments for phi

Describe the solution you'd like

This could easily solved using the Landen Transformation. Let's take as example, the incomplete elliptic integral of the first kind ellipkinc

We could approximate the function as follows (note that it is expressed in terms of the parameter k instead of m where m=k²):

from the second expression above,, we could express phi at n+1 as follows:

The advantage of this last expression over using something like scipy.optimize.fsolve is that it could accept complex numbers.

The implementation is easy.

For different complex arguments for phi the results match exactly with results in WolframAlpha

Reference

R.E. Deakin & M.N. Hunter Elliptic Integrals And Landen's Transformation: What I should've known for Geodesy. Link

Issue 2:
Continuation of gh-1431: extend ellipk et al to complex plane.
Issue 1:
Hi,

since I found NO way to contact anyone in a reasonable amount of time, I see no other way than a bug report:

The description in scipy.stats.linregress

stderr : float
Standard error of the estimate

is absolutely inexpressive -- what estimate? I propose changing this to

Standard error of the estimate of the slope

or something...

Cheers

Stephan

Issue 2:
To conduct linear regression of x=(0,1,2,3) and y=(0,2,4.5,6), I use the follow code:

from scipy.stats import linregress

slope, intercept, r_value, p_value, std_err = linregress((0,1,2,3),(0,2,4.5,6))

and the "std_err" is 0.13228756555322888 (see the image below)

But if I calculate it in Matlab using the following code

p=polyfit([0:3],[0,2,4.5,6],1);

f=polyval(p,[0:3]);

std(f-[0,2,4.5,6])

, the answer is 0.2415 (see the image below)

. Since I believe in Matlab, I think the calculation of scipy is wrone. So I think it is a bug and report it.
Issue 1:
matplotlib 1.5.3, Python 2.7.3, Linux (Ubuntu 14.04 LTS), installed using pip

pyplot.subplots() is significantly slower than pyplot.subplot(). This becomes significant when plotting a large number of subplots. For example subplots(40) takes 2.3s whereas 40 calls to subplot() with differing parameters just take 25ms.

Minimal example (using ipython):

import matplotlib.pyplot as plt
%timeit plt.subplots(40)

The effect does not depend on the grid: 40x1 is the same as 5x8.

The time needed increases linearly with the number of subplots.

The effect does not seem to depend on the parameters sharex, sharey and squeeze (though I have not tested all possible parameters)

profiling the call reveals that there are a lot of calls to reset_ticks, which use up 75% of the time. See the runsnake screenshot below:

It seems there is a lot of unneccesary(?) clearing happening. Would it be possible to speed this up?

Issue 2:
> python -V
Python 2.7.11
> pip freeze | grep matplotlib
matplotlib==1.5.1
> python -m platform -s "print platform()"
Windows-7-6.1.7601-SP2

I have discovered that my application spends a lot of time in Axes creation. Results of class instantiation profiling is below:

> python -m timeit -s "from matplotlib.figure import Figure; from matplotlib.axes import Axes; fig = Figure()" "Axes(fig, (0, 0, 1 ,1))"
10 loops, best of 3: 33.2 msec per loop

Inside Axes.__init__ most of the execution time takes self.cla() call and about the half of it is

this loop below

for name, spine in six.iteritems(self.spines):
spine.cla()

After commenting this two lines I have got this:

> python -m timeit -s "from matplotlib.figure import Figure; from matplotlib.axes import Axes; fig = Figure()" "Axes(fig, (0, 0, 1 ,1))"
100 loops, best of 3: 17.9 msec per loop

So we have 33 ms per axes creation, and the half of this time it is used for spines creation that actually may be not used (in my case I have bunch of sharex axes and only one of them have spines).

I see a possible solution where creation of spines, scales (you can see creation of logarithmic scale, which I do not use too) and other stuff is delayed to the point when it actually needed/initialized.

And the fun part. For 20 created Axes we have 60115 calls to Rectangle.stale (3005 call per Axes instantiation)
Issue 1:
Please do not auto close the ext install window.

the first run ext install was very slow. but if miss focus, the window will be closed .

Terrible experience.

would you please do not auto close the window?

You can provide a close button, let us control when to close the window or not.

we want to install the extension.but not want reopen the window again and again

Issue 2:
The quick open UI isn't working fully well.

We need to come up with a better UI story that can

increase visibility of extensions;

fix awkward UI interactions we have today (status bar widget, error output pane, messages, etc);

enable us to implement more features in the future (enablement/disablement, statistics, etc).
Issue 1:
Code Sample, a copy-pastable example if possible

df = pd.DataFrame( data = {
'acol' : np.arange(4),
'bcol' : 2*np.arange(4)
})
df.drop(df.bcol > 2, axis=0, inplace=True)

print(df)

Expected Output

acol	bcol
0	0	0
1	1	2

Observed Output

acol	bcol
2	2	4
3	3	6
4	4	8

Problem description

The anticipated behavior was that rows with bcol > 2 would be dropped. The actual behavior is that the boolean gets converted to 0/1, and then treated as index label. So row numbers 0 and/or 1 are dropped... but all other rows will be kept.

The documentation did not make it clear what was happening.

Solutions might include documentation clarifying that .drop() cannot be used with boolean indexing, or a warning when receiving the (attempted) boolean index.

Output of pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.1.final.0
python-bits: 64
OS: Linux
OS-release: 2.6.32-573.12.1.el6.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.20.2

pytest: 3.1.2

pip: 9.0.1

setuptools: 33.1.1.post20170320

Cython: 0.25.2

numpy: 1.12.1

scipy: 0.19.1

xarray: 0.9.6

IPython: 6.1.0

sphinx: 1.6.3

patsy: 0.4.1

dateutil: 2.6.0

pytz: 2017.2

blosc: None

bottleneck: 1.2.0

tables: 3.4.2

numexpr: 2.6.2

feather: None

matplotlib: 2.0.2

openpyxl: 2.5.0a1

xlrd: 1.0.0

xlwt: 1.2.0

xlsxwriter: 0.9.6

lxml: 3.8.0

bs4: 4.5.3

html5lib: 0.9999999

sqlalchemy: 1.1.11

pymysql: 0.7.9.None

psycopg2: 2.7.1 (dt dec pq3 ext lo64)

jinja2: 2.9.5

s3fs: 0.1.1

pandas_gbq: None

pandas_datareader: None

Issue 2:
Shouldn't this work?

>>> pd.version.version
'0.13.0-472-g9109812'

>>> df = pd.DataFrame(np.random.random((10,4)))

>>> df = df.drop(df[0] > .5)

>>> df.drop(df[0] < .2)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-23-5df7f56de272> in <module>()
----> 1 df.drop(df[0] > .5)

/usr/local/lib/python2.7/dist-packages/pandas-0.13.0_472_g9109812-py2.7-linux-x86_64.egg/pandas/core/generic.pyc in drop(self, labels, axis, level, inplace, **kwargs)
1397 new_axis = axis.drop(labels, level=level)
1398 else:
-> 1399 new_axis = axis.drop(labels)
1400 dropped = self.reindex(**{axis_name: new_axis})
1401 try:

/usr/local/lib/python2.7/dist-packages/pandas-0.13.0_472_g9109812-py2.7-linux-x86_64.egg/pandas/core/index.pyc in drop(self, labels)
1621 mask = indexer == -1
1622 if mask.any():
-> 1623 raise ValueError('labels %s not contained in axis' % labels[mask])
1624 return self.delete(indexer)
1625

ValueError: labels [False False True True True True True False] not contained in axis
Issue 1:
Glide Version: 3.7.0

Integration libraries: glideOkHttpVersion = '1.4.0'

Device/Android Version: Nexus 5x Android 6.0.1

I'm trying to save cached images like:

builder.setDiskCache(() -> {
final File cacheLocation = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), ALBUM);
if (!cacheLocation.mkdirs()) {
Timber.d("Directory not created");
}
return DiskLruCacheWrapper.get(cacheLocation, CACHE_SIZE);
});

and the question is, if I could set the name policy for cached images, because now they are saved as xxxxxxx.o and I would like to see all those cached images in Gallery App, so that means that they should have an jpg of png extension

Issue 2:
java.lang.IllegalStateException: Too many receivers, total of 1000, registered for pid: 21355, callerPackage: com.ttd.tokl

at android.os.Parcel.createException(Parcel.java:1971)

at android.os.Parcel.readException(Parcel.java:1931)

at android.os.Parcel.readException(Parcel.java:1881)

at android.app.IActivityManager$Stub$Proxy.registerReceiver(IActivityManager.java:3676)

at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1507)

at android.app.ContextImpl.registerReceiver(ContextImpl.java:1468)

at android.app.ContextImpl.registerReceiver(ContextImpl.java:1456)

at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:623)

at com.bumptech.glide.c.e.a(SourceFile:55)

at com.bumptech.glide.c.e.i(SourceFile:101)

at com.bumptech.glide.c.a.a(SourceFile:37)

at com.bumptech.glide.i.(SourceFile:116)

at com.bumptech.glide.i.(SourceFile:78)

at com.bbk.appstore.imageloader.e.(SourceFile:38)

at com.bumptech.glide.c.a(SourceFile:19)

at com.bumptech.glide.c.l.a(SourceFile:441)

at com.bumptech.glide.c.l.a(SourceFile:134)

at com.bumptech.glide.c.l.a(SourceFile:116)

at com.bumptech.glide.e.b(SourceFile:707)
Issue 1:
Describe the issue:

Running

pyright foo.py

on

import numpy as np

def myfun(x: np.ndarray, b: np.ndarray):
v = b - x
v.copy()

gives

/tmp/dummy.py:6:7 - error: Cannot access member "copy" for type "NoReturn"
Member "copy" is unknown (reportGeneralTypeIssues)

The vector operations +, *, / work fine.

NumPy/Python version information:

1.21.3 3.9.7 (default, Sep 10 2021, 14:59:43)

[GCC 11.2.0]

Issue 2:
Describe the issue:

A operation between a NDArray[Any] array and an integer, as in the code example, makes Mypy infer the result as

numpy.ndarray[Any, numpy.dtype[numpy.signedinteger[Any]]]. This is an error, as the result could also be a floating point array, or even a complex one.

Reproduce the code example:

from numpy.typing import NDArray

def f(arr: NDArray[Any]) -> None:
reveal_type(arr + 2)

Error message:

No response

NumPy/Python version information:

1.21.2 3.7.6 (default, Jan 8 2020, 19:59:22)

[GCC 7.3.0]
Issue 1:
Under numexpr 2.2.2 (and for some reason that's the latest version available in the anaconda distribution at the moment), I get the following kind of errors:

>>> data.shape
(2, 219, 104, 6)
>>> data.dtype
dtype('float64')
>>> df = pd.Panel(data[0]).to_frame().reset_index()
>>> df[0].dtype
dtype('float64')
>>> df[0].count()
711
>>> df[0] + 1
TypeError: Could not operate 1 with block values using `oa_ndim == 0` when `op_axes` is NULL is
deprecated. Use `oa_ndim == -1` or the MultiNew iterator for NumPy <1.8 compatibility

Looks like the same as here and here.

Upgrading to numexpr 2.3 solves it. Should v2.3 be then strictly required by pandas?

Issue 2:
with pandas 0.16 and sqlalchemy, the to_sql method of a dataframe creates duplicate redundant constraints on each boolean column, at least when exporting to Microsoft SQL Server, because for each column it creates 2 constraints checking the field must be either 0 or 1. This is redundant and slows down the database. A short example is below. Of course you must check the output in the sql database. Also, the fact that there is no control and no documentation over the constraints created by to_sql is extremely frustrating

import pandas as pd

import numpy as np

from sqlalchemy import create_engine, MetaData, Table, select

import sqlalchemy as sqlalchemy

from sqlalchemy import create_engine, MetaData, Table, select

import sqlalchemy as sqlalchemy

ServerName = "cdodb-wb"

Database = "DealAnalysis"

engine = create_engine('mssql+pyodbc://' + ServerName + '/' + Database, encoding='latin1')

conn = engine.connect()

metadata = MetaData(conn)

df=pd.DataFrame(np.random.rand(20)>0.5, columns=['random_boolean'])

df.to_sql('python_test_table',engine,if_exists='replace')
Issue 1:
This is a bit of a weird one cropping up under very particular circumstances, but I spent a while last week puzzling over the issue. Probably best explained through the example.

Expected Behavior

Entering "Todd" into the form field in this simple example app and submitting the form takes the user to /hello/Todd, just like clicking the "Click here if your name is Todd" link does.

from flask import Flask, redirect, request, url_for
app = Flask(__name__)

@app.route("/")
def form():
return """
<p><a href="{}">Click here if your name is Todd</a><p>
<form action="{}" method="post">
<input type="text" name="name">
<button type="submit">This is my name!</button>
</form>
""".format(
url_for("hello", name="Todd"),
url_for("hello")
)

@app.route("/hello", methods=["GET", "POST"])
@app.route("/hello/<name>")
def hello(name=None):
if request.method == "POST":
return redirect(url_for("hello", name=request.form.get("name")))
if name:
return "Hello {}!".format(name)
else:
return "Hello World!"

Actual Behavior

Submitting the form instead takes you to /hello?name=Todd.

Through my own testing I've concluded that url_for("hello", name="Todd") will return /hello?name=Todd if

we are currently processing a POST request, and

the target endpoint has a parameter-less route with the POST method allowed (/hello), but the route we actually want (/hello/<name>) only allows GET requests.

This seems obviously bizarre and counterintuitive.

Environment

Python version: 3.6.4

Flask version: 0.12.2

Werkzeug version: 0.13

Issue 2:
In response to a POST, I wanted to construct a URL pointing at a different URL (the home of the created object) which did NOT support POST.

It turns out, this doesn't work with Flask==0.12.2. The rule I want doesn't match, so I end up matching a less specific rule, with the distinguishing name treated as a parameter, not a path.

What appears to be happening is that default method is being pulled out of _request_ctx early in url_for(). In this case, that method will be a POST.

I'm not sure if defaulting to the request's current method is really desirable. How often are you responding to a POST and want url_for to respond with the best match for POST? I think typically most endpoints will respond to a GET, but many endpoints won't respond to a POST.

The workaround is to include the undocumented _method keyword argument. That will work (hopefully permanently), but I'd prefer:

A) for this to be explicitly supported by the API, and

B) I think the default should probably always be GET. My guess is that will be correct far more
Issue 1:
Glide Version: 3.8.0

Integration libraries: no

Device/Android Version: All version

Issue details / Repro steps / Use case background:

Original file:

Result:

I had upgraded to the latest version 3.8.0 but it`s not solved.

Glide load line / GlideModule (if any) / list Adapter code (if any):

Glide.with(context)
.load(new GlideUrl(url, mHeader))
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.error(error)
.placeholder(placeHolder)
.into(view);

Layout XML:

<ImageView
android:id="@+id/activity_personal_homepage_headgear"
android:layout_width="145dp"
android:layout_height="145dp"
android:layout_gravity="center"
/>

Stack trace / LogCat:

paste stack trace and/or log here

Issue 2:
Glide Version: 4.0.0.

Integration libraries: okhttp3-integration

I am experiencing strict mode crashes both on emulator and real devices on Android versions from 4.2 to 7.1. Issue looks similar to now closed ticket #1996.

E/StrictMode: A resource was acquired at attached stack trace but never released.
See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'response.body().close()' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at okhttp3.internal.platform.AndroidPlatform$CloseGuard.createAndOpen(AndroidPlatform.java:272)
at okhttp3.internal.platform.AndroidPlatform.getStackTraceForCloseable(AndroidPlatform.java:138)
at okhttp3.RealCall.captureCallStackTrace(RealCall.java:78)
at okhttp3.RealCall.enqueue(RealCall.java:87)
at com.bumptech.glide.integration.okhttp3.OkHttpStreamFetcher.loadData(OkHttpStreamFetcher.java:45)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:61)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:282)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:252)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:222)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:347)

This happens a lot when fast-scrolling recycler view.

My RecyclerView.Adapter is simple:

final GlideRequests glideRequests = GlideApp.with(fragment);
// glideRequests is instance variable of adapter

@Override
public void onBindViewHolder(final ProductViewHolder holder, final int position) {
glideRequests.asBitmap()
.priority(Priority.NORMAL)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop()
.thumbnail(0.25f)
.placeholder(R.drawable.placeholder)
.load(product)
.into(holder.cover);
}

@Override
public void onViewRecycled(final ProductViewHolder holder) {
super.onViewRecycled(holder);
glideRequests.clear(holder.cover);
}
Issue 1:
1 - Windows Vista

2 - Chrome 28

3 - Happens in Docs even after shift + refresh

Backstory:

Open a modal here http://getbootstrap.com/javascript/#modals with button 'Launch demo modal'.

Close modal

Press same launch button again

Close modal (but this time nothing happens)

Issue 2:
Hi,

The code used on last Thursday worked fine. But after updated to latest code on Monday (GMT+8), the modal dialog when clicks to dismiss for seconds onward cannot be close.

I am checking on source code line 932, if I commented out this line then it is working again.

this.$element

.removeClass('in')

.attr('aria-hidden', true)

//.off('click.dismiss.modal')

Am I missing anything...?

Sorry for the grammar. Thanks.