WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
In pandas 0.15, a DataFrame's index no longer supports the modulo operator. I believe the following code used to work under pandas 0.14, but under pandas 0.15, a TypeError indicating "unsupported operand types" is raised:

In [1]: import pandas

In [2]: print pandas.version.version
0.15.2

In [3]: df = pandas.DataFrame({ 'i': xrange(10) })

In [4]: df.index
Out[4]: Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64')

In [5]: r = df.index % 2
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-405b698d3a56> in <module>()
----> 1 r = df.index % 2

TypeError: unsupported operand type(s) for %: 'Int64Index' and 'int'

In [6]: r = df.index.to_series() % 2

In [7]:

Line 6 shows that a workaround exists, using the to_series() function.

This issue is very similar to Issue #8608, which dealt with other arithemtic operations on an index. Pandas commit 2fcbc7f fixed that issue by adding addition, subtraction, multiplication, division, and unary operators, but not the modulo operator.

Issue 2:
In 0.14:

In [1]: pd.__version__
Out[1]: '0.14.1'

In [2]: intidx = pd.Index(range(10))

In [3]: intidx % 2
Out[3]: Int64Index([0, 1, 0, 1, 0, 1, 0, 1, 0, 1], dtype='int64')

now:

In [1]: pd.__version__
Out[1]: '0.15.2'

In [2]: intidx = pd.Index(range(10))

In [3]: intidx % 2
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-de0ac1282c31> in <module>()
----> 1 intidx % 2

TypeError: unsupported operand type(s) for %: 'Int64Index' and 'int'
Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

i tried electron 12,13.xx,14.xx but silent print with device name does not work

Proposed Solution

which electron version correctly works print all feature give in electron docs?

Alternatives Considered

which electron version correctly works print all feature give in electron docs?

Additional Information

which electron version correctly works print all feature give in electron docs?

Issue 2:
This is duplicate of this #14720 closed issue which actually still exists :(((

I use following url request - uploadData is undefined for POST, PUT, PATCH

POST electron://process/file

(as you can see, instead https i have electron - because I use it as API to communicate with my web-based app ) and I'm unable to send file in body
Issue 1:
in "@types/react": "^16.8.2"

this works:

export class Test extends React.PureComponent<void, void> {
render() {
return this.props.children;
}
}

but this doesn't work:

export const Test:React.FC<void> = p => {
return p.children;
};

seems like the functional component should allow bare return of children just as the class component does. Perhaps a mismatch between the ReactNode and ReactElement types?

Issue 2:
I tried using the @types/xxxx package and had problems.

I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript

I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).

Mention the authors (see Definitions by: in index.d.ts) so they can respond.

Authors: @gaspard @vbfox

As mentioned in React documentation, a stateless component can return false for empty content. Currently StatelessComponent is defined as:

