WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Issue description

I noticed that some loss functions in torch.nn.functional do tensor broadcasting while other does not.

I started using cosine_embedding_loss and was happy because it handles input tensors with (N, F) and (1, F) shapes, where N - number of examples, F - number of features in one example (vector). Then I moved to mse_loss and l1_loss to check for better results. And I was disappointed to see that the latter both require (N, F) and (N, F) tensors - they do not support tensor broadcasting as cosine_embedding_loss does. Now I need to either stack the second tensor N times (and I do not know whether the gradient history is stored if a tensor is copied; in any case it is memory and computationaly inefficient) or implement l1 and l2 losses on my own.

Please, make loss behavior consistent - either all functions require exactly the same shape or handle broadcasting for each of them. Thank you.

Code example

t1 = torch.randn(5,7)
t2 = torch.randn(1,7)
loss_cosine = F.cosine_embedding_loss(t1, t2, target=torch.ones(5)) # works fine
loss_l2 = F.mse_loss(t1, t2)
# RuntimeError: input and target shapes do not match: input [5 x 7], target [1 x 7]

How you installed PyTorch: conda install pytorch-cpu torchvision-cpu -c pytorch

PyTorch version: 0.4.1

Python version: 3.6.6

Issue 2:
To Reproduce

a = T.zeros(5,1,10, requires_grad=True)
b = T.zeros(5,10,10, requires_grad=True)
F.mse_loss(a,b)
# OK

a = T.zeros(5,1,10)
b = T.zeros(5,10,10)
F.mse_loss(a,b)
# RuntimeError: input and target shapes do not match: input [5 x 1 x 10], target [5 x 10 x 10] at /opt/conda/conda-bld/pytorch_1524577523076/work/aten/src/THNN/generic/MSECriterion.c:13

Expected behavior

Broadcast should work the same as with grad.

Workaround

# assumes size_average=False
def my_mse(a,b):
return ((a-b)**2).sum()
Issue 1:
I am trying to run resnet_v2.py from provided modles but getting error ImportError: No module named nets .

I have done following

First installing slim

cd $HOME/tensorflow git clone https://github.com/tensorflow/models/

To verify that this has worked, execute the following commands; it should run

without raising any errors.

`cd $HOME/tensorflow/models/slim
python3 -c "from nets import cifarnet; mynet = cifarnet.cifarnet"`

I got no error.

But when I run following gives error "ImportError: No module named nets". I have also tried

cd $HOME/tensorflow/models/slim/ python3 -c "from nets import resnet_utils"

Got not error. Also build using bazel build nets output

INFO: Found 1 target... Target //slim:nets up-to-date (nothing to build) INFO: Elapsed time: 0.096s, Critical Path: 0.00s

I don't know why this is not working.

Issue 2:
I am trying to run resnet_v2.py from provided modles but getting error ImportError: No module named nets.

I have done following

First installing slim

cd $HOME/tensorflow git clone https://github.com/tensorflow/models/

To verify that this has worked, execute the following commands; it should run

without raising any errors.

cd $HOME/tensorflow/models/slim python3 -c "from nets import cifarnet; mynet = cifarnet.cifarnet"

I got no error.

But when I run following gives error "ImportError: No module named nets". I have also tried

cd $HOME/tensorflow/models/slim/ python3 -c "from nets import resnet_utils"

Got not error. Also build using bazel build nets output INFO: Found 1 target... Target //slim:nets up-to-date (nothing to build) INFO: Elapsed time: 0.096s, Critical Path: 0.00s

Same thing happen when try to run Inception with error ImportError: No module named inception

I don't know why this is not working.
Issue 1:
Output of node_modules/.bin/electron --version: 3.0.13

Operating System (Platform and Version): MacOS 10.14.2

Output of node_modules/.bin/electron --version on last known working Electron version (if applicable): 2.0.16

Expected Behavior

Print all content.

Actual behavior

Only printing first page's content, the reset of the pages are blank. Electron 2 prints all pages.

To Reproduce

Print anything greater than one page on Electron 3 using window.print().

Screenshots

Issue 2:
Electron Version: 3.0.0-beta.6

Operating System (Platform and Version): Mac OS 10.13.6

Last known working Electron version: 2.0.7

