WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
First check

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

[ YES] I searched the FastAPI documentation, with the integrated search.

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

Description

How can I add multiple request body for same endpoint. I wanted to accept application/json and application/pdf for same endpoint. Lets say i have exposed http://localhost:5000/test which should accept application/json as well as application/pdf. I wanted to write business logic based on request body type.?

Is it possible to expose only one endpoint with multiple request body type like application/json and application/pdf?

Additional context

Issue 2:
OpenAPI allows describing multiple accepted content-types for a request.

Is it possible via FastAPI means?

I'd like to make a password login endpoint accepting both application/json and application/x-www-form-urlencoded using a single handler.
Issue 1:
I am testing the fitting functionality of scipy. I noticed that I can fix certain shape parametrs, fix the loc and scale, as well as give starting points for scale and loc. Is it also possible to give starting positions for shape parameters? Simply put I'd like to be able to specify s in the following example

from scipy.stats import lognorm

scale = 1.0
loc = 1.0
s = 2.0

data = lognorm(s=s, loc=loc, scale=scale).rvs(100)

params = lognorm.fit(data, loc=loc, scale=scale)
print(params)

Issue 2:
I've got a numpy.ndarray of shape (24569,) (also tried with (24569,1)) with samples of random variables (not the distribution)

fit_alpha, fit_loc, fit_beta=stats.gamma.fit(data)

results in fit_alpha and fit_loc being nans, while fit_beta = 1

I've tried to suggest starting parameters by using stats.gamma.fit(data,a=k,loc=0,scale=theta)

where k = 4/skew^2, theta=variance/mean are the shape and scale parameters respectively.

But I got the following error:

/usr/local/lib/python2.7/dist-packages/scipy/stats/_continuous_distns.pyc in fit(self, data, *args, **kwds)
1916 if floc is None:
1917 # loc is not fixed. Use the default fit method.
-> 1918 return super(gamma_gen, self).fit(data, *args, **kwds)
1919
1920 # Special case: loc is fixed.

/usr/local/lib/python2.7/dist-packages/scipy/stats/_distn_infrastructure.pyc in fit(self, data, *args, **kwds)
2126 # by now kwds must be empty, since everybody took what they needed
2127 if kwds:
-> 2128 raise TypeError("Unknown arguments: %s." % kwds)
2129
2130 vals = optimizer(func, x0, args=(ravel(data),), disp=0)

TypeError: Unknown arguments: {'a': 0.14115690248522836}.

after using floc=0 as a parameter (which is not documented anywhere as far as I can tell) I got an exception pointing out that negative values are not allowed in data (I got one negative "error" value in the data) - after fixing this, I got results which made sense...

The documentation on that fit function is lacking - it also does not mention that the parameters returned are shape, loc, scale, as well as that fa, floc and fscale are not suggestions of initial fit, but are constraints on the fit to keep these values fixed. There appears to be no way to suggest initial parameters.
Issue 1:
Symfony version(s) affected: 4.1.8

Description

My app base on laravel 5.6, when I upgrade composer libs, symfony http-foundation is update from 4.1.7 to 4.1.8. And laravel feature test is crash, it can not simulate request to url, all return 404 code.

I think a minor version should not broke compatibility in other libs.

How to reproduce

make a laravel 5.6 app.

make a feature test.

try to test some api like:

$response = $this->json('GET', '/some/path');
dd($response->exception);

Issue 2:
Symfony version(s) affected: 4.1.8

Description

(in built in server)[ERROR] The process has been signaled with signal "11".

How to reproduce

In any new project, if you clone symfony/website-skeleton run built-in server

Additional context

I think it has a relationship with latest [Routing] fixes @Route
Issue 1:
Moving this piece from this comment. Generally the idea is to have the kubelet to attach SHA of the image(s) running in a pod in the pod status field. This will be useful for the aforementioned image policy proposal and related image auditing capabilities.

@erictune fyi

Issue 2:
The image digest from an image is much more useful to be reported with a container than just the image id. We should return the digest as well, which would allow policy tie back to 3rd party engines as well as understanding the exact image in use. I believe the gap today is the local graph driver doesn't preserve the digest, but that work is going on upstream in Docker to make that more generally available.

@vbatts correct me if I missed anything about the state of Docker on this (links to issues would be helpful)

@ncdc @pweil- policy around managing what images can be used on a Kubelet is a next big area of exploration - knowing exactly what is in use is a part of that
Issue 1:
For building a lib i want to disable codeSplitting with webpack

adding the LimitChunkCountPlugin

plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
],

but get this error on build

ERROR in webpack/runtime/runtimeId
RuntimeIdRuntimeModule must be in a single runtime
Error: RuntimeIdRuntimeModule must be in a single runtime
at RuntimeIdRuntimeModule.generate (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js:22:10)
at RuntimeIdRuntimeModule.getGeneratedCode (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/RuntimeModule.js:182:44)
at RuntimeIdRuntimeModule.codeGeneration (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/RuntimeModule.js:137:30)
at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3324:22
at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Cache.js:93:5
at Hook.eval [as callAsync] (eval at create (/home/arpu/Work/projects/vland_app/vland_app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Cache.get (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Cache.js:75:18)
at ItemCacheFacade.get (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/CacheFacade.js:111:15)
at Compilation._codeGenerationModule (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3317:9)
at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3224:11

without the plugin all works fine

node v14.19.0

webpack 5.69.1

Issue 2:
Bug report

What is the current behavior?

When updating the code loaded by web worker nothing happens.

If the current behavior is a bug, please provide the steps to reproduce.

This is a very simple configuration where HMR doesn't work:

https://github.com/wclr/webpack-worker-hot-reload

What is the expected behavior?

I believe it should work the following way:

If the worker's entry script accepts hot reload, hot reload should be executed in the context of running web worker(s).

Otherwise it should be upstreamed to the parent context (probably parent script where new URL of the worker script was created).

Other relevant information:

webpack version: 5

Node.js version: 14

Operating System:

Additional tools:
Issue 1:
I find the reliance on conda in the Ubuntu development environment quickstart guide exceedingly complex, not to mention the need to rename libgfortran.so, but I guess that those instructions are there for a good reason (historical pain setting up development environments, messed up Python installations... and other incarnations of Evil ™️ ). However, I tried this on a modern Linux Mint 20 box (based on Ubuntu 20.04 LTS Focal Fossa) and this seemed to work just fine:

$ # create and activate pyenv/venv/virtualenv environment
(venv) $ pip install -e .
(venv) $ pip install numpy # Surprisingly, NumPy didn't get installed in this step
(venv) $ pip install pytest
(venv) $ pytest -k optimize # Works!

Is there any potential drawback in following this method?

Issue 2:
Original ticket http://projects.scipy.org/scipy/ticket/1721 on 2012-08-21 by trac user alataza, assigned to unknown.

Hi!

I'm a complete newbie to SciPy and NumPy. I've downloaded and installed these packages as I need them to run the Brian simulator. I'm using OSX 10.8 (just installed from the scratch to be able to use the SciPy Superpack from Chris Fonnesbeck) with Fortan 2.7.2, XCode 4.4.1. As per Fonnesbeck's reccomendation, I've performed the test and several errors have arised. I know that he's using development versions (SciPy 0.12) and therefore may be bugs there, but I couldn't get Brian work just by installing the stable releases with my previous OSX version. I'm attaching the output generated by the test file in case it might help you in the development of Scipy.

Cheers!

Marc.
Issue 1:
There seems to be a bug in the documentation of the classification of text documents: http://scikit-learn.org/stable/auto_examples/text/mlcomp_sparse_document_classification.html#sphx-glr-auto-examples-text-mlcomp-sparse-document-classification-py

The files are opened as utf-8 which leads to a bug. I have solved the issue changing "open(f)" into "open(f, encoding='latin1')".

Issue 2:
Sometimes I get what seems to be a divide-by-zero in the Nyström kernel approximation:

/usr/local/lib/python2.7/site-packages/sklearn/kernel_approximation.py:445: RuntimeWarning: divide by zero encountered in divide
self.normalization_ = np.dot(U * 1. / np.sqrt(S), V)
/usr/local/lib/python2.7/site-packages/sklearn/kernel_approximation.py:445: RuntimeWarning: invalid value encountered in divide
self.normalization_ = np.dot(U * 1. / np.sqrt(S), V)

I am trying to minimal example to reproduce the problem, but so far I have not been able to do so. I expect that some eigenvalues of the kernel matrix are rounded to zero, which could be caused by a rank-deficient kernel matrix. This is with sklearn version 0.13.1.

If that is the case, this problem can be fixed by adding a tiny ridge to the kernel matrix, or by adding a tiny value to the eigenvalues S. Alternatively, one could use only positive eigenvalues in the computation.
Issue 1:
The output of scipy.ndimage.rotate() for a single 180 degree rotation is inconsistent with the result of two consecutive 90 degree rotations. I had expected these should be equivalent. Is this expected behaviour?

Reproducing code example:

# Sample code to reproduce the problem
import numpy as np
import scipy.ndimage

arr = np.array([[1, 2], [3, 4]])

scipy.ndimage.rotate(arr, 180)
# produces this unexpected result
# array([[4, 0],
# [2, 0]])

scipy.ndimage.rotate(scipy.ndimage.rotate(arr, 90), 90)
# whereas two consecutive 90 degree rotations produce a result more like I'd expect
# array([[4, 3],
# [2, 1]])

np.flip(arr, axis=(0,1))
# I also expect the rotations above should be equal to np.flip(arr, axis=(0, 1))
# array([[4, 3],
# [2, 1]])

Error message:

No error message is produced.

Scipy/Numpy/Python version information:

1.3.1 1.17.2 sys.version_info(major=3, minor=7, micro=4, releaselevel='final', serial=0)

Issue 2:
Original ticket http://projects.scipy.org/scipy/ticket/1378 on 2011-01-29 by trac user tmcookies, assigned to unknown.

When rotating 3d-structure elements, some values get lost. I have two cases that i can show:

import numpy as np
from scipy.ndimage import rotate

cTA = np.array([
[[-1, -1, -1],
[-1, -1, -1],
[-1, -1, -1]],
[[ 0, 0, 0],
[ 0, 1, 0],
[ 0, 0, 0]],
[[ 0, 0, 0],
[ 0, 1, 0],
[ 0, 0, 0]]
])

cTA1 = rotate(cTA, 90,(0,1))
cTA6 = rotate(cTA,180,(0,1))
cTA6_ = rotate(cTA1,90,(0,1))

print cTA6
print cTA6_

The result of cTA6 and cTA6_ should be the same (rotating 180 or two times 90 should be the same), but the 180-rotation loses three values at the bottom array.

The result i get is the following:

[[[ 0 0 0]
[ 0 1 0]
[ 0 0 0]]

[[ 0 0 0]
[ 0 1 0]
[ 0 0 0]]

[[-1 -1 -1]
[-1 -1 -1]
[ 0 0 0]]] __here are the missing '-1' __

[[[ 0 0 0]
[ 0 1 0]
[ 0 0 0]]

[[ 0 0 0]
[ 0 1 0]
[ 0 0 0]]

[[-1 -1 -1]
[-1 -1 -1]
[-1 -1 -1]]]

By the way: i'm running Ubuntu 10.10 32bit (yeah, they still didn't switch to 0.8)
Issue 1:
When you do a search with the google search button on scikit-learn.org, the result are blended with the index page :

If I do the same thing on the local version generated from make doc-noplot, it's working perfectly :

It seems that the size of header-wrapper is not update when search is clicked.

Maybe the website on github is not updated ?

Issue 2:
Description

I noticed problems with the search results on the scikit-learn website. I am not sure if this problem just occurred today after 0.18 went live. Below is a screenshot of how it looks like when I do a search on the main page; on subpages the search does not seem to work altogether -- tested it on Chrome and Safari.

Steps/Code to Reproduce

Expected Results

Actual Results

Versions
Issue 1:
As you can see in the attached image, markdown syntax highlighter takes into account the _ and * present in a code block. I think that it should ignore any of these characters if they are within an indented code block.

No problem when I use fenced code blocks. But indented blocks are much easier.

I hope that this is the right place to report it.

I'm using Atom 0.189.0

Issue 2:
If one wants to write a * as a normal char, not as a bold or italic start char, things will go wrong.

Even,when there is no newline after the line contains the *

When the * is the last char of one line, everything is ok...
Issue 1:
TypeScript Version:

nightly (1.9.0-dev.20160429)

Code

for (let num of [ 1, 2, 3 ]) {
num.toString();
}

Expected behavior:

There should be no error; num should be reported as just a number.

Actual behavior:

num has type number | undefined, so compiler complains with Object is possibly 'undefined'.

Issue 2:
The variable in a for-of loop contains undefined when the target is set to es6. For es5, everything works as expected.

TypeScript Version:

nightly (1.9.0-dev.20160428)

Code

for (const x of ["a", "b"]) {
x.substring;
}

tsconfig.json:

{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"strictNullChecks": true
}
}

Expected behavior:

Type of x is string in the loop body, no compile error.

Actual behavior:

Type of x is string | undefined, which gives an error.

@ahejlsberg
Issue 1:
Bug Report

Current Behavior

I use the "useBuiltIns": "usage" option in .babelrc file.But cause white screen in ios9.3 version,but ios10+ version is normal.

Input Code

My config is :

{
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"targets": {
"browsers": [
"iOS >= 9.3",
"android >= 67"
]
},
"useBuiltIns": "usage",
"corejs": 3,
// "exclude": ["es.promise"],
}
]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
]
}

Expected behavior/code

I want to use the usage option, it can reduce the file size.

Babel Configuration (.babelrc)

"presets": [
[
"@babel/preset-env",
{
"modules": false,
"targets": {
"browsers": [
"iOS >= 9.3",
"android >= 67"
]
},
"useBuiltIns": "usage",
"corejs": 3,
// "exclude": ["es.promise"],
}
]
]

Environment

Babel version(s): [7.4.5]

Node/npm version: [Node 8.12.0/npm 6.4.1]

OS: [e.g. IOS9.3]

How you are using Babel: [webpack/babel-loader]

Possible Solution

Use useBuiltIns:entry instead of usage

Additional context/Screenshots

Maybe is 'es.promise' cause this, because i add config: "exclude": ["es.promise"], this ios9.3 is normal.

Issue 2:
I want to report a bug which is related to the release of version 3.2.0.

It works on 3.1.4 perfectly and I found the piece of code that breaks the application which has to run on Andoird 2.x devices.

What happened:

Promise.then stopped working. The provided callbacks do not execute at all.

How I fixed it:

In the file es.promise.js I commented out lines 278 - 286, which is currently:

nativeThen = NativePromise.prototype.then;

// wrap native Promise#then for native async functions
redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
var that = this;
return new PromiseConstructor(function (resolve, reject) {
nativeThen.call(that, resolve, reject);
}).then(onFulfilled, onRejected);
});

Then everything worked again on Adnoird 2.x. Since I don't know what this peace of code was intended to achieve, I didn't upload a pull request myself.

Please find some expert to fix that issue. I would be glad to help by testing whatever changes on the Andoird 2.x devices.
Issue 1:
/docs

https://cdn.jsdelivr.net/npm/swagger-ui-dist@3/swagger-ui-bundle.js

Error!

Issue 2:
First Check

I added a very descriptive title to this issue.

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.

I already read and followed all the tutorial in the docs and didn't find an answer.

I already checked if it is not related to FastAPI but to Pydantic.

I already checked if it is not related to FastAPI but to Swagger UI.

I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

I commit to help with one of those options 👆

Example Code

from typing import List

from fastapi import FastAPI
from pydantic import BaseModel, Field

app = FastAPI()

class Schema(BaseModel):
business: List[str] = Field(default_factory=list)

@app.get("/test", response_model=Schema)
def test():
return {}

Description

expect: {"business": []}

actually: {"business": None}

Operating System

Linux

Operating System Details

No response

FastAPI Version

0.81.0

Python Version

3.8

Additional Context

No response
Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

setup

ANSIBLE VERSION

ansible 2.4.0.0
config file = None
configured module search path = [u'/Users/anandb/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.14 (default, Sep 25 2017, 09:53:22) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]

CONFIGURATION

ANSIBLE_SSH_CONTROL_PATH(env: ANSIBLE_SSH_CONTROL_PATH) = /tmp/%%r@%%h

ANSIBLE_SSH_PIPELINING(env: ANSIBLE_SSH_PIPELINING) = True

DEFAULT_GATHERING(env: ANSIBLE_GATHERING) = smart

DEFAULT_HASH_BEHAVIOUR(env: ANSIBLE_HASH_BEHAVIOUR) = merge

DEFAULT_HOST_LIST(env: ANSIBLE_INVENTORY) = [u'/Users/anandb/repo/ansible/hosts']

DEFAULT_REMOTE_TMP(env: ANSIBLE_REMOTE_TEMP) = /tmp

DEFAULT_TIMEOUT(env: ANSIBLE_TIMEOUT) = 75

HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False

RETRY_FILES_ENABLED(env: ANSIBLE_RETRY_FILES_ENABLED) = False

OS / ENVIRONMENT

Running ansible from MacOSX 10.12.6, and managing CentOS 6.9

SUMMARY

The ansible_service_mgr fact should contain "upstart" but contains "service" instead.

STEPS TO REPRODUCE

ansible centos6.host -bK -m setup -a filter=ansible_service_mgr

EXPECTED RESULTS

I expected "ansible_service_mgr" to contain "upstart".

ACTUAL RESULTS

centos6.host | SUCCESS => {
"ansible_facts": {
"ansible_service_mgr": "service"
},
"changed": false,
"failed": false
}

Issue 2:
Issue Type:

Feature Pull Request

Ansible Version:

All versions.

Environment:

Ubuntu 14.04, and all other.

Summary:

The module "lineinfile" should have an option to remove duplicate lines matched by regexp.

Currently it changes only the last line.

Steps To Reproduce:

Let's say that we have the following lines in sshd_config (don't ask me how I got this):

PasswordAuthentication yes
# some stuff
PasswordAuthentication yes

We run ansible as:

$ansible -c local -m lineinfile -a 'dest=./sshd_config regexp="^[#\s]*PasswordAuthentication.*" line="PasswordAuthentication no"' localhost

Expected Results:

With an option like "remove_dups=yes" we would have:

# some stuff
PasswordAuthentication no

Actual Results:

PasswordAuthentication yes
# some stuff
PasswordAuthentication no
Issue 1:
For translation and summarization training, decoder_input_ids should be provided. If no decoder_input_ids is provided, the model will create this tensor by shifting the input_ids to the right for denoising pre-training following the paper.

https://huggingface.co/docs/transformers/v4.16.2/en/model_doc/bart#transformers.BartForConditionalGeneration.forward.decoder_input_ids

This is inappropriate. If labels is provided, the model will create this tensor by shifting the labels:

transformers/src/transformers/models/bart/modeling_bart.py

Lines 1320 to 1324
in
db7d6a8

if labels is not None:

if decoder_input_ids is None and decoder_inputs_embeds is None:

decoder_input_ids = shift_tokens_right(

labels, self.config.pad_token_id, self.config.decoder_start_token_id

)

Issue 2:
Here

https://huggingface.co/transformers/model_doc/bart.html

It says that for both BartForConditionalGeneration and BartModel, decoder_input_ids will be generated by shifting input_ids if not given.

However, from the source codes, forward function of BartForConditionalGeneration has these lines:

if labels is not None:

if decoder_input_ids is None and decoder_inputs_embeds is None:

decoder_input_ids = shift_tokens_right(

labels, self.config.pad_token_id, self.config.decoder_start_token_id

)

which suggests it is shifted from labels, instead of input_ids.

Can someone confirm what is the decoder_input_ids and labels for text summarization for

training

generation

Thanks.
Issue 1:
Summary of the new feature/enhancement

Please change the powertoys icon to something that uses a single color. Most applications follow this rule which makes is easy to organize their icons in the tray in a way that lets you quickly find the icon, but a multicolor icon like the current one doesn't fit anywhere. Alternatively, just make it a white outline icon without any color, like most other win10 icons, so it can be grouped with those.

Small thing, surprisingly important to get right.

Issue 2:
Summary of the new feature/enhancement

Add functionality to switch between settingsv1 and settingsv2 based on the Windows OS version.

Keep both setting UIs and do OS detection

If RS4/5

old settings

KBM disabled even if JSON says it is enabled

Launcher disabled even if JSON says it is enabled

Tab for -> Launcher: “This feature requires Windows 10, May 2019 Update”

Tab for -> KBM: “This feature requires Windows 10, May 2019 Update”

OS detect for image resizer so its old settings link still works.

This I don’t know if it will work.

IF 19h1+

new settings

Launcher is functional and enabled by default.

Launcher is functional and enabled by default.

This would help us not have a hard 19H1 upgrade.