WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
How do we add additional responses (e.g. 401, 403, 500, etc..) to the documentation other than the default 200 response and the 422 validation error response?

Issue 2:
First check

I used the GitHub search to find a similar issue and didn't find it.

I searched the FastAPI documentation, with the integrated search.

I already searched in Google "How to X in FastAPI" and didn't find any information.

Description

I have a database pool with which I have to define two exact method except for the @asynccontextmanager decorator.

class Pool:
async def get_con(self):
con = await self.pool.acquire()
try:
yield con
finally:
await self.pool.release(con)

@asynccontextmanager
async def __call__(self):
con = await self.pool.acquire()
try:
yield con
finally:
await self.pool.release(con)

pool = Pool()

One is used in my internal code:

async with pool() as con:
con.fetch()

And the other with the Depends:

@router.get("/item/{id}")
async def get(id: UUID, db: Connection = Depends(pool.get_con)):

In the documentation there is a line which states

But you don't have to use the decorators for FastAPI dependencies (and you shouldn't).

If you try:

@router.get("/item/{id}")
async def get(id: UUID, db: Connection = Depends(pool)):

I actually get an AttributeError. I'm assuming pool is yieled instead of pool.__call__.

AttributeError: '_AsyncGeneratorContextManager' object has no attribute 'fetchrow'

Which makes it pretty clear that I cannot use a contextmanager in a Depends, but this creates duplicate and non consistent code when getting a db connection.

Is this the way it is? Can Depends work with both regular yields and contextmanagers directly?
Issue 1:
Multiple FancyZones

Hi all,

I would like to have the possibility to activate a whole different layout by holding another set of keys. Example: 1) holding Shift key while dragging a Template previously attributed to that command would appear; 2) holding Ctrl + Shift key while dragging another Template for that command would appear; and so on...

I couldn't find that request anywhere. Sorry, by any means, if this is a duplicated suggestion...

Issue 2:
User defined, meaning that the user can actually customize the hotkeys to there own liking

not Microsoft Predefined hotkeys, that cant be changed (microsoft is bad at this)
Issue 1:
Problem description

When we display a list of MenuItems, hovering the mouse results in whatever the mouse landing on being highlighted. From that state, keyboard controls (assuming the list is receiving them) change what is selected, and therefore the highlighting, but the hover highlight does not go away. Moving the mouse between menu items replaces both highlightings.

Steps to reproduce

create a paper element

create a series of menuitem elements inside the paper element

hover mouse over a menu item

press the down arrow

Versions

Material-UI: 1.0.0-beta.4

React: 15.6.1

Browser: IE11, chrome 60.0.3112.90

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

Expected Behavior

When using the latest beta26 under TypeScript, I expect to be able to leverage the changes to zIndex, namely theme.zIndex.drawer.

Current Behavior

The TypeScript typings were not updated with the changes, and reference removed keys as well as lacking the newer (e.g., drawer, etc) keys.

Steps to Reproduce (for bugs)

Look at: https://github.com/mui-org/material-ui/blob/bd42549ee464bce03743f7ee18964066f9d3907d/src/styles/zIndex.js

Then look at the type definition: https://github.com/mui-org/material-ui/blob/bd42549ee464bce03743f7ee18964066f9d3907d/src/styles/zIndex.d.ts

Note the differences in keys defined for zIndex (also noted in the Changelog: https://github.com/mui-org/material-ui/releases/tag/v1.0.0-beta.26)

Context

I was previously using theme.zIndex.navDrawer, and on upgrading to beta26 noticed that I had styling issues -- further investigation revealed the zIndex wasn't being set at all, but this wasn't caught by the TypeScript compiler (because the types hadn't been updated).

Your Environment

TypeScript 2.6.2, NodeJS 8.9.1, OSX High Sierra

Tech
Version

Material-UI
1.0.0-beta26

React
16.2.0

browser
Chrome 63.0.3239.84 (Official Build) (64-bit) OSX
Issue 1:
In UI

In runner it is OK:

System info

Playwright Version: [v1.33.0]

Operating System: [Windows 11]

Browser: [Chromium]

Other info:

Base on default code after running 'npx init playwright@latest'

VSC extension: Playwright Test for VSCode v1.0.11

VSC: 1.78.2

Source code

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

File structure (base on defaults provided by running: npm init playwright@latest)

Config file

Added to default config: baseUrl, and projects with session

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

export const STORAGE_STATE = path.join(__dirname, "session.json");
export default defineConfig({
testDir: "./tests",
globalSetup: "global-setup.ts",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: "html",
use: {
trace: "on-first-retry",
baseURL: "https://demo-bank.vercel.app",
},
projects: [
{
name: "setup-project",
testMatch: "**/*.setup.ts",
},
{
name: "authenticated tests",
testMatch: "**/*example.spec.ts",
dependencies: ["setup-project"],
use: {
storageState: STORAGE_STATE,
},
},
],
});

IMPORTANT: Global setup for clearing session to avoid false positives

//global-setup.ts
import fs from "fs";
import { STORAGE_STATE } from "./playwright.config";

async function globalSetup() {
// Remove session
if (fs.existsSync(STORAGE_STATE)) {
fs.unlinkSync(STORAGE_STATE);
}
}

export default globalSetup;

Test file (self-contained)

//login.setup.ts
import { test as setup, expect } from "@playwright/test";
import { STORAGE_STATE } from "../playwright.config";

setup("successful login with correct credentials", async ({ page }) => {
await page.goto("/");
console.log("Running setup: successful login with correct credentials...");
await page.getByTestId("login-input").fill('testerxx');
await page.getByTestId("password-input").fill('12345678');
await page.getByTestId("login-button").click();

await expect(page.getByTestId("user-name")).toHaveText("Jan Demobankowy");

await page.context().storageState({ path: STORAGE_STATE });
});

//example.spec.ts
import { test, expect } from "@playwright/test";

test.describe("Logged test", () => {

test("mock bank panel @logged", async ({ page }) => {
await page.goto("/pulpit.html");
await expect(page.getByTestId("user-name")).toHaveText("Jan Demobankowy");
});
});

Steps

npx playwright test --ui

try run test what contain dependencies

Expected

Test and it's dependencies run successfully

Actual

Test fail, dependencies not run before test

Issue 2:
Running playwright test with a test that have a dependency. For example the below snippet will run the setup dependency when running npx playwright test. In UI mode I would reasonably expect the same - in that when running a test that has a dependency it would run the dependency first and then run the test. This is currently not the case.

name: 'loggedIn',
use: {
...devices['Desktop Chrome'],
storageState: STORAGE_STATE,
},
testIgnore: ['**/*login.spec.ts', '**/*.setup.ts'],
dependencies: ['setup'],
},```
Issue 1:
Code

fn foo1(x: &str) {
println!("foo1({})", x);
}

fn foo2(x: &str) {
println!("foo2({})", x);
}

macro_rules! wtf {
(1) => (foo1);
(2) => (foo2);
}

macro_rules! wtf_foo {
($x:expr, $num:expr) => {
wtf!($num)($x);
}
}

fn main() {
//Fails
wtf_foo!("one", 1);
//Works
wtf!(1)("one");
}

Output

$ rustc foo.rs
foo.rs:16:8: 17:12 error: no rules expected the token `1`
foo.rs:16 wtf!($num)($x);
^~~~

Expected Output

$ rustc foo.rs
foo.rs:5:1: 7:2 warning: function is never used: `foo2`, #[warn(dead_code)] on by default
foo.rs:5 fn foo2(x: &str) {
foo.rs:6 println!("foo2({})", x);
foo.rs:7 }
$ ./foo
foo1(one)
foo1(one)

Other

This works fine, so the problem appears to be limited to literal patterns (not sure if that's the right term):

macro_rules! print_stuff_for_real {
($x:expr) => (println!("Printing stuff: {}", $x));
}

macro_rules! print_stuff {
($x:expr) => (print_stuff_for_real!($x));
}

fn main() {
print_stuff!("stuff");
}

Meta

I used two versions of rustc; they behaved identically.

rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)
binary: rustc
commit-hash: a59de37e99060162a2674e3ff45409ac73595c0e
commit-date: 2015-05-13
build-date: 2015-05-14
host: x86_64-unknown-linux-gnu
release: 1.0.0

rustc 1.2.0-nightly (f76d9bcfc 2015-05-28) (built 2015-05-28)
binary: rustc
commit-hash: f76d9bcfc2c269452522fbbe19f66fe653325646
commit-date: 2015-05-28
build-date: 2015-05-28
host: x86_64-unknown-linux-gnu
release: 1.2.0-nightly

Issue 2:
With the exception of metavariables with ident and tt fragment specifiers, a macro that passes a metavariable into another macro which contains the raw tokens specified by that metavariable in the matcher will throw a no rules expected the token `{tokens}` error, despite the raw tokens matching up.

The code in this gist should all compile, but doesn't with the given error messages: https://gist.github.com/Osspial/d0eb4827d764aa40912bface538dd0ea

Meta

> rustc --version --verbose
rustc 1.16.0 (30cf806ef 2017-03-10)
binary: rustc
commit-hash: 30cf806ef8881c41821fbd43e5cf3699c5290c16
commit-date: 2017-03-10
host: x86_64-pc-windows-gnu
release: 1.16.0
LLVM version: 3.9
Issue 1:
I also think is a pain-in-the-ass to have to manually click on "Only in selection".

NetBeans handles this quite good, if you had a selection before searching it will automatically activate that for you.

Issue 2:
Hello, i try change keybind for ctrl-alt-f and dont work. I using windows7 and latest version of Atom.

'atom-workspace atom-text-editor:not([mini])':

'ctrl-alt-f: 'editor:fold-selection'

i changed to

'atom-workspace atom-text-editor:not([mini])':

'ctrl-alt-1: 'editor:fold-selection'
Issue 1:
According to https://github.com/plnice/can-i-drop-jetifier, Glide still references support libs and Jetifier cannot be turned off.

* com.github.bumptech.glide:glide:4.9.0
\-- com.android.support:support-fragment:27.1.1
\-- com.android.support:animated-vector-drawable:27.1.1
\-- com.github.bumptech.glide:gifdecoder:4.9.0
\-- com.android.support:support-annotations:27.1.1

Issue 2:
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
11-27 19:24:00.443 5411-5411/com.pic*****:******* E/Glide: class com.bumptech.glide.load.engine.GlideException: Failed to load resource
11-27 19:24:00.443 5411-21483/com.pic*****:******* E/GlideExecutor: Request threw uncaught throwable
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at java.util.Collections$UnmodifiableList.get(Collections.java:1050)
at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:58)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:273)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:240)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:218)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:200)
Issue 1:
@flipside: 'I don't use the data browser graph view as much as I'd like to because the screen gets cluttered very fast as I add more and more nodes with all the grey, unselected nodes on the screen. It'd be really great if there was a button to hide all this unselected nodes and relationships so I can get an uncluttered look at the part of the graph I'm interested in.

Thanks,

-Mat'

Issue 2:
@peterneubauer: ''
Issue 1:
Sometimes you need to parse and modify URL yourself. There is parse_url function in PHP. But it returns all components as array. Rebuilding the URL from the array is a little bit cumbersome because you need lots of checks like here http://stackoverflow.com/questions/4354904/php-parse-url-reverse-parsed-url#answer-31691249

And there is also some hardcoded logic in UrlGenerator like this

https://github.com/symfony/Routing/blob/master/Generator/UrlGenerator.php#L58

So it's hard to build it the same way UrlGenerator does it. OFC one can use the generator for it but it's not usable for URLs which are not routed.

I think it would be nice to move this logic to a new value object so one can use it for creating/modifying URLs. Like this

https://github.com/nette/http/blob/master/src/Http/Url.php

Not only UrlGenerator could use it. For example RedirectResponse is another candidate which could return it instead of a string so one can just for example safely append query parameter to it. I was solving this issue in my custom authentication failure handler which overrides the default symfony one and appends query parameter to the RedirectResponse.

What do you think?

EDIT: Or if it was too big change then at least moving the hardcoded logic from urlgenerator would also be useful. Maybe even just an utility class...

Issue 2:
Naïve list gathered with grep. Let's make using each of these usable, standalone, in a PSR-7 centric app, or just check if there is something to do, or decide to not do it.

May handle PSR-7:

Bridge/Doctrine (see #15414 (comment))

Bridge/Monolog

Bridge/Swiftmailer (see #15414 (comment))

Bridge/Twig

Component/Asset

Component/Debug (see #15415 and #15418)

Component/Form

Component/Routing

Component/Security/Core

Component/Security/Csrf (see #15414 (comment))

Component/Security/Http

Component/Translation (see #15414 (comment))

Component/Validator (see #15421)

May not handle PSR-7:

Component/HttpFoundation

Component/HttpKernel

Bundle/DebugBundle

Bundle/FrameworkBundle

Bundle/SecurityBundle

Bundle/TwigBundle

Bundle/WebProfilerBundle
Issue 1:
Describe what you were doing when the bug occurred:

1.

2.

3.

Please do not remove the text below this line

DevTools version: 4.10.0-11a2ae3a0d

Component stack: CommitFlamegraphAutoSizer@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:34133:50

div

div

div

SettingsModalContextController@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:28194:1

Profiler_Profiler@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:35761:50

ErrorBoundary_ErrorBoundary@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:29208:5

PortaledContent@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:29325:27

div

div

ProfilerContextController@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:32922:1

TreeContextController@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:24310:1

SettingsContextController@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:24799:1

ModalDialogContextController@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:29392:1

DevTools_DevTools@moz-extension://6d279fb6-5484-4bfe-af1b-7776429d75f6/build/main.js:36195:1

Issue 2:
Describe what you were doing when the bug occurred:

Go to profile tag

Click to record

After stop recording, click on any commits.

Please do not remove the text below this line

DevTools version: 4.9.0-75726fadfd

Component stack: CommitFlamegraphAutoSizer@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:33986:50

div

div

div

SettingsModalContextController@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:28047:1

Profiler_Profiler@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:35614:50

ErrorBoundary_ErrorBoundary@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:29061:5

PortaledContent@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:29178:27

div

div

ProfilerContextController@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:32775:1

TreeContextController@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:24163:1

SettingsContextController@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:24652:1

ModalDialogContextController@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:29245:1

DevTools_DevTools@moz-extension://7ef91e4d-0a91-434a-b6fa-c2646d78406c/build/main.js:36048:1
Issue 1:
Hi,

I must say I'm new to typescript, but I try to use it with React and Redux.

I met the next case, here I'm trying to use the decorator @connect together with my component:

@autobind
@connect((store) => {
return {
states: store.states
};
})
export default class Index extends React.Component<any, any> {
componentWillMount() {
this.props.dispatch(loadStates())
}
render() {
return (
<section className="container">
<h1>Webpack React</h1>
<div className="panel panel-default">
hello
</div>
</section>
)
}
}

During the compilation the error appears:

ERROR in ./app/pages/Index.tsx
(8,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
Type 'ComponentClass<{}>' is not assignable to type 'typeof Index'.
Type 'Component<{}, ComponentState>' is not assignable to type 'Index'.
Property 'componentWillMount' is missing in type 'Component<{}, ComponentState>'.

In case I will remove the componentWillMount method from the component - there is no error.

After that, I've tried to apply the connect as a function call, like this:

@autobind
class Index extends React.Component<any, any> {
componentWillMount() {
this.props.dispatch(loadStates())
}

render() {
return (
<section className="container">
<h1>Webpack React</h1>
<div className="panel panel-default">
hello
</div>
</section>
)
}
}

export default connect((store) => {
return {
states: store.states
};
})(Index);

This works fine, no errors during the compilation.

I really want to use decorators as long as I can. Unfortunately the produced error doesn't ring a bell to me :) I would be glad in case somebody can point me to the right direction.

pinging @tkqubo, @jgillich as I saw you helped in the similar topic:

#6237

Let me know if I can provide more information.

Regards,

Issue 2:
One of the best 2d physics engines available: https://github.com/josephg/Chipmunk-js

Despite a low user base it has great potential and seems to be more up-to-date than the popular Box2dWeb.

TypeScript definitions would be highly appreciated :)
Issue 1:
should raise when orient='columns' and index is non_unique

orient='index' and column is non_unique?

I'm trying out to_json and read_json on a data frame with 800k rows. However, after calling to_json on the file, read_json gets back only 2k rows. This happens if I call them in series or if I give to_json a filename and call the filename with read_json. Judging by the size of the file, all the data is being written (the json is roughly the size of the pickled data frame object). Any idea what's going on?

Issue 2:
In the above, I have a region that I'm querying for with a partially overlapping interval. The query succeeds when the interval is partially overlapping until it doesn't, throwing the key error:

KeyError Traceback (most recent call last)
/Users/alex/Documents/GarNet/venv/lib/python3.6/site-packages/pandas/core/indexing.py in _has_valid_type(self, key, axis)
1433 if not ax.contains(key):
-> 1434 error()
1435 except TypeError as e:

/Users/alex/Documents/GarNet/venv/lib/python3.6/site-packages/pandas/core/indexing.py in error()
1428 raise KeyError("the label [%s] is not in the [%s]" %
-> 1429 (key, self.obj._get_axis_name(axis)))
1430

KeyError: 'the label [(5409951, 5409965]] is not in the [index]'

I think this is particularly confusing because there doesn't seem to be any prominent difference between the locs that succeed and the loc that fails as far as I can tell. I know we had discussed loc's behavior in this context but I'm not sure we came to a conclusion.

By the way, my larger question is about how to find intersections between two IntervalIndex. It seems like the find_intersections function didn't make it into this release @jreback ? Let me know! =]
Issue 1:
the "well" class is as close as I can find to a generic rounded corner container. However, that seems somewhat specialized to me. How do you feel about a more simplistic rounded corner box without the inner box shadow?

Issue 2:
Would you consider adding a component that is not a well, thumbnail, or modal, but something in between? Especially with Modal dropping the .hide class in v3 I see a great need. For example, take a look here on GitHub at the ReadMe box. It has similarities to a modal in that it has a heading and sits "above" the page a bit. Another example is the "example" boxes here in the v2 docs.

Of course, thumbnail is inappropriate, and well loses importance to some degree. The generic term "widget" is the best name I can come up with, but there's probably a better term without quite the stigma.

I'd be more than happy to add a pull request if that helps.

Thanks for all the hard work!
Issue 1:
From @voxking on March 14, 2016 23:12

VSCode Version: 0.10.10

OS Version: Windows 10

Typescript says things are duplicate when i move a file around.

My guess is that the location of the file is not updated in the typescript service properly because when i restart VSCode it fixes itself but still its annoying to have to restart the editor.

Steps to Reproduce:

get a large typescript code base like react.d.ts or something similar

move it

watch it happen

Copied from original issue: microsoft/vscode#4211

Issue 2:
TypeScript Version:

If the version number were in the sources, i could answer this. bower says it's 1.8.x

Code

// this is compiled JS code from some random bit of ts...
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};

Expected behavior:

typeof ... === "object" is insufficient for such checks because of this JS quirk:

(typeof null === "object")

Actual behavior:

Such uses should include a null/falsy check:

if(Reflect && typeof Reflect==="object" && ...)

Update: as Daniel points out, the typeof check needs to come first:

if(typeof Reflect==="object" && Reflect && ...)

because typeof special-cases the handling of undefined symbols (as opposed to those when the undefined value).
Issue 1:
Hello ,

I've got a problem ... my files in PHP are not coloring ... it always happens that involves files in PHP ... any solution? My Atom is in Patch 0.201.0

Thank you !!

Waiting for answers !

Issue 2:
I am was using Elementary OS and version 0.107.0, and when I write PHP and this happens:

The surrounding HTML code is highlighted, but PHP isn't.

It's even worse when you have a string in the PHP code, because the whole following text (even after ?>) is seen as html value and has the same color.

I believe this package should be responsible for this: https://atom.io/packages/language-php , please tell me if this is the wrong place, but i'm not sure if it is a general atom issue.

Please note that javascript and CSS are highlighted when written inside of the HTML.