WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Describe the bug

Mounting StaticFiles with an APIRouter doesn't work.

To Reproduce

from typing import Any
from fastapi import FastAPI, Request, APIRouter
from fastapi.staticfiles import StaticFiles
from fastapi.testclient import TestClient

router = APIRouter()

@router.get("/")
async def foo(request: Request) -> Any:
# this raises starlette.routing.NoMatchFound
return request.url_for("static", path="/bar")

app = FastAPI()

router.mount("/static", StaticFiles(directory="."), name="static")
# uncomment to fix
# app.mount("/static", StaticFiles(directory="."), name="static")

app.include_router(router)

client = TestClient(app)
client.get("/")

Execute the script, raises NoMatchFound

Uncomment line to mount with app instead

Executes as expected

Expected behavior

I can use APIRouter() as if it was a FastAPI() as noted in the docs.

Issue 2:
Description

This is half a question on conceptual ideas, and half a feature request maybe?

I was wondering if anyone here has any thoughts on the following scenario.

Say I'm making a profile API. When posting a new profile, you use this model

class Profile(BaseModel):
first_name: str
last_name: str
title: str = None
age: int = None
tagline: str = None

First name and last name are understandably required fields, because we have to have something for a profile.

So now I want to add a patch endpoint, where you can just edit a single field. For that we want to enable the following request:

patch service.com/profile/1234
{
"tagline": "I am so cool"
}

But I haven't given a first and last name, so obviously this endpoint can't use the Profile model as its body model.

What is the best approach for this? I can think of a variety of options, but nothing really sparks joy.

Obviously one approach is to just make a different model for patch. This is certainly the most straightforward, but across a large service you might end up with a lot of duplicate models. And you'll have to manually maintain similarities between the two 🤢

Another thought I had (not sure how easy this would be with Fast built in behaviors? I might be missing something), was to maybe bring the method POST v PATCH into a field on the profile model, and write a validator that is dependent on the value of that method field...but that is definitely a bit hacky 😬

There are likely lots of other ideas, just curious what the thoughts are from other users of this API (and or the creator)
Issue 1:
With the proposal for #22858, I've been thinking it could be useful to have a type which commonly represents "AllIndices". So A[AllIndices()] would return A, making it the identity indexing element in some sense.

The reason is so that this could handle non-standard indexing. In some algorithms you might want the user to specify some indices that they "want to save", and you can default to AllIndices. In many of these cases, you haven't built the array yet and may be getting a non-standard type from the user, so defaulting to eachindex or something like that isn't possible. Currently a way to handle this is to default the chosen indices to nothing, and if you see nothing you treat it as AllIndices applied to the type by iterating eachindex after the array is built.

The name could change of course.

Issue 2:
Numpy has this ellipsis notation for filling

index tuples up to dimension, where in

A[..., i, k]

... is interpreted as shorthand for the number of colons :, :, : etc needed to fill

the indexing tuple up to dimension n.

http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html

This gives nice access to contiguous subarrays in the dense array case and would be not more harmful than the : notation itself.

Was this feature already considered? It was mentioned by @toivoh on the mailing list, but did not trigger discussion.
Issue 1:
I just upgraded from 2.0.16 to 2.1.0 Beta 4 and in this code I get error:

$builder->add('name', 'text');
$builder->add('category', 'entity', array(
'class' => 'PostBundle:Category',
'query_builder' => function(EntityRepository $er) {
return $er->createQueryBuilder('u');
},
));

Class PostBundle:Category does not exist

Using Acme\PostBundle\Entity\Category instead of PostBundle:Category does work.

Issue 2:
The master documentation says the following about the entity form type:

The class of your entity (e.g. AcmeStoreBundle:Category). This can be a fully-qualified class name (e.g. Acme\StoreBundle\Entity\Category) or the short alias name (as shown prior).

However, the Bundle:Entity syntax throws the following exception:

Class Bundle:Entity does not exist

I've downloaded the symfony-standard edition and made the following test, just to be sure the problem is not caused by my project.

namespace Acme\DemoBundle\Entity;

class Smartie
{
private $smarties = array('red', 'green', 'yellow', 'brown');

public function getSmarties()
{
return $this->smarties;
}
}

namespace Acme\DemoBundle\Form;

public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('yummie', 'entity', array(
'class' => 'AcmeDemoBundle:Smartie',
'property' => 'smarties'
));
}

{{ form_widget(form.yummie) }}

And that throws the following exception:

Class AcmeDemoBundle:Smartie does not exist

vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php at line 158

$proxyClass = new \ReflectionClass($class);

