WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Migrated issue, originally created by Anonymous

In my project I need to catch and process an integrity exceptions, because user want to see a understandable error message instead of framework's exception (or just http 500 error). So the easiest way I found was something like this (let's say i want to process only duplicate errors. obj is object to save and table is table, mapped to obj's class):

errors = {}
try:
Session.flush([obj](obj))
except sqlalchemy.exceptions.IntegrityError, e:
err = str(e.orig)
m = re.match(r'^column (\w+) is not unique$', err, re.I)
if not m: raise e
dupcol = m.groups(0)[0](0)
del m
if not dupcol in table.c: raise e
dupcol = table.c[dupcol](dupcol)
errors[dupcol](dupcol) = IntegrityError(dupcol.unique)

It is not clear and simple way, is it?

I am sorry for my English.

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

we had someone wanting postgres SQLSTATE values to be propagated. i could not find any psycopg documentation at all about this being available, but then someone just posted an example that illustrated the undocumented psycopg attribute that makes this available.

the SQLError exception should have a "code" attribute that tries to get at the SQLSTATE/error number reported by the database, if possible. and maybe also "message". this way people wont need to drill into the db-specific exception itself. will need to build hooks into the dialect to populate this value when sql exceptions are raised.

the hard part here is identifying how all the dbapis report the code/message...im a little skeptical if they even all have codes.
Issue 1:
Since 7.0.8, when using

node_modules/@types/node/index.d.ts(50,14): error TS2687: All declarations of 'iterator' must have identical modifiers.

Our tsconfig :

{ "compilerOptions": { "target": "es5", "module": "amd", "sourceMap": true, "strictNullChecks": true, "noImplicitAny": false, "noImplicitReturns": true, "noImplicitThis": false, "noUnusedParameters": false, "noUnusedLocals": true, "experimentalDecorators": false, "emitDecoratorMetadata": false, "removeComments": true, "outFile": "../js/ts.js" }, "exclude": [ "node_modules", "../node_modules", "../../node_modules" ] }

Conflicts is between @types/node line 50 and @types/core-js, line 504 (iterator:Symbol)

Issue 2:
I added angular.d.ts and jquery.d.ts via nuget to a new Visual Studio 2013 project. Now I am getting 412 errors. Many of them are duplicate overload signature errors in angular.d.ts.
Issue 1:
I want to embed Sendpulse into my next.js page, how can I do this?

Their code:

<script charset="UTF-8" src="//cdn.sendpulse.com/9dae6d62c816560a842268bde2cd317d/js/push/998014b3613c5ffdd01ac8c8a6390391_1.js" async></script>

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

Issue 2:
when i surf the http://localhost:80 ，the query is undefined, then i push or replace the query, it will shallowEqual with the old query, but it is undefined ,so something go wrong.

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

Expected Behavior

Current Behavior

Steps to Reproduce (for bugs)

Context

Your Environment

Tech
Version

next

node

OS

browser

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

When it comes to node servers, expressjs has now got tough competition when it comes to performance.

Here is a benchmark which shows some alternatives like micro, connect and fastify are much faster/efficient than expressjs.

Are there any plans of next.js moving to one of these faster alternatives to expressjs?

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

Expected Behavior

Have the url prop on the server too, so that the "withData" hoc (as per the withApollo example) can use it to execute the query server-side

Current Behavior

this.props.url is undefined on the server, so that SSR is done without data and I see the query done client-side (SSR HTML has just the app scheleton).

Steps to Reproduce (for bugs)

graphql(singleProduct, {
options: ({ url }) => ({
variables: {
seoName: url.query.productSeoName,
crossSellingLimit: 12
}
}),
props: ({ data: { loading, error, product } }) => ({
loading,
error,
product
})
})(MyComponent)

Error

error: TypeError: Cannot read property 'query' of undefined at options [...]

Your Environment

Next 5.0.0

Apollo client 2.2.7

React 16.2
Issue 1:
I have such code:

new webpack.NormalModuleReplacementPlugin(
REG_EXP_FOR_FILES,
function (result) {
const matches = result.request.match(REG_EXP_FOR_FILES);
const routes = `${matches[1]}/index.js`;

if (fs.existsSync(path.resolve(__dirname, routes))) {
result.request = routes;
}
}
),