Expected Behavior

If content spans multiple pages, all pages should print.

Actual behavior

Only content on the first page is being printed

To Reproduce

https://github.com/enstrategic/printing-example

$ git clone https://github.com/enstrategic/printing-example
$ yarn
$ yarn run start

Click on the print button

Screenshots

Electron 3 example:

Electron 2 output:

Additional Information

Add any other context about the problem here.
Issue 1:
System information (version)

OpenCV => 4.0.0-alpha, 4.0.0-beta

Operating System / Platform => Ubuntu 16.04

Detailed description

Since OpenCV 4.0.0-alpha, I cannot use anymore Features2d.NOT_DRAW_SINGLE_POINTS with Java binding.

Is this intended since it looks like it is no more possible to call drawMatches with this flag parameter?

In 3.4.3, there is:

drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, MatOfByte matchesMask, int flags)

But in 4.0.0-beta there is only:

drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, MatOfByte matchesMask)

Issue 2:
System information (version)

OpenCV => 4.0.0

Operating System / Platform => nixpkgs on macOS 10.14 (Mojave)

Compiler => clang

Detailed description

I'm packaging OpenCV-4.0.0 in nixpkgs at NixOS/nixpkgs#51027.

The build succeeds on the aarch64-linux and x86_64-linux platforms. Unfortunately it fails on x86_64-darwin while linking the videoio module. See the full build log here.

So it looks like a linker issue:

[ 62%] Linking CXX shared library ../../lib/libopencv_videoio.dylib
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_NSData", referenced from:
objc-class-ref in cap_avfoundation_mac.mm.o
"_OBJC_CLASS_$_NSDate", referenced from:
objc-class-ref in cap_avfoundation_mac.mm.o
"_OBJC_CLASS_$_NSDictionary", referenced from:
objc-class-ref in cap_avfoundation_mac.mm.o
"_OBJC_CLASS_$_NSURL", referenced from:
objc-class-ref in cap_avfoundation_mac.mm.o
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:193: lib/libopencv_videoio.4.0.0.dylib] Error 1

Apparently NSData is part of the Foundation framework. I don't see -framework foundation anywhere in the opencv sources so I tried adding it to the makefile of the failing videoio module here. Unfortunately that didn't help.

Any idea what I'm doing wrong?

Steps to reproduce

First install Nix on OS X.

git clone git@github.com:NixOS/nixpkgs.git
cd nixpkgs

# Fetch my PR that adds OpenCV-4.0.0
git fetch origin pull/51027/head:opencv-4.0.0
git checkout opencv-4.0.0

# Try building OpenCV-4.0.0
nix-build -A opencv4
Issue 1:
Issue originally reported by @marcoacierno in babel/babel-preset-env#417