Maybe something has changed due the latest form improvements, I don't know. Either it's a bug or the documentation needs a update.
Issue 1:
Will node programs be able to run via deno? Will there be an adapter? I think that's pretty important if deno adaption is to increase.

Issue 2:
Would it be possible to get access to exactly the same API in Node.js?

I found the API surface overall to be exquisitely neatly designed, and I like it a lot. I'd like to be able to seamlessly switch between Deno and Node.js without memorizing strikingly different OS/file APIs.
Issue 1:
Feature Request: Open recent documents and reopen last closed window

Issue 2:
A feature I love about ST2 and iA Writer, which I'm missing in Atom, is when you quit the app with open windows (including unsaved documents), they all appear again when you reopen.

This has saved me countless times in my workflow to handle having to do a system restart for software update, etc and not have to take time to save all my unsaved docs, etc.

It's also nice because I generally have five or six open projects that I just keep minimized in the editor for ease of access. It would be great to have such a feature in Atom.
Issue 1:
I upgraded MUI from v0.16.7 to v0.19.3 and have now the following problem with my popovers.

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

Expected Behavior

Popover should rendered at the position the placement logic calculates.

Current Behavior

Popover renders at position 0/0 and after a short amount jumps to correct position.

Steps to Reproduce (for bugs)

I made a video of the DatePicker docs which uses a Popover if inlined:

https://www.youtube.com/watch?v=cxSSbHWHR-U

Your Environment

Tech
Version

Material-UI
0.19.3

React
15.6.2

browser
Chrome 59.0.3071.115

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

Expected Behavior

A button should be rendered.

Current Behavior

An error is displayed: Using version beta28 in a newly created create-react-app app that renders only a material-ui Button, I get the following error with firefox 57.0.1 (mac os): TypeError: CSS2Properties doesn't have an indexed property setter for '0'

Steps to Reproduce

run the following commands:

create-react-app test-cra
cd test-cra
yarn install material-ui@1.0.0-beta.28

replace the content of src/index.js by the following code:

import React from 'react';
import ReactDOM from 'react-dom';
import Button from 'material-ui/Button';

ReactDOM.render(<Button raised>Boom</Button>, document.querySelector('#root'));

Here is a codesandbox link but I can't reproduce the issue in it... 😞 (maybe some dependency caching in codesandbox?..)

Note: version 1.0.0-beta.27 works well.

Context

It happened to me while upgrading material-ui in a medium-size project.

Your Environment

mac os high sierra 10.13.2

firefox 57.0.1

react-script

dependencies:

"material-ui": "1.0.0-beta.28",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.0"

Tech
Version

Material-UI
1.0.0-beta

React
16.2.0

browser
Firefox 57.0.1

react-dom
16.2.0

react-scripts
1.1.0
Issue 1:
Q
A

Bug report?
no

Feature request?
yes

BC Break report?
no

RFC?
yes

Symfony version
4.1+

The Validator component comes with some constraints that require optional third-party libraries (for example, the EmailValidator constraint can optionally be used with the egulias/email-validator library). Right now, these requirements are evaluated at runtime when the validator is executed. If you do not have tests covering the validators, you may only notice at runtime that you needed to set up something when your application breaks with an exception.

To improve DX here I suggest to move these checks from the validators to the actual constraint classes to allow to catch mistakes earlier. However, we cannot do that in 4.1 as this would break applications where constraint metadata is loaded for classes that are never used (for example, when you depend on some third-party bundle that defines those constraints while you do not use all of their classes).

As an upgrade path I suggest to duplicate the checks in 4.1 from the validator classes to the constraint, but not throw exceptions there but trigger deprecations instead. So at least we can then finally make this move in 5.0.

Issue 2:
Q
A

Bug report?
Maybe

Feature request?
no

BC Break report?
no

RFC?
no

Symfony version
3.4.x

Hello,

I have run a composer update to my project runnning PHP 5.6

These are the packages that have been updated:

Package
Old Version
New Version

league/csv
8.2.2
8.2.3

php-amqplib/php-amqplib
v2.7.0
v2.7.2

symfony/polyfill-mbstring
v1.6.0
v1.7.0

symfony/polyfill-php70
v1.6.0
v1.7.0

symfony/polyfill-util
v1.6.0
v1.7.0

symfony/polyfill-php56
v1.6.0
v1.7.0

symfony/symfony
v3.4.3
v3.4.4

symfony/polyfill-intl-icu
v1.6.0
v1.7.0

symfony/polyfill-apcu
v1.6.0
v1.7.0