But in case of file doesn't exist I have error Module is not found. But I need to have no errors and have no hook files like empty.js.

Ho can skip file resolving with normal modules resolver?

Issue 2:
Not sure if this is a watcher issue or a build issue in general, but I've found that sometimes I'm getting empty bundles and/or empty source maps. My wild guess why this is happening is that if I reload my application at juuust the right moment, it locks the bundle/map file so that webpack can't write its contents. Is that possible? Has anyone else seen this behavior?

I would expect either an error event or stat error or warning to be generated, but that doesn't seem to be happening.
Issue 1:
System info

Playwright Version: v1.33, All?

Source code

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

Test file (self-contained)

// repro.mjs

import { chromium } from '@playwright/test'

const browser = await chromium.launch({
headless: false
})

const context = await browser.newContext()
const page = await context.newPage()

page.once('load', async page => {
await page.waitForTimeout(10000)

console.log('after 10 sec!')
})

await page.goto('https://google.com/')

await page.locator('#L2AGLb').click()
await page.locator('textarea#APjFqb').first().type('Playwright')

await page.locator('.FPdoLc input.gNO89b[name="btnK"]').click()

await page.pause()

Steps

npm install @playwright/test

npx playwright install --with-deps

node repro.mjs

Expected

I expected that the callback in the event listener would block executing the rest of the script for 10 seconds.

Actual

The script is executed without waiting for the callback to be fulfilled (a Google search is done first, and a message is logged to the console later).

Comment

I wasn't sure if it should be reported as a bug or maybe a feature request, so please adjust the issue. If an actual implementation has to stay untouched, then I believe putting information in the docs for that scenario could be helpful for others. Providing me with a workaround to achieve my goal is also very welcome here.

Issue 2:
My application have two different environments. In one of the environment, elements are available in iframe whereas in other environment, they are present in page. I don't want to duplicate my code. Is there a way that I can handle both frame and page elements in the same ts file?
Issue 1:
Problem

For SVG elements that need animation, a 'hook' is needed to tween the element from one configuration to another before React steps in and updates the DOM (and thereby prevents the animation).

My current work-around

For SVG components that need animation, I have to write render method that always returns the same 'dummy' DOM so that React doesn't find any diffs and I can handle all DOM updates myself inside the componentDidUpdate. IMO, this results in a very non-idiomatic ReactJS code because the render method does not have a true representation of what the SVG element will look like after applying state and props.

See this example.

Possible Solution

It would be helpful if components inside transition groups had a componentWillTween(callback) method similar to componentWillEnter etc.

This would be invoked after componentWillUpdate but before componentDidUpdate for components added to an existing TransitionGroup. It would block updates from being flushed to DOM until the callback is called. It would not be called on the initial render of a TransitionGroup.

Issue 2:
I just spent >20min wondering why my page was hanging. Turns out I had referenced the component I was rendering in the return method.

I know it's a stupid mistake however to prevent more time being wasted on it I propose a circular reference check which should throw an error.

I may work on a pull request later if I have time and it hasn't been patched yet.
Issue 1:
Summary of the new feature/enhancement

As a power user I frequently open up my "Programs and Features" (or also known as "Uninstall a program" under Control Panel) and uncommonly other Control Panel items. If I typed in "programs" into the Run window it would provide me with "Programs and Features" as an item and I am able to open up this window without having to open up the Control Panel by searching for that first then opening up the window that I want.

Proposed technical implementation details (optional)

Thanks so much team and keep up the amazing work!

Issue 2:
I like the Powertoys run utility in this new update. Could sysdm.cpl or any of the other of the other .cpl applets be added?
Issue 1:
This is related to #12766

Possibly a duplicate.

A small, complete example of the issue

DD = pd.DataFrame({'A':[1,2,3,4,5]})
DD.index.name = 'Test'
print DD.index.name
DD.index = DD.index.map(unicode)
print DD.index.name

Expected Output

The mapping operation deletes the index name.

However mapping a function on the index means modifying an existing index, so one would expect the name of the index to stay the same as opposed to when choosing a completely new index.

Output of pd.show_versions()

python: 2.7.12.final.0
pandas: 0.19.0

EDIT:

Doing a set_index(column) does NOT set the column name as the index name, I think it would be common sense that the name of the column which becomes the new index be automatically set as the index name.

