WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
I have a function that takes a class constructor as a parameter, and returns another class constructor of the same type. Internally, the provided constructor is subclassed and augmented, and the subclass is returned.

I'm having trouble finding a way to express this function in a generic, strongly-typed manner. Note the //ERROR comment in the repro code below:

Repro code:

// Base type of the family of classes operated on by the augment() function
class FooClass { /*...*/ }

// ========== Works, but is not generic ==========
function augment(SuperClass: typeof FooClass): typeof FooClass {
class SubClass extends SuperClass {
/*...*/
}
return SubClass;
}
var FooClass2 = augment(FooClass);

// ========== Generic, but does not compile ==========
function genericAugment<T extends typeof FooClass>(SuperClass: T): T {
class SubClass extends SuperClass { //ERROR: Type 'T' is not a constructor function type
/*...*/
}
return SubClass;
}

I've tried a few other variations, but can't seem to find a way to express this pattern.

Is there any way to do it?

Issue 2:
There appears to be some kind of internal "class" type that is impossible to represent generically:

You can see a live version here: http://goo.gl/exBzY6

function IdentifiableSubclass<T extends What?>(SuperClass: T) {
return class extends T {
public _id = null;
}
}

class Thing {
public hello = null;
/* impl */
}

const IdentifiableThing = IdentifiableSubclass(Thing);

class ChildThing extends IdentifiableThing {

}

let child = new ChildThing();
child.hello; // TS does not understand that this exists
child._id; // TS understands that this exists
Issue 1:
Opening a new issue since no action has been taken on #842 for more than a month.

Looks like we have an issue on how fastapi handles lists of elements passed as Form parameter (so anything that is type hinted List[...] = Form(...)). The issue doesn't arise when they are defined as Query parameters.

After some digging I managed to get to the root of the problem, which is how we pass the parameters when making an api call. fastapi indeed correctly understands that the input needs to be a list of elements, but doesn't parse the list if it comes from a single field.

Example using Query, works as expected

@app.post("/")
def api_test(l: List[int] = Query(...)) -> List[int]:
return l

Api request generated using the swagger UI

curl -X 'GET' \
'http://localhost:5009/?l=1&l=2' \
-H 'accept: application/json'

note how the passed values are l=1&l=2

[
1,
2
]

Example using Form, doesn't work as expected

@app.post("/")
def api_test(l: List[int] = Form(...)) -> List[int]:
return l

Api request generated using the swagger UI

curl -X 'POST' \
'http://localhost:5009/' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'l=1,2'

note how the passed values are l=1,2

{
"detail": [
{
"loc": [
"body",
"l",
0
],
"msg": "value is not a valid integer",
"type": "type_error.integer"
}
]
}

Manual api request

curl -X 'POST' \
'http://localhost:5009/' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'l=1' \
-d 'l=2'

Now the values are passed as -d 'l=1' and -d 'l=2'

[
1,
2
]

I am fairly sure that l=1,2 should be an accepted way of passing a list of values as parameter, but fastapi doesn't seem to like it. Also, if this isn't the case, the Swagger UI doesn't produce the correct curl requests for lists given as Form parameters.

Packages:

fastapi: 0.66.0

python: 3.7.4

Let me know if you need other details!

Thank you for coming to my TED talk

Issue 2:
Description

I need to support several query parameters with same name in GET route. Typical request looks like this:

http://localhost/item?num=1&num=2

I configured a route

@app.get("/item", content_type=UJSONResponse)
async def get_part(num: list):
found = False
for i in num:
if i in some_data:
found = True
break
return {"found": found}

The idea is, that I can pass several numbers to check, if they exist in some_data. In my opinion, it is not a good idea to get numbers from body here, because it is a simple GET request, but in current version application expects argument "num" in body, so on my request (written above) I receive a response

{"detail":[{"loc":["body","num"],"msg":"field required","type":"value_error.missing"}]}

As I know, it is not restricted to pass several query parameters with the same name in an HTTP request by any specifications, so I would like to ask, is it possible to configure a route in FastAPI, which will be able to parse several query parameters with the same name?
Issue 1:
If you define a class that has a property which only has a setter, but not a getter, and then attempt to use the non-existent getter the code will compile, but the getter is undefined, leading to a crash when it is used. For example:

class MyClass {

private theCount: number;

constructor() {
this.theCount = 5;
}

public set count(i: number) {
this.theCount = i;
}
}

window.onload = () => {
var obj: MyClass = new MyClass();
obj.count = 12;
var num: number = obj.count;
document.getElementById("content").innerHTML = num.toString();
};

The above will compile, but crashes when reading obj.count.

Surely it would be better if this code did not compile.

Issue 2:
What, all this business with union types, indeed a veritable managerie of type-related tricks, and we can't make the basics work?

function borked(): number {
if (false)
return 1;
}

I know this will be flagged with the dreaded "By Design", because of some silly JavaScript use case that I can't imagine, but it's such an obviously wrong feature of the language that I can't help raising as an issue. (Apologies if it's a duplicate.)
Issue 1:
This complies ok:

struct A(int);

impl A {
unsafe fn a(&self) -> int { **self }
}

trait B {
unsafe fn b(&self) -> int;
}

impl B for A {
unsafe fn b(&self) -> int { **self }
}

fn main() {
let _ = A(1).a();
let _ = A(1).b();

unsafe {
let _ = A(1).a();
let _ = A(1).b();
}
}

With this warning:

unsafe-methods.rs:19:4: 22:5 warning: unnecessary `unsafe` block [-W unused-unsafe (default)]
unsafe-methods.rs:19 unsafe {
unsafe-methods.rs:20 let _ = A(1).a();
unsafe-methods.rs:21 let _ = A(1).b();
unsafe-methods.rs:22 }

Yikes.

Issue 2:
This compiles, and shouldn't:

enum x = ();
impl x {
unsafe fn with() { }
}

fn main() {
x(()).with();
}
Issue 1:
Im not sure if this is an implementation issue or Doctrine itself. But if i was to create two identical entities and persist them, why does doctrine store two entries in the database? surely the idea of a DBAL is to handle normalisation for you? Is there a way you can prevent duplicate entries in the database?

$address = new Address();
$address->setTitle('Mr');
$address->setFirstname('Sam');
$this->em->persist($address);

$address1 = new Address();
$address1->setTitle('Mr');
$address1->setFirstname('Sam');
$this->em->persist($address1);

I feel doctrine should not persist the second entity but just pretend it has. It should then only create two rows if the two entities where to become different.

Issue 2:
The Framework bundle only implements two asset version strategies: empty and static (defaults provided by the Asset component).

If I want to use a custom strategy for my package (eg. to add the locale its path) without overriding the defaults, the recommended solution is to:

create a new service (my strategy)

use a compiler pass to extract the version and version format parameters from the default static strategy my package is compiled with

update the definition of my service with previously extracted parameters

If I have two packages with the same custom strategy but different versions, I need to duplicate my service declaration and update my compiler. And I cannot create services on-demand during the compiler pass. I could also create my own package configuration for my bundle that would override or extend the default assets.packages service.

It's neither convenient nor elegant.

I propose to add an optional parameter to set custom strategies:

#app/config/config.yml

framework:
#...
assets:
base_urls: //my.cdn.com
packages:
pdf:
version: %version%
version_format: /name/space/%%2$s/pdf%%1$s
localized_doc:
version: %version%
version_strategy: my.abstract.service.id # default is assets.static_version_strategy falling back on assets.empty_version_strategy if version is null (current behavior)
version_format: /name/space/%%2$s/doc/%%3$s%/abc%1$s #%3$s would be my locale

A convenient abstract BaseVersionStrategy class could be provided that would declare setVersion and setVersionFormat to inject said parameters.

This solves a particular problem I have where I want to inject known parameters in an asset base_urls or base_path. Please provide your thoughts.
Issue 1:
The file tensorflow/lite/experimental/micro/README.md says