sensio/framework-extra-bundle
v5.1.4
v5.1.5

symfony/phpunit-bridge
v3.4.3
v3.4.4

webmozart/assert
1.2.0
1.3.0

phpspec/prophecy
1.7.3
1.7.4

One of these packages seems to have increased the memory usage of my tests. Most of them are symfony packages so I thought I might ask here first.

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes) in symfony/var/cache/test/ContainerHnbtgen/appTestDebugProjectContainer.php on line 9372

My tests used to get around 400 MB
Issue 1:
Based on the discussion https://discourse.julialang.org/t/getting-union-tuple-covariance-for-maps-between-parallel-type-hierarchies/70060/6

abstract type Continuous end
abstract type Count end

Scitype(::Type{<:Integer}) = Count
Scitype(::Type{<:AbstractFloat}) = Continuous

Scitype(::Type{Union{A,B}}) where {A<:Integer,B} = Union{Count,Scitype(B)}
# Scitype(::Type{Union{A,B}}) where {A,B<:AbstractFloat} = Union{Scitype(A),Continuous}

println(Scitype(Union{Int,Float64}))

fails with

ERROR: LoadError: StackOverflowError:

whereas

abstract type Continuous end
abstract type Count end

Scitype(::Type{<:Integer}) = Count
Scitype(::Type{<:AbstractFloat}) = Continuous

# Scitype(::Type{Union{A,B}}) where {A<:Integer,B} = Union{Count,Scitype(B)}
Scitype(::Type{Union{A,B}}) where {A,B<:AbstractFloat} = Union{Scitype(A),Continuous}

println(Scitype(Union{Int,Float64}))

succeeds with

Union{Continuous, Count}

This looks illogical. Tested on 1.6.3

Issue 2:
in a fresh Mac v1.6.2 session:

julia> function f1(x::Union{AbstractArray{T}, AbstractArray{Union{T, Missing}}},
y::Union{AbstractArray{T}, AbstractArray{Union{T, Missing}}};
α::T = T(3.0) ) where {T<:Real}
println(typeof(x), " ", typeof(y))
end;

julia> f1([1.0, missing], [2.0, missing])
ERROR: MethodError: no method matching Union{Missing, Float64}(::Float64)
Stacktrace:
[1] f1(x::Vector{Union{Missing, Float64}}, y::Vector{Union{Missing, Float64}})
@ Main ./REPL[1]:4
[2] top-level scope
@ REPL[2]:1

julia> function f2(x::Union{AbstractArray{T}, AbstractArray{<:Union{T, Missing}}},
y::Union{AbstractArray{T}, AbstractArray{<:Union{T, Missing}}};
α::T = T(3.0) ) where {T<:Real}
println(typeof(x), " ", typeof(y))
end;

julia> f2([1.0, missing], [2.0, missing])
Vector{Union{Missing, Float64}} Vector{Union{Missing, Float64}}

error seems coming from mistaking Union{Missing, Float64} as T, which should be Float64, in the default keyword argument assignment.

noted that if I supply the keyboard argument such that the default value assignment is not called, no error:

julia> f1([1.0, missing], [2.0, missing]; α = 2.2)
Vector{Union{Missing, Float64}} Vector{Union{Missing, Float64}}

it seems to be a bug in extracting the T (when Union is involved?).

the original discussion is from here. Thanks.
Issue 1:
Add new "local" snapshot repository type that would be similar to shared filesystem repository but will allow storing all snapshot file on a local file system of a single node.

Issue 2:
Elasticsearch version: v5.0.0-alpha5

Plugins installed: x-pack

JVM version: jdk1.8.0_92

OS version: Mac 10.11.5

Description of the problem including expected versus actual behavior:

When using an ingest pipeline with a rename processor that tries to rename the element to a nested one where the parent object name is the same as the current object, it fails.

Steps to reproduce:

POST _ingest/pipeline/_simulate
{
"pipeline": {
"processors": [
{
"rename": {
"field": "version",
"target_field": "version.displayName"
}
}
]
},
"docs": [
{
"_index": "myindex",
"_type": "doc",
"_id": "1",
"_source": {
"version": "1.1.0"
}
}
]
}

Results in the following error:

{
"docs": [
{
"error": {
"root_cause": [
{
"type": "exception",
"reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: cannot set [displayName] with parent object of type [java.lang.String] as part of path [version.displayName]",
"header": {
"processor_type": "rename"
}
}
],
"type": "exception",
"reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: cannot set [displayName] with parent object of type [java.lang.String] as part of path [version.displayName]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "java.lang.IllegalArgumentException: cannot set [displayName] with parent object of type [java.lang.String] as part of path [version.displayName]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "cannot set [displayName] with parent object of type [java.lang.String] as part of path [version.displayName]"
}
},
"header": {
"processor_type": "rename"
}
}
}
]
}

