WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Feature request

Author of Sass here 👋! I'm talking with @markwhitfeld about trying to get Dart Sass's JS output running in the browser, and we're running into some hassles with Webpack in particular that I think a new feature could address.

What is the expected behavior?

I need to meet all the following requirements:

I want to be able to distribute a single npm package with minimal duplication...

that works on both Node.js and the web...

with nothing more complicated than npm i sass and require('sass')...

and plays nicely with Webpack bundling on both platforms...

without needing any special configuration...

and uses some libraries that are only available on Node...

while gracefully degrading when those libraries aren't available on the web.

As a special bonus non-requirement, it would be nice if the JS file we generate can be used as-is on web pages without bundling.

What is motivation or use case for adding/changing the behavior?

As far as I can tell, there's no way to meet all of the above requirements right now. If I didn't have to worry about Webpack, I'd just write

const chokidar = typeof window === 'undefined' ? require('chokidar') : null;

and be on my merry way, but that won't actually prevent webpack from bundling the dependency's code when targeting a browser so it fails requirement 4.

How should this be implemented in your opinion?

I'm agnostic on the best way to make this work, as long as it satisfies the requirements outlined above. The simplest solution might be to recognize typeof window === 'undefined' as a magic check that can be inlined and used for constant-folding. A more explicit solution might be to provide a __webpack_target_browser__ constant that explicitly indicates whether the platform is a browser.

Are you willing to work on this yourself?

No.

Issue 2:
I see alot of prs to upgrade to es6. Some noise might be reduced if you set eslint to require let and const, then allow eslint to auto fix the errors..
Issue 1:
I include a AppGlideModule implementation in My application also setting annotationProcessor and compile package,But GlideApp is not generated, I try to Make Project or Make Module,But still not

:

import com.bumptech.glide.annotation.GlideModule;

import com.bumptech.glide.load.engine.cache.LruResourceCache;

import com.bumptech.glide.module.AppGlideModule;

import java.io.InputStream;

/**

Created by --ln on 2017/7/15.

*/

@GlideModule

public class CustomAppGlideModule extends AppGlideModule {}

Issue 2:
I have a working config like this:

public class GlideSetup implements GlideModule

and in the manifest:

<meta-data
android:name="com.mo.android.glide.GlideSetup"
android:value="GlideModule"/>

This module is working on all the requests in entire application. The question is that how can i disable this module in some cases (and maybe set another module)?
Issue 1:
Description

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/naive_bayes.py#L53

The predict() method defined here doesn't do the input validation by calling

X = check_array(X)

Which then results in a different difficult to understand error.

Steps/Code to Reproduce

import pandas as pd
import numpy as np
from sklearn.naive_bayes import GaussianNB

data = [[418241,442351,2,1905,2,2,2,1,1,1,38,7,2 ],
[424993,432898,2,1615,1,2,2,1,1,2,50,1,1 ],
[431159,436397,2,1645,1,2,1,1,1,1,26,1,1 ],
[431159,436397,2,1645,1,2,1,1,2,2,22,1,1 ],
[439313,432376,2,956,2,1,1,1,1,1,57,2,1 ],
[426994,439957,2,1115,2,2,1,1,1,1,59,2,2 ],
[427813,431257,1,1352,3,1,1,1,1,2,53,1,2 ],
[431496,432727,2,2015,1,1,2,3,2,2,22,1,1 ],
[431880,430498,2,1110,3,1,1,1,2,2,20,1,1]]

data = np.array(data).reshape(-1,13)

y = data[:,12]
X = data[:,0:12]

model = GaussianNB()
model.fit(X, y)

X_test = ['427750', '426259', '2', '1610', '2', '1', '2', '1', '4', '1', '47', '2']
X_test = np.reshape(X_test, [1, -1])
y_pred = model.predict(X_test)

Expected Results

Error should have been thrown as input in X_test is non numerical.

Actual Results

A different error occured:

File "/home/local/EZDI/vivek.k/Desktop/untitlsss.py", line 33, in

y_pred = model.predict(X_test)

File "/usr/local/lib/python2.7/dist-packages/sklearn/naive_bayes.py", line 66, in predict

jll = self._joint_log_likelihood(X)

File "/usr/local/lib/python2.7/dist-packages/sklearn/naive_bayes.py", line 433, in joint_log_likelihood