interface StatelessComponent<P = {}> {
(props: P & { children?: ReactNode }, context?: any): ReactElement<any> | null;

whereas Component has

class Component<P, S> {
constructor(props?: P, context?: any);
// ...snip...
render(): JSX.Element | null | false;

Shouldn't these types be the same (including eliminating the ReactElement vs JSX.Element difference)? And to avoid future such issues (#14064, this one) it should probably be a named type, e.g. RenderResult.

A search for | null also comes up with ComponentSpec.render which probably should also have the same result type.
Issue 1:
I'm submitting a ... (check one with "x")

[x] bug report
[x] feature request

Current behavior

Setting animation on a the host is not supported.

Expected/desired behavior

Enable a component to apply animation on it's own host element.

What is the motivation / use case for changing the behavior?

While usually the host will have it's animation from the parent component via template syntax, there is possibility to insert a component using the ComponentResolver -> ComponentFactory. The only way to control host properties/attributes is by applying @hostxxx decorators on setting the host component metadata property.

@Component({
selector: 'modal-backdrop[@fade=fadeState]',
host: {
'@myTrigger': 'myTriggerProp',
'[@myTrigger1]': 'myTriggerProp1'
},
...

None of the above work.

My use case is in a Modal/Dialog window, where a top level component is the container of the overlay, backdrop and dialog itself.

The top level component does not have actual UI thus no animation. When closing I destroy the top level component via componentRef.destroy(). Animation triggers are set on child components but the do not trigger.

I guess I can enter an intermediate state in the top level component, the fires a close event and wait for everything to finish but that seems manual...

I'm not sure if there's an issue, and if there is - is it using @tigger attributes on the host or having the host remove all children, wait for animation and then dispose, which is also problematic...

Issue 2:
Issue 1:
Version: 0.21.1.0

OS Version: Microsoft Windows NT 10.0.18362.0

IntPtr Length: 8

x64: True

Date: 09/14/2020 15:36:37

Exception:

System.IO.FileNotFoundException: C:\Users[USERNAME]\Desktop\jdk-10.0.2_windows-x64_bin.exe

at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)

at Microsoft.Plugin.Program.Programs.Win32Program.ExeProgram(String path)

at Microsoft.Plugin.Program.Programs.Win32Program.GetAppFromPath(String path)

at Microsoft.Plugin.Program.Storage.Win32ProgramRepository.OnAppCreated(Object sender, FileSystemEventArgs e)

at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(WatcherChangeTypes changeType, ReadOnlySpan`1 name)

at System.IO.FileSystemWatcher.ParseEventBufferAndNotifyForEach(Byte[] buffer)

at System.IO.FileSystemWatcher.ReadDirectoryChangesCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)

at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

--- End of stack trace from previous location where exception was thrown ---

at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pNativeOverlapped)

Issue 2:
ℹ Computer information

PowerToys version: 0.21.1.0

PowerToy Utility:FancyZones

Running PowerToys as Admin:Yes

Windows build number:Microsoft Windows NT 10.0.19041.0

📝 Provide detailed reproduction steps (if any)

Version: 0.21.1.0

OS Version: Microsoft Windows NT 10.0.19041.0

IntPtr Length: 8

x64: True

Date: 09/07/2020 13:54:35

Exception:

System.IO.FileNotFoundException: C:\Users\Ryan\Desktop\advanced-systemcare-setup.exe

at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)

at Microsoft.Plugin.Program.Programs.Win32Program.ExeProgram(String path)

at Microsoft.Plugin.Program.Programs.Win32Program.GetAppFromPath(String path)

at Microsoft.Plugin.Program.Storage.Win32ProgramRepository.OnAppCreated(Object sender, FileSystemEventArgs e)

at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(WatcherChangeTypes changeType, ReadOnlySpan`1 name)

at System.IO.FileSystemWatcher.ParseEventBufferAndNotifyForEach(Byte[] buffer)

at System.IO.FileSystemWatcher.ReadDirectoryChangesCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)

at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

--- End of stack trace from previous location where exception was thrown ---

at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pNativeOverlapped)

✔️ Expected result

What is the expected result of the above steps?

❌ Actual result

What is the actual result of the above steps?

📷 Screenshots

Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form
Issue 1:
by daniel@heroku.com:

Although it's already possible to link C code into a Go program (that controls the entry
point), it would be highly useful to me to have the opposite (running a Go runtime in a
C program).

I'm mostly interested in exposing exported Go symbols and bindings to Python (and Ruby,
Java, and similar), and PostgreSQL. In the latter case, the sandboxed variant of Go
provides a more unique advantage as it can be run as a "trusted" language.

Issue 2:
Interface equality check is expensive compared to integer comparison check.

In the benchmark, I compare two integers. I then wrap them in interface{} and compare
them.

As interface{}, the comparison check takes over 20X the time taken by just plain
comparison check.

See http://play.golang.org/p/1evwkTYYlB

Results:
BenchmarkIntfEqual 100000000 14.5 ns/op
BenchmarkReflectTypeEqual 100000000 14.4 ns/op
BenchmarkPtrEqual 2000000000 1.06 ns/op
BenchmarkIntEqual 2000000000 0.70 ns/op
BenchmarkIntMapAccess 500000000 5.22 ns/op
BenchmarkReflectTypeMapAccess 50000000 57.6 ns/op
BenchmarkIntMapAccessMiss 100000000 16.4 ns/op
BenchmarkReflectTypeMapAccessMiss 50000000 58.3 ns/op

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux 3.8.0-27-generic #40-Ubuntu SMP Tue Jul 9 00:17:05 UTC 2013 x86_64 x86_64 x86_64
GNU/Linux

Which version are you using? (run 'go version')
go version devel +21ae2c5817da Fri Aug 09 23:23:34 2013 +1000 linux/amd64

Please provide any additional information below.
Issue 1:
I've just installed PyTorch using:

sudo pip3 install http://download.pytorch.org/whl/cu90/torch-0.3.0.post4-cp36-cp36m-linux_x86_64.whl

The installation process was successful, however, when I try to import torch I get:

Python 3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Segmentation fault (core dumped)

I'm running on Ubuntu 17.10 with CUDA 9.0, CUDNN 7.0 and NVIDIA 384.90.

Issue 2:
I've just installed PyTorch using:

sudo pip3 install http://download.pytorch.org/whl/cu90/torch-0.3.0.post4-cp36-cp36m-linux_x86_64.whl

The installation process was successful, however, when I try to import torch I get:

Python 3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Segmentation fault (core dumped)

I'm running on Ubuntu 17.10 with CUDA 9.0, CUDNN 7.0 and NVIDIA 384.90.
Issue 1:
Environment

Windows build number: 10.0.18362.418
Windows Terminal version: 0.6.2951.0

Steps to reproduce

Open the new Windows Terminal (Preview), then click on Azure Cloud Shell Menu (Ctrl + Shift + 4)

Expected behavior

A shell logged into my Azure Portal.

Actual behavior

When I try to open the Azure Cloud Shell, it does not displays the code requested by the Azure portal:

Issue 2:
Description of the new feature/enhancement

When opening a new tab AND OPTIONALLY if the current program in the active shell is not the shell program, use the current path of the active shell as the default path for the newTab action.

Proposed technical implementation details (optional)

There should be an option for this. useCurrentPath in globals which takes in a string of "never", "always", "whenNotShell"
Issue 1:
System information

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

Ubuntu 16.04

Tensorflow installed from source, latest HEAD from master (CPU)

1.6rc0

Python 3.5.2

Bazel 0.10.1

gcc-5

Describe the problem

When using tensorflow, I got hundred of DeprecationWarnings: This message exactly

/home/jerome/.local/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py:560: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead

return np.fromstring(tensor.tensor_content, dtype=dtype).reshape(shape)

EDIT : fixed replacing line 560 in tensor_util.py by :

return np.frombuffer(tensor.tensor_content, dtype=dtype).reshape(shape)

Thanks for any kind of help :)

Issue 2:
I want to know if using estimator to train on multi gpus can share the mean and var of batchnorm.

As the example in cifar, it cannot deal with the batchnorm sharing between different gpu
Issue 1:
Also raised on #26 (comment). See also #544.

Describe the bug

Write here a clear and concise description of what the bug is.

To Reproduce

Replace each part with your own scenario:

Create a file with:

from fastapi import FastAPI

app = FastAPI()

@app.get("/app")
def read_root():
return {"Hello": "World"}

Launch it using uvicorn --root-path="bar" test_app:app

Open the browser and go to http://127.0.0.1:8000/docs.

From the documentation, call the GET /app route.

The doc page calls /app and succeeds.

Expected behavior

The above test should fail after having called /bar/app, since root_path is supposed to prefix all generated URLs in case the application is served behind a reverse-proxy, among ther things. FastAPI only acknowledges openapi_prefix for the API doc.

Environment

OS: Windows

FastAPI Version: 0.45.0

Python version: 3.8.0

Additional context

A similar issue applies to sub-applications:

from fastapi import FastAPI

app = FastAPI()

@app.get("/app")
def read_main():
return {"message": "Hello World from main app"}

#subapi = FastAPI(openapi_prefix="/subapi")
subapi = FastAPI()

@subapi.get("/sub")
def read_sub(request: Request):
return {
"root_path": request.scope['root_path'],
"raw_path": request.scope['raw_path'],
"path": request.scope['path'],
"app_url_for": app.url_path_for("read_sub"),
"subapp_url_for": subapi.url_path_for("read_sub"),
}

app.mount("/subapi", subapi)

{
"root_path":"bar/subapi",
"raw_path":"/subapi/sub",
"path":"/sub",
"app_url_for":"/subapi/sub",
"subapp_url_for":"/sub"
}

(url_for not being prefixed with root_path is fixed upstream by encode/starlette#699)

Unless openapi_prefix="/subapi" is passed when creating the subapplication, both http://127.0.0.1:8000/docs and http://127.0.0.1:8000/subapi/docs will point towards http://127.0.0.1:8000/openapi.json, which goes against the point of having isolated subapplications.

openapi_prefix should probably just be deprecated and assumed to match root_path if absent.

Issue 2:
It would be nice to have a way to exclude fields from a model when using it to type a query/body parameter. My use case is a post request where a user needs to pass all the fields for a model except the id. The id is generated in the app when they make the post.

Example

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class Widget(BaseModel):
id = str
foo = str
bar = str

@app.post("/widgets")
def r(foo: str, bar: str):
w = Widget(id=gen_id(), foo=foo, bar=bar)
...

This means my code is more verbose because I have to type out every field/type in the model in the signature. Something like the following that returns a duplicated class that hides the field from the user.

@app.post("/widgets")
def r(widget: Widget.exclude('id')):
widget.id = gen_id()
...
Issue 1:
Original ticket http://projects.scipy.org/numpy/ticket/2154 on 2012-06-08 by trac user ktdrv, assigned to unknown.

Unless this is expected but undocumented behavior, trying to dot product an array in-place, results in a broken result:

>>> a = arange(1, 10, dtype = float64).reshape(3, 3)
>>> a
array([[ 1., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.]])
>>> dot(a, identity(3), a)
array([[ 0., 2., 3.],
[ 4., 5., 6.],
[ 7., 8., 9.]])

Issue 2:
Describe the issue:

when I use the np.digitize, if the input bin is generated using np.arrange, the binning results are wrong even I set right =True.

Reproduce the code example:

number = np.arange(-10,10.2,0.2)
number
a = [0.2,0.4,1.0]
bin_index = np.digitize(a, number,right=True)
number[bin_index]

Error message:

The results should be [0.2, 0.4, 1.0] it turns out to be array([0.4, 0.6, 1.2])

NumPy/Python version information:

1.21.5 3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:00:33)

[Clang 13.0.1 ]

Context for the issue:

No response
Issue 1:
Challenge Name

https://www.freecodecamp.com/gilliantrethewey

Issue Description

I have been consistently working on the challenges daily and making sure the squares turn dark green each day. The work is showing up properly, but the tally at the base is not correct; it is remaining at 17 days despite the streak lengthening daily, and it also is saying Current Streak is 1 day.

Browser Information

Using Chrome for Mac (Desktop).

Screenshot

Issue 2:
Challenge Declare JavaScript Variables has an issue.

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36.

I'm on the East coast of the US at 10:15PM EST on 01/17/2017, and I am completing my challenges for today, but they are logged on my profile as being completed on 01/18/2017. This restarted my streak, and I would like to keep it going :'(. Can anybody help, please? Thank you!
Issue 1:
When passing tuple of ndarrays to np.asanyarray, it may return array of arrays OR give ValueError when first dimensions of arrays match. Found out trying to np.save a tuple (sometimes worked, sometimes did not).

np.__version__
'1.11.2'

a = np.ones((2,1))
b = np.ones(3)
np.asanyarray((a,b))
array([array([[ 1.],
[ 1.]]), array([ 1., 1., 1.])], dtype=object)

b = b[:-1] # now the first dimensions match
np.asanyarray((a,b))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ml/anaconda/envs/face_lasagne/lib/python2.7/site-packages/numpy/core/numeric.py", line 533, in asanyarray
return array(a, dtype, copy=False, order=order, subok=True)
ValueError: could not broadcast input array from shape (2,1) into shape (2)

Issue 2:
The functions numpy.array and numpy.asarray have a well defined behaviour when applied to lists of arrays: if the listed arrays have the same dimensions and size, the list is turned in one of the dimensions of the resulting array (let's call it "mode 1"). If not, an array of arrays is returned ("mode 2").

However, the behaviour of numpy.array and numpy.asarray in "mode 2" seems to be dependent on the number of items in the arrays. The following code is not very elegant relative to numpy usefulness, but works:

>>> a = np.array([1, 2, 3])
>>> b = np.array([[1, 0], [0, 1]])
>>> np.asarray([a, b])
array([array([1, 2, 3]), array([[1, 0],
[0, 1]])], dtype=object)

But the following doesn't:

>>> a = np.array([1, 2])
>>> b = np.array([[1, 0], [0, 1]])
>>> np.asarray([a, b])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/numpy/core/numeric.py", line 474, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: could not broadcast input array from shape (2,2) into shape (2)

Clearly, the problem is that, when numpy.asarray sees the first dimension has the same length in a and b, it tries to go for "mode 1", which is impossible here.

EDIT: I'm using numpy 1.10.4 and python 3.4.3.
Issue 1:
Environment

Windows build number: Microsoft Windows [Version 10.0.18922.1000]

Windows Terminal version (if applicable): 0.2.1715.0

Any other software? - None

Steps to reproduce

Open Terminal from the Start Menu. Try to open 'Settings' from menu or 'Ctrl + ,'

Expected behavior

The settings screen should open and present itself.

Actual behavior

Absolutely nothing is happening. It is as if I did not try to open settings at all.

Issue 2:
When I press the settings on the Windows Terminal, it asks me how I want to open the .json file. So the settings won't open. Please help me
Issue 1:
Do you want to request a feature or report a bug?

Reporting a bug.

What is the current behavior?

Unexpected DOM elements in list rendering

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

https://jsfiddle.net/tse5xcg5/1/

just switch the tabs, there are unexpected DOM elements

What is the expected behavior?

no unexpected DOM elements

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

tested with React >= 16

no extra elements with React 15

Duplicate keys are mistakes, but these DOM elements should not be there anyway.

Issue 2:
Posting this issue to share a common phenomenon related to strict effect, I have created a sandbox to demonstrate this issue: https://codesandbox.io/s/unmount-guard-in-strict-effect-5eneb?file=/src/App.js

Previously this is a common practice to have a unmounted ref indicating whether current component is unmounted, and to prevent calls to setState after unmount in order to get rid of those ugly console warnings.

With react 18's strict effect, the intentional "mount -> unmount -> mount" steps may break some unmounted ref implements, the ahooks implementation is incorrect while the react-use implement is correct.

We can simply fix it by "revive" this ref in mount effect:

const unmounted = useRef(false);
useEffect(
() => {
// Add this line!
unmounted.current = false;
return () => {
unmounted.current = true;
};
},
[]
);

Still, I have 3 questions related to this:

In real world concurrent mode, is there a chance that fakeFetch may resolve after component is unmounted and before it is remounted?

Is this mean that we should not guard our setState calls with an unmounted ref flag? Maybe simply allow setState on an "unmounted" component can perfectly fix this problem.

Since we don't want to cancel fetch in unmount (maybe this is a side effect, or duplicated request can hit performance), is there any recommended practice to handle such situations?