WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
🐛 Bug

Hello,

Trying to subclass:

class MyPool(torch.multiprocessing.Pool):
pass

Ends up with:

TypeError: method expected 2 arguments, got 3

This does makes sense, as it is not possible to subclass python's multiprocessing.Pool as well - but only multiprocessing.pool.Pool.

multiprocessing.Pool is not a type, but rather a context method:

print ( torch.multiprocessing.Pool)
#output:
<bound method BaseContext.Pool of <multiprocessing.context.DefaultContext object at 0x10f4bd550>>

The main problem is that torch doesn't expose the torch.multiprocessing.pool module - so it impossible to subclass torch.multiprocessing.pool.Pool()

AttributeError: module 'torch.multiprocessing' has no attribute 'pool'

This might be related to #16954 - but I don't think it's a dupe, as the main problem here is exposing the torch.pool module.

Issue 2:
🐛 Bug

Trying to subclass:

class MyPool(torch.multiprocessing.Pool):
pass

Ends up with:

TypeError: method expected 2 arguments, got 3

This does makes sense, as it is not possible to subclass python's multiprocessing.Pool as well - but only multiprocessing.pool.Pool.

multiprocessing.Pool is not a type, but rather a context method:

print ( torch.multiprocessing.Pool)
#output:
<bound method BaseContext.Pool of <multiprocessing.context.DefaultContext object at 0x10f4bd550>>

The main problem is that torch doesn't expose the torch.multiprocessing.pool module - so it impossible to subclass torch.multiprocessing.pool.Pool()

AttributeError: module 'torch.multiprocessing' has no attribute 'pool'

This might be related to #16954 - but I don't think it's a dupe, as the main problem here is exposing the torch.pool module.

To Reproduce

Steps to reproduce the behavior:

class MyPool(torch.multiprocessing.Pool):

Expected behavior

It should be possible to subclass torch's multiprocessing pool.

Environment

PyTorch version: 1.0.0

Is debug build: No

CUDA used to build PyTorch: 9.0.176

OS: Ubuntu 16.04 LTS,

GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609

CMake version: Could not collect

Python version: 3.6

Is CUDA available: Yes

CUDA runtime version: Could not collect

GPU models and configuration: GPU 0: Tesla P100-PCIE-12GB

Nvidia driver version: 390.30

cuDNN version: Could not collect

Versions of relevant libraries:

[pip3] numpy==1.14.3

[pip3] torch==1.0.0

[pip3] torchvision==0.2.1

[conda] Could not collect
Issue 1:
Flaky DruidCoordinatorBalancerTests.testMoveToEmptyServerBalancer after #4472

@leventov @dgolitsyn

Issue 2:
Running io.druid.server.coordinator.DruidCoordinatorBalancerTest
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.247 sec <<< FAILURE! - in io.druid.server.coordinator.DruidCoordinatorBalancerTest
testMoveToEmptyServerBalancer(io.druid.server.coordinator.DruidCoordinatorBalancerTest) Time elapsed: 0.22 sec <<< FAILURE!
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertTrue(Assert.java:52)
at io.druid.server.coordinator.DruidCoordinatorBalancerTest.testMoveToEmptyServerBalancer(DruidCoordinatorBalancerTest.java:207)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Issue 1:
Hi all!

I came accross and odd behaviour on binding my css classes to HTML elements.

Am I supposed to use an expression on [class] property?

Example:

HTML Element:

The css class properties are not visible on the HTML (background color).

As you can see, I used an expression to bind the class of the element.

But the output has hyphens instead of Capital Letters.

The expected output of the class:

MenuItemBlueColor

By the way, the class exists and the expected output would be the background color.

Best regards,

Tiago Braga

Issue 2:
I'm finding problems with css that uses camel case when using CSSClass because this line automatically converts each class to dashed case.

Can we have a choice between camel case and raw input when using the CSSClass directive?

Would be nice if we could provide a means to configure CSSClass directive per component.
Issue 1:
Instead, it returns a tuple type (Port,Chan), which is inconsistent with other Type::new() does.

Rename to PortAndChan::new() ? or Chan::new_port_and_chan()? or something other should be change or refactor.