n_ij -= 0.5 * np.sum(((X - self.theta[i, :]) ** 2) /

TypeError: ufunc 'subtract' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')

Issue 2:
Currently, dtype='numeric' is defined as "dtype is preserved unless array.dtype is object". This seems overly lenient and strange behaviour, as in #9342 where @qinhanmin2014 shows that check_array(['a', 'b', 'c'], dtype='numeric') works without error and produces an array of strings! This behaviour is not tested and it's hard to believe that it is useful and intended. Perhaps we need a deprecation cycle, but I think dtype='numeric' should raise an error, or attempt to coerce, if the data does not actually have a numeric, real-valued dtype.
Issue 1:
by kosak@kosak.com:

primes := []int{2, 3, 5, 7, 9, 2147483647}

I gather from the storied history of this line [note 1] that this is some kind of inside
joke, but I feel torn because you also say "We pride ourselves on being meticulous;
no issue is too small." [note 2] At the risk of failing your humor test, I hereby
file this defect report :-)

[note 1]
https://code.google.com/p/go/source/detail?name=3bbc978a64a4
https://code.google.com/p/go/source/detail?name=61a004522a55
https://code.google.com/p/go/source/detail?r=389444436d35
https://code.google.com/p/go/source/detail?r=c90b59861968

[note 2]
http://golang.org/project/

Issue 2:
by anta40:

I just updated my go source code, and this was the latest commit, anyway:
changeset: 16999:cda3832e9a12
tag: tip
user: Anthony Martin <ality@pbrane.org>
date: Tue Jun 04 17:30:45 2013 -0700
summary: mime: add support for Plan 9

Tried to build it on 32-bit Windows 7 using gcc 4.8.0 from MinGW-builds project, and I
got this:
# ..\misc\cgo\test
--- FAIL: TestParallelSleep (1.00 seconds)
basic.go:570: difference in start time for two sleep(1) is 230h50m49.392s
basic.go:575: parallel 1-second sleeps slept for 831049.392000 seconds
FAIL
scatter = 00498F97
hello from C
FAIL _/C_/go/misc/cgo/test 1.150s

Maybe I should revert back to previous version of gcc, like 4.7.2?
Issue 1:
Chris Beams opened SPR-5879 and commented

Some, but not all of the functionality available in AbstractTransactionalSpringContextTests is currently available in the TestContext framework.

Notably missing is support for setComplete(), endTransaction(), and startNewTransaction() methods.

Since these methods ultimately manipulate thread-bound resources, it should be possible to provide equivalent support through static methods on utility class that ships as part of the TestContext support.

Issue Links:

#9753 Support programmatic starting and stopping of transactions in the TestContext framework ("duplicates")

1 votes, 1 watchers

Issue 2:
Paul Austin opened SPR-6993 and commented

At the moment the AnnotationMethodHandlerAdaptor only uses a simple approach to content negotiation for RequestBody and ResponseBody parameters using the Accept and Content-type headers.

It would be useful if additional content negotiation, such as using file name extensions, request parameter and a default media type were also provided. This is similar to the approach provided by the ContentNegotiatingViewResolver for views.

I have implemented an example implementation if you'd like to use that as a basis for the implementation.

Look at the ServletHandlerMethodInvoker.handleResponseBodyMethod and the ServletHandlerMethodInvoker.resolveRequestBody. You'll see it uses a MediaTypeUtils class to get all the possible accepted media types.

The MediaTypeUtils uses the mediaTypeOrder field to decide which order the content negotiation should be performed in. This gives the developer the option to decide which types of content negotiation can be performed and the precedence order of these. The important thing to note is that all media types from all the selected sources are added so that there is fall back if one of the options is not supported by the different message converters.

Affects: 3.0.1

Attachments:

AnnotationMethodHandlerAdapter.java (47.27 kB)

ContentNegotatingResponseBody.java (5.91 kB)

ContentNegotatingResponseBody.java (5.86 kB)

MediaTypeUtil.java (4.29 kB)

Issue Links:

#11163 @RequestMapping should support accept header and url extension ("duplicates")

#13057 Content negotiation improvements ("is superseded by")

9 votes, 7 watchers
Issue 1:
System Info

working:

transformers version: 4.26.1

Platform: Linux-6.0.12-x86_64-with-glibc2.10

Python version: 3.8.16

Huggingface_hub version: 0.12.0

PyTorch version (GPU?): 1.13.1+cu117 (True)

Tensorflow version (GPU?): not installed (NA)

Flax version (CPU?/GPU?/TPU?): not installed (NA)

Jax version: not installed

JaxLib version: not installed

Using GPU in script?: yes

Using distributed or parallel set-up in script?: no

broken:

transformers version: 4.27.0.dev0

Platform: Linux-6.0.12-x86_64-with-glibc2.10

Python version: 3.8.16

Huggingface_hub version: 0.12.0

PyTorch version (GPU?): 1.13.1+cu117 (True)

Tensorflow version (GPU?): not installed (NA)

Flax version (CPU?/GPU?/TPU?): not installed (NA)

Jax version: not installed

JaxLib version: not installed

Using GPU in script?: yes

Using distributed or parallel set-up in script?: no

Who can help?

@gante @NielsRogge

Information

The official example scripts

My own modified scripts

Tasks

An officially supported task in the examples folder (such as GLUE/SQuAD, ...)

My own task or dataset (give details below)

Reproduction

Start with clean env setup via https://github.com/salesforce/LAVIS/blob/main/requirements.txt (transformers-4.26.1)

Run python test_simple.py, model is correctly loaded and prints a caption

pip install --upgrade git+https://github.com/huggingface/transformers (I wanted the new shiny blip2 conversion script so I can conver my finetuned model into HF format)

Resolved https://github.com/huggingface/transformers to commit 8b3db33a763ccef828fca89bac7e6cbff314f131

Run python test_simple.py

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 25 but got size 5 for tensor number 1 in the list.

import torch
from lavis.models import load_model_and_preprocess
import torch
from PIL import Image
import requests

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model, vis_processors, _ = load_model_and_preprocess(name="blip2_opt", model_type="caption_coco_opt6.7b", is_eval=True, device=device)

url = "..."
raw_image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
image = vis_processors["eval"](raw_image).unsqueeze(0).to(device)
data = model.generate({"image": image})
print(data)

Expected behavior

Can use BLIP2 with latest HF

Issue 2:
System Info

transformers version: 4.27.0.dev0

Who can help?

@NielsRogge

Information

The official example scripts

My own modified scripts

Tasks

An officially supported task in the examples folder (such as GLUE/SQuAD, ...)

My own task or dataset (give details below)

Reproduction

The following error happens when running BLIP-2 model's generate() with num_beams>1 and input batch_size>1

Expected behavior

The model should be able to do batch generate.
Issue 1:
Is your feature request related to a problem? Please describe.

I'm struggling with a poor performance when certain number of meshes are being rendered.

Doing some research about the inner working of the threejs pipeline, I found that in the render process is being performed a filtering with the purpose of renders only visible objects laying within the camera frustum. But despite to be nesting the meshes in groups, the process of filtering is performed only in Mesh, Line or Point objects.

Describe the solution you'd like

Could be interesting to implement the possibility of computing bounding boxes in Groups to avoid to check their children if them are laying outside the camera frustum.

For example if you have a scene with 100 groups of 10 meshes each, with the actual way there are performed a 1000 of checks to know what meshes are laying within the camera frustum. Implementing bounding boxes in groups, only 100 checks would be needed to know what groups are laying within the camera frustum and then checks the children of groups which tested positive.

The bounding box of the group could be updated by the user or each time a children is added or removed, performing an union with the children's bounding box.

And the same could be applied in Raycaster

Describe alternatives you've considered

I have structured the scene in chunks, so my idea is to perform a pre filter before call the render method.

Additional context

Issue 2:
At the moment BufferGeometry's groups are sorted using the centre of the whole BufferGeometry. In the near future we could consider having a BoundingSphere per group so transparent sub parts of a geometry get proper sorted.

Follow up from #7066.
Issue 1:
Marc Ludwig opened SPR-3873 and commented

I have been using both LTW and Component scanning using 2.1 M3. (This is actually for testing as we use Compile Time Weaving in the built application).

Just tried with 2.1 M4, and it appears that duplicate bean definitions are being generated, causing exceptions.

The XML config is as follows:

[code]

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:util="http://www.springframework.org/schema/util"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:tx="http://www.springframework.org/schema/tx"

xmlns:jee="http://www.springframework.org/schema/jee"

xsi:schemaLocation="

http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd

http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.1.xsd

http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd">

<context:load-time-weaver aspectj-weaving="on"/>

<context:component-scan annotation-config="true" base-package="base.package"/>

</beans>

[/code]

If any @Component is picked up by the scanning then the following exception is thrown:

[code]

org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [base.package.domain.ObjectWithDependencies] for bean with name 'objectWithDependencies' defined in null: problem with class file or dependent class; nested exception is java.lang.LinkageError: duplicate class definition:base/package/domain/ObjectWithDependencies

[/code]

Is it now incorrect to combine the component scanning and load time weaving, or is this unexpected behaviour?

Regards

Affects: 2.1 M4

Attachments:

spring-ltw-test.zip (6.42 kB)

1 votes, 2 watchers

Issue 2:
Andreas Benneke opened SPR-7900 and commented

Annotation driven injection on public methods specified in a non-public base classes does not work, because Java generates bridge methods for the subclass which are not ignored by Spring (as they should IMHO).

Example:

/* not public! */ class Base {

@Resource
public void setResource(Injectable injectable) {
...
}
}

@Component
public class Target extends Base {

}

Same applies to @Autowired.

The attached maven project demonstrates this.

Workarounds: Use field injection, re-declare the method(s) in the subclass or make the base class public.

Affects: 3.0.5

Attachments:

injection-test.zip (3.10 kB)

mylyn-context.zip (4.65 kB)

Issue Links:

#13080 AutowiredAnnotationBeanPostProcessor should ignore bridge methods when looking for annotations ("is duplicated by")

#13302 Bridged method detection leads to false positive detection of autowired annotations

#17096 @Resource injection broken under spring-framework > 4.1.0

#17101 Consistent bridge method handling in annotation post-processors
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

xxx

xxx

xxx

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

Dubbo version: 2.7.2

Operating System version: win10

Java version: 1.8

this issue

[DUBBO] Duplicate class org/apache/dubbo/common/Version.class in 2 jar [file:/E:/maven/repository/default/org/apache/dubbo/dubbo/2.7.2/

dubbo-2.7.2.jar

!/org/apache/dubbo/common/Version.class, file:/E:/maven/repository/default/org/apache/dubbo/dubbo-common/2.7.2/

dubbo-common-2.7.2.jar

!/org/apache/dubbo/common/Version.class], dubbo version: 2.7.2
Issue 1:
Environment

Windows build number: 18362

OS version: 10.0.18362

Powershell Core version: 6.2.3

Windows Terminal version: 0.5.2762.0

Steps to reproduce

Open new tabs until they exceed the edge of the titlebar

Expected behavior

Existing tabs should be resized so all of them can be visible on the titlebar.

Or

The tabs that exceed the titlebar edge should be aggregated in a single tab which:

is positioned to the right of the titlebar

