WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
This works:

>>> pd.to_datetime(1, unit='D')
Timestamp('1970-01-02 00:00:00')

However, the following gives incorrect output:

>>> pd.to_datetime(1, unit='D', errors='coerce')
NaT

Details of Configuration:

python: 2.7.11.final.0

python-bits: 64

OS: Windows

OS-release: 10

machine: AMD64

processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel

byteorder: little

LC_ALL: None

LANG: None

pandas: 0.18.0

nose: 1.3.7

pip: 8.1.1

setuptools: 20.3

Cython: 0.23.4

numpy: 1.10.4

scipy: 0.17.0

statsmodels: 0.6.1

xarray: None

IPython: 4.1.2

sphinx: 1.3.5

patsy: 0.4.0

dateutil: 2.5.1

pytz: 2016.2

blosc: None

bottleneck: 1.0.0

tables: 3.2.2

numexpr: 2.5

matplotlib: 1.5.1

openpyxl: 2.3.2

xlrd: 0.9.4

xlwt: 1.0.0

xlsxwriter: 0.8.4

lxml: 3.6.0

bs4: 4.4.1

html5lib: None

httplib2: None

apiclient: None

sqlalchemy: 1.0.12

pymysql: None

psycopg2: None

jinja2: 2.8

boto: 2.39.0

Issue 2:
xref #11760

Parsing unix epoch timestamps give NaT with errors='coerce' while they can be parsed correctly without it:

>>> pd.to_datetime(1420043460, errors='coerce', unit='s')
NaT
>>> pd.to_datetime(1420043460, unit='s')
Timestamp('2014-12-31 16:31:00')

pandas: 0.17.1

numpy: 1.10.1

Python 2.7.7
Issue 1:
I grew tired of having to convert my units just for the sake of specifying the figure size. I'd like to specify the figure size directly in a metric unit, nominally centimeters (or millimeters, no difference). In most EU countries metric is the norm. I only have to deal with inches when looking at monitor sizes, printing, and matplotlib :(

I've found at least two issues about this: #1369 and the more generic #9226.

Of course, having support for generic unit specifiers would be nice, but I'm not entirely satisfied by the extra complexity of #9226. I'm also thorn about (size, unit) tuples, because I don't ever think I'm going to specify the figure size in AU, or picometers. Cm is regularly used for anything that fits paper.

I see two cases where inches are specified in the rc:

figure.figsize

savefig.pad_inches

In the api, there is the figsize kwarg, I guess a pad_inches kwarg, and the set_size_inches method.

What abound the KISS approach: add a figsize_cm kwarg, pad_cm, and the set_size_cm method, and the two respective rcParams? Fully backward compatible, and allows metric countries to get by easily.

I could easily contribute such a patch.

Issue 2:
Problem

I've noticed that matplotlib currently doesn't support saving images in webp format, which I later confirmed by looking into supported file formats in backend_bases.py file.

Saving images in webp would definitely be useful for users who want to upload the graphs they generate in matplotlib to the web. Compression to webp helps significantly reduce the image size, without losing quality. More information about webp can be found here.

Proposed solution

Would it be possible to add webp as a supported image saving format? It seems that Pillow package is automatically installed as a dependency when installing matplotlib. Pillow makes it relatively easy to convert an image to webp using the save() method. More detailed information can be found in the documentation

Additional context and prior art

No response
Issue 1:
TypeScript should support emitting minified JavaScript.

There are several different things we could support:

Just remove whitespace

Minify unobservable identifiers

Remove provably dead code

Whole-program minification (i.e. closure compiler)

(Others?)

Issue 2:
For completeness's sake, this is a list of breaking changes from the 1.0 compiler that we believe very few users will encounter.

These are errors that should have been reported and represent very likely errors in user code:

Comparison operators (<, >) more correctly check their operands for compatibility

typeof undefined is now undefined, not any

These mainly cover how certain TypeScript language constructs are emitted in the presence of serious errors in the code:

Classes with constructor overloads lacking an implementation, or with multiple implementations: emit has changed

Duplicate export = assignments emit has changed

Uses of this in fat arrow function expressions in static initializers no longer capture this

Nonsense circular external module declarations are now an error

Some constructs which are early errors in JavaScript are now considered as parse errors

Invalid uses of super in fat arrow function expressions emit has changed

Emit in some cases has changed to semantically-equivalent, but better, code:

Array copy code for unused rest parameters is no longer emitted

Exact emit for certain boilerplate constructs (rest args, default parameter values) has changed
Issue 1:
There are many examples in the docs that require some adjustments to get to compile, e.g. the following requires a main function:

let a = [0];
let b = [1];
let mut it = a.iter().chain(b.iter());
assert_eq!(it.next().get(), &0);
assert_eq!(it.next().get(), &1);
assert!(it.next().is_none());

(Iterator.chain at the time of filing.)

And others that are entirely self-contained, and can just be copy-pasted to be run.

use std::rand;

fn main () {
let tuple_ptr = rand::random::<~(f64, char)>();
printfln!(tuple_ptr)
}

(One of the examples at the top of std::rand.)

It seems like it would be good to be consistent about this. I prefer the latter, and it would make automatically running the tests much easier (#2925).

Issue 2:
Hello All,

Just stumbled upon

...
compile_and_link: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd.so
error: unknown debug flag: no-debug-borrows
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
task 'rustc' failed at 'explicit failure', /mnt/disk2/opt/pkgs/rust/src/librustc/driver/driver.rs:1137

Additional information:

Top of tree:

latest

commit f8477c9

duplicates the bug

#11707

Thanks
Issue 1:
Hello everyone,

I am having a problem with joblib.load("filename.pkl") returning the error:

ValueError: "Did not recognize loaded array layout"

I've looked for information on this error but have found non. Could someone assist?

Further information

I've installed sklearn through pythonxy, on a windows 7 machine, version 15.2 of sklearn. I've trained a large over a large amount of data, about 30 thousand samples, using the random forest classifier. I dump my classifier using joblib.dump then try to reloaded it using joblib and receive the error message above.

I've tried the same code on my mac(this was not through pythonxy) and do not receive an error. I then uninstalled my pythonxy to install the newest version but I receive the same error.

Full error:

Traceback (most recent call last):

File "", line 1, in

File "C:\Python27\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 425, in load

obj = unpickler.load()

File "C:\Python27\lib\pickle.py", line 858, in load

dispatchkey

File "C:\Python27\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 285, in load_build

Unpickler.load_build(self)

File "C:\Python27\lib\pickle.py", line 1217, in load_build

setstate(state)

File "_tree.pyx", line 2280, in sklearn.tree._tree.Tree.setstate (sklearn\tree_tree.c:18350)

ValueError: Did not recognise loaded array layout

Issue 2:
Hello,

I want to save a randomForest model to predict a class on new data. I use joblib to save and load data but I get this error when I use joblib.load. ValueError: "Did not recognize loaded array layout"

More information :

platform: Windows-7-6.1.7601-SP1

system: 'Python', '2.7.10 |Anaconda 2.3.0 (32-bit)| (default, May 28 2015, 17:02:00) [MSC v.1500 32 bit (Intel)]'

numpy version 1.9.2

sklearn version 0.16.1

scipy version 0.15.1

code reproducing the error:

from sklearn.externals import joblib
import numpy as np
from sklearn.ensemble import RandomForestClassifier
X = np.random.randn(1500,8)
l = np.random.randint(6, size = 1500)
clf_forest = RandomForestClassifier(n_estimators = 10)
clf_forest.fit(X,l)
joblib.dump(clf_forest,'clf_forest.pkl')
X_test = joblib.load('clf_forest.pkl')

Full error:

File "<ipython-input-4-fbcdf8eeb9d7>", line 1, in <module>
X_test = joblib.load('clf_forest.pkl')
File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 425, in load
obj = unpickler.load()

File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\pickle.py", line 858, in load
dispatch[key](self)

File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 285, in load_build
Unpickler.load_build(self)

File "C:\Users\P\AppData\Local\Continuum\Anaconda\lib\pickle.py", line 1217, in load_build
setstate(state)

File "sklearn/tree/_tree.pyx", line 3113, in sklearn.tree._tree.Tree.__setstate__ (sklearn\tree\_tree.c:23599)

ValueError: Did not recognise loaded array layout

Thanks for the help
Issue 1:
#With this code:
#-----------------------------
from datetime import datetime
import pytz
from pandas import DataFrame

original_date = datetime(2016, 9, 2, 0, 0, 0, 0, pytz.timezone('America/Manaus'))
dataframe = DataFrame(columns = ['stored_date'])
dataframe.loc['A'] = [original_date]

print("I expect it shows '2016-09-02T00:00:00-04:00', but it shows '2016-09-02 04:00:00'...")
print("original_date: " + original_date.isoformat())
print("stored_date in dataframe: " + str(dataframe.loc['A', 'stored_date']))
#-----------------------------

#I get this output:
#-----------------------------
I expect it shows '2016-09-02T00:00:00-04:00', but it shows '2016-09-02 04:00:00'...
original_date: 2016-09-02T00:00:00-04:00
stored_date in dataframe: 2016-09-02 04:00:00
#-----------------------------

#Output from pd.show_versions()
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.7.1-1-ARCH
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: pt_BR.utf8

pandas: 0.18.1
nose: None
pip: 8.1.2
setuptools: 26.0.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.1.0
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.14
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: 0.2.1

Issue 2:
xref #12502 (example there as well)

xref #14148

In [3]: idx = pd.date_range('20130101',periods=3,tz='US/Eastern')

In [4]: df = DataFrame({'A' : [1,2,3]})

In [5]: df['B'] = idx

In [6]: df.dtypes
Out[6]:
A int64
B datetime64[ns, US/Eastern]
dtype: object

In [7]: df.loc[[True,False,True],'C'] = idx

In [8]: df
Out[8]:
A B C
0 1 2013-01-01 00:00:00-05:00 2013-01-01 05:00:00
1 2 2013-01-02 00:00:00-05:00 NaT
2 3 2013-01-03 00:00:00-05:00 2013-01-02 05:00:00

# C should be the same time zone
In [9]: df.dtypes
Out[9]:
A int64
B datetime64[ns, US/Eastern]
C datetime64[ns]
dtype: object

this is also realized to #11351 [4]
Issue 1:
Documentation of 1.0.0 (http://docs.python-requests.org/en/v1.0.0/user/advanced/) says

requests.session(auth=auth, headers=headers) is a legitimate statement.

However, reading the code I see that session(), nor Session.init do not take any arguments.

https://github.com/kennethreitz/requests/blob/master/requests/sessions.py

So if I have not misread anything, the docs should be fixed demonstrating the way to set persistent session-specific headers, auth etc.

Issue 2:
requests.session(**kwargs)
Returns a Session for context-management.

This not longer works:

session = requests.Session(verify=not staging)

TypeError: __init__() got an unexpected keyword argument 'verify'
Issue 1:
This function is a faster version of the builtin python bisect.bisect_left (side='left') and bisect.bisect_right (side='right') functions

No, it's not faster for basic cases.

Reproducing code example:

Python bisect is 3x faster than searchsorted:

from bisect import bisect_right
from numpy import searchsorted

l = list(range(1024 * 8))
m = int(len(l)/3)
%timeit bisect_right(l, m)

a = np.asarray(l)
%timeit searchsorted(a, m)

444 ns ± 14.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
1.57 µs ± 13.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)

For reference, numba's implementation of searchsorted() is a little faster than bisect:

from numba import njit

@njit
def searchsorted_jit(_a, _v):
return searchsorted(_a, _v)

searchsorted_jit(a, m)
%timeit searchsorted_jit(a, m)

391 ns ± 2.93 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)

Numpy/Python version information:

1.16.2 3.7.3 (default, Mar 27 2019, 09:23:39)
[Clang 10.0.0 (clang-1000.11.45.5)]

Issue 2:
Reproducing code example:

import numpy as np
<< your code here >>

Error message:

Numpy/Python version information:

I tried to run" import numpy as np" but it shows me an error message. I uninstalled and reinstalled 2 times but the problem is still present. I installed anaconda via the site : "https://www.anaconda.com/distribution/" and I launched the launcher for the installed one.The message is :

ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed. Most

likely you are trying to import a failed build of numpy.

Here is how to proceed:

If you're working with a numpy git repository, try git clean -xdf

(removes all files not under version control) and rebuild numpy.

If you are simply trying to use the numpy version that you have installed:

your installation is broken - please reinstall numpy.

If you have already reinstalled and that did not fix the problem, then:

Check that you are using the Python you expect (you're using C:\Users\harry\Anaconda3\pythonw.exe),

and that you have no directories in your PATH or PYTHONPATH that can

interfere with the Python and numpy versions you're trying to use.

If (1) looks fine, you can open a new issue at

https://github.com/numpy/numpy/issues. Please include details on:

how you installed Python

how you installed numpy

your operating system

whether or not you have multiple versions of Python installed

if you built from source, your compiler versions and ideally a build log

Note: this error has many possible causes, so please don't comment on

an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'
Issue 1:
I tried to compile a simple hello.rs and ran into the following - output below after turning on RUST_BACKTRACE=1:

error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'needs a temp dir', /home/rustbuild/src/rust-buildbot/slave/dist2-linux/build/src/libcore/option.rs:315

stack backtrace:
1: 0xb6a79d00 - rt::backtrace::imp::write::h71c0311871d92b33BCq
2: 0xb6a7cc80 - <unknown>
3: 0xb6dc6c50 - unwind::begin_unwind_inner::hecb213f6de4ee4abIxd
4: 0xb6dc68b0 - unwind::begin_unwind_fmt::h14c200c16a264a5eavd
5: 0xb6dc6850 - rust_begin_unwind
6: 0xb6e16530 - failure::fail_fmt::h767d9e1ca2333a4biqk
7: 0xb6f63b80 - <unknown>
8: 0xb6f5a2b0 - back::link::link_binary::hf1d7c6859ef3a2c6xBa
9: 0xb782d2f0 - driver::driver::phase_6_link_output::he5609548684fab17h2w
10: 0xb7824590 - driver::driver::compile_input::h665973ab72cfb8bbKww
11: 0xb78a89d0 - <unknown>
12: 0xb78a88a0 - <unknown>
13: 0xb6f8a8f0 - <unknown>
14: 0xb6f8a6e0 - <unknown>
15: 0xb7fc2550 - <unknown>
16: 0xb6dc6660 - <unknown>
17: 0xb6e26110 - <unknown>
18: 0xb6e260d0 - rust_try
19: 0xb6dc4780 - unwind::try::h38aefa52248da233qmd
20: 0xb6dc45f0 - task::Task::run::h52211e2f40072d874Bc
21: 0xb7fc22f0 - <unknown>
22: 0xb6dc5da0 - <unknown>
23: 0x0 - <unknown>

hello.rs is a simple calculator demo program found on rust-lang.org.

$ rustc --version
rustc 0.12.0 (ba4081a5a 2014-10-07 13:44:41 -0700)

Please let me know if you need more information.

Issue 2:
When compiling without a valid temp directory (i.e. TMPDIR environment variable) rustc issues the following error:

error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'needs a temp dir', /path/to/rust/src/libstd/option.rs:167
Issue 1:
I am using the BCELoss for input and target with size of batchsize * channel * height * width, I also want to weight the loss using a weight matrix of the same size, then I get the below error:

File "/home/nianliu/anaconda3/lib/python3.6/site-packages/torch/nn/_functions/thnn/loss.py", line 15, in _resize_weight

self.weight = self.weight.view(1, target.size(1)).expand_as(target)

RuntimeError: size '[1 x 1]' is invalid for input of with 320 elements at /py/conda-bld/pytorch_1493680494901/work/torch/lib/TH/THStorage.c:59

Apparently, on this line, it's incorrect to reshape the weight matrix to the size of 1*target.size(1), unless only the channel-wise weights are allowed.

Since one may want to use sample-wise weights, channel-wise weights, pixel-wise weights, element-wise weights (jusk like my case), or other forms, I think we may remove the expanding operation and let users do it by themselves to ensure the flexibility.

Issue 2:
How can I save some tensor in python, but load it in libtorch:

I save tensor named piror using python, using the code:

torch.save(prior, 'prior.pth')

And I load the tensor in libtorch using C++, by the following code:

std::vector<torch::Tensor> tensorVec;
torch::load(tensorVec, "/app/model/prior.pth");
torch::Tensor priors = tensorVec[0];

But I got the error:

terminate called after throwing an instance of 'c10::Error'

what(): torch::jit::load() received a file from torch.save(), but torch::jit::load() can only load files produced by torch.jit.save() (load at ../torch/csrc/jit/serialization/import.cpp:285)

Why is that? And what should I do to solve the issue? Thanks in advance.

cc @suo @yf225
Issue 1:
I have a 50 node cluster with 1 rc with 1500 replicas. Each pod list takes few second and saturates 4 core master for that time. This slows down the whole system including scheduler, node/pod status updates, controllers etc.

@wojtek-t

Issue 2:
Background

Currently, to serve LIST operation in apiserver we do the following:

read all objects of a given resource from etcd

filter out objects that user is not interested in

return the result

This means, that complexity of LIST operation is proportional to the number of all objects of a given type, not to the number of objects returned to the user.

As an example, consider 1000-node cluster with 30.000 pods running in it. If a user has a ReplicationController with, say 10 replicas, then listing them requires requires reading all 30.000 from etcd, filtering them and returning just 10 which are interesting for the user.

Proposal

We would like to make the LIST operation proportional to the number of elements it returns as a result.

With the "Cacher" layer (used by watch in apiserver: #10475), we already store a copies of objects with a given type in apiserver so if we add an Indexer to it (which should be simple), we would be able to effectively serve list operations from it.

The problem is that a cache in apiserver is delayed (usually by tens to hundreds milliseconds). So if we just start to serve list operations from there we will change the semantics - e.g. it can happen that if you POST an object to apiserver and call LIST immediately after, the returned list may not contain already POSTed object.

In many cases, this doesn't really matter, for example if LIST is only done to start watching from that point, we will get eventual consistency anyway (just the starting point changes). However, it can possibly break some other clients.

I can see 3 main options:

just change the semantics

add an option (parameter) to LIST operation to force listing from database; however, in this case we should probably make listing from database by switched off by default to take advantage from it wherever it's possible

change the LIST operation to take ResourceVersion paramater and ensure that what we return in a result is no older than the given ResourceVersion (however, to make it efficient, we don't give any guarantees on how fresh the result is - we only promise to return the result not older than the given ResourceVersion).

[The third option is the best in my opinion].

What do you think about it?

@kubernetes/goog-control-plane @kubernetes/goog-csi

@lavalamp @brendandburns @quinton-hoole @bgrant0607

@smarterclayton @derekwaynecarr
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.

Environment

Dubbo version: 2.7.0-SNAPSHOT

场景描述：

新版异步方式，会在ConsumerContextFilter中设置 remoteAddress

RpcContext.getContext()
.setInvoker(invoker)
.setInvocation(invocation)
.setLocalAddress(NetUtils.getLocalHost(), 0)
.setRemoteAddress(invoker.getUrl().getHost(),
invoker.getUrl().getPort());

且会在 ExceptionFilter 的 doPostProcess中使用

logger.error("Got unchecked and undeclared exception which called by " + RpcContext.getContext().getRemoteHost()
+ ". service: " + invoker.getInterface().getName() + ", method: " + invocation.getMethodName()
+ ", exception: " + exception.getClass().getName() + ": " + exception.getMessage(), exception);

那么问题来了。

当连续的两个异步调用 A/B 在同一个线程先后执行的时候，A 的结果尚未返回，B 就开始执行，此时 A与 B 的 RpcContext 是同一个对象，就会导致 B 的 RpcContext 覆盖掉 A 的设置，导致 A 结果返回后获取到的 RpcContext 不再是 A 设置的内容，导致数据不一致。

提供一种问题解决思路，仅供参考：

RpcContext 提供拷贝函数，对 attachments, values 进行深拷贝，其他属性浅拷贝；

AsyncRpcResult中 storedContext以及 storedServerContext 调用RpcContext.getContext().copy()完成赋值；

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.x

Operating System version: xxx

Java version: 1.8
Issue 1:
I have created a device that supports integer constant tensors (because I would like to be able to support the inputs to reshape etc...), but not the integer maths operators (because I'm not going to accelerate those initially).

The gradient generation logic creates trees of integer maths. The constants for this maths are placed on the device, while the maths nodes themselves are placed on the CPU (as expected).

This isn't very sensible.

I think it would be better that constants are not placed on a device, unless they are feeding downstream nodes that are also on the same device.

There may be some classes of constant (ones with a specific memory placement, very large ones), which would end up on a different device to their downstream nodes, but I think that the default should be to keep them together.

Issue 2:
Are tf.TFRecord(num_parallel_reads) and interleave(num_parallel_calls) duplicated? what is the behavior if they are both set > 1? And the difference of shuffle before repeat and shuffle after repeat? I think the design of Dataset is too complicated, we need a more clear approach.