WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Code Sample, a copy-pastable example if possible

Problem description

I find a bug when using panel.apply(), and with some digging, I find an interesting indexing problem caused by multiindex in Panel Object. It is demonstrated below:

#
import pandas as pd
pn1 = pd.Panel(pd.np.random.random(size=(3,4,5)),items=['AAA','BBB','CCC'])
print pn1.loc[:,:,1]
pn2 = pn1.copy()
pn2.major_axis = pd.MultiIndex.from_product([list('AB'),list('ab')])
print pn2.loc[:,:,1]

Output:

AAA BBB CCC
0 0.182982 0.774812 0.894589
1 0.654716 0.695453 0.790078
2 0.340826 0.941283 0.938544
3 0.351851 0.971896 0.362317
A B
a b a b
AAA 0.182982 0.654716 0.340826 0.351851
BBB 0.774812 0.695453 0.941283 0.971896
CCC 0.894589 0.790078 0.938544 0.362317

With a multiindex as the major_axis of Panel object, the indexing result is transposed. And because of that, when using pn.apply(func, axis=('items','major')), it give you the wrong results when the major_axis is a multiindex.

Is this a bug? if not, then what is the purpose that it is designed like this?

Thanks for help.

Issue 2:
If you have a Panel with a MultiIndex, you can read but not write to it with .ix (same with .loc).

Before 0.13 I would normally do something like pn[item].ix[a, b][stuff] = values, surprisingly it used to work (now it spits out a SettingWithCopyWarning but still kinda works).

So what are the valid options in 0.13?

>>> df = pd.DataFrame([1] * 3, pd.MultiIndex.from_tuples(zip(range(3), range(3))))
>>> df
0
0 0 1
1 1 1
2 2 1

[3 rows x 1 columns]

>>> pn = pd.Panel(dict((k, df.copy() * k) for k in xrange(2)))
>>> pn
<class 'pandas.core.panel.Panel'>
Dimensions: 2 (items) x 3 (major_axis) x 1 (minor_axis)
Items axis: 0 to 1
Major_axis axis: (0, 0) to (2, 2)
Minor_axis axis: 0 to 0

>>> pn.ix[1, (0, 0), 0]
1

>>> pn.ix[1, (0, 0), 0] = 1
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-64-f48c3a7f93c3> in <module>()
----> 1 pn.ix[1, (0, 0), 0] = 1

/home/smirnov/anaconda/lib/python2.7/site-packages/pandas-0.13.1-py2.7-linux-x86_64.egg/pandas/core/indexing.pyc in __setitem__(self, key, value)
96 indexer = self._convert_to_indexer(key, is_setter=True)
97
---> 98 self._setitem_with_indexer(indexer, value)
99
100 def _has_valid_type(self, k, axis):

/home/smirnov/anaconda/lib/python2.7/site-packages/pandas-0.13.1-py2.7-linux-x86_64.egg/pandas/core/indexing.pyc in _setitem_with_indexer(self, indexer, value)
299 obj = self.obj[item]
300 index = obj.index
--> 301 idx = indexer[:info_axis][0]
302 try:
303 if idx in index:

IndexError: tuple index out of range
> /home/smirnov/anaconda/lib/python2.7/site-packages/pandas-0.13.1-py2.7-linux-x86_64.egg/pandas/core/indexing.py(301)_setitem_with_indexer()
300 index = obj.index
--> 301 idx = indexer[:info_axis][0]
302 try:
Issue 1:
[Enter steps to reproduce below:]

...

...

Atom Version: 0.168.0

System: Mac OS X 10.10.1

Thrown From: Atom Core

Stack Trace

Uncaught Error: Atom can only handle files < 2MB for now.

At /Applications/Atom.app/Contents/Resources/app/src/project.js:355

Error: Atom can only handle files < 2MB for now.
at Project.module.exports.Project.buildBuffer (/Applications/Atom.app/Contents/Resources/app/src/project.js:355:15)
at Project.module.exports.Project.bufferForPath (/Applications/Atom.app/Contents/Resources/app/src/project.js:332:63)
at Project.module.exports.Project.open (/Applications/Atom.app/Contents/Resources/app/src/project.js:286:19)
at Workspace.module.exports.Workspace.openUriInPane (/Applications/Atom.app/Contents/Resources/app/src/workspace.js:485:29)
at Workspace.module.exports.Workspace.open (/Applications/Atom.app/Contents/Resources/app/src/workspace.js:412:19)
at Ipc.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:45:32)
at Ipc.emit (events.js:110:17)
at process.<anonymous> (/Applications/Atom.app/Contents/Resources/atom/renderer/api/lib/ipc.js:22:29)
at process.emit (events.js:118:17)

Commands

62x -5:43.1 core:backspace (atom-text-editor.editor)
-3:18.6 core:save (atom-text-editor.editor)
-3:02.7 find-and-replace:select-next (atom-text-editor.editor)
-3:01.1 core:move-to-bottom (atom-text-editor.editor)
-2:59.3 core:move-to-top (atom-text-editor.editor)
2x -2:49.2 core:move-down (atom-text-editor.editor)
11x -2:47.5 core:move-right (atom-text-editor.editor)
-2:39.9 find-and-replace:select-next (atom-text-editor.editor)
-2:37.9 core:move-to-bottom (atom-text-editor.editor)
7x -2:19.2 core:backspace (atom-text-editor.editor)
9x -0:36.7 find-and-replace:select-next (atom-text-editor.editor)
-0:29.1 core:backspace (atom-text-editor.editor)
-0:12.7 core:copy (atom-text-editor.editor)
-0:07.8 editor:newline (atom-text-editor.editor)
-0:06.4 core:paste (atom-text-editor.editor)
-0:00.0 core:save (atom-text-editor.editor)

Config

{
"core": {},
"editor": {
"tabLength": 4,
"invisibles": {}
}
}

Installed Packages

# User
pdf-view, v0.14.0

# Dev
No dev packages

Issue 2:
So, I use my text editor for all kinds of things (writing code, reading readmes, editing dotfiles, etc). One of the things I do most often during any given day is open up large log files to troubleshoot Enterprise problems. These files can sometimes get as large as 500-800MB.

I just tried viewing a 350MB log file and Atom locked up immediately -- the file selector didn't change and the entire window went completely white 4 seconds after I tried viewing the file. I could still close the top level window, but we should still have better handling for this kind of thing.

Sublime Text 2 took about 55 seconds to open the file, but gave a nice progress indicator while it was loading:

Once it loaded it was as responsive as any other file I load (scrolled fast, normal text highlight performance, etc). It would be nice if we set this as a baseline for expected behavior (progress bar + responsive after loading).
Issue 1:
In BinaryFilesResponse.php's "prepare" method, the partial response is created only if no "If-Range" request header found, or if it matches the response's ETag.

Default behavior of this response is to not send ETag header, but Last-Modified, so we have no browser cache.

As per the spec, "If-Range" request header value may also be compared with the response's Last-Modified time.

And that would be usefull :-)

Issue 2:
According to w3c specification http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html,

in the request, If-range header can contains last modified date of file, but in BinaryFileResponse(symfony v2.6.8) only etag accepted.

As in current realization etag generating by sha1_file function in takes much time with big files.
Issue 1:
https://golang.org/pkg/crypto/rand/

The last example, Read prints an error upon running.

I don't see anything wrong with the example code, though I don't play with this package much.

out:

error: read /dev/urandom: Invalid argument

Screenshot:

Wish I could be more help :/

Sarah

Issue 2:
by fgergo:

On http://golang.org/pkg/crypto/rand/#Prime click Example then click Run.

What is the expected output?
10 cryptographically secure pseudorandom numbers

What do you see instead?
error: permission denied
Program exited.

Which operating system are you using?
Chrome (25.0.1364.172) and firefox (19.0.2) on windows 7, though it probably does not
matter.
Issue 1:
Full error is:

--- FAIL: TestInterfaces (0.00s)

interface_test.go:74: route ip+net: invalid network interface name

Issue 2:
by smith.winston.101:

Building Go 1.3-beta1 on FreeBSD-CURRENT-r264670/armv6 (Beaglebone Black) fails the
following tests (see below for details):
1) math
2) net
3) strconv

Go 1.3beta1 was built as follows:

CC=clang ./all.bash

`go version` shows:

go version devel +f8b50ad4cac4 Mon Apr 21 17:00:27 2014 -0700 + freebsd/arm

`clang --version` shows:

FreeBSD clang version 3.4 (tags/RELEASE_34/final 197956) 20140216
Target: armv6--freebsd11.0-gnueabi
Thread model: posix

NOTES:
1) Go 1.3-beta1 compiled and ran tests OK on FreeBSD-RELEASE-10 using Clang 3.3 (tags/RELEASE_33/final 183502)
2) Go 1.3-beta1 compiled and ran tests OK on the same BeagleBone Black hardware running Linux (Debian Wheezy, GCC 4.6.3).

--- FAIL: TestFrexp (0.00 seconds)
all_test.go:2048: Frexp(0) = 0, 0, want 0.9999999999999998, -1022
all_test.go:2048: Frexp(0) = 0, 0, want 0.5, -1073
all_test.go:2048: Frexp(0) = 0, 0, want -0.9999999999999998, -1022
all_test.go:2048: Frexp(0) = 0, 0, want -0.5, -1073
--- FAIL: TestIlogb (0.00 seconds)
all_test.go:2108: Ilogb(0) = -2147483648, want -1023
all_test.go:2108: Ilogb(0) = -2147483648, want -1074
all_test.go:2108: Ilogb(0) = -2147483648, want -1023
all_test.go:2108: Ilogb(0) = -2147483648, want -1074
--- FAIL: TestLdexp (0.00 seconds)
all_test.go:2169: Ldexp(0.9999999999999998, -1022) = 2.225073858507201e-308, want 0
all_test.go:2169: Ldexp(0.5, -1073) = 5e-324, want 0
all_test.go:2169: Ldexp(-0.9999999999999998, -1022) = -2.225073858507201e-308, want 0
all_test.go:2169: Ldexp(-0.5, -1073) = -5e-324, want 0
all_test.go:2169: Ldexp(2.2250738585072014e-308, -52) = 5e-324, want 0
all_test.go:2169: Ldexp(0, 1074) = 0, want 1
all_test.go:2169: Ldexp(1.7976931348623157e+308, -2097) = 1e-323, want 0
--- FAIL: TestLogb (0.00 seconds)
all_test.go:2229: Logb(0) = -Inf, want -1023
all_test.go:2229: Logb(0) = -Inf, want -1074
all_test.go:2229: Logb(0) = -Inf, want -1023
all_test.go:2229: Logb(0) = -Inf, want -1074
--- FAIL: TestNextafter (0.00 seconds)
all_test.go:2314: Nextafter(0, -1) = -5e-324 want 0
all_test.go:2314: Nextafter(-0, 1) = 5e-324 want 0
all_test.go:2314: Nextafter(-0, -1) = -5e-324 want 0
--- FAIL: TestFloatMinMax (0.00 seconds)
all_test.go:2577: Sprint(SmallestNonzeroFloat64) = 0, want 5e-324
all_test.go:2577: Sprint(SmallestNonzeroFloat32) = 0, want 1e-45
FAIL
FAIL math 1.036s

--- FAIL: TestInterfaces (0.00 seconds)
interface_test.go:59: table: len/cap = 2/2
interface_test.go:71: InterfaceByName("") failed: invalid network interface name
FAIL
FAIL net 5.944s

--- FAIL: TestFtoa (0.01 seconds)
ftoa_test.go:149: testN=64 0 g -1 want 2.225073858507201e-308 got 0
ftoa_test.go:149: AppendFloat testN=64 0 g -1 want abc2.225073858507201e-308 got abc0
ftoa_test.go:147: testN=32 0 g -1 want 2.225073858507201e-308 got 0
ftoa_test.go:151: AppendFloat testN=32 0 g -1 want abc2.225073858507201e-308 got abc0
FAIL
FAIL strconv 6.168s
Issue 1:
Question : Is there any way we can .crossFade() image when we load image as .asBitmap()?

Glide.with(getContext())
.load(url)
.asBitmap()
.crossFade() --> Not possible.
.into(imageView);

Or do we need to customize the animate ?

Glide.with(imageView.getContext())
.load(url)
.animate("do something here") // TODO
.into(imageView);

Just curious why we lose .crossFade() when we load .asBitmap()?

Thanks!

Manju

Issue 2:
Is it possible to change the load format between ARGB and RGB_565 for specific loads and still load a drawable to get the transition effect between thumbnail and actual image?
Issue 1:
As seen in this Jupyter notebook (in HTML format) - (gist of the HTML here), using FacetGrid and seaborn.boxplot may produce incorrect/incomplete outputs.

This problem appears primarily when data has gaps or missing values, the target column is used for FacetGrid(row=...) and the dtype of said column is object. The problem is gone when columns are converted to category. Detailed examples on the linked HTML document.

Issue 2:
As shown in the screenshot, FacetGrid erroneously moves countplot's columns towards the leftmost position on the subplot's x-axis whenever any of countplot's lowest-value columns are empty. As the (correct) sns.factorplot right above the faulty FacetGrid illustrates, this error occurs for the subplots t_s_len = 1 and t_s_len = 2 (where no data point has a yr_diff value of -1).
Issue 1:
I didn't notice any deviation from the behavior I expected from the component.

component:

export const Contract: FC<ContractProps> = ({
contract = demo_contract,
hide,
show
}) => {
if (!show) {
return <></>
}
const { user } = useAppSelector(store => store.users)
const [loan_contract, set_loan_contract] = useState(compute_whole_contract(contract, user as User));
useEffect(() => {
set_loan_contract(compute_whole_contract(contract, user as User))
}, [contract])

return (
<Modal show={show} fullscreen onHide={hide} className="addloan_contract">
<Modal.Header closeButton>
<Modal.Title>Loan Contract</Modal.Title>
</Modal.Header>
<Modal.Body className="add_loan_contract_form">
<ContractContext.Provider value={{ loan_contract, set_loan_contract }}>
<ContractForm />
<LoanRepaymentSchedule />
</ContractContext.Provider>
</Modal.Body>
</Modal>
)
}

Issue 2:
React version: V18.0.0

React router DOM: V5.2.1

Steps To Reproduce

Going to profile page

Warning: Internal React error: Expected static flag was missing. Please notify the React team.

Link to code example:

DynamicFilter.js component

The current behavior

The expected behavior
Issue 1:
Reading rust documentation online can be confusing because it may be out of date with the latest version.

The output of rustdoc should including the date and version number of the crate to help identify if the documentation is relevant.

Issue 2:
If I try to create a const &'static Fn(u32), I trigger an ICE:

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: self.mode == Mode::Var', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc/middle/check_const.rs:254

error code 101

A small example code snippet is on the playpen (see http://is.gd/U0DmxV):

const x: &'static Fn() = &|| println!("ICE here"); //ICE

fn main() {}
Issue 1:
I'd like to use cross_validation.cross_val_score with metrics.precision_recall_fscore_support so that I can get all relevant cross-validation metrics without having to run my cross-validation once for accuracy, once for precision, once for recall, and once for f1. But when I try this I get a ValueError:

from sklearn.datasets import fetch_20newsgroups

from sklearn.svm import LinearSVC
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import metrics
from sklearn import cross_validation
import numpy as np

data_train = fetch_20newsgroups(subset='train', #categories=categories,
shuffle=True, random_state=42)
clf = LinearSVC(loss='l1', penalty='l2')
vectorizer = TfidfVectorizer(
sublinear_tf=False,
max_df=0.5,
min_df=2,
ngram_range = (1,1),
use_idf=False,
stop_words='english')

X_train = vectorizer.fit_transform(data_train.data)

# Cross-validate:
scores = cross_validation.cross_val_score(
clf, X_train, data_train.target, cv=5,
scoring=metrics.precision_recall_fscore_support)

Issue 2:
Scikit-learn does not specify any of its dependencies in the setup.py file, despite requiring (and explicitly stating in documentation) both the NumPy and SciPy packages.

These requirements should be included in the setup.py file using the install_requires convention documented here to make installation easier:

http://python-packaging.readthedocs.io/en/latest/dependencies.html
Issue 1:
Running tests requires linking to std, where the test runner lives. core has a huge hack in it to allow it to link to std when building with --test.

When building core tests (an executable), core links to std, which then links to the actual core shared library. As a result coretest actually includes two entire copies of core at runtime. The tests are exercising the core code compiled into the executable, and std is exercising the core library.

This caused a confusing problem with the TLS tests which use function addresses as keys, because std and coretest were using two different functions.

Two solutions

move std::test to core

move core tests to their own crate

Issue 2:
struct Foo;

trait Bar {
fn bar(&self) -> int;
}
impl Bar for Foo {
fn bar(&self) -> int {1}
fn bar(&self) -> int {2}
}

fn main() {
printfln!(Foo.bar())
}

$ rustc double-def.rs
$ ./double-def
1
Issue 1:
I'd like to have console option behaving in this way:

#1. The option is not used at all, so don't use any value of it
./app.php command
#2. Use default value of the option
./app.php command --myoption
#3. Use custom value of the option
./app.php command --myoption=myvalue

However, as far as I know, there is currently not a clean way how to do it - because if you define default value for your option, then using $input->getOption('myoption') you will get the default value even for the case 1. (= even if the option was not passed at all).

The real-world use case is that I have an option, that is not always needed, but when you use it, you need in 95% of cases the same value (smart default), but for the remaining edge cases you must have an ability how to override the default.

This was already suggested with some workaround in issue #8135 (comment), but this issue was primarily about different topic, so I am creating a separate issue for this.

Issue 2:
This issue was already reported for Twig (https://github.com/fabpot/Twig/issues/792#issuecomment-7393946), but since other users may be having problems with this:

When I render a form using the Twig function form_widget(form) I get:

"An exception has been thrown during the rendering of a template ("Notice: Undefined index: parent ..."

This happens because one of the Twig templates for rendering a form tries to access form.parent, which should retrieve the public property FormView::$parent. Instead, it calls FormView::offsetGet('parent'), which results in the above-mentioned exception being thrown. The cause for this misbehavior is a bug in the Twig PHP extension.

The solution would be to (temporarily) disable the Twig PHP extension by removing it from the list of extensions in your php.ini file.

A question to the maintainer of the Form Component: are unit tests run with and without the Twig PHP extension?
Issue 1:
The DatePickerDialog is a very nice date picker component. Currently, it's only available to be used internally in the DatePicker component. It would be nice to have it as a component that can be used by consumers of material-ui, not just internally.

I also think that the open state should be controlled via a prop. It's pretty nasty to have the component only be able to opened / closed via instance methods.

Issue 2:
How can I add a custom attribute and get its value within onCheck handler?

Example:

<Checkbox
label={this.props.label}
onCheck={this.onCheck}
checked={this.props.checked}
labelStyle={{width: 'initial'}}
data-my-custom-attribute="FOO" // the attribute
/>

onCheck(e, checked) {

// How to get the attribute here?
let foo = e.target.getAttribute('data-my-custom-attribute'); // foo === "FOO"
}
Issue 1:
Hello, when I use a flask, I found that the request will execute multiple responses, I don't know where the problem is

main.py:

import server

def print_hi(name):
print(f'Hi, {name}')

if __name__ == '__main__':
# print_hi('PyCharm')
server.start_server()

server.py:

import json

from flask import Flask, request
from threading import Thread
import logger

import alertManager
import captureutil

app = Flask('')
@app.route('/webhook', methods=['POST', 'GET'])
def post_message():
try:
jsonRequest=request.args.get("jsonRequest")
data = request.data
body_unicode = data.decode('utf-8')
logger.log_handler(f"Trigger response begin ---")

if request.method == 'POST':
if jsonRequest == "true":
if check_json(body_unicode):
json_data = json.loads(data)
logger.log_handler(f" post jsonData:{json_data}")
sendJsonFunc(json_data)
return 'success', 200
else:
logger.log_handler(f" post text :{body_unicode}")
sendTextFunc(body_unicode)
return 'success', 200
else:
logger.log_handler(f" post text :{body_unicode}")
sendTextFunc(body_unicode)
return 'success', 200
else:
logger.log_handler(f" get text :{body_unicode}")
sendTextFunc(body_unicode)
return 'success', 200
except Exception as e:
logger.log_handler("[X] Exception Occured : ", e)
return 'failure', 500

@app.route('/')
def main():
return 'Your bot is alive!'

def run():
logger.log_handler("run 新的一次启动")
app.run(host='127.0.0.1', port=5000)

def start_server_async():
server = Thread(target=run)
server.start()

def start_server():
logger.log_handler("start_server : NewServer Begin")
app.run(host='127.0.0.1', port=5000)

def check_json(input_str):
try:
json.loads(input_str)
return True
except:
return False

def sendJsonFunc(json_data):
return ""
# alertManager.sendJsonMsg(json_data)

def sendTextFunc(TextMsg):
return ""
# alertManager.sendTextMsg(TextMsg)

Issue 2:
With the following example:

from flask import Flask

app = Flask(__name__)

@app.route('/', methods=['POST'])
def hello_world():
return 'Hello World!'

if __name__ == '__main__':
app.run()

When you set the request body to {} with Postman or any HTTP clients, the first request will return 200, while the second request will return a 405 error response. The log shows the request method is {}POST:

"{}POST / HTTP/1.1" 405

Notice the request body became the part of the request method.
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.

Electron Version

12.0.13

What operating system are you using?

macOS

Operating System Version

macos 11.5

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

The debug button can be clicked

Actual Behavior

The debug button can't be clicked

Testcase Gist URL

No response

Additional Information

This is the describe

This is the code

my-electron-app.zip

steps

unzip

npm i && npm start

Click the button at the top

then debug buttons cannot be clicked

Issue 2:
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 an issue that matches the one I want to file, without success.

Issue Details

Electron Version: 11.0.1

Operating System: macOS 10.14.6

Expected Behavior

Devtools should be interactive and the user can control debugging process

Actual Behavior

Devtools not interactive and the user unable to click on any tabs or buttons. Only scroll works.

To Reproduce

I created a repo to reproduce this behavior - https://github.com/Karine91/devtools-webview

To install:

$ git clone https://github.com/Karine91/devtools-webview.git
$ yarn
$ yarn start

After running the project go to the source of preload.js file

Add debugger breakpoint

Reload the page by clicking on github logo

After that debugger paused but you not able to click on any buttons in webview, but scroll works
Issue 1:
Run Gallery -> Text fields

Rotate into landscape mode

Enter some text into the Name field and dismiss the keyboard

Scroll to the bottom of the form, and then scroll back to the top. The Name field will now be blank.

I noticed that the framework is disposing the EditableTextState when the field scrolls out of view. Is that a new behavior and is it intentional?

EditableTextState.dispose() also hides the keyboard, so the dispose might be causing other bugs related to showing/hiding the keyboard during scrolling and relayout (#9221, #9231)

Issue 2:
Not clear here why this is duplicated – although it seems copied.

At a minimum, it'd be nice if this file explained why it's not pub_semver.