in it`s title has a value that represent the number of aggregated tabs

when clicked on it, opens a dropdown with the aggregated tabs and the user is able to select

and switch to one of those

Actual behavior

The tabs that exceed the edge of the window, are not visible.

They are only selectable with shortcuts, but you would have to remember their position or guess it, which is very unproductive.

Issue 2:
This bug-tracker is monitored by Windows Console development team and other technical types. We like detail!

Please use this form and describe your issue, concisely but precisely, with as much detail as possible

Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.18898.1000]

What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)

Video demonstration of both issues below

A newly created tab doesn't scroll the tab bar to the end - could possibly be a config variable

When using tabs in the title bar and creating a new partially hidden tab, the tab gets cut off.

What's wrong / what should be happening instead:

The tab should not be cut off.
Issue 1:
I have the following in a component template:

<style is='custom-style'>...</style>

which is transformed and inserted under the 'head' tag:

<style>...</style>

losing the "is='custom-style'" during the process.

This marker is needed by polymer.

Issue 2:
I'm submitting a...

[x] Bug report
[x] Feature request

Background

Imagine you have the following webcomponent:

<expression>
<script type='text/plain'>
If(var1 < var2,
Sum([Field 1])
,
Sum([Field 2])
)
</script>
</expression>

The component reads the text inside the script tag and sends it to a server which evaluates the result.

The webcomponent should be embedded in an Angular App. It is no Angular component and should just rendered as is.

It has to contain a script tag because 'text/plain' allows it not to be parsed as HTML and like this, it is possible for expressions to contain characters like < as in var1 < var2 without being recognized as the beginning of a html tag.

Current behavior

Angular deletes all script tags inside templates, also those with text/plain. I read, that this is because you shouldn't mix JavaScript with Angular Templates, but this is just plain text.

Expected behavior

<script type="text/plain" should not be deleted. It is the only way to integrate text without having to escape all html characters.

Minimal reproduction of the problem with instructions

Insert the following code into a template and see if it will be deleted.

<script type='text/plain'>
If(var1 < var2,
Sum([Field 1])
,
Sum([Field 2])
)
</script>

What is the motivation / use case for changing the behavior?

If <script type="text/plain" would not be deleted it is possible to insert everything which is not html without having to escape it. HTML 5 supports it and as far as I know there is no alternative. Also it isn't a security vulnerability.

Environment

Angular version: 6.1.0
Browser:
- [x] Chrome (desktop) version 69
Issue 1:
Bug report

Consider the following example:

from pylab import *
from matplotlib.backend_bases import MouseEvent
rcdefaults()

fig, axs = plt.subplots(2)
for i, ax in enumerate(axs):
ax.set(xlim=(0, 1), ylim=(0, 1))
ann = ax.annotate(
"hello", xy=(.4, .4), xytext=(.6, .6), arrowprops={"arrowstyle": "->"})
ax.figure.canvas.draw()
xs = np.linspace(*ax.get_xlim(), 30)
ys = np.linspace(*ax.get_ylim(), 30)
for x in xs:
for y in ys:
event = MouseEvent(
"button_press_event",
ax.figure.canvas,
*ax.transData.transform_point((x, y)))
art = [ann, ann.arrow_patch][i]
ax.plot(x, y, ".", c="g" if art.contains(event)[0] else "r")
plt.show()

Points in green mark (a) in the top plot, points that are "contained" (per artist.contains) in the annotation object; (b) in the bottom plot, points that are "contained" in the arrow patch of the annotation object.

Obviously neither set of contained points is correct. This affects, for example, the points that trigger interactive dragging of the annotation.

Matplotlib version

Operating system:

Matplotlib version: 2.2.1, but also present in 1.5

Matplotlib backend (print(matplotlib.get_backend())): qt5

Python version: 3.6

Jupyter version (if applicable):

Other libraries:

Issue 2:
Bug report

Bug summary

The picker of FancyArrowPatch will not work with some arrow styles (see included example). Certain arrow styles will cause the picker to produce a pick event if the user clicks anywhere to the left of the arrow.

Code for reproduction

from matplotlib import pyplot as plt
from matplotlib import patches

def pick_event(event):
print("PICK", event.artist)

def main():
fig = plt.figure()
axes = fig.add_subplot(111)
axes.set_xlim((0, 10))
axes.set_ylim((0, 10))

arrow = patches.FancyArrowPatch(
(8, 2),
(9, 3),
# Uncommenting this will make the pick event be triggered every time I
# click to the left of the arrow.
# arrowstyle='-|>',
)
# Same thing happens with arrow.set_picker(True)
arrow.set_picker(4)

fig.canvas.mpl_connect('pick_event', pick_event)
axes.add_patch(arrow)
plt.show()

if __name__ == '__main__':
main()

Actual outcome

(With the arrowstyle line uncommented)

A pick event is always triggered when clicking to the left of the arrow.

PICK FancyArrowPatch(8,2->9,3)
PICK FancyArrowPatch(8,2->9,3)
PICK FancyArrowPatch(8,2->9,3)
PICK FancyArrowPatch(8,2->9,3)
PICK FancyArrowPatch(8,2->9,3)

Expected outcome

The pick event is not triggered unless the user actually clicks on the arrow.

Matplotlib version

I tested this with two versions of matplotlib:

version 2.0.0 installed via pip 9.0.1 using Python 2.7.12 included in ubuntu

version 1.5.3 built from source using Python 2.7.11 built from source

OS information:

$ uname -a
Linux 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux