WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Hey Typescript,

React's current typing for setState (at https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react/react.d.ts#L128) is somewhat wrong - it asks for type S, while the documentation (at https://facebook.github.io/react/docs/component-api.html#setstate) specifies only that:

The first argument can be an object (containing zero or more keys to update)...

That is, callers aren't required to specify all properties on the state, but only a subset of properties that they're updating. Unfortunately, there's currently no way to express this in the type system. People workaround this by defining type S as having all optional properties to begin with, even if some properties should be required.

It'd be great if Typescript had a some type operator that, when applied to an existing type, could construct a new type where all the properties specified in the original type are optional.

Example of use:

class Component<S> {
setState(state: S?): void;
// example syntax - "S?" is the type S but where all properties are optional
}

interface MyState {
foo: string;
bar: string;
}

class MyComponent extends Component<MyState> {
constructor() {
this.state = {foo: "a", bar: "b"};
}

function updateFoo() {
// this should pass
this.setState({ foo: "newFoo" });

// you can also specify that a value is of an optional type
const updates: MyState? = {
bar: "newBar"
};
this.setState(updates);

// of course, properties not in the original type are still not allowed
// this should throw "'nonExistentProperty' does not exist in type 'MyState?'"
const bad: MyState? = {
nonExistentProperty: 123
};
}

}

Let me know if there's anything else I could clarify, thanks for your time!

Issue 2:
// Given:
interface Foo {
simpleMember: number;
optionalMember?: string;
objectMember: X; // Where X is a inline object type, interface, or other object-like type
}

// This:
var foo: partial Foo;
// Is equivalent to:
var foo: {simpleMember?: number, optionalMember?: string, objectMember?: X};

// And this:
var bar: deepPartial Foo;
// Is equivalent to:
var foo: {simpleMember?: number, optionalMember?: string, objectMember?: deepPartial X};

Potential Use Cases

Mongo Queries (deepPartial)

React.setState (partial)
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: 2faf5e7

Steps to reproduce this issue

There's no samples of provider/consumer configured by API, So I'd like to add one

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.7.6-SNAPSHOT

Operating System version: ALL

Java version: ALL

Steps to reproduce this issue

wrongs comments in org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator line 78

Expected Result

test if given type has at least one method annotated with Adaptive

Actual Result

test if given type has at least one method annotated with SPI
Issue 1:
Description

In #18127 Apache Superset noticed the potential of using a test framework created on the basis of Pytest to verify the Helm Chart. I believe that a synergistic effect is possible in this respect.

I am aware that Apache Airflow is going to introduce some optimizations to its framework. However, they - for the Apache Superset - are not blocking to the naturally low number of tests at the beginning of the adaptation and the planned strategy to make them fast enough.

A more important issue is how to share this code between projects, so as not to have duplicate it (which is necessary for a synergistic effect) and copyright requirements (despite the Apache license, it is necessary to exercise moral rights).

What actions are required on the Apache Airflow side to be able to share this code and make it available e.g. as a shared library?

Use case/motivation

Apache Superset would like perform off-line Helm Charts tests to verify that generated manifests have valid format.

Apache Airflow had already a few iterations of Helm Chart testing, including generated manifest format. Currently, the solution based on the pytest is satisfying Apache Airflow developers, hence I am looking to adapt it to Apache Superset.

Related issues

apache/superset#18127 (discussed by @kaxil, @mik-laj, @potiuk )

Are you willing to submit a 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:

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment:

Cloud provider or hardware configuration: Aliyun

OS (e.g. from /etc/os-release): CentOS Linux" VERSION="7 (Core)

Kernel (e.g. uname -a): Linux 3.10.0-514.21.1.el7.x86_64

Install tools: celery 4.4.7 rabbitmq 3.8.17

Others:

What happened:

Task log can't be shown on Web-Server when the task runs failed, while log can be shown normally when the task success

*** Log file does not exist: /home/airflow/airflow/logs/dag_id/task_id/2021-06-28T00:00:00+08:00/28.log
*** Fetching from: http://:8793/log/dag_id/task_id/2021-06-28T00:00:00+08:00/28.log
*** Failed to fetch log file from worker. Unsupported URL protocol

What you expected to happen:

The task log should be shown normally when the task runs failed.

The Hostname info doesn't be written into the task instance table, so the webserver can't get the corresponding hostname.

How to reproduce it:

Just run a dag and make its task fail to reproduce the bug.

Anything else we need to know:

I have fixed it in my env and will commit a PR to fix it.
Issue 1:
Whenever you are coding and you press ENTER in an indented line, it will add a new line, remove the indentation and start the cursor at the beginning of that line.

Setting editor.formatOnType to false disables this behavior.

Issue 2:
VSCode Version: 0.10.11

OS Version: Windows 8.1

The problem is observed only in the following scenario:

for (i=0; attr && i<attr.length; i++) {
if (attr[i].specified) {
props[attr[i].name] = attr[i].value;
hasAttrib = true;
}
}

compared to:

for (i=0; attr && i <attr.length; i++) {
if (attr[i].specified) {
props[attr[i].name] = attr[i].value;
hasAttrib = true;
}
}

Notice the space between i and <.
Issue 1:
Hi, love this code but think I see an issue which can be seen on the live example (https://threejs.org/examples/misc_controls_transform.html) where the user is able to toggle off an axis (X,Y or Z) but is still able to translate the object along that axis even while the handles are not visible... you just have to carefully click and drag where you think the invisible handles are.

I believe the issue may have arisen with how the three.js raycaster catches the handles meshes that are not visible.

I seem to have fixed it for my case by throwing in a conditional checking for visibility of the children in the this.pointerHover handler

var intersect = ray.intersectObjects(_gizmo.picker[this.mode].children, true)[0] || false;
if (intersect) {
if (!intersect.object.visible) {//my added condition
const intersectedChildren = ray.intersectObjects(_gizmo.picker[this.mode].children, true);
this.axis = null;
for (let i = 0; i < intersectedChildren.length; i++) {
if (intersectedChildren[i].object.visible) {
this.axis = intersect.object.name;
continue;
}
}
} else {
this.axis = intersect.object.name;
}

Just thought I'd let you know.

Issue 2:
Description of the problem

Not sure how many of these are relevant to WebGL as it doens't support geometry shaders but it is a pretty decent article none the less:

http://www.iquilezles.org/www/articles/stereo/stereo.htm

Three.js version

Dev

r76

...

Browser

All of them

Chrome

Firefox

Internet Explorer

OS

All of them

Windows

Linux

Android

IOS

Hardware Requirements (graphics card, VR Device, ...)
Issue 1:
Original ticket http://projects.scipy.org/numpy/ticket/372 on 2006-11-04 by @FrancescAlted, assigned to unknown.

When you create recarrays with records.py and not specify the dtype argument explicitely, the names are generated with 1 as base (i.e. 'f1', 'f2', ...) instead of using 0 (i.e. 'f0','f1',...) which is the default in !NumPy. The next exposes the issue:

In [7]:numpy.array([(1,2), (3,4)], "i4,i4")
Out[7]:
array([(1, 2), (3, 4)],
dtype=[('f0', '<i4'), ('f1', '<i4')])
In [8]:numpy.rec.array([(1,2), (3,4)], "i4,i4")
Out[8]:
recarray([(1, 2), (3, 4)],
dtype=[('f0', '<i4'), ('f1', '<i4')])
In [9]:numpy.rec.array([(1,2), (3,4)])
Out[9]:
recarray([(1, 2), (3, 4)],
dtype=[('f1', '<i4'), ('f2', '<i4')]) # !
In [10]:numpy.rec.fromarrays([(1,2), (3,4)], "i4,i4")
Out[10]:
recarray([(1, 3), (2, 4)],
dtype=[('f0', '<i4'), ('f1', '<i4')])
In [11]:numpy.rec.fromarrays([(1,2), (3,4)])
Out[11]:
recarray([(1, 3), (2, 4)],
dtype=[('f1', '<i4'), ('f2', '<i4')]) # !

The next patch is a cure for this:

--- numpy/core/records.py (revision 3428)
+++ numpy/core/records.py (working copy)
@@ -82,11 +82,11 @@
else:
self._names = []

- # if the names are not specified, they will be assigned as "f1, f2,..."
- # if not enough names are specified, they will be assigned as "f[n+1],
- # f[n+2],..." etc. where n is the number of specified names..."
- self._names += ['f%d' % i for i in range(len(self._names)+1,
- self._nfields+1)]
+ # if the names are not specified, they will be assigned as "f0, f1,..."
+ # if not enough names are specified, they will be assigned as "f[n],
+ # f[n+1],..." etc. where n is the number of specified names..."
+ self._names += ['f%d' % i for i in range(len(self._names),
+ self._nfields)]
# check for redundant names
_dup = find_duplicate(self._names)
if _dup:

Issue 2:
Reproducing code example:

import numpy as np
x = np.rec.array([('abcd',)], dtype=[('a', str)])
print(repr(x))

Erroneous Behavior:

str type is inferred as <U dtype.

A similar expression using numpy arrays infers the length for '<UN' dtype.

Numpy/Python version information:

1.15.4 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)]
Issue 1:
Could you please add a setting for where the brace gets placed when autoformat runs.

When the auto format runs it moves the brace to a new line. This is very annoying to me.

Issue 2:
From @TJSoftware on January 29, 2016 17:35

Summary

I am unable to format code for xml and c#. json and javascript do not have any issues.

What I have done

Originally I modified my editor.tabSize to be 2 (in workspace). I removed this override and just left in the defaults. I also overwrote the keybinding for editor.action.format to use ctrl+k ctrl+d. I also removed those and left just the default in. Working with test files of each type mentioned above I am able to format some file types, but not others. This does not seem to be dependent on any of my settings, I have just added that information in just in case it is relevant.

C# example - what I expect

The following screenshot the brackets should line up in MyClass.

In this case while the tab size is set to 2 I would also expect that MyClass would be moved left to adjust to the correct tab size.

Officially the starting bracket would be on the same line as the class definition for my company policy, but I do not see that option available. Bonus points if you can mention how to set this in VSCode. VS Enterprise was able to do this with just a checkbox in settings, I am ok with a bool in json, I just do not see the value anywhere.

XML example - what I expect

Here I expect that subLevel3 would be tabbed in to whatever the current tab setting is.

Tech Specs

Windows 10 Pro

Copied from original issue: microsoft/vscode#2554
Issue 1:
Describe the issue linked to the documentation

Hi folks,

I am somewhat in doubt that the sklearn.feature_selection.chi2 function is implemented correctly. At least, checking the source code, it is entirely unclear to me why that kind of scoring would make sense.

Best,

Felix

Suggest a potential alternative/fix

Is there any reference that justifies the computation in the implemented way? Then it should be added to the documentation.

Issue 2:
Describe the bug

When looking for correlation between features (for feature selection), I found that sklearn implementation of Chi2 test of independence produce significantly different results from scipy.stats implementation.

My sample data contains 300 records, with 6 anonymized categorical features and the label. My focus is on the feature A. This data is available in this folder in github . The file sample300.csv has the file, while the file chi2_showcase.ipynb has the code demonstrating the mismatch.

For the feature A, sklearn's SelectKBest() returned the lowest ranking, suggesting there is no correlation between A and the target. But scipy.stats.chi2_contingency() returned very different result, suggesting the correlation is very high.

Because of mismatch between the two, I went a long way performing a number of different tests described in detail in this article The results suggest that the scipy implementation is correct, while sklearn implementation is incorrect.

Steps/Code to Reproduce

Please see the two links given above, where I provided the full source code and the results.

The piece of code is quite standard:

fs = SelectKBest(score_func=skfs.chi2, k = 'all')
X, y = df[cat_feature_cols], df[label]
selector = fs.fit(X, y)
kbest = pd.DataFrame({'feature': X.columns, 'score': fs.scores_})
kbest.sort_values(by = 'score', ascending = False).reset_index()

Expected Results

I would expect that sklearn.feature_selection.SelectKBest(score_func=skfs.chi2) returns same, or at least similar results (p-value and chi2 statistics) as scipy.stats.chi2_contingency() . In the particular case of feature A from my set, these expected results are:

chi2 = 127.497517
p-value = 1.445816e-29

Actual Results

For the feature A in my set, sklearn.feature_selection.chi2() (encapsulated inside SelectKBest(score_func=skfs.chi2)) returned lowest rank of all features, suggesting no correlation. Feature A has score 1.412797, while other features score between 1647 and 24.

In contrast, scipy.stats.chi2_contingency() gave highest rank to feature A, suggesting high correlation. The other tests described in the article suggest that the latter is correct.

Versions

System:
python: 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]
executable: C:\Users\pplaszczak\AppData\Local\Continuum\anaconda3\python.exe
machine: Windows-10-10.0.18362-SP0

Python dependencies:
pip: 21.0.1
setuptools: 52.0.0.post20210125
sklearn: 0.24.1
numpy: 1.19.2
scipy: 1.6.2
Cython: 0.29.22
pandas: 1.2.3
matplotlib: 3.3.4
joblib: 1.0.1
threadpoolctl: 2.1.0

Built with OpenMP: True
Issue 1:
I have followed the below steps to generate the bug.

I have created a file named after server.ts using the below command:

import { serve } from "https://deno.land/std@0.50.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
req.respond({ body: "Hello World\n" });
}

I have tried to bundle the code using the below command:

deno bundle server.ts server.bundle.js

Then I have tried to run the bundled code using the below command:

deno run server.bundle.js

After that, I have found the below issue into the terminal

error: Uncaught SyntaxError: Unexpected reserved word
for await (const req of s) {
~~~~~
at file:///Projects/Personal/server.bundle.js:5467:13

Issue 2:
Steps to reproduce

Create server.js with the following content:

import { serve } from "https://deno.land/std@v0.35.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
req.respond({ body: "Hello World\n" });
}

Run deno bundle server.js out.js

Run deno out.js

Expected result

The code runs

Actual result

error: Uncaught SyntaxError: Unexpected reserved word
► file:///path/to/out.js:113:17

113 for await (const req of s) {
~~~~~

Notes

Adding await console.log("test"); or any other await statement is detected by the bundler and allows the for-await block to work properly. (See #4206)

deno 0.35.0
v8 8.1.310
typescript 3.8.2
Issue 1:
Currently, the only ways to adjust the offset and repeat are to either change it on the texture object or to change the UV coordinates of the geometry. However, there are cases where it would be useful and performant to adjust on the Material.

For example, imagine creating a room where the walls would share a repeating texture - perhaps tiles, drywall, marble, etc. Ideally, you'd be able to use a single texture for all the walls and a single geometry, with each wall as its own Mesh object with different scales, positions and rotations. But if the walls had different dimensions, the tiling pattern would be stretched differently on each wall. To solve this now, you'd either have to make many instances of the texture, each with its own repeat/offset values or you'd have to give each wall its own geometry. It would be easier, faster and more flexible to allow each Mesh to have its own values.

Yes, you could merge the whole room into a single geometry and tweak the UV values. But that's much harder to do procedurally and it doesn't suit cases that require flexibility such as a scene editor. And it's slower to adjust in real time.

(This issue replaces #10490)

Issue 2:
I use the Texture.clone() function a lot in my code, because I need to set the UV coordinates differently on every model, and this slows down the initiation of the page considerably. If I don't clone the texture, then the scene renders instantly. So something is not optimal in the rendering pipeline.

It seems that the Texture.clone() function indeed creates a shallow clone that reuses the image, but then when data is sent to the graphics card these two textures are seen as having two separate images, sending the same image twice. Is this correct? Perhaps this is where the bottleneck is.

Coming from XNA and DirectX, where textures are not much more than containers for bitmap data, I wonder why Three.js also includes UV data in them, instead of specifying UV once the texture is applied to a mesh?
Issue 1:
ltisys:150:

`# transfer function is C (sI - A)**(-1) B + D`

should read:

# transfer matrix is C (sI - A)**(-1) B + D

Although, this matrix is not actually calculated, so the comment should probably be removed.

ltisys:179:

`type_test = A[:, 0] + B[:, 0] + C[0, :] + D`

Results in an error when a system with multiple ouputs is passed to ss2tf.

Suggested fix: add an optional argument 'output' which specifies the output for which the transfer function is desired.

Issue 2:
Is your feature request related to a problem? Please describe.

If we specify the covariance matrix manually, we usually do it in a form of rotation matrix and variances. So running the decomposition internally is redundant and inefficient.

Describe the solution you'd like.

Internally the covariance matrix should be stored in the decomposed form, so we can alter the components separately. We should be able to provide them explicitly, so skipping the solver. We should also be able to provide the angles instead of the matrix, as a more convenient interface, so we don't have to mess with .spatial.transform.Rotation ourselves.

Describe alternatives you've considered.

No response

Additional context (e.g. screenshots, GIFs)

No response
Issue 1:
Hi @mwaskom ,

I raised an issue regarding importing seaborn error #1200

while trying to run the flask application in IIS server. However since I couldn't provide much information at that time you couldn't help me. Sorry for late reply.

But I tried to log the traceback error caused due to importing seaborn. Results are below. Any help regarding this?

Traceback (most recent call last):

File ".\test.py", line 62, in

import seaborn as sns

File "C:\ProgramData\Anaconda3\lib\site-packages\seaborn_init_.py", line 16, in

from .widgets import *

File "C:\ProgramData\Anaconda3\lib\site-packages\seaborn\widgets.py", line 8, in

from ipywidgets import interact, FloatSlider, IntSlider

File "C:\ProgramData\Anaconda3\lib\site-packages\ipywidgets_init_.py", line 23, in

from IPython import get_ipython

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython_init_.py", line 49, in

from .terminal.embed import embed

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 17, in

from IPython.core.interactiveshell import DummyMod, InteractiveShell

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 62, in

from IPython.utils import io

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\utils\io.py", line 97, in

stdin = IOStream(sys.stdin, fallback=devnull)

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\utils\io.py", line 41, in init

for meth in filter(clone, dir(stream)):

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\utils\io.py", line 40, in clone

return not hasattr(self, meth) and not meth.startswith('_')

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\utils\io.py", line 84, in closed

return self.stream.closed

ValueError: underlying buffer has been detached

Eagerly waiting for your insights into this.

Issue 2:
I'm fairly certain that I found a bug; though it could be user error on my part. If this is a known issue, please feel free to close :)

Minimal Code:

import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd

# technically not necessary, but looks nicer :)
sns.set_context("talk")

df = pd.DataFrame({"A": ["foo", "foo", "foo", "foo", "foo",
"bar", "bar", "bar", "bar"],
"B": ["1", "1", "1", "2", "2",
"1", "1", "2", "2"],
"C": ["small", "large", "large", "small",
"small", "large", "small", "small",
"large"],
"D": [1, 2, 2, 3, 3, 4, 5, 6, 7],
"E": [2, 4, 5, 5, 6, 6, 8, 9, 9]})

table = pd.pivot_table(df, values='D', index=['A', 'B'],
columns=['C'], aggfunc=np.sum)

fig, ax = plt.subplots()
sns.heatmap(table, fmt=".2f", cmap=sns.diverging_palette(230, 20, as_cmap=True), ax=ax)

plt.show()

Produces:

Which has misaligned labels along the y-axis. If the labels get longer, seaborn seems to automatically rotate them, in which case the problem disappears.

Version Info:

Python 3.8.8
seaborn==0.11.1
matplotlib==3.3.4
Issue 1:
The labels-badges. less file uses the nested ampersand & operator to create extra classes by appending "-important", "-warning" etc. to the names ".label" and ".badge".

This generates some weird CSS if you use .label or .badge as a mixin on something that ends with a tag rather than a class e.g.

".text-with-labels span { .label }" creates ".text-with-label span-warning" etc.

It seems like the similar .btn-small and .btn-mini classes in buttons.less don't use this format, and from looking at the history it may have been done this way to reduce some duplication in the .less caused by the merger of badges and labels. Since the reduction in size of the less isn't actually making the output CSS any smaller I wonder if this might have been an overlooked consequence of using this shorthand and it might be changed back to having .label-warning, .badge-warning specified in full in the less to allow .label and .badge to be used freely as mixins again without the production of the spurious CSS.

Issue 2:
Simply browse the docs page in IE Tester (http://my-debugbar.com/wiki/IETester/HomePage): http://twitter.github.com/bootstrap/javascript.html#tooltips

None of the tooltip examples work.