WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
My issue is about to solve a sparse linear system is much slower in Scipy than in Matlab.

Reproducing code example:

I tried the following script in python

import numpy as np
import scipy.sparse.linalg
import time
N = 6
diagonals = np.zeros((3, N)) # 3 diagonals
diagonals[0,:] = np.linspace(-1, -N, N)
diagonals[1,:] = -2
diagonals[2,:] = np.linspace(1, N, N)
time1 = time.time()
A = scipy.sparse.spdiags(diagonals, [-1,0,1], N, N, format='csc')
print "spdiags takes " + str(time.time()-time1)
x = np.linspace(-1, 1, N) # choose solution
b = A.dot(x) # sparse matrix vector product
time1 = time.time()
x = scipy.sparse.linalg.spsolve(A, b)
print "solve a linear system takes" + str(time.time()-time1)
print x

Result:

spdiags takes 0.000300168991089
solve a linear system takes0.000184059143066
[-1. -0.6 -0.2 0.2 0.6 1. ]

I also tried the following code in Matlab:

N = 6;
diagonals = zeros(N, 3);
diagonals(:,1) = linspace(-1, -N, N);
diagonals(:,2) = -2;
diagonals(:,3) = linspace(1, N, N);
tic
A = spdiags(diagonals, -1:1,N,N);
toc
x = linspace(-1, 1, N)';
b = A * x;
tic
x = A\b;
toc
x

Result:

Elapsed time is 0.000452 seconds.
Elapsed time is 0.000073 seconds.

x =

-1.0000
-0.6000
-0.2000
0.2000
0.6000
1.0000

It only takes 0.000073 seconds in Matlab while 0.000184059143066 in Scipy.

Scipy/Numpy/Python version information:

import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
('1.1.0', '1.13.3', sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0))

Issue 2:
I've found that on some page you have trouble with the latex markup

http://docs.scipy.org/doc/scipy-0.15.1/reference/tutorial/linalg.html

there is a lot of [ and ] that appear all over the text.
Issue 1:
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 7/64

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:

TensorFlow installed from (source or binary): pip

TensorFlow version: 2.0

Python version: 3.6

Installed using virtualenv? pip? conda?: pip

Bazel version (if compiling from source):

GCC/Compiler version (if compiling from source):

CUDA/cuDNN version:

GPU model and memory:

Describe the problem

Provide the exact sequence of commands / steps that you executed before running into the problem

Any other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Issue 2:
Hi,

is it possible to use Inception-v3 to classify images only for dogs?The example at tensorflow/examples/label_image/ classify images into 1000 classes.
Issue 1:
I want to be able to recompile only dependencies (rather than everything in a crate), like SML's compilation manager or GHC's --make mode. I don't really care about the approach so long as it works and the outcome is that adding one #debug call in one file doesn't trigger recompilation of 100 other files in the same crate :-) I am volunteering to work on this after 0.3, but suggestions are welcome. Patrick suggested a good place to start would be to generate a (visualizable) graph of item dependencies, which makes sense to me.

Issue 2:
rustc 1.0.0-nightly (2b01a37 2015-02-21) (built 2015-02-22)

I try to compile file:

use std::sync::{Arc, Mutex};

fn main() {
}

fn compile_ok() -> Result<(), ()> {
let hash_lock = Arc::new(Mutex::new("test".to_string()));
let result = match hash_lock.lock() {
Ok(_) => Ok(()),
Err(_) => Ok(())
};
result
}

fn compile_fail() -> Result<(), ()> {
let hash_lock = Arc::new(Mutex::new("test".to_string()));
match hash_lock.lock() {
Ok(_) => Ok(()),
Err(_) => Ok(())
}
}

And get error:

sample.rs:17:8: 17:17 error: `hash_lock` does not live long enough
sample.rs:17 match hash_lock.lock() {
^~~~~~~~~
sample.rs:15:37: 21:2 note: reference must be valid for the destruction scope surrounding block at 15:36...
sample.rs:15 fn compile_fail() -> Result<(), ()> {
sample.rs:16 let hash_lock = Arc::new(Mutex::new("test".to_string()));
sample.rs:17 match hash_lock.lock() {
sample.rs:18 Ok(_) => Ok(()),
sample.rs:19 Err(_) => Ok(())
sample.rs:20 }
...
sample.rs:16:58: 21:2 note: ...but borrowed value is only valid for the block suffix following statement 0 at 16:57
sample.rs:16 let hash_lock = Arc::new(Mutex::new("test".to_string()));
sample.rs:17 match hash_lock.lock() {
sample.rs:18 Ok(_) => Ok(()),
sample.rs:19 Err(_) => Ok(())
sample.rs:20 }
sample.rs:21 }
error: aborting due to previous error
Issue 1:
Hi,

I'm wondering which steps are necessary to move from the greedy decoder currently implemented to an actual beam search decoder. Is this enhancement already in someone's roadmap? If not, could anyone tell me which is the right point in the code where to add this functionality?

Thanks a lot!

Marcello

Issue 2:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): 16.04

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Yes

TensorFlow installed from (source or binary): binary

TensorFlow version (use command below): 1.13.0-dev20181222

Python version: 3.6

Bazel version (if compiling from source): /

GCC/Compiler version (if compiling from source): /

CUDA/cuDNN version: 9.1

GPU model and memory: 1080 Ti with 11Gib memory

You can collect some of this information using our environment capture script

You can also obtain the TensorFlow version with

python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Code to reproduce the issue

I was trying to convert the model in https://github.com/MIT-HAN-LAB/ProxylessNAS to TFLite, however, when following the tutorial, I got errors below

import tensorflow as tf
from proxyless_nas_tensorflow import proxyless_cpu, proxyless_gpu, proxyless_mobile, proxyless_mobile_14

net = proxyless_cpu()
net.is_training = False

converter = tf.lite.TFLiteConverter.from_session(net.sess, [net.images, net.labels], [net.cross_entropy])
tflite_model = converter.convert()
'''
~/anaconda3/envs/tf-nightly/lib/python3.6/site-packages/tensorflow/lite/python/convert.py in toco_convert_protos(model_flags_str, toco_flags_str, input_data_str)
206 stderr = _try_convert_to_unicode(stderr)
207 raise ConverterError(
--> 208 "TOCO failed. See console for info.\n%s\n%s\n" % (stdout, stderr))
209 finally:
210 # Must manually cleanup files.

ConverterError: TOCO failed. See console for info.
2018-12-22 13:38:13.626047: F tensorflow/core/framework/function.cc:1626] Check failed: GetOpGradFactory()->insert({op, func}).second Duplicated gradient for ReadVariableOp
Aborted (core dumped)
'''

Any advice would be appreciated!
Issue 1:
Electron version: electron-prebuilt@0.36.12

Operating system: MAC OS X Yosemite 10.10.5

I have this sample setup:

const BrowserWindow = electron.BrowserWindow;
// ... rest of electron boilerplate

function createMainWindow() {
const win = new electron.BrowserWindow({
width: 600,
height: 400
});

win.on('blur', blurHandler);
win.on('focus', blurHandler);

win.loadURL(`file://${__dirname}/index.html`);
win.on('closed', onClosed);

return win;
}

function blurHandler() {
let focusedWindow = BrowserWindow.getFocusedWindow();
if (focusedWindow) {
console.log('There is a focused window!');
} else {
console.log('no focused window. :(');
}
}

The above code simply calls blurHandler() on the blur and focus events.

The expected behavior: is to get the console output of "There is a focused window!" when I click back (to get focus) on the only Electron window, and to get the output of "no focused window. :(" when I click on any other application windows, or otherwise trigger the blur event on the electron window.

The actual behavior: No matter the method of gaining focus on the electron window I can never get the BrowserWindow.getFocusedWindow() method to return anything except undefined. My log just looks like this:

no focused window. :(
no focused window. :(
no focused window. :(
no focused window. :(
no focused window. :(
no focused window. :(

Can anyone see what I am doing wrong here, or have I found a bug?

Issue 2:
Hi,

I'm working on a new feature in our App which relate with focus behaviour. The feature is to capture if an atom-shell app is totally lost focused. Since my App can have multiple windows, I can not simply do this by using one window's blur and focus events. Instead, I try to do this by detecting if all of my windows get unfocused when a blur event fired.

Here is my script to do this:

this.nativeWin.on ( 'blur', function () {
if ( !BrowserWindow.getFocusedWindow() ) {
/// none of my atom-shell windows get focused, safely send 'totally-blur' message here!
}
}.bind(this) );

Actually the above script works correctly in Mac OSX, but when I test it in Windows platform, the getFocusedWindow() will still return the window who fired blur there. What I expect is a null/undefined here.

Another suggestion:

I think the focus and blur event can carry more information from its event. The event should known which window get lost and which one get focus to (if that is an atom-shell window). This is very similar to what we have in DOM event. The focus-in, focus-out, focus and blur event have a parameter named event.relatedTarget, which will holding the next focus or last blur element, and will become null/undefined if user just click mouse outside browser.

Besides, like what we discussed in #981 , if we have the ability to detect DevTools' window behaviour, that would be perfect for detecting totally blur in my case.

Test environment:

I test this under Windows 7/8, Mac OSX 10.10.1 with atom-shell v0.20.4.
Issue 1:
The bug can occur in special cases e.g. when the divisor is scalar and equal to 9 or 13 and the dividend is array contains consecutive duplicate values of 233.

Reproducing code example:

>>> import numpy as np
>>> a = np.full(64, 233, dtype=np.uint8)
>>> a // 9
array([25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25,
26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26,
25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25,
26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26, 25, 26], dtype=uint8)

NumPy/Python version information:

main, after #18075. related to #18178

Issue 2:
NumPy contains SIMD vectorized code for x86 SSE and AVX. This issue is a feature request to implement native, equivalent enablement for Power VSX, achieving equivalent speedup appropriate for the SIMD vector width of VSX (128 bits).

EDIT (by @rgommers): link to bounty: https://www.bountysource.com/issues/73221262-optimize-numpy-simd-algorithms-for-power-vsx

The focus is PPC64LE Linux. If the optimization can be portable to AIX (big endian) that's great, but not a strict requirement. In other words, if AIX continues to use the scalar code for now, that's okay.
Issue 1:
When using native networking in in AWS (i.e. with options cloud-provider=aws, cluster-name=<cluster_name>, allocate-node-cidrs=true, cluster-cidr=<pod_network>, configure-cbr0=true, bridge=cbr0, iptables=false, and ip-msq=false as appropriate to kube-apiserver, kube-controller-manager, kubelet, and docker), everything works except that Pods, including kube-dns, can't make DNS queries to the Amazon provided DNS server in the subnet. That means Pods can't resolve external hostnames.

It appears that the Amazon provided DNS server won't respond to queries with an address other than one within the subnet. The solution to the problem is to masquerade traffic from the Pod network to the Amazon provided DNS server in the subnet.

sudo iptables --table nat -A POSTROUTING -s <pod_cidr> -d <dns_ip>/32 -j MASQUERADE

Arguably this should be done by kubeletwhen it is passed the configure-cbr0 option alongside the cloud-provider=aws option.

Issue 2:
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): no

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): s3, bucket, permissions

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Kubernetes version (use kubectl version): 1.3.0

Environment:

Cloud provider or hardware configuration: AWS

OS (e.g. from /etc/os-release): the one used by kube-up.sh

Kernel (e.g. uname -a): the one used by kube-up.sh

Install tools: kube-up.sh

Others:

What happened:

The S3 bucket created by kube-up is publicly accesible.

Also, the S3 IAM permissions don't respect the value of the AWS_S3_BUCKET env variable and are hardcoded to kubernetes-*

What you expected to happen:

I don't think the bucket should be public.

If it is public for a good reason, the IAM policies shouldn't contain explicit permission for S3 or at the very least they should follow the bucket name set by AWS_S3_BUCKET

How to reproduce it (as minimally and precisely as possible):

Just calling kube-up.sh

Anything else do we need to know:

Not really
Issue 1:
I updated to 0.10.10 today, hoping to try out the new JavaScript support with Salsa. Unfortunately, my Intellisense has stopped working. I am using type definition files from definitely typed (e.g. the express.d.ts).

For example, using 0.10.8:

var exp = require("express");

exp.Router

I will see the content assist for the "Router" function and I can visit the definition file by right clicking on "Router" > Go to Definition

Now when I do the same thing in 0.10.10, I don't see "Router" in the Intellisense list. In addition, the list seems to have variables I had defined earlier in my code (which doesn't apply to express at all).

Issue 2:
It would be useful for extension developers to get a range of visible positions (or lines) in the editor.

This would be useful when the extension is dealing with the visual aspect of the VSCode since the extension does not need to update the visual on invisible area.

For example, Guides needs to update its indentation guide lines but this has impact the extension performance (spywhere/vscode-guides#6) due to a calculation on whole file which cause the lag on the VSCode. With this API, Guides can now update only visible area, reduce the necessity of update the invisible area which can improve the performance a lot.
Issue 1:
The code generated for loading big fields is currently very bad. Here is a small example:

mutable struct Mut
data::NTuple{10, Int}
end

struct Immut
data::NTuple{10, Int}
end

load(x, i::Int) = @inbounds x.data[i]

Comparing the generated code (on the offial julia-0.7.0 linux x64 binaries):

code_native(load, (Immut, Int))

mov	rax, qword ptr [rdi + 8*rsi - 8]
ret

with:

code_native(load, (Mut, Int))

movups	xmm0, xmmword ptr [rdi]
movups	xmm1, xmmword ptr [rdi + 16]
movups	xmm2, xmmword ptr [rdi + 32]
movups	xmm3, xmmword ptr [rdi + 48]
movups	xmm4, xmmword ptr [rdi + 64]
movaps	xmmword ptr [rsp - 88], xmm0
movaps	xmmword ptr [rsp - 72], xmm1
movaps	xmmword ptr [rsp - 56], xmm2
movaps	xmmword ptr [rsp - 40], xmm3
movaps	xmmword ptr [rsp - 24], xmm4
mov	rax, qword ptr [rsp + 8*rsi - 96]
ret

In the mutable case, the tuple is first copied to the stack and then loaded from there.

This currently makes MArray (from StaticArrays) very slow in some cases, e.g. sort! slows down proportional to the size of the MArray. It would be possible to do the loads through a pointer, but this inhibits a lot of optimisations on the Julia side.

I looked at the emitted llvm code, and in the difference is apparently, that in the mutable case Julia generates alloca + load + store and in the immutable one just a getelementptr, LLVM is not able to optimize this code.

Issue 2:
It looks like the logging facilities (e.g. @info, @warn, etc.) have docstrings but are not in the manual. It would be great to have a section of the manual devoted to logging now that we have the framework for it.
Issue 1:
From @alexandrudima on January 27, 2016 13:6

Testing #2218

I have the following settings:

// Place your settings in this file to overwrite default and user settings.
{
"typescript.tsdk": "C:\\Alex\\salsa\\node_modules\\typescript\\lib",
"editor.tabSize": 4,
"editor.insertSpaces": false
}

If I have a function indented with 5 spaces, and choose format, the 5 spaces get replaced with a tab:

function howdyAgain(name) {
return 'hi';
}

If I have the same function indented with 4 spaces, and choose format, the 4 spaces do not get replaced with a tab:

function howdyAgain(name) {
return 'hi';
}

Copied from original issue: microsoft/vscode#2443

Issue 2:
The formatter described in the link below currently doesn't seem to offer a way to indent by using tabs.

https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#pretty-printer-using-the-ls-formatter

Could that be added?

Thanks!
Issue 1:
Migrated issue, originally created by Anonymous

During schema reflection SQLAlchemy fails with AssertionError

Traceback (most recent call last):
File "/tmp/sqla2.py", line 190, in <module>
concentrate=False # Don't try to join the relation lines together
File "/tmp/sqla2.py", line 132, in create_schema_graph
metadata.reflect()
File "/home/filip/tefnet/teferp/workspace/tefobjects/lib/python2.5/site-packages/SQLAlchemy-0.5.5-py2.5.egg/sqlalchemy/schema.py", line 1733, in reflect
Table(name, self, **reflect_opts)
File "/home/filip/tefnet/teferp/workspace/tefobjects/lib/python2.5/site-packages/SQLAlchemy-0.5.5-py2.5.egg/sqlalchemy/schema.py", line 108, in __call__
return type.__call__(self, name, metadata, *args, **kwargs)
File "/home/filip/tefnet/teferp/workspace/tefobjects/lib/python2.5/site-packages/SQLAlchemy-0.5.5-py2.5.egg/sqlalchemy/schema.py", line 236, in __init__
_bind_or_error(metadata).reflecttable(self, include_columns=include_columns)
File "/home/filip/tefnet/teferp/workspace/tefobjects/lib/python2.5/site-packages/SQLAlchemy-0.5.5-py2.5.egg/sqlalchemy/engine/base.py", line 1265, in reflecttable
self.dialect.reflecttable(conn, table, include_columns)
File "/mnt/tmp/tefnet/teferp/workspace/tefobjects/lib/python2.5/site-packages/SQLAlchemy-0.5.5-py2.5.egg/sqlalchemy/databases/firebird.py", line 502, in reflecttable
assert row['fdefault']('fdefault').upper().startswith('DEFAULT '), row
AssertionError: (u'DATAREJ ', 1, u'DATE ', None, 4, None, 0, ' DEFAULT CURRENT_DATE')

The problem is because 'DEFAULT' sometimes has whitespaces at the begining

Attachments: tef_firebird_default_reflection.patch

Issue 2:
Migrated issue, originally created by Anonymous

Reflecting columns with default values fails assertion test. This may not happen on all tables, but did on at least one of mine. The problem is in lines 502 and 503 of firebird.py. They were:

assert row['fdefault']('fdefault').upper().startswith('DEFAULT '), row
defvalue = row['fdefault']('fdefault')![8:](8:)

The problem was, at least in my case, that there was a space before the word DEFAULT in row. This caused the assertion to fail. I fixed it with the following code:

assert row['fdefault']('fdefault').upper().lstrip().startswith('DEFAULT '), row
defvalue = row['fdefault']('fdefault').lstrip()![8:](8:)

Everything worked fine after that.
Issue 1:
suggestion

I suggess to add the following command :

deno bundleForNode {filename.js/ts} -- --output o.js

like deno bundleForNode {filename.js/ts} -- --output o.js

but

finlename.js/ts can access any node api

node can run o.js without problem

deno run --compet o.js may failed if the some node api not supported by --compat are used

use case

allow develop to use deno ecosystem for develop frontend using framwork like svelte, vue ... with little effort

Issue 2:
suggestion

I suggess to add the following command :

deno bundleForNode {filename.js/ts} -- --output o.js

like deno bundle {filename.js/ts} -- --output o.js

but with differance

filename.js/ts can access any node api

node can run o.js without problem

deno run --compet o.js may failed if the some node api not supported by --compat are used

use case

allow develop to use deno ecosystem for develop frontend using framwork like svelte, vue ... with little effort
Issue 1:
wes, how would you feel about adding something like the following as

a Dataframe method? especially with method chaining I would find this

useful. Will add handling for datatypes and so on.

In [32]: from pandas.util.testing import makeCustomDataframe as mkdf
In [33]: def grep(df,col,pat):
...: vals=df[col]
...: return df.ix[[bool(re.search(pat,unicode(x))) for x in vals]]
In [34]: df=mkdf(20,2)
...: print df
C0 C_l0_g0 C_l0_g1 \
R0
R_l0_g0 R0C0 R0C1
R_l0_g1 R1C0 R1C1
R_l0_g10 R2C0 R2C1
R_l0_g11 R3C0 R3C1
R_l0_g12 R4C0 R4C1
R_l0_g13 R5C0 R5C1
R_l0_g14 R6C0 R6C1
R_l0_g15 R7C0 R7C1
R_l0_g16 R8C0 R8C1
R_l0_g17 R9C0 R9C1
R_l0_g18 R10C0 R10C1
R_l0_g19 R11C0 R11C1
R_l0_g2 R12C0 R12C1
R_l0_g20 R13C0 R13C1
R_l0_g3 R14C0 R14C1
R_l0_g4 R15C0 R15C1
R_l0_g5 R16C0 R16C1
R_l0_g6 R17C0 R17C1
R_l0_g7 R18C0 R18C1
R_l0_g8 R19C0 R19C1

In [35]: grep(df,"C_l0_g0","R.*6")
Out[35]:
C0 C_l0_g0 C_l0_g1 \
R0
R_l0_g14 R6C0 R6C1
R_l0_g5 R16C0 R16C1

Issue 2:
As discussed on the mailing list, we should outline how we are going to do backports. Goals would be to provide a 0.19.1 bug-fix only release and at the same time allow master to proceed as 0.20/1.0 with all bug-fixes and API changes.

This issue is for how to do this, as we are ready to merge some 0.19.1 fixes. So need to put some machinery in place ASAP.

create a 0.19.1 (or .x?) branch

scripts/merge-py.py merges to master

then cherry-pick to 0.19.1?

Some questions

how to ensure that we are getting the appropriate commits. Do we need a comparison script?

how do we deal with the duplicated whatsnew issue (IOW, should commiters be directed to 0.20, then we copy / fix to put also in 0.19.1)?

testing, I think travis/appveyor will build both branches (master and 0.19.x)

would be nice to link some examples of how other projects do this. We have quite a lot of activity and don't want this to become a burden.