Issue 2:
Hello,

I'm trying to install pandas on Mac OS X 10.11.6 in a Django project. Pandas library is used with one of the 3rd party libraries that I am using in the project.

Since I don't want to switch to different package manager (Anakonda) just for installing pandas (I'm using pip now), in order for me to get the C files compiled, I decided to install pandas by including --editable git+git://github.com/pydata/pandas.git@v0.18.1#egg=pandas in the requirements.txt file and the library is now installed in my src dir and there's a symlink in my virtualenv's site-packages which points to it.

This gets these headers compiled, but causes many strange importing errors in pandas source code itself when it is imported by a third party library that is also installed with --editable mode. F. ex. file at Users/eimantas/Desktop/Projects/WeShareSolar/mijnstroom/virtualenv/src/knmi-py/knmi/parsers.py has this line import pandas as pd. And I had to edit this code block in virtualenv/src/pandas/pandas/__init__.py for things to work:

try:
# XXX: I had to comment this out for things to work:
# from pandas import hashtable, tslib, lib
import hashtable, tslib, lib
except ImportError as e: # pragma: no cover
module = str(e).lstrip('cannot import name ') # hack but overkill to use re
raise ImportError("C extension: {0} not built. If you want to import "
"pandas from the source directory, you may need to run "
"'python setup.py build_ext --inplace' to build the C "
"extensions first.".format(module))

But then another importing error appears here: virtualenv/src/pandas/pandas/core/config.py:

File "/Users/eimantas/Desktop/Projects/WeShareSolar/mijnstroom/virtualenv/src/pandas/pandas/core/config.py", line 57, in <module>
import pandas.compat as compat
AttributeError: 'module' object has no attribute 'compat'

What should I do to get these things fixed ? I'd love to be able to use this library with pip and Django.
Issue 1:
While using scipy.optimize.linprog(method="highs"), I encountered a status message stating "The solver did not provide a solution nor did it report a failure" and asking for a bug report, which I am hereby writing :-)

As I have little experience in numerics, I make no claims about the qualities (feasibility, boundedness, etc) of the problem I was trying to solve. (I was trying to deactivate bounds I did not require by setting b_ub elements to a large value (100000.0). I have no idea if that is part of the problem.)

Reproducing code example:

Please see the attached file for problem parameters: bug_reproducer.py.gz (Some 3MB uncompressed. As I have no idea what is causing the problem, I can not build a minimal reproducer, sorry).

Gist of the code:

import numpy, scipy.optimize

c=...
A_ub=...
b_ub=...
res=scipy.optimize.linprog(c=c, A_ub=A_ub, b_ub=b_ub, method='highs')
print('status=', res.status)
print('message=', res.message)

Error message:

/home/philipp/.local/lib/python3.7/site-packages/scipy/optimize/_linprog_highs.py:317: OptimizeWarning: model_status is not optimal, using scaled_model_status instead.
lb, ub, options)
status= 4
message= The solver did not provide a solution nor did it report a failure. Please submit a bug report.

Scipy/Numpy/Python version information:

>import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
1.6.1 1.20.1 sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)

Thanks for your time,

Philipp

Issue 2:
My issue is about scipy.optimize.linprog(c, A_ub=A_ub, b_ub=b_ub, A_eq=A_eq, b_eq=b_eq, method='highs') telling me to submit a bug report.

Reproducing code example:

See minimal reproducer in a comment

#13610 (comment)

Error message:

/home/chn/env/lib/python3.8/site-packages/scipy/optimize/_linprog_highs.py:316: OptimizeWarning: model_status is not optimal, using scaled_model_status instead.
res = _highs_wrapper(c, A.indptr, A.indices, A.data, lhs, rhs,
The solver did not provide a solution nor did it report a failure. Please submit a bug report.

Scipy/Numpy/Python version information:

1.6.1 1.18.3 sys.version_info(major=3, minor=8, micro=5, releaselevel='final', serial=0)
Issue 1:
Bug summary

SageMath project uses matplotlib for graphics. We are recently upgrading matplotlib to version 3.6. In this effort, we encountered a failure in this command:

plot(2*x+1,(x,0,5), ticks=[[0,1,e,pi,sqrt(20)],2], tick_formatter="latex")

Here we use symbolic constants e, pi, sqrt(20) as major x-axis tick values. This worked very well up to now. But matplotlib version 3.6 fails this. I investigated the ultimate source of this failure.

We set the major tick locator as FixedLocator with the above symbolic values, and the minor tick locator to NullLocator. When matplotlib renders the plot, it tries to update minor tick values and calls matplotlib.axis.get_minorticklocs(), which is

def get_minorticklocs(self):
"""Return this Axis' minor tick locations in data coordinates."""
# Remove minor ticks duplicating major ticks.
minor_locs = np.asarray(self.minor.locator())
if self.remove_overlapping_locs:
major_locs = self.major.locator()
transform = self._scale.get_transform()
tr_minor_locs = transform.transform(minor_locs)
tr_major_locs = transform.transform(major_locs)
lo, hi = sorted(transform.transform(self.get_view_interval()))
# Use the transformed view limits as scale. 1e-5 is the default
# rtol for np.isclose.
tol = (hi - lo) * 1e-5
mask = np.isclose(tr_minor_locs[:, None], tr_major_locs[None, :],
atol=tol, rtol=0).any(axis=1)
minor_locs = minor_locs[~mask]
return minor_locs

Note that tr_minor_locs is an empty numpy array and tr_major_locs contains our symbolic values. The line mask = np.isclose(...) raises an exception because it does not understand the symbolic values. This behavior is new due to code changes in get_minorticklocs() in matplotlib 3.6.

Note that as the minor tick locator is NullLocator, that is, empty. get_minorticklocs() has nothing to do here. So by this change

--- if self.remove_overlapping_locs:
+++ if len(minor_locs) and and self.remove_overlapping_locs:

matplotlib can save unnecessary computation, and our problem in SageMath will be solved. So please consider this.

Code for reproduction

Explained in Bug summary

Actual outcome

Explained in Bug summary

Expected outcome

Explained in Bug summary

Additional information

No response

Operating system

No response

Matplotlib Version

3.6

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

No response

Issue 2:
Setting mec='none' removes the entire marker when exporting to PNG. See attached MWE and compare PDF and PNG output. May be related to #621 and #3687

import numpy as np
from matplotlib import pyplot as plt
x = np.random.random(10)
y = np.random.random(10)

plt.clf()
plt.plot(x, y, 'o', mec='none')
plt.savefig('test.pdf')
plt.savefig('test.png')
Issue 1:
Description of the new feature/enhancement

Proposed technical implementation details (optional)

Issue 2:
Environment

Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 0.6.2951.0

Steps to reproduce

Start Windows Terminal

Drag window to other screen (which happens to run at a different DPI/scaling setting)

Terminal exits :-/

My first screen (on which Terminal initially opened) is set 150% scaling, the second one (on which Terminal dies) is at 100%.

Expected behavior

Terminal should continue working on other screen.

Actual behavior

After releasing the drag&drop operation the window briefly (~1s) seems to be usable, but then it just closes.
Issue 1:
Hello,

There is an issue where the tooltip gets cut off when inside of a modal. Please refer to this JSFiddle to see the behavior.

I would expect the tooltip to show over the modal-shadow.

http://jsfiddle.net/zk7dF/38/

Best regards,

Andrew

Issue 2:
With Bootstrap 2.0.3, tooltips were appended to the document body and so they weren't constrained to their parent container

Bootstrap 2.0.3: http://jsfiddle.net/TwMdK/1/

With Bootstrap 2.2.2, tooltips are now appended to their parent container and this can cause tooltips to appear "chopped off"

Bootstrap 2.2.2: http://jsfiddle.net/VWVsV/2/
Issue 1:
Original report at SourceForge, opened Sun Oct 10 22:25:55 2010

This would probably be in mlab. I haven't checked but the count plotting functions probably use a private function similar to contourc behind the scenes. Having access to this would be great. Currently I am creating a figure. drawing a contour plot, than closing the figure.

Issue 2:
Bug report

Only the first bar in barplot has border when edgecolor is a single value.

Bug summary

Code for reproduction

import matplotlib.pyplot as plt

def main():

fig = plt.figure()
ax = plt.gca()

data = list(range(5, 10))

ax.bar(data, data, width=0.5, align="edge", linewidth=2,
edgecolor="k", facecolor="m")

plt.show()

if __name__ == '__main__':
main()

Actual outcome

Expected outcome

I can work around the issue by specifying a list of edgecolors and linewidths for each bar. Specifying only the list of linewidths for each bar and leaving one value for the edgecolor would only show a border of the first bar due to this code in the Patch.draw:

lw = self._linewidth
if self._edgecolor[3] == 0:
lw = 0

Matplotlib version

Operating system: Linux

Matplotlib version: 2.1.0

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

Python version: Python 3.6.2

I installed matplotlib using conda. But I am not sure from which channel.
Issue 1:
System information (version)

OpenCV => 3.4.2

Operating System / Platform => Haiku

Compiler => GCC 7.3.0

Detailed description

Testlogs:

[----------] 1 test from Core_globbing
[ RUN ] Core_globbing.accuracy
/sources/opencv-3.4.2/modules/core/test/test_io.cpp:552: Failure
Expected: (lenas.size()) > (pngLenas.size()), actual: 0 vs 0
[ FAILED ] Core_globbing.accuracy (0 ms)
[----------] 1 test from Core_globbing (0 ms total)

This is not the only failing test.

Current recipe: haikuports/haikuports#2891

Steps to reproduce

I did an out of tree build. As far as i can see, the testcases cannot find the assets file, thus fails. (But unsure)

mkdir build_haiku && cd build_haiku
cmake ..
make test

Issue 2:
System information (version)

OpenCV => :3.4.1 and 4.1.0 Tested

Operating System / Platform =>Windows 7/

Compiler => : Visual studio 2017 pro

Detailed description

Hi. I'm using opencv multiple projects. But I have a problem with using opencv.

When i use opencv, Opencv maeks memory leaks on debug mode, actually not real leak but false leak alarm.

Here is the leak script.

From searching, I found the sites(http://www.pklab.com/index.php?lang=EN&id=397) so I applied the method that using delay loaded DLL, but it does not work.

(I cannnot use "Static link for MFC" because of my project environments.)

I know that this is not real leak but when i'm using debugging mode, it makes me annoying.

How can I fix this problem??

Project Properties > Configuration Properties > Debugging> Environment > PATH=D:\Downloads\opencv\build\x64\vc15\bin;%PATH%

Project Properties > Configuration Properties > C/C++>General >Additional Include Directories > D:\Downloads\opencv\build\include

Project Properties > Configuration Properties > Linker > General > Additional Library Directories > D:\Downloads\opencv\build\x64\vc15\lib

Project Properties > Configuration Properties > Linker > Input > Additional Dependencies > opencv_world410d.lib

Project Properties > Configuration Properties > Linker > Input > Delay Loaded Dlls > opencv_world410d.dll

Steps to reproduce

This is not my project code but it is same false leak using opencv.

// Here is the code

#include <opencv2/highgui.hpp>

#include <opencv2/imgproc.hpp>

#include

using namespace cv;

using namespace std;

#include <stdlib.h>

#include <crtdbg.h>

int main(int argc, char** argv)

{

Mat img_original, img_gray;

//Image Load

img_original = imread("1.jpg", IMREAD_COLOR);

if (img_original.empty())

{

cout << "Could not open or find the image" << std::endl;

return -1;

}

cout << "Open CV Version : " << CV_VERSION << std::endl;

//Create Window
namedWindow("original image", WINDOW_AUTOSIZE);

//Show in Window
imshow("original image", img_original);

waitKey(0);

_CrtDumpMemoryLeaks();
return 0;

}
Issue 1:
Addition of Everything search and reduce memory consumption of power launcher

Proposed technical implementation details (optional)

Issue 2:
Like the little tool TypingAid that is a complied version of an AutoHotKey script, it would be great if Windows had the ability to build up words lists of previously typed words and prompt them as typing - anywhere.

This would be a great little PowerToys tool.

If you'd like to see this feature implemented, add a 👍 reaction to this post.
Issue 1:
❯❯ babel --version
5.8.23 (babel-core 5.8.25)

input

()=>{}()

output

"use strict";

(function () {})();

expected:

Error: Unexpected token "("

Issue 2:
These non-programs are accepted by babel: !()=>0, a + ()=>0, a || ()=>0, etc.

Arrows should have the precedence of an assignment expression.