The core runtime fits in 16KB on a Cortex M3, and with enough operators to run a speech keyword detection model, takes up a total of 22KB.

But after compiling libtensorflow-microlite.a, I get

ls -lh
total 512
-rw-r--r-- 1 xxx xxx 254K Sep 9 18:11 libtensorflow-microlite.a

which is an order of magnitude larger than 22KB.

The command I used to compile it is:

make -j2 -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=foo microlite

The configuration file lite/experimental/micro/tools/make/targets/foo_makefile.inc is

ifeq ($(TARGET), foo)

TARGET_TOOLCHAIN_PREFIX := arm-none-eabi-

COMMON_FLAGS := \
-O2 \
-fno-unwind-tables \
-fstack-reuse=all -ffunction-sections -fdata-sections -Wl,--gc-sections -nostartfiles \
-mthumb -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
-mno-thumb-interwork -ffast-math \
-Wall -Werror -Wlogical-op -Waddress -Wempty-body -Wpointer-arith \
-Wenum-compare -fno-strict-aliasing \
-Wno-sign-compare \
-nostdlib \
-fno-exceptions \
-fno-unwind-tables \
-fno-builtin

CXXFLAGS += $(COMMON_FLAGS) -fno-rtti
CCFLAGS += $(COMMON_FLAGS)

endif

The compiler toolchain information is as follows:

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.3.1 20160307 (release) [ARM/embedded-5-branch revision 234589]
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Issue 2:
Hello,

I would like to ask if current API of datasets allows for implementation of oversampling algorithm? I deal with highly imbalanced class problem. I was thinking that it would be nice to oversample specific classes during dataset parsing i.e. online generation. I've seen the implementation for rejection_resample function, however this removes samples instead of duplicating them and its slows down batch generation (when target distribution is much different then initial one). The thing I would like to achieve is: to take an example, look at its class probability decide if duplicate it or not. Then call dataset.shuffle(...) dataset.batch(...) and get iterator. The best (in my opinion) approach would be to oversample low probable classes and subsample most probable ones. I would like to do it online since it's more flexible. Just wondering if this is possible with current API?
Issue 1:
Describe what you were doing when the bug occurred:

Reading the flamegraph of my React app

Clicked on one of the options in the Rendered at list of the graph

This caused the below error to appear in React DevTools.

Please do not remove the text below this line

DevTools version: 4.0.6-a39d9c3

Call stack: at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:11:11442

at Map.forEach ()

at commitIndex (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:11:11388)

at e.getRankedChartData (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:11:11921)

at xi (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:56:277807)

at Ha (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:55891)

at bi (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:62940)

at Xl (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:99536)

at Hl (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:84256)

at Fl (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:81286)

Component stack: in xi

in div

in div

in div

in Ir

in Unknown

in n

in Unknown

in div

in div

in Wa

in ce

in be

in So

in Vl

Issue 2:
PLEASE INCLUDE REPRO INSTRUCTIONS AND EXAMPLE CODE

I got this error when I click 'Ranked'.

Please do not remove the text below this line

DevTools version: 4.0.4-3c6a219

Call stack: at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:11:11441

at Map.forEach ()

at commitIndex (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:11:11387)

at e.getRankedChartData (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:11:11920)

at _i (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:56:277123)

at Ha (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:55890)

at Xl (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:98280)

at Hl (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:84255)

at Fl (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:81285)

at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:43:25363

Component stack: in _i

in div

in div

in div

in Or

in Unknown

in n

in Unknown

in div

in div

in Ha

in le

in ve

in ko

in Ul
Issue 1:
It would be super handy if there was an interface for drag and drop on the file tree to move files around. I shouldn't think it would be too terribly difficult (I might actually have a crack at it if I can find the time) as it the action would just be an alias for a cut/paste action.

Issue 2:
Would be awesome to be able to drag and drop files between folders in the file tree right in Atom. I like the text-based rename feature that lets you move files between folders, but drag and drop feels more natural to me having gotten used to it in TextMate.
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: xxx

