Issue 1:
Describe the issue:

There seems to be something whacky with the type annotations for np.sinc that causes mypy to later think that an array is a boolean array when clearly it is not. See the reproducing code below. This seems to have started with numpy 1.22 (presumably due to the more accuracy dtype annotations). Changing np.sinc to np.sin or np.exp makes the problem disappear, which is why I assume it is specific to sinc.

Reproduce the code example:

import numpy as np

def what_the() -> None:
idx = np.arange(16, dtype=float)
c = idx * np.sinc(idx)
c /= np.sum(c)

Error message:

Error message from mypy 0.961:

show_type.py:6: error: Invalid self argument "ndarray[Any, dtype[bool_]]" to attribute function "__itruediv__" with type "Callable[[ndarray[Any, dtype[floating[_NBit1]]], Union[_SupportsArray[dtype[Union[bool_, integer[Any], floating[Any]]]], _NestedSequence[_SupportsArray[dtype[Union[bool_, integer[Any], floating[Any]]]]], bool, int, float, _NestedSequence[Union[bool, int, float]]]], ndarray[Any, dtype[floating[_NBit1]]]]"

Note the bool_ on the first line.

### NumPy/Python version information:

1.23.0 3.10.5 (main, Jun 11 2022, 16:53:24) [GCC 9.4.0]

Issue 2:
I am sending a file from front end to backend, i have also installed cors extension for the browser but got badly engaged with the error: I have tried a lot i performed debugging. I also added the cors in the flask, i added some code in the function of component.html to perform manual debugging. Previously i was receiving the error of cors disabled the response but it got resolved by adding cors in the browser:

App.py:

import csv

from flask import make_response, url_for

from flask import Flask, jsonify,render_template

from flask_cors import CORS, cross_origin

from werkzeug.utils import secure_filename

from flask_restful import Resource, Api;

from flask import Flask, render_template, request, redirect

import matplotlib.pyplot as plt

from test import test

app = Flask(name)

#cors = CORS(app, resources={r"/api/http://localhost:4200": {"origins": "http://localhost:4200"}})# api = Api(app)

CORS(app, supports_credentials=True)

app.register_blueprint(test,url_prefix="/admin")

@app.route('/uploader', methods = ['POST','GET'])

#@cross_origin(["http://localhost:4200"])

@cross_origin(allow_headers=['http://localhost:4200'])

def upload_file():

print(request.files)

# check if the post request has the file part

if 'file' not in request.files:

print('no file in request')

return"no file in request"

file = request.files['file']

if file.filename == '':

print('no selected file')

return"no selected file"

if file and allowed_file(file.filename):

print("hello")

filename = secure_filename(file.filename)

#file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))

return "Successful"

print("end")

return"Bye"

@app.route('/')

def index():

return ('This is the main page of Python and calling the index function')

weather = {

"data":[ {

"day":"1/6/2019",

"temperature":"23",

"windspeed":"16",

"event":"Sunny"

}, {

"day":"5/6/2019",

"temperature":"17",

"windspeed":"18",

"event":"Rainy"

}, {

"day":"6/6/2019",

"temperature":"19",

"windspeed":"21",

"event":"Rainy"

}, {

"day":"7/6/2019",

"temperature":"28",

"windspeed":"14",

"event":"Sunny"

}

]

}

@app.route("/weatherReport/", methods = ['GET'])

def WeatherReport():

global weather

return jsonify([weather])

if name == 'main':

app.run(debug = True)

component.ts:

@ViewChild('fileInput') fileInput;

ngOnInit() {

this.todaydate = this.myservice.showTodayDate();

}

handleFileInput(files: FileList) {

console.log('Inside handleFileInput');

this.receivedFile = files.item(0);

const isFileupload = true;

console.log( Received File: ${this.receivedFile});

}

uploadFile() {

console.log('Inside uploadFile');

const files: FileList = this.fileInput.nativeElement.files;

console.log('Inside uploadFile line 02');

if (files.length === 0) {

console.log('Inside uploadFile 03');

console.log('no file content here');

console.log('Inside uploadFile 04');

return;

};

console.log('Inside uploadFile 05');

this.restservice.parseTable(files).subscribe((data: any) => {
console.log('Inside uploadFile 06');
console.log('Data that i am sending: ' + data);
},

//at here the error block is executing;

(error) => {

console.log('Inside uploadFile 07');

console.log('No Data Found' + error);

});

}

}

service.ts:

parseTable(files) {

const formData: FormData = new FormData();

formData.append('file', files[0], files[0].name);

return this.http.post(this.backendAddress, formData);

}

component.html:

<input #fileInput name="file" type="file" (change)="handleFileInput($event.target.files)" >

<button mat-raised-button class="standard-button" (click)="uploadFile()">Upload file

Error

POST http://localhost:5000/uploader 500 (INTERNAL SERVER ERROR)

Request:

Please help me out friends