WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
When some libraries get ahold of a Promise, they don't always add an onFulfilled handler, and they don't always add an onRejected handler using .catch(). Sometimes it looks like this:

.then(undefined, onError)

which is perfectly valid. I just experienced this error because GraphQL.js does this, for example: https://github.com/graphql/graphql-js/blob/85bfd13b5c63b4896d7643f8cd37a4f918fc5261/src/execution/execute.js#L369

But, SameLoopPromise always assumes that onFulfilled (onResult in its case) will be a function and tries to call it: https://github.com/zeit/next.js/blob/e13bb3f62f2c26d86cfe7bc41c0dc68456964707/lib/dynamic.js#L196

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

Expected Behavior

If no onFulfilled handler is passed, don't try calling it.

Current Behavior

TypeError: onResult is not a function

Steps to Reproduce (for bugs)

Return an import() result that another library attaches a handler to like .then(undefined, onError). In my case: write a GraphQL resolver that returns the result of import().

Context

Your Environment

Tech
Version

next
3.2.1

node
8.2.1

Issue 2:
example of styled-jsx-postcss broken after commit 559c252

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

Expected Behavior

The custom babel-present.js in example can modify the next/babel

Current Behavior

after commit, next/babel became a function and cannot be modified

Steps to Reproduce (for bugs)

Use example in here next.js/examples/with-styled-jsx-postcss/

run dev

Context

We use styled-jsx-postcss, but since we want to update to the latest of next, it got broken

Your Environment

Tech
Version

next
4.0.1

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

Expected Behavior

A page's getInitialProps should only be called once per page load.

Current Behavior

Sometimes getInitialProps is called multiple times in one page load.

Steps to Reproduce (for bugs)

Minimal example app (almost identical to the next example app "custom-server-express"): https://github.com/approots/next-express-issue

To reproduce:

Run npm run dev and check the terminal console for multiple outputs of the console.log statement in the getInitialProps function of pages/index.js ("getInitialProps index").

Or click the link to "post 2", refresh the page, then load the index page again (localhost:3000/), and check the terminal and see multiple console.logs of "getInitialProps index". This also happens in production.

Context

This means that API calls are being duplicated.

Your Environment

Tech
Version

next
^5.1.0

node
8.9.4

OS
Windows

browser
Chrome

express
^4.16.3

Issue 2:
Bug report

[ event ] build page: /

[ wait ] compiling ...

[ event ] build page: /about

[ ready ] compiled successfully - ready on http://localhost:3000

[ event ] disposing inactive page(s): /next/dist/pages/_error

[ event ] build page: /next/dist/pages/_error

[ wait ] compiling ...

[ ready ] compiled successfully - ready on http://localhost:3000

[ event ] disposing inactive page(s): /next/dist/pages/_error

[ event ] build page: /next/dist/pages/_error

[ wait ] compiling ...

[ ready ] compiled successfully - ready on http://localhost:3000

[ event ] disposing inactive page(s): /next/dist/pages/_error

It appears my pages are constantly being compiled. I'm unsure of what's causing this. Furthermore when i push to production my routes fail to work within my Navbar.

Steps to reproduce the behavior, please provide code snippets or a repository:

visit this repository and npm run dev in order to see what's happening

https://github.com/Rterrell25/Rterrell_Personal_Site
Issue 1:
Bug report

It seems matplotlib's 3d plot components is not rendering things right. The lines are disappearing at the top of surface plot.

Bug summary

Code for reproduction

from mpl_toolkits.mplot3d import Axes3D

kk = 3
sigma = 0.8
t = np.linspace(-kk, kk, 128)
x, y = np.meshgrid(t, t)
f = (1-(x**2+y**2)/2/sigma**2)*np.exp(-(x**2+y**2)/2/sigma**2)/sigma**4

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x,y, f, rcount=20, ccount=20)

Actual outcome

Matplotlib version

Operating system: Windows10

Matplotlib version: 3.1.0

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

Python version: 3.7

Jupyter version (if applicable):

Other libraries: numpy

Issue 2:
This is the underlying problem raised in #1178.

It is illustrated by the test below; note that boundary anomalies are visible in all forms--agg on the screen, and pdf and svg displayed with a viewer--but in different places depending on the viewer and the size of the figure as rendered.

Note that the colorbar is rendered using pcolormesh, which has its own renderer with agg but otherwise is handled by draw_path_collection.

import numpy as np
import matplotlib.pyplot as plt

z = np.arange(150)
z.shape = (10,15)

fig, axs = plt.subplots(2,2)

ax = axs[0,0]
cs0 = ax.contourf(z, 20)
cbar0 = fig.colorbar(cs0, ax=ax)

ax = axs[0,1]
cs1 = ax.contourf(z, 20, alpha=0.3)
cbar1 = fig.colorbar(cs1, ax=ax)

ax = axs[1,0]
im2 = ax.imshow(z, interpolation='nearest')
cbar2 = fig.colorbar(im2, ax=ax)

ax = axs[1,1]
im3 = ax.imshow(z, interpolation='nearest', alpha=0.3)
cbar3 = fig.colorbar(im3, ax=ax)

plt.savefig("test1.pdf")
plt.savefig("test1.svg")
plt.show()
Issue 1:
Adding search_after option to the search api will allow better deep pagination support for search request that don't use the scroll api.

The search_after option should be used to hold the last seen sort value for each search request being executed with the same query (just like updating the from option). Although in this case we don't keep open a consistent view of all the shards, like we do with scroll search, it is a good alternative for deep pagination for normal search requests that use from option. (actually the only one that doesn't cause jvm heap issues without maintaining open search contexts during subsequent scroll requests)

Issue 2:
The settings are as follows:

"products_v2": {
"settings": {
"index": {
"creation_date": "1475684313640",
"analysis": {
"filter": {
"english_keywords": {
"ignore_case": "true",
"type": "keyword_marker",
"keywords_path": "analysis/exclude_stem.txt"
},
"synonym_expand": {
"type": "synonym",
"synonyms_path": "analysis/synonyms.txt"
},
"english_stemmer": {
"type": "stemmer",
"language": "english"
},
"english_stop": {
"type": "stop",
"stopwords": "_english_"
},
"english_possessive_stemmer": {
"type": "stemmer",
"language": "possessive_english"
},
"char_filter": {
"stem_mapping": {
"type": "mapping",
"mappings_path": "analysis/char_mappings.txt"
}
},
"analyzer": {
"synonyms_expand": {
"filter": [
"synonym_expand",
"english_possessive_stemmer",
"lowercase",
"english_stop",
"english_keywords",
"english_stemmer"
],
"type": "custom",
"tokenizer": "standard"
}
}
}
}

The expected result after expansion for synonym is the following:

GET /products_v2/_analyze?analyzer=english&text="jell-o"
{
"tokens": [
{
"token": "jell",
"start_offset": 1,
"end_offset": 5,
"type": "<ALPHANUM>",
"position": 0
},
{
"token": "o",
"start_offset": 6,
"end_offset": 7,
"type": "<ALPHANUM>",
"position": 1
}
]
}

The synonym I put in is jello=>jell-o

The result that I get after using the synonym analyzer

GET /products_v2/_analyze?analyzer=synonyms_expand&text="jello"
{
"tokens": [
{
"token": "jell-o",
"start_offset": 1,
"end_offset": 6,
"type": "SYNONYM",
"position": 0
}
]
}

This doesn't seem right. I use the english chain after synonyms expanded.

The result should be the same as the one that I get when running:

GET /products_v2/_analyze?analyzer=english&text="jell-o"

The reason for this is because the standard analyzer gets applied first and only then do we apply the synonym analyzer

What happens:

jello, the standard analyzer gets applied. There is no taken chain

Then the word gets expanded to the synonym analzyer: jell-o

At this point there is no tokenization that happens to jell-o. The word doesn't change.

When jell-o gets indexed - it gets indexed using the english analyzer so "jell o". Therefore it doesn't change. Is there anyway we can add a standard tokenizer to the chain of analysis after the synonym expansion happens?
Issue 1:
misc/cgo/test fails after this change https://golang.org/cl/7304104/

test crashes sometimes. Perhaps, this will help you:

(gdb) disas
Dump of assembler code for function runtime.usleep:
0x00416680 <+0>: mov %fs:0x14,%ecx
=> 0x00416687 <+7>: mov (%ecx),%ecx
0x00416689 <+9>: cmp (%ecx),%esp
0x0041668b <+11>: ja 0x416699 <runtime.usleep+25>
0x0041668d <+13>: xor %edx,%edx
0x0041668f <+15>: mov $0x4,%eax
0x00416694 <+20>: call 0x41c470 <runtime.morestack>
0x00416699 <+25>: sub $0xc,%esp
0x0041669c <+28>: mov 0x10(%esp),%ecx
0x004166a0 <+32>: mov $0x10624dd3,%eax
0x004166a5 <+37>: mul %ecx
0x004166a7 <+39>: shr $0x6,%edx
0x004166aa <+42>: mov %edx,%ecx
0x004166ac <+44>: cmp $0x0,%edx
0x004166af <+47>: jne 0x4166b6 <runtime.usleep+54>
0x004166b1 <+49>: mov $0x1,%ecx
0x004166b6 <+54>: mov 0x58a0c4,%eax
0x004166bc <+60>: mov %eax,(%esp)
0x004166bf <+63>: mov $0x1,%eax
0x004166c4 <+68>: mov %eax,0x4(%esp)
0x004166c8 <+72>: mov %ecx,0x8(%esp)
0x004166cc <+76>: call 0x416ad0 <runtime.stdcall>
0x004166d1 <+81>: add $0xc,%esp
0x004166d4 <+84>: ret
End of assembler dump.
(gdb) info r
eax 0x1 1
ecx 0x0 0
edx 0x0 0
ebx 0x0 0
esp 0x3182fecc 0x3182fecc
ebp 0x3182ff30 0x3182ff30
esi 0xa 10
edi 0x0 0
eip 0x416687 0x416687 <runtime.usleep+7>
eflags 0x10246 [ PF ZF IF RF ]
cs 0x1b 27
ss 0x23 35
ds 0x23 35
es 0x23 35
fs 0x3b 59
gs 0x0 0
(gdb) bt
#0 0x00416687 in runtime.usleep (us=void)
at C:/go/root/src/pkg/runtime/thread_windows.c:146
#1 0x004121bd in lockextra (nilokay=void)
at C:/go/root/src/pkg/runtime/proc.c:1044
#2 0x00411fbc in runtime.needm (x=void)
at C:/go/root/src/pkg/runtime/proc.c:915
#3 0x0041c70c in runtime.cgocallback (fn=void, frame=void,
framesize=void)
at C:/go/root/src/pkg/runtime/asm_386.s:495
#4 0x0042c780 in _cgoexp_e9125f37873d_Add (a=void, n=void)
at
C:/DOCUME~1/brainman/LOCALS~1/Temp/go-build908326399/_/C_/go/root/misc/cgo/test/_test/_cgo_defun.c:321
#5 0x00480836 in ?? ()
#6 0x0042ccdb in ?? ()
#7 0x0042d65c in ?? ()
#8 0x77c3a3b0 in msvcrt!_endthreadex () from
C:\WINDOWS\system32\msvcrt.dll
#9 0x7c80b729 in KERNEL32!GetModuleFileNameA ()
from C:\WINDOWS\system32\kernel32.dll
#10 0x00000000 in ?? ()
(gdb)

Issue 2:
What steps will reproduce the problem?
1. When moving code from file A to file B, I copy file A's imports as well.
2. Run gofmt, which sorts the imports.
3. Compile the code, which detects unused imports, which I can remove.
4. I still need to remove duplicate unnamed imports manually.

What is the expected output? What do you see instead?
gofmt could safely remove the duplicate unnamed imports.

Please use labels and text to provide additional information.
Issue 1:
Maybe I am overlooking something, but useMount and useUpdate seem to be useful.

// Ignore didMount. Behave like didUpdate. This should be part of React imho.
const didMountRef = useRef(false);
useEffect(() => {
if (!didMountRef.current) {
didMountRef.current = true;
return;
}
saveDraftWebThrottled(document);
}, [document, saveDraftWebThrottled]);

Issue 2:
version

React version:

why react version in tag v17.0.2 is 17.0.0, Which commit is the source code of version 17.0.2 react

Steps To Reproduce

Link to code example:

The current behavior

The expected behavior
Issue 1:
ismaelvc@toybox ~/D/julia (master)> julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.3.0-prerelease+1817 (2014-03-03 02:50 UTC)
_/ |\__'_|_|_|\__'_| | Commit f189271* (0 days old master)
|__/ | i686-pc-linux-gnu

julia> ;ls
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
ismaelvc@toybox ~/D/julia (master)> echo $status
0

Issue 2:
With fish as my default shell, I get the below error. Presumably that is because in Fish, (x) is like $x in bash and not a grouping operator.

julia> ;ls

fish: Illegal command name '(ls)'

Standard input: (ls) && true

^

ERROR: failed process: Process(/usr/local/bin/fish -i -c '(ls) && true', ProcessExited(127)) [127]

in pipeline_error at process.jl:476

in run at process.jl:453

in repl_cmd at client.jl:62
Issue 1:
Issue Type:

Bug report

Ansible Version:

ansible 1.4.3

Environment:

RHEL 6.5 from RHEL 6.5; bug appears to be generic though.

Summary:

The hack at https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/__init__.py#L586 appears to break filter usage (name={{item | basename }}).

Steps To Reproduce:

This code:

- name: install RPMs
yum: name=/root/{{ item }}
notify: restart recursor
with_items:
- '{{ recursor_rpm_url | basename }}'
- '{{ pdnsmgrd_rpm_url | basename }}'

Should behave identically to:

- name: install RPMs
yum: name=/root/{{ item | basename }}
notify: restart recursor
with_items:
- '{{ recursor_rpm_url }}'
- '{{ pdnsmgrd_rpm_url }}'

However, the second version feeds the full URLs (that I have in those vars) to yum.

In both cases /root/ is dropped as well, but the first version accepts this because ansible is running from /root anyway.

Expected Results:

Both versions do the same, honoring /root and | basename.

Actual Results:

One version works, mostly by accident. The other does not work at all.

Issue 2:
This is regarding the discussion at https://groups.google.com/forum/#!topic/ansible-project/89nAO_ncAs0

The idea is to be able to add a prefix to apt and yum so that the following would work:

- name: PHP | MAIN | Install php packages
apt: >
pkg=php5-{{ item }}
state=latest
with_items:
- cli
- intl
- mcrypt
- curl
sudo: yes

A suggestion from James Tanner:

One possible solution is to add a pkg_prefix option to the apt and yum modules.
Issue 1:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md

The above link is broken. Loading leads to a 404 error.

Issue 2:
System information

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

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

TensorFlow installed from (source or binary):binary

TensorFlow version (use command below):2.0.0-alpha0

Python version:3.6

Describe the current behavior

The session return an ndarray [[value_estimate]] instead of value_estimate.

Describe the expected behavior

The session should return a scalar float. Just value_estimate. It should not be in an ndarray.

Workaround: get the actual scalar float in the ndarray if it is not a float

https://github.com/SetoKaiba/ml-agents/blob/tf2/ml-agents/mlagents/trainers/ppo/policy.py#L199-L200

if not isinstance(value_estimate, float):
value_estimate = value_estimate[0][0]

Code to reproduce the issue

https://github.com/SetoKaiba/ml-agents/blob/tf2/ml-agents/mlagents/trainers/ppo/policy.py#L199-L200

The problem can be reproduced without the two lines workaround.

Other info / logs

The value_estimate is calculated by the session and model.value. Code is lines below.

https://github.com/SetoKaiba/ml-agents/blob/tf2/ml-agents/mlagents/trainers/ppo/policy.py#L198

value_estimate = self.sess.run(self.model.value, feed_dict)

self.model.value is defined like this. The previous layer is dense layer with one units.

And the tf.identity should just return a scalar float.

The code is running correctly in TF 1.x.

But it's working incorrectly in TF 2.0.

https://github.com/SetoKaiba/ml-agents/blob/tf2/ml-agents/mlagents/trainers/models.py#L298-L299

value = tf.layers.dense(hidden_value, 1, activation=None)
self.value = tf.identity(value, name="value_estimate")
Issue 1:
Environment

Windows build number: [run "ver" at a command prompt] Microsoft Windows [Version 10.0.19041.329]
PowerToys version: 0.19.0
PowerToy module for which you are reporting the bug (if applicable): FancyZones

Steps to reproduce

Ensure that "Hold Shift key to activate zones while dragging" is unticked

. Previous version 0.18.2 allowed the shift key to disable zones when in this mode

Expected behavior

Drag a window and it will show the zone guides. Depress the shift key and the zone guides should stop, and the window won't re-size to a zone.

Actual behavior

Drag a window - the zones will activate even when the shift key is held down. The window must now be placed in a zone

Screenshots

Issue 2:
Environment

Windows build number: Version 10.0.20150.1000]
PowerToys version: 19.0
PowerToy module for which you are reporting the bug (if applicable): FancyZones

Steps to reproduce

"Override Windows Snap hotkeys" active

"Hold key to activate second zone set while dragging" is not active

Drag a Window, hold Shift

Expected behavior

Normal Window dragging is active (as it was with PowerToys 18.2)

Actual behavior

Zone snipping is active

Somehow refs #4401
Issue 1:
A subset of #9875, redesign the static home page, http://www.rust-lang.org.

@thehydroimpulse has been working on https://github.com/TheHydroImpulse/rust-website and @adridu59 on http://adridu59.github.io/rust-www/

Nominating.

Issue 2:
This includes rust-lang.org, the tutorials, guides, manuals and API docs.

I think most of us value the spare style on our home page, so we want to preserve that general aesthetic, though not that specific design. We need something attractive and consistent across all of our pages, that can be adapted to additional content as our needs grow. Some existing examples that we like are sinatra, node, homebrew.

Remember that Rust is a community project, and for engineers; the purpose of our web presence isn't to sell to managers; let's just present the facts cleanly.

This task probably also includes reevaluating what content is on the front page of rust-lang.org and rewriting it.

The web page should probably, like the above examples, tell you very simply how to install Rust, and point you at the docs and other resources, and not much else. Maybe a very brief elevator pitch.
Issue 1:
Would it make sense to define Base.iterate(::Nothing) = nothing ?

HTTP.jl has a generic interface that accepts anything iterable.

A user has reported method matching iterate(::Nothing) when they passed nothing.

It seems that eltype is already defined.

julia> eltype(nothing)
Any

But, HasEltype, HasShape and HasLength are not.

Issue 2:
julia> setdiff!([1, 2, nothing], nothing)
ERROR: MethodError: no method matching start(::Nothing)
Closest candidates are:
start(::Core.SimpleVector) at essentials.jl:533
start(::Base.MethodList) at reflection.jl:684
start(::ExponentialBackOff) at error.jl:170
...
Stacktrace:
[1] mapfoldl(::Function, ::Function, ::Set{Union{Nothing, Int64}}, ::Nothing) at ./reduce.jl:59
[2] foldl at ./reduce.jl:90 [inlined]
[3] setdiff! at ./abstractset.jl:149 [inlined]
[4] _shrink! at ./array.jl:2338 [inlined]
[5] setdiff!(::Array{Union{Nothing, Int64},1}, ::Nothing) at ./array.jl:2343
[6] top-level scope

Needs an implementation of:

start(::Nothing)

and a test.
Issue 1:
I'm using scipy's Fisk distribution. The documentation says the pdf is:

f(x, c) = c x^{-c-1} (1 + x^{-c})^{-2},

but it should be:

f(x, c) = c x^{c-1} (1 + x^{c})^{-2}.

I think the same applies to the documentation of the Burr distribution. I'm not sure if this is worthy of an issue, just wanted to mention it because it could potentially confuse users.

Issue 2:
In _continuous_distns.py [1] the method burr_gen._pdf() specifies the PDF of the Burr distribution, which is also used by the Fisk distribution (fisk_gen._pdf()).

The current PDF is c*d*(x**(-c-1.0))*((1+x**(-c*1.0))**(-d-1.0)), however, the sign of the first c is wrong.

The PDF should be: c*d*(x**(c-1.0))*((1+x**(-c*1.0))**(-d-1.0)).

This can be verified in Equation 53 of the paper referenced in the class documentation [2].

[1] scipy/scipy/stats/_continuous_distns.py

[2] Burr, I. W. "Cumulative frequency functions", Annals of Mathematical Statistics, 13(2), pp 215-232 (1942).
Issue 1:
Original ticket http://projects.scipy.org/scipy/ticket/1354 on 2011-01-12 by trac user bubla, assigned to unknown.

Hello, as stated in the summary, something needs to be done with the Scipy FFT implementation.

Consider this example:

import scipy as sp
import scipy.fftpack
import numpy as np
import numpy.fft

# Now watch the system's resource usage
a = sp.rand(300,300,300)
sp.fftpack.fftn(a)
# Still lots of memory occupied
np.fft.fftn(a)
# Almost no additional memory occupied

The point is that scipy uses much more resources and frees little, numpy is much better here.

Issue 2:
Problem

_linprog.py solves linear programming problems, originally via the simplex method. An implementation of the interior-point method was later added via _linprog_ip.py using the original _linprog.py as the top-level interface. The simplex and interior-point implementations duplicate similar behaviour and arguments especially to:

Clean user input.

Convert problem to standard equality form.

Call-back functions (not (yet) implemented in IP)

Further _linprog_ip.py implements the _presolve(...) and _postprocess(...), which may also improve the simplex method.

Proposed changes

I'm proposing to refactor _linprog.py and _linprog_ip.py into three new files _linprog.py, _linprog_ip.py and _linprog_simplex.py

_linprog.py to be the top level linear programming interface and handle behaviour common to all linear programming methods:

Validating and cleaning input.

Conversion to standard form.

Call-back functions.

Pre-solving and post-processing.

_linprog_ip.py and _linprog_simplex.py to implement the specific methods.

Benefits

Remove code implementing similar behaviour.

Avoid calling more complex solvers if problem is trivially solved.

Supply problem in standard equality form to all solvers.

Reduce the complexity of _linprog_simplex(...) by reusing _clean_inputs(...) and _get_Abc(...) from the interior point method.

Improve simplex method implementation by pre-solving and post-processing.

Would this be worth refactoring or are there any other suggestions? @rgommers @mdhaber