Operating System version: xxx

Java version: xxx

Steps to reproduce this issue

unboxing may get failed because null value could be returned

https://github.com/apache/dubbo/blob/master/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java#L587

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

Expected Result

What do you expected from the above steps？

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!

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: master

Operating System version: all platform

Java version: all version

Steps to reproduce this issue

set SystemProperty "java.net.preferIPv6Addresses" to true.

call org.apache.dubbo.common.utils.NetUtils#isPreferIPV6Address().

check the return value.

Expected Result

org.apache.dubbo.common.utils.NetUtils#isPreferIPV6Address() will return true when SystemProperty "java.net.preferIPv6Addresses" set to true.

Actual Result

org.apache.dubbo.common.utils.NetUtils#isPreferIPV6Address() method ignore SystemProperty "java.net.preferIPv6Addresses" and always return false
Issue 1:
Apache Airflow version

main (development)

Operating System

macOsS

Versions of Apache Airflow Providers

apache-airflow-providers-amazon (main)

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

What happened

airflow/airflow/providers/amazon/aws/utils/emailer.py

Lines 40 to 41
in
098765e

mail_from=None,

to=to,

hook.send_email(
mail_from=None,
to=to,
subject=subject,
html_content=html_content,
files=files,
cc=cc,
bcc=bcc,
mime_subtype=mime_subtype,
mime_charset=mime_charset,
)

the mail_from=None will trigger an error when sending the mail, when using AWS Simple Email Service you need to provide a from address and has to be already verified in AWS SES > "Verified identities"

What you expected to happen

I expected it to send a mail but it doesn't because

How to reproduce

No response

Anything else

This is easily solved by providing a from address like in:

smtp_mail_from = conf.get('smtp', 'SMTP_MAIL_FROM')
hook.send_email(
mail_from=smtp_mail_from,

the problem is: Can we reuse the smtp.SMTP_MAIL_FROM or do we need to create a new configuration parameter like email.email_from_address ?

smtp uses its own config smtp.smtp_mail_from

sendgrid uses an environment variable SENDGRID_MAIL_FROM (undocumented by the way)

So, my personal proposal is to

introduce an email.email_from_email and email.email_from_name

read those new configuration parameters at utils.email.send_email

pass those as arguments to the backend (kwargs from_email, from_name) . the sendgrid backend can already read those although seems unused at the momemt.

Are you willing to submit PR?

Yes I am willing to submit a PR!

Code of Conduct

I agree to follow this project's Code of Conduct

Issue 2:
Apache Airflow version

2.6.1

What happened

When using search filters for pages accessible from the Browse context menu (i.e. Browse > DAG Runs), some filters do not seem to apply. Instances of this are clearest with filtering by logical date which returns all DAG Runs, with the ones matching the filter generally being towards the top. This can also be seen on the Variables page using the ends with filter.

What you think should happen instead

When a filter is applied, it appropriately filters out the rows that do not meet the filter and only those that do are shown.

How to reproduce

Have DAG Runs across multiple logical dates

Go to Browse > DAG Runs

Filter based on a logical date (i.e. greater than 2023-05-31 12:00 AM)

Scroll to see that extraneous data is included

Operating System

CentOS Linux 7 (Core)

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

Installed on a miniconda environment running Python 3.9

Anything else

Not all filters seem to be broken. "Starts with" seems to work well, meanwhile "Ends with" does not. They both do add a request to the URL, however the "ends with" one seems to add ?_flt_undefined_key= whereas the "starts with" adds ?_flt_0_key=. The filters that do not work also do not appear on the filter list.

Are you willing to submit PR?

Yes I am willing to submit a PR!

Code of Conduct

I agree to follow this project's Code of Conduct
Issue 1:
Description of the problem

I seems that DirectGeometry.fromGeometry creates duplicate vertices. In this line of code vertices are created when looping through faces, not vertices. This result in duplicate vertices.

I think this is unintended, or am I missing something?.

This problem effects BufferGeometry (via fromGeometry) and means the WebGL renderer needs to do ~6x as much work.

Working example:

JSFiddle

To replicate this, convert a geometry to buffer geometry and back again. Then compare the vertices as below:

// extract from jsfiddle
var bufferGeom = new THREE.BufferGeometry()
bufferGeom.fromGeometry(geometry)

var newGeom = geometry.clone()
newGeom.fromBufferGeometry(bufferGeom)

if (newGeom.vertices.length != geometry.vertices.length) {
console.error('The new geometry has ', newGeom.vertices.length, 'vertices while the geometry only had ', geometry.vertices.length)
}

Three.js version

Dev

r75

...

Browser

All of them

Chrome

Firefox

Internet Explorer

OS

All of them

Windows

Linux

Android

IOS

Hardware Requirements (graphics card, VR Device, ...)

NA

Issue 2:
I miss the wireframe feature on BufferGeometry based objects like Planes (e.g. webgl_geometry_extrude_shapes2.html). I'm not sure why it was removed.

So I tried to put it back in. I added some code in "WebGLRenderer.js" to "renderBufferDirect" and it worked as expected:

var offsets = geometry.offsets;

if ( offsets.length === 0 ) {

+ if ( material.wireframe ) {
+
+ if ( updateBuffers ) {
+
+ setupVertexAttributes( material, programAttributes, geometryAttributes, 0 );
+
+ var webglLineBuffer = _gl.createBuffer();
+ var lineArray = new Uint16Array( index.array.length * 2 );
+ var f, fl, offset_line = 0;
+
+ for ( f = 0, fl = index.array.length; f < fl; f ++ ) {
+ lineArray[ offset_line ] = index.array[f];
+ lineArray[ offset_line + 1 ] = index.array[f+1];
+
+ lineArray[ offset_line + 2 ] = index.array[f+1];
+ lineArray[ offset_line + 3 ] = index.array[f+2];
+
+ lineArray[ offset_line + 4 ] = index.array[f+2];
+ lineArray[ offset_line + 5 ] = index.array[f];
+
+ offset_line += 6;
+ f += 2;
+ }
+
+ _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, webglLineBuffer );
+ _gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, lineArray, _gl.DYNAMIC_DRAW );
+
+ }
+
+ _gl.drawElements( _gl.LINES, lineArray.length, type, 0 );
+ } else {

if ( updateBuffers ) {

setupVertexAttributes( material, programAttributes, geometryAttributes, 0 );
_gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, index.buffer );

}

_gl.drawElements( _gl.TRIANGLES, index.array.length, type, 0 );
+ }

_this.info.render.calls ++;
_this.info.render.vertices += index.array.length; // not really true, here vertices can be shared
_this.info.render.faces += index.array.length / 3;

} else {

This is probably not the best place to put this creation of the lineArray and it's certainly not the only place where this has to be done. But it doesn't look very complicated.

Unfortunately I'm not deep enough into this code to do it myself without breaking something important. Nevertheless I would love to see wireframe resurrected :-)
Issue 1:
Chaining ngFor with a slice pipe throws errors.

I just realized that now that the dev mode is enabled by default (alpha-55).

@Component({
selector: 'users-cmp',
template: `<div *ngFor="#user of users | slice:0:2">{{user.name}}</div>`
})
export class UsersCmp {
users: Array<any> = [
{name: 'Cedric},
{name: 'Agnes'},
{name: 'Cyril'}
];
}

Gives Expression 'users | slice:0:2 in UsersCmp@0:5' has changed after it was checked.

Runtime works (despite the errors), but unit tests are failing.

Related to #5941 I think.

Issue 2:
I'm submitting a ...

[x] bug report

Modules are loaded twice.

• angular version : 2.4.4 (latest)

• angular/router : 3.4.4 (latest)

Reproduction of the problem

https://github.com/ASmeha/angular2-sample

In this sample modules are loaded when changing routes .

Example in the repo for the issue :

Logs in modules class constructor are displayed twice.