@alexcrichton

Issue 2:
The current Chan::new() -> (Port, Chan) is confusing because new returns a tuple instead of a new object, 'port' and 'chan' are not intuitive, and the name 'chan' is reused for two purposes (the sender and the total channel).

Some proposed alternatives:

Chan::open() -> (Source, Sink)

Chan::new() -> (Source, Sink)

Chan::new() -> (Sender, Receiver)

Chan::new() -> (Source, Drain)

pipe() -> (Port, Chan)

Also need to consider whether sender or receiver comes first in the tuple.

Nominating.

Discussion: https://mail.mozilla.org/pipermail/rust-dev/2014-January/007928.html
Issue 1:
VSCode Version:

1.1.1

OS Version:

Win 10

Steps to Reproduce:

Create a new file in notepad, save it as ANSI (on my machine Ansi = Windows-1252)

Open the file in vs code

Result: VSCode assumes UTF-8 and the file is corrupted. Sublime-text has no problem recognizing Windows-1252.

Issue 2:
Steps to reproduce:

set up environment

git clone https://github.com/minggo/vscode-issue
cd vscode-issue
npm install

set breakpoint at this line

debug as a node app

input ast in Debug Console

input ast.classes in Debug Console

Then you will meet cancelled because node is unresponsive error.
Issue 1:
System info

Playwright Version: [v1.35.1]

Operating System: [macOS Ventura 13.0]

Browser: [All]

Other info: Nx monorepo, using @nxkit/playwright extension

Source code

I provided exact source code that allows reproducing the issue locally.

Config file

// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
testDir: './src/e2e',
retries: process.env.CI ? 2 : 0,
maxFailures: 2,
timeout: 30 * 1000,
expect: {
timeout: 5000,
},
use: {
baseUrl: 'http://localhost:4200/',
actionTimeout: 0,
video: 'off',
trace: 'off',
},
fullyParallel: true,
forbidOnly: !!process.env.CI,
workers: process.env.CI ? 1 : undefined,
reporter: [
['html', { outputFolder: '../../.playwright/app-name' }],
[
'json',
{
outputFile: '../../.playwright/app-name/test-results.json',
},
],
],
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
},
});

Test file (self-contained)

it('should show homepage', async ({ page }) => {
await page.goto(pageUrl);
await page.screenshot({ path: 'folderOne/screenshot-name.png' }); // working fine
await page.screenshot({ path: 'folderOne/folderTwo/screenshot-name.png' }); // not working
});

Steps

[Run the test]

Expected

The 1st screenshot is saved in {root}/folderOne/screenshot-name.png.

The 2nd screenshot is saved in {root}/folderOne/folderTwo/screenshot-name.png.

Actual

The 1st screenshot is saved in {root}/folderOne/screenshot-name.png.

The 2nd screenshot is saved in {root}.

Why is it not possible to save the screenshot in more than one layer of folders?

The folder exists in the repo.

Issue 2:
System info

Playwright Version: [v1.34.3]

Operating System: [macOS 13.2.1]

Browser: [Chromium, Firefox]

Other info:

Source code

I provided exact source code that allows reproducing the issue locally.

import { test } from '@playwright/test';

test.describe('verify', async () => {
test('test Case Name', async ({ page }) => {
page.on('request', (request) => {
if (request.method() === 'POST') {
console.log(request.method());
console.log(request.url());
console.log(request.postData());
console.log(request.postDataJSON());
console.log(request.postDataBuffer());
}
});
await page.goto('https://google.com');
const inputs = await page.locator('[type="submit"]').all();
await inputs[3].click();
});
});

Steps

[Run the test]

Expected

postData to return payload

postDataJSON to return payload

postDataBuffer to return payload

Actual

returns null

The test above returns null for postDataJSON() and for postDataBuffer() and for postData(). I also tried using page.WaitForRequest() to get the payload, but the same result, null instead of payload. I tried both Chromium and Firefox.
Issue 1:
Hello,

It would be very helpful if the PowerRename window stays open once a rename action is completed. On many occasion, I need to do many PowerRename action to have all the files renamed following the same pattern, but for each action, I need to re-open PowerRename. A button would need to be added to close the window.