I'm having difficulties using the plugin transform-class-properties together with babel-preset-env, even if it's defined in the .babelrc the build still says 'Missing class properties transform.'. Searching online I found that you need to use transform-class-properties before the others (or after, can't recall now) but as far as I know I can't change the execution order in the babelrc.

How can I solve this problem?

The error

SyntaxError: /Users/marco/projects/TAOPP/Frontend/js/App.js: Missing class properties transform.
32 |
33 | class App extends React.Component {
> 34 | static childContextTypes = {
| ^

My .babelrc

{
'presets': [
['env', {
'targets': {
'browsers': ['last 2 versions'],
},
'modules': false,
'debug': true,
}],
'react',
],
'plugins': [
'transform-class-properties',
'transform-object-rest-spread',
],
'env': {
'server': {
'presets': [
['env', {
'modules': 'commonjs',
}],
]
},
'production': {
'presets': ['minify'],
},
},
}

(p.s. the documentation is not really clear about how .babelrc handles the env merge, so I'm not sure that my babelrc is correct)

Issue 2:
The code as follow running normally at last version(V7.8.6), but at Version7.8.7，throw error.

let obj = {one:{a:1}, other: {b:2}}
function fn(obj, key) {
for(var key in obj) {
fn(obj[key], key)
}
}
fn(obj, 'base');

throw error:

TypeError: Property left of ForInStatement expected node to be of a type ["VariableDeclaration","LVal"] but instead got null.

my enviorment: @babel/core:7.8.7, @babel/types:7.8.7,@babel/generator:7.8.7.

Now, I fix it as:

let obj = {base:{a:1}, other: {b:2}}
function fn(obj, key) {
for(let key in obj) {
fn(obj[key], key)
}
}
fn(obj, 'base');

or like this:

let obj = {base:{a:1}, other: {b:2}}
function fn(obj, key) {
for(var key2 in obj) {
fn(obj[key2], key2)
}
}
fn(obj, 'base');

Is it a bug with V7.8.7 or just change rules?
Issue 1:
npm WARN deprecated fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size

npm WARN deprecated core-js@1.2.7: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

[ ......] | extract:rxjs: sill extract rxjs@^6.5.2 extracted to /mnt/d/work/luoshu/node_modules/.staging/rxj

[ ......] | extract:rxjs: sill extract rxjs@^6.5.2 extracted to /mnt/d/work/luoshu/node_modules/.staging/rxj

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:

npm ERR! /home/zhaohx/.npm/_logs/2019-12-11T10_27_58_941Z-debug.log

Issue 2:
Is there an existing issue for this?

I have searched the existing issues

This issue exists in the latest npm version

I am using the latest npm

Current Behavior

I can observe moduleA in node_modules of moduleB

Expected Behavior

npm must not download a peer dependency if it is resolvable within NODE_PATH or any other method described in https://nodejs.org/api/modules.html#loading-from-the-global-folders

Steps To Reproduce

Install moduleA globally (npm i -g moduleA)

Install moduleB, where moduleA is set as a peer dependency locally: NODE_PATH=<node_modules_root_where_moduleA_installled> npm i moduleB

Check node_modules folder of moduleB

Environment

npm: 8.16.0

Node.js: v18.5.0

OS Name: macOS

System Model Name: Darwin SL-1204 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64

npm config:

; copy and paste output from `npm config ls` here
Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Electron Version

12.x

What operating system are you using?

Other (specify below)

Operating System Version

both in win and mac

What arch are you using?

x64

Last Known Working Electron version

11.4.3

Expected Behavior

print options

{
silent: true,
deviceName: 'actual printer name',
landscape: true,
copies: 2,
pageRanges: [{from: 1, to: 1}],
pageSize: 'A5'
}

all of the options would be honored when silent true

Actual Behavior

all of the options above not honored

Testcase Gist URL

No response

Additional Information

No response

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Electron Version

12.0.2

What operating system are you using?

Windows

Operating System Version

Windows 10 Home Single Language 20H2 19042.867

What arch are you using?

ia32

Last Known Working Electron version

11.4.2

Expected Behavior

This script should print to all existing printers. The printers "Microsoft XPS Document Writer" and "Microsoft Print to PDF" should block the loop and ask for file name.

Actual Behavior

All prints will return success, but print will happen always only to print set as default in system.

Testcase Gist URL

https://gist.github.com/fc8b4a9fbf986965c51e8f92b8ddb39f

Good way to run the test is to set printer "Microsoft Print To PDF" as default printer.
Issue 1:
Some NumPy C functions do not have signatures available. I have not audited the full API but I know this is true at least for arange.

It sounds like you can add signatures for functions defined in C by adding a __text_signature__ attribute. Or you can add a __signature__ attribute to return a Signature instance.

Reproducing code example:

import numpy as np
import inspect

inspect.signature(np.arange)

Error message:

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-3-5338db87f2d9> in <module>
----> 1 signature(np.arange)

/usr/local/Caskroom/miniconda/base/envs/python-record-api/lib/python3.8/inspect.py in signature(obj, follow_wrapped)
3091 def signature(obj, *, follow_wrapped=True):
3092 """Get a signature object for the passed callable."""
-> 3093 return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
3094
3095

/usr/local/Caskroom/miniconda/base/envs/python-record-api/lib/python3.8/inspect.py in from_callable(cls, obj, follow_wrapped)
2840 def from_callable(cls, obj, *, follow_wrapped=True):
2841 """Constructs Signature for the given callable object."""
-> 2842 return _signature_from_callable(obj, sigcls=cls,
2843 follow_wrapper_chains=follow_wrapped)
2844

/usr/local/Caskroom/miniconda/base/envs/python-record-api/lib/python3.8/inspect.py in _signature_from_callable(obj, follow_wrapper_chains, skip_bound_arg, sigcls)
2294
2295 if _signature_is_builtin(obj):
-> 2296 return _signature_from_builtin(sigcls, obj,
2297 skip_bound_arg=skip_bound_arg)
2298

/usr/local/Caskroom/miniconda/base/envs/python-record-api/lib/python3.8/inspect.py in _signature_from_builtin(cls, func, skip_bound_arg)
2105 s = getattr(func, "__text_signature__", None)
2106 if not s:
-> 2107 raise ValueError("no signature found for builtin {!r}".format(func))
2108
2109 return _signature_fromstr(cls, func, s, skip_bound_arg)

ValueError: no signature found for builtin <built-in function arange>

Numpy/Python version information:

>>> import sys, numpy; print(numpy.__version__, sys.version)
1.18.4 3.8.2 | packaged by conda-forge | (default, Apr 16 2020, 17:20:38)
[Clang 9.0.1 ]

Issue 2:
Which involves including --\n\n in the docstrings. See http://stackoverflow.com/a/41245451/102441
Issue 1:
I'm using the latest version of VS Code on OS X (Version 0.10.8 (0.10.8), db71ac6).

Replication steps:

Paste the following into a new whatever.ts file.

function foo() { }
function bar() { }
function baz() { }

export {
foo,
bar,
baz
};

Now highlight the properties of the export (the 3 lines saying foo, bar, baz) and press tab to indent them and it outputs the following and can't be undone using the undo command:

function foo() { }
function bar() { }
function baz() { }

export {
az
};

The indenting seems to happen but where did my exports go?! 😮

Issue 2:
I wanted to indent multiple lines at once but it failed. This is how it looks like when I select some lines and press Tab. Sometimes it works though, like when creating an untitled file in split screen.

Quite important bug @egamma @jrieken @bpasero
Issue 1:
📝 Provide a description of the new feature

It would be nice to have a feature similar to Linux Xcompose or wincompose.

What is the expected behavior of the proposed feature? What is the scenario this would be used?

The expected behavior would be to have similar capabilities as we have with https://github.com/samhocevar/wincompose

It's a great tool that I think should be included with powertoys.

If you'd like to see this feature implemented, add a 👍 reaction to this post.

Issue 2:
📝 Provide a description of the new feature

What if I write asap and automatically the word is replaced by "as soon as possible" ?

There are lots of programs that can do it but most of them are not free and they have lots of useless features and they are resources-hungry.

It's not implemented natively on windows but this is a very very very important feature to save time and correct typing errors.

I got this idea from Text Replacement in Ios, which is basilar but efficient.

If you'd like to see this feature implemented, add a 👍 reaction to this post.
Issue 1:
when using the "yum" module to install a package in RHEL6, I just get this error:

fatal: [jofo-mgmt1] => failed to parse: This system is not registered with RHN.

RHN support will be disabled.

{"changed": true}

These lines are always printed by yum on the machine, unless the RHN plugin is disabled with "--disableplugin=rhnplugin", or, I guess, by registering the machine with RHN. However, the latter would probably be impractical since it's actually a disposable VM in a opennebula cluster.

Issue 2:
From @Vladimir-csp on 2016-06-12T09:45:24Z

ISSUE TYPE

Feature Idea

COMPONENT NAME

copy

template

ANSIBLE VERSION

ansible 2.1.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides

CONFIGURATION

OS / ENVIRONMENT

N/A

SUMMARY

As was suggested in #6929, I am opening new issue on this matter

Please add 'state' parameter for template and copy modules, so items could be removed with the same task by using condition or variable override.

STEPS TO REPRODUCE

EXPECTED RESULTS

Something like this should be possible

- name: govern foo template
template: src=foo dest=/etc/foo state="{% if enable_foo == true %}present{% else %}absent{% endif%}"

On second thought, file, copy, and template modules could be merged together into file module to make some cool things like:

- name: linked template
file: template=foo.conf state=link src=../bar/bar.conf dest=/etc/foo/foo.conf
# makes link /etc/foo/foo.conf > /etc/bar/bar.conf,
# templates /etc/foo/foo.conf from foo.conf effectively writing to /etc/bar/bar.conf.

ACTUAL RESULTS

Copied from original issue: ansible/ansible-modules-core#3934
Issue 1:
Version

2.5.3

Reproduction link

https://vuejs.org/v2/guide/render-function.html#Template-Compilation

(Alternative reproduction on jsfiddle: https://jsfiddle.net/Linusborg/pqbppg7a/)

Steps to reproduce

Paste the following piece of HTML into the textarea of the linked documentation chapter above.

<input type="text" v-bind:value="message" v-model="message">

Inspect the code of the created render function, especially the domProps options:

domProps: {
"value": message,
"value": (message)
},

What is expected?

The code should run in all browsers, or throw an error or warning.

What is actually happening?

IE11 throws an error: "duplicate properties not allowed in strict mode".

I realize that using both v-bind:value and v-model on an input is not recommended or even sensible, but it doesn't throw an error or warning when done in modern browsers, and doesn't create any problems if the expression is the same for both, so it can easily be overlooked when added accidentally.

Uglify also doesn't help - it doesn't remove the first occurrence that would otherwise be "overwritten" by the second in modern browsers.

So what would be a sensible solution? I'm not sure.

We could adjust the codegen of domProps to check for a double occurence of the value prop on elements of type "input" and drop all but the last occurrence. Possible Problem: performance?

We could log a warning to console (how to deal with that in vue-loader?)

We could throw an error, forcing the user to choose between the two (breaking change)

we could improve awareness by adding a warning to docs and a rule to eslint-plugin-vue?

Issue 2:
Version

2.6.10

Reproduction link

https://codesandbox.io/s/quizzical-hooks-flxdp

Steps to reproduce

No steps. Just check out the reproduction.

What is expected?

The class styles in App.vue to be applied on the functional SFC.

What is actually happening?

Parent class is added to the classlist of child, but the css is not generated for the class.

If you remove the 'scoped' keyword from functional component, then all the styles are applied. But the need is to use this with scoped styles, as with normal components is done.
Issue 1:
Auke van Leeuwen opened SPR-8805 and commented

There is a small typo in the one of the code samples in the Cache Abstraction documentation: http://static.springsource.org/spring/docs/3.1.0.M1/spring-framework-reference/html/cache.html:

<bean id="cacheManager" class="org.springframework.cache.ehcache.EhcacheCacheManager" p:cache-manager="ehcache"/>

<!-- Ehcache library setup -->
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config-location="ehcache.xml"/>

Instead of org.springframework.cache.ehcache.EhcacheCacheManager it's actually: org.springframework.cache.ehcache.Eh{*}C{*}acheCacheManager. Just a small typo but it will of course not start your spring-context if you copy-paste it.

Affects: 3.1 RC1

Issue Links:

#13277 Use lowercase 'c' in 'Ehcache' consistently ("duplicates")

Issue 2:
Yannick Lazzari opened SPR-9100 and commented

There seems to be a difference in the way configuration classes, i.e. classes annotated with @Configuration, are handled by the ClassPathBeanDefinitionScanner vs the AnnotatedBeanDefinitionReader. The javadoc says that the AnnotatedBeanDefinitionReader is, "...an alternative to ClassPathBeanDefinitionScanner, applying the same resolution of annotations but for explicitly registered classes only.". If you read the Spring forum thread attached to this issue report, you will find an example that shows that the way @ComponentScan excludeFilters are processed is not the same; actually, they seemed to be totally ignored when the ClassPathBeanDefinitionScanner scans a class annotated in the following manner:

@Configuration

@ComponentScan(basePackages={"com.foo", "com.bar"}, excludeFilters={@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = com.foo.ComponentA.class)})

public class TestConfig {

}

Affects: 3.1 GA

Reference URL: http://forum.springsource.org/showthread.php?122907-Spring-3-1-AnnotationConfigWebApplicationContext-scan-vs-register-method&p=400832

Issue Links:

#13670 @ComponentScan with includeFilters on @Import-ed context does not work ("duplicates")

#12634 @ComponentScan does not work when referenced from XML config

#13361 @ComponentScan(includeFilters=@Filter(...)) fails when @Import'ed