Desired expectation is that this would work. The workaround right now is to rename to a temporary name. So for example:

POST _ingest/pipeline/_simulate
{
"pipeline": {
"processors": [
{
"rename": {
"field": "version",
"target_field": "versionTemp"
}
},
{
"rename": {
"field": "versionTemp",
"target_field": "version.displayName"
}
}
]
},
"docs": [
{
"_index": "myindex",
"_type": "doc",
"_id": "1",
"_source": {
"version": "1.1.0"
}
}
]
}
Issue 1:
Do you want to request a feature or report a bug?

Bug

What is the current behavior?

The unsafe lifecycle function aliases in 16.3.2 are not merged when defined more than once because of mixins, triggering an error:

Uncaught Error: ReactClassInterface: You are attempting to define UNSAFE_componentWillReceiveProps on your component more than once. This conflict may be due to a mixin.

To reproduce: rename all cWM, cWRP, and cWU functions with their UNSAFE_ versions in a project where mixins cause those functions to be duplicated

What is the expected behavior?

That these lifecyle function continue to work as expected when called via UNSAFE aliases in 16.3, and if they are not supposed to with regard to redefining/merging, that the migration path documentation is updated to indicate so.

Issue 2:
I'm trying to run this snippet:

class Container extends React.Component {
constructor() {
super();
​
this.state = {
text: '...',
};
}
​
componentDidMount() {
fetch(urlThatReturnsSomeText)
.then(res => res.text())
.then(text => this.setState({ text }));
}
​
render() {
return <div>{this.state.text}</div>;
}
}

It causes the warning. I noticed, that setState triggers componentWillUnmount hook in React 16.

Hooks are consoled in the next order:

componentWillMount
componentDidMount
componentWillMount
componentWillUnmount
componentDidMount

In previous version component only was mounting twice (that behavior is also a bit strange to me).

When it comes to only setState without any data fetching everything works fine.
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.7-SNAPSHOT

Operating System version: mac

Java version: 1.8.0_65

Steps to reproduce this issue

PojoUtilsTest 下的test_PrimitiveArray新增如下测试用例

assertObject(new int[][]{{37, -39, 12456}});

assertObject(new Integer[][][]{{{37, -39, 12456}}});

assertArrayObject(new Integer[]{37, -39, 12456});

3. xxx

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

通过测试用例

Actual Result

What actually happens?

org.opentest4j.AssertionFailedError: expected: [[I@b3d7190<[[37, -39, 12456]]> but was: [[I@10d59286<[[37, -39, 12456]]>

生成一个新的对象了。

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

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.6.2

Operating System version: win7

Java version: 1.8

Steps to reproduce this issue

启动两个服务提供者

对其中一个服务提供者设置断点使其不响应客户端

启动服务消费者消费服务

服务消费者代码

@Reference(loadbalance = "random", cluster = "failfast", retries = 2)
private DemoService failFastService;

@Test
public void testFail()
{
String str = failFastService.sayHello("freeseawind");
System.out.println(str);
}

服务提供者示例截图

问题重现工程地址：https://github.com/freeseawind/copycat-dubbo

Expected Result

调用失败后立即结束

Actual Result

随机重试了服务消费者，日志显示的是FailOver调用失败而不是Failfast

@carryxyh
Issue 1:
It looks like webpack try to bundle all of server side dependencies, so it can't find module fs.

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

Expected Behavior

dotenv in _document works with Next.js v6.

Current Behavior

After upgrading from v5 to v6, it throws error:

This dependency was not found:

* fs in ./node_modules/dotenv/lib/main.js

To install it, you can run: npm install --save fs
(node:6389) DeprecationWarning: Module.chunks: Use Module.forEachChunk/mapChunks/getNumberOfChunks/isInChunk/addChunk/removeChunk instead
Client on: http://localhost:3000/projects

Steps to Reproduce (for bugs)

use dotenv in _doucment

upgrade to Next.js v6

Context

Your Environment

Tech
Version

next
v6.6.0

node
v9.11.1

OS
macos 10.13.4

browser

etc

Issue 2:
I'm trying to rely on multiple <style jsx global> to be ordered correctly. E.g.:

<GlobalStyle />
<BlogStyle />

Where I'd like BlogStyle to tweak stuff like body background image and text color. But it looks like tags get ordered certain way irrespective of their order in the component (probably based on the hash?).

If "I'm doing it wrong", then how would you adjust body bg image, color, default text and link color for a specific page (e.g. dark zeit home page vs white blog)? Without having to duplicate all of the global styles into 2 js modules.

E.g. I'd be ok with adding a class to , but not sure how to do that from within the <BlogLayout /> component.
Issue 1:
I followed the build instructions given for the FreeBSD (10.0 x86_64) here- https://github.com/atom/atom/blob/master/docs/build-instructions/freebsd.md

I compiled node and npm from sources (FreeBSD ports) but still no luck. Here is the full error log:

http://pastebin.com/WQx8UXWs

Issue 2:
I tried to build it following this instructions:

https://github.com/atom/atom/blob/8db47bd7b2226b858a255867aaa16419c652f64d/docs/build-instructions/freebsd.md

Here is the full build log:

http://pastebin.com/VEtB9WuY

TIA,
Issue 1:
I've recently updated scipy in Fedora to newest 0.13.0 release and I can see one test failure on every architecture, both in python 2 and 3:

Python 3.3.2

ERROR: test_fitpack.TestSplder.test_kink
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILDROOT/scipy-0.13.0-1.fc21.arm/usr/lib/python3.3/site-packages/scipy/interpolate/fitpack.py", line 1178, in splder
c = (c[1:-1-k] - c[:-2-k]) * k / dt
FloatingPointError: invalid value encountered in true_divide
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/builddir/build/BUILDROOT/scipy-0.13.0-1.fc21.arm/usr/lib/python3.3/site-packages/scipy/interpolate/tests/test_fitpack.py", line 329, in test_kink
splder(spl2, 2) # Should work
File "/builddir/build/BUILDROOT/scipy-0.13.0-1.fc21.arm/usr/lib/python3.3/site-packages/scipy/interpolate/fitpack.py", line 1186, in splder
"and is not differentiable %d times") % n)
ValueError: The spline has internal repeated knots and is not differentiable 2 times

Python 2.7.5

ERROR: test_fitpack.TestSplder.test_kink
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILDROOT/scipy-0.13.0-1.fc21.arm/usr/lib/python2.7/site-packages/scipy/interpolate/tests/test_fitpack.py", line 329, in test_kink
splder(spl2, 2) # Should work
File "/builddir/build/BUILDROOT/scipy-0.13.0-1.fc21.arm/usr/lib/python2.7/site-packages/scipy/interpolate/fitpack.py", line 1186, in splder
"and is not differentiable %d times") % n)
ValueError: The spline has internal repeated knots and is not differentiable 2 times

Setup

numpy 1.8.0

atlas 3.10.1

blas 3.4.2

lapack 3.4.2

Build logs:

http://kojipkgs.fedoraproject.org/packages/scipy/0.13.0/1.fc21/data/logs/armv7hl/build.log

http://kojipkgs.fedoraproject.org/packages/scipy/0.13.0/1.fc21/data/logs/i686/build.log

http://kojipkgs.fedoraproject.org/packages/scipy/0.13.0/1.fc21/data/logs/x86_64/build.log

Issue 2:
eigs, eigsh, svds all default to using 2 * k + 1 for the number of lanczos vectors ncv. This is fine for k > ~5 or so but drastically slows the algorithm down for small k (e.g. k=2 or 1 slower than k=6!) and often means the convergence fails. The problem is worse for dense matrices (these sparse methods are actually very useful for dense matrices as well).

The optimum value depends on n, k,, the sparsity and other factors, but should generally should be >= 10. Matlab apparently uses 20 as its minimum for equivalent functions but this might be a bit high for small sparse matrices.

There might be a method of choosing ncv intelligently? But setting it to at minimum 10 would be a quick fix.
Issue 1:
Challenge Name

Issue Description

The code editor won't let me select or even navigate down to the last two lines of code. The 3rd line from the bottom it will let me select 2/3s of the line and the 4th line up will let me select about 3/4.

Browser Information

Browser Name, Version: Google Chrome Version 55.0.2883.87 m

Operating System: Windows 7

Mobile, Desktop, or Tablet:

Your Code

Screenshot

Issue 2:
In all the exercises, we the users are forced to press the enter key before writing any code.

Update:

We have locked the conversation temporarily on this thread to collaborators only, this has been resolved in staging, and will be live soon.

The fix can be confirmed on the beta website.

The workaround currently on production website is:

Press the Enter key on the challenge editor and then proceed with the challenge.

Apologies for the inconvenience meanwhile.

Reach us in the chat room if you need any assistance.