Issue 2:
Summary of the new feature/enhancement

If I need to perform more than one action, it's very unhandy because i need to restart the tool again.

Proposed technical implementation details (optional)

Leave Power Rename open after performing a change (or make an option for it)
Issue 1:
I am compiling SCSS and externalizing the resulting CSS into a file using sass-loader and extract-text-webpack-plugin in next.config.js. The compiled CSS file is being emitted into the .next folder. I also have some static resources, i.e. images and fonts that I'm referencing in the stylesheet. These static resources are also being compiled into the .next folder using the file-loader plugin in next.config.js.

However, when the page loads in the browser, I get a 404 on these resources because NextJS seems to prepend their paths with a /_next/webpack/ in the compiled CSS file:

http://54.197.22.181/_next/webpack/52a802f51895f840821c1083434f3d84.ttf

Is there any workaround to this issue? I really need to use SASS and keep the compiled CSS as an external file as against embedded style. So, the CSS-in-JS model isn't what I'm comfortable with.

For reference, my project is hosted at https://github.com/amitsch666/nano.

Here's the relevant rule I have in my next.config.js:

{ test: /\.(ttf|eot|png)$/, loader: 'file-loader' }

Here's the font declaration in my scss file:

@font-face {
font-family: 'Lemonada';
src: url('../static/fonts/Lemonada/Lemonada-Regular.ttf');
src: url('../static/fonts/Lemonada/Lemonada-Bold.ttf');
src: url('../static/fonts/Lemonada/Lemonada-SemiBold.ttf');
src: url('../static/fonts/Lemonada/Lemonada-Light.ttf');
}

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

Update: I have managed to make my site work by routing all _next/webpack/static/ requests to /.next/static in my Express middleware. However, this still seems a tad hackish to me and would love to hear if someone has a more "standard" solution.

Issue 2:
Production mode works as expected. Running the example in development mode does not build the common.js file.

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

Expected Behavior

Both main.js and I expect common.js to exist in the /.next directory in development mode.

Current Behavior

In the browser console:

GET http://localhost:3000/_next/-/commons.js net::ERR_ABORTED
[HMR] connected
GET http://localhost:3000/_next/-/commons.js 404 (Not Found)

I have checked in the .next directory and it's definitely not there.

Steps to Reproduce (for bugs)

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/using-preact

cd using-preact

npm i

npm run dev

Context

I am unable to run next-preact or the current with-preact example in development mode.

Your Environment

Tech
Version

next
5.0.0

node
8.9.4

OS
MacOS 10.13.3

browser
Chrome 63.0.3239.132
Issue 1:
Reproducing code example:

import numpy as np
import matplotlib.pyplot as plt

n_groups = 4
means_frank = (90, 55, 40, 65)
means_guido = (85, 62, 54, 20)

fig, ax = plt.subplots()
index = np.arange(n_groups)
bar_width = 0.35
opacity = 0.8

rects1 = plt.bar(index, means_frank, bar_width,
alpha=opacity,
color='b',
label='Frank')

rects2 = plt.bar(index + bar_width, means_guido, bar_width,
alpha=opacity,
color='g',
label='Guido')

plt.xlabel('Person')
plt.ylabel('Scores')
plt.title('Scores by person')
plt.xticks(index + bar_width, ('A', 'B', 'C', 'D'))
plt.legend()

plt.tight_layout()
plt.show()

Error message:

RuntimeError: The current Numpy installation ('C:\\Users\\Username\\AppData\\Local\\Programs\\Python\\Python39\\Lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime.

NumPy/Python version information:

Python version : python3.9

NumPy version : numpy1.19.4

Issue 2:
This is a BUG

train = np.zeros([26,26])
train2 = np.zeros([26,26])
tmp = [1,2,3,4,5,6,1,2,3,4,5,6]
train[tmp[0:-1], tmp[1:]] += 1
for i in range(len(tmp)-1):
train2[tmp[i], tmp[i+1]] += 1
print(np.sum(train - train2))

the output is -5

I find that train is not equal to train2 when there are some duplicate tuples in tmp. Is there something wrong in numpy slicing.
Issue 1:
I create a new project using cargo new hello_world --bin, and then run cargo build -v, but get the following error.

Process didn't exit successfully: `rustc - --crate-name - --crate-type dylib --crate-type bin --print=file-names` (status=101)
--- stderr
error: crate name cannot start with a hyphen: -
error: aborting due to previous error

This error just started appearing since I updated to the latest nightly.

Incidentally, there seems to be no different to the Cargo.toml file or directory structure or indeed main.rs file, regardless of whether I specify the --bin option or not to cargo new. Is this right?

Issue 2:
With a fresh build of both rustc and cargo, cargo build and other similar commands are executing rustc somewhere along the way with the crate name -, which is completely forbidden since rust-lang/rust#22664 landed a few hours ago. I guess it used to work in some manner or other but is now a non-zero exit code propagating to cause failure of the build.

This is happening on all my libraries, regardless of any dependencies they may or may not have.

$ cargo build --verbose
Process didn't exit successfully: `rustc - --crate-name - --crate-type dylib --crate-type bin --print=file-names` (status=101)
--- stderr
error: crate name cannot start with a hyphen: -
error: aborting due to previous error

cargo 0.0.1-pre (b6c07a6 2015-02-24 00:28:31 +0000)

rustc 1.0.0-dev (91a5a1ab4 2015-02-23) (built 2015-02-24)
Issue 1:
<button class="btn btn-primary btn-lg" data-toggle="modal tooltip" title="Tooltip on left" data-target="#myModal">
Launch demo modal
</button>

In the above modal button code, I have included the tooltip code such as

title="Tooltip on left" and data-toggle="tooltip". Then this modal button does not show tooltip and also not modal.

When I remove tooltip from data-toggle, then modal works and when I remove modal from data-toggle, then tooltip works.

Please give some solution to deal with this.

Issue 2:
Since #6380 the recommendation has been to use data-toggle="tooltip" and data-toggle="popover", alongside the existing data-toggle="modal" and data-toggle="dropdown" attributes, which is a good idea.

However, sometimes you might want to show a tooltip on a button which also toggles a modal or a dropdown.

It's not possible to use multiple data-toggle attributes on the same node, and [data-toggle=modal] doesn't match data-toggle="tooltip modal".

Possibilities:

Use the ~= selector, which matches one of a set of space-separated attributes: [data-toggle~=modal]

Use separate "data-toggle-tooltip", "data-toggle-popover", "data-toggle-modal", "data-toggle-dropdown" attributes.
Issue 1:
by benjamin.heatwole:

$GOOS = linux
$GOARCH = amd64
hg identify = f7e1cbc5ce28 tip

Compile the following code demonstrating the issue using 6g/6l:

func main() {
var min float32 = math.MinFloat32
var minPlusOne float32 = min + 1.0
var negOne float32 = -1.0
var zero float32 = 0.0
var one float32 = 1.0

// All these should be true, but only the comparison with a
positive number works
fmt.Println("Testing comparisons using math.MinFloat32 ... ")
fmt.Printf("%v > %v = %v\n", negOne, min, negOne > min)
fmt.Printf("%v > %v = %v\n", zero, min, zero > min)
fmt.Printf("%v > %v = %v\n", one, min, one > min)
fmt.Println()

// Adding one to MinFloat32 doesn't help
fmt.Println("Testing comparisons using math.MinFloat32 + 1 ... ")
fmt.Printf("%v > %v = %v\n", negOne, minPlusOne, negOne >
minPlusOne)
fmt.Printf("%v > %v = %v\n", zero, minPlusOne, zero > minPlusOne)
fmt.Printf("%v > %v = %v\n", one, minPlusOne, one > minPlusOne)
fmt.Println()

// Using another small value works
var small float32 = -999999.0
fmt.Println("Testing comparisons using -999999.0 ... ")
fmt.Printf("%v > %v = %v\n", negOne, small, negOne > small)
fmt.Printf("%v > %v = %v\n", zero, small, zero > small)
fmt.Printf("%v > %v = %v\n", one, small, one > small)
fmt.Println()

// One final test
fmt.Println("Testing 0 == MinFloat32 ... ")
fmt.Printf("%v == %v = %v\n", zero, min, zero == min)
}

Output is:

Testing comparisons using math.MinFloat32 ...
-1 > 1e-45 = false
0 > 1e-45 = false
1 > 1e-45 = true

Testing comparisons using math.MinFloat32 + 1 ...
-1 > 1 = false
0 > 1 = false
1 > 1 = false

Testing comparisons using -999999.0 ...
-1 > -999999 = true
0 > -999999 = true
1 > -999999 = true

Testing 0 == MinFloat32 ...
0 == 1e-45 = false

As you can see from the tests, MinFloat32 is being printed as "1e-45" but
internally its treating the value as "0" in some cases (the second test
with MinFloat32+1 prints as "1"), but not in others (the last test of 0 ==
MinFloat32 is false).

I'm not sure entirely what's going on, but something is goofy.

Issue 2:
Context: http://tour.golang.org/moretypes/20

For someone starting to program, this sentence is not very useful. How about providing a bit of context as to why this would be useful?
Issue 1:
I saw the below code used in several places so that LabelBinarizer() can be used within pipeline. Can it be added as a part of sklearn default?

from sklearn.preprocessing import LabelBinarizer

class LabelBinarizerPipelineFriendly(LabelBinarizer):
def fit(self, X, y=None):
"""this would allow us to fit the model based on the X input."""
super(LabelBinarizerPipelineFriendly,self).fit(X)
def transform(self, X, y=None):
return super(LabelBinarizerPipelineFriendly, self).transform(X)
def fit_transform(self, X, y=None):
return super(LabelBinarizerPipelineFriendly, self).fit(X).transform(X)

The problem is that LabelBinarizer()'s functions take one parameter, while they should take the X, y = None params. I undestand that this would lead to changing interface (=major change), but it seems to be reasonable and consistent with the general interface.

Issue 2:
I get this error when I try to use LabelBinarizer and LabelEncoder in a Pipeline:

sklearn/pipeline.pyc in fit_transform(self, X, y, **fit_params)
141 Xt, fit_params = self._pre_transform(X, y, **fit_params)
142 if hasattr(self.steps[-1][-1], 'fit_transform'):
--> 143 return self.steps[-1][-1].fit_transform(Xt, y, **fit_params)
144 else:
145 return self.steps[-1][-1].fit(Xt, y, **fit_params).transform(Xt)

TypeError: fit_transform() takes exactly 2 arguments (3 given)

It seems like this is because the classes' fit and transform signatures are different from most other estimators and only accept a single argument.

I think this is a pretty easy fix (just change the signature to def(self, X, y=None)) that I'd be happy to send a pull request for, but I wanted to check if there were any other reasons that the signatures are the way they are that I didn't think of.
Issue 1:
Environment

Introduced by #2422

Since we'll be defaulting to the Windows Terminal default settings, this means that the user may be working with profiles that don't exist AFTER the proper settings are imported. Below is an example of such a case, but several other places may cause the same issue to arise.

I'd bet that this is because we usually use "FindProfile()" (or something like that) and we just don't handle that properly.

Steps to reproduce

create a tab from the WT default settings

import your custom settings

duplicate the created tab

Expected behavior

Not sure. Maybe a dialogue box saying "This operation could not be completed"?

Actual behavior

CRASH!

Issue 2:
Environment

Windows Terminal version: Version: 0.6.2951.0

Microsoft Windows [Version 10.0.18362.418]

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Windows Terminal version (if applicable):

Any other software?

Steps to reproduce

Install Ubuntu 18.04 (on WSL 1.0), install minicom inside Ubuntu.

Open Windows Terminal and run Ubuntu 18.04

Open minicom from Windows Terminal and try to capture serial console message from any embedded dev. board (say Raspberry PI)

You will see messages scrolling above the view port. If you scroll up you won't see the messages from the minicom.

Expected behavior

If I scroll up, I should be able to see the serial console messages from my embedded target.

Actual behavior

Scroll up shows my command that I typed long ago. The serial console message is lost. If I run Ubuntu terminal directly (instead of doing the same from Windows Terminal), I could scroll up and see right messages.

Not sure, may be ncurses behavior is not compatible with Windows Terminal's expectations?