WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
When I use a proxy in my code I find a problem. In the code below

s = requests.Session()
s.proxies = {'http':'127.0.0.1:3128'}
r = s.get("http://www.apple.com")

If I set environmet var http_proxy='http://192.168.1.100:3128' then the request will use environment proxy rather than the proxy I have set in the code.

But if I use proxy like below the program will use the proxy which I set in the code.

s = requests.Session()
r = s.get("http://www.apple.com", proxies={'http':'127.0.0.1:3128'})

Is there any issue?

Issue 2:
Problem

Currently, tools (e.g., openstack/python-swiftclient) fight how requests sets the Content-Type header for a request. Notice that if the user of swiftclient doesn't provide their own content_type then the library sets the header's value to ''. Ideally, setting None in a situation like this (where the Session has no default Content-Type) would prevent the request preparation from setting its own Content-Type header. This doesn't work because the per-session and per-request settings are merged at the session level.

Potential solutions

Split the responsibility of merging settings

The merge at the session level could just take care of ensuring that the per-request settings have priority while waiting for the request preparation to remove Nones. The downside of this behaviour is that it breaks backwards compatibility. Why? Consider the following:

import requests

s = requests.Session()
s.headers['Content-Type'] = 'application/json'
s.post(url, data={'some': 'formdata'}, headers={'Content-Type': None})

This allows for requests to detect that it is in fact application/x-www-form-urlencoded by removing the default set by the session. Keeping backwards compatibility would mean that we would have to do extra work while merging settings on the session-level. We would have to check if the header was set on the session level, and then we would delete headers with value None, otherwise, persist the None value. This is clearly a lot of extra logic.

Create a constant/singleton to mean "Do not autogenerate any of this for me"

We could potentially expose a new constant or singleton in requests to allow users to specify when they want to prevent requests from handling it for them. I dislike this idea a lot, but it's potentially easier to implement and a bit more explicit than overloading the already overloaded meaning of None in this context.
Issue 1:
Symfony: 3.2

What is the reasoning behind checking if the viewdata is an instance of the data_class in Form.php? Is this check preventing some situations that would be bad?

I got the corresponding LogicException in a situation that issued some strange demands on my code. Simplest code is in the zip in attachment: a ValueObject that encapsulates a string, and a formtype using this VO.

I used a ModelTransformer to convert my data from string to VO and back. The error demands that I set my data_class to null, or add a ViewTransformer. I added the ViewTransformer, as a ReversedTransformer from my ModelTransformer (not sure why ViewData would need to be an object). That did not work, so I changed the data_class to another option "data_class_my", to test if this would help. It did, untill I added some data to my formtype. I had to explicitly set the data_class to null, which makes no sense to do, as all seems to work if I simply remove the if block in Form.php on line 358.

Why would Symfony tell me to convert my norm data to view data which is an object, when the view data I receive from the submitted form is never going to be an object? It seems unneeded to actually add a view data transformer there.

Why can I not use data_class to tell my formtype to convert it to an object?

I know I can do this some other way with datamappers, DTO's, and so on..., but I'm really puzzled why this is not working. Is this actually a bug, or is it avoiding some more terrible situations?

Symfony.zip

Did a little digging, @webmozart, do you remember what is going on here? It was added in 2012, so might be hard to remember...

Issue 2:
why cannot customize about this.
Issue 1:
We are planning to implement horizontal pod autoscaling base on custom metrics.

The custom metrics need to be exposed by each of pods from RC/deployment as described in custom metrics proposal.

Spec of HPA will contain a list of custom metric names together with their target utilizations. If the desired numbers of pods resulting from different custom metrics utilizations are different, the autoscaler will choose the bigger number. HPA Status will contain latest observed values of the custom metrics.

Proposed modification in the API:

type CustomMetricTargetUtilization struct {
Metric string
Target float64
}

type HorizontalPodAutoscalerSpec struct {
...
CustomMetricUtilizations []CustomMetricTargetUtilization
}

type CustomMetricCurrentValue struct {
Metric string
Value float64
}

type HorizontalPodAutoscalerStatus struct {
...
CustomMetricValues []CustomMetricCurrentValue
}

Issue 2:
What happened:

We created a scheduled jobs from example mentioned on documentation.

kubectl run hello --schedule="0/1 * * * ?" --restart=OnFailure --image=busybox -- /bin/sh -c "date; echo Hello from the Kubernetes cluster"

kubectl get scheduledjob hello

NAME SCHEDULE SUSPEND ACTIVE LAST-SCHEDULE

hello 0/1 * * * ? False 0

It never create a associated jobs.

What you expected to happen:

It should create jobs as per scheduled job specification.

How to reproduce it (as minimally and precisely as possible):

We noticed this problem with v1.4.3 however on stage cluster we run v1.4.4 and it does create associated jobs there.

Output from stage cluster:

kubectl get jobs
NAME DESIRED SUCCESSFUL AGE
hello-1859028810 1 1 11m
hello-1934853965 1 1 12m
hello-1934985037 1 1 9m
hello-1935116109 1 1 6m
hello-2010810192 1 1 10m
hello-2010941264 1 1 7m
hello-2011072336 1 1 4m
hello-2011203408 1 1 1m
hello-2086766419 1 1 8m
hello-2086897491 1 1 5m
hello-2087028563 1 1 2m
hello-2162853718 1 1 3m
hello-2162984790 1 1 33s

Kubernetes version (use kubectl version):

1.4.3

Environment:

Cloud provider or hardware configuration: AWS

OS (e.g. from /etc/os-release): CoreOS 1122.3.0

Kernel (e.g. uname -a): Linux -1 4.7.0-coreos-r1

Others: Enabled --runtime-config=batch/v2alpha1 in apiserver flag.

Is this issue related to specific kubernetes version like v1.4.3 where it couldn't create associated jobs as per scheduled job specification?

Please let us know if you need any more information on this.

Thanks!
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: 2.7.7

Operating System version: macOS Mojave

Java version: 1.8

@Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
...
registerApplicationListeners(registry);
...

private void registerApplicationListeners(BeanDefinitionRegistry registry) {
registerBeans(registry, DubboLifecycleComponentApplicationListener.class);
registerBeans(registry, DubboBootstrapApplicationListener.class);
}

解析每一个element节点都会调用registerApplicationListeners方法,虽然在registerBeans中是有判断

bean是否已经注册过了,如果注册就忽略,但是可以在registerApplicationListeners方法中判断下,如果已经存在了就不再调用registerBeans方法了

private void registerApplicationListeners(BeanDefinitionRegistry registry) {
if (!isPresentBean(registry, DubboLifecycleComponentApplicationListener.class)) {
registerBeans(registry, DubboLifecycleComponentApplicationListener.class);
}
if (!isPresentBean(registry, DubboBootstrapApplicationListener.class)) {
registerBeans(registry, DubboBootstrapApplicationListener.class);
}
}

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: 2.6.x

Operating System version: MacOS 10.12.6

Java version: 1.8.0_181

Steps to reproduce this issue

Consumer set retries and invoke any provider via generic invocation.

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

Expected Result

Get the correct retries in FailoverClusterInvoker.

public Result doInvoke(Invocation invocation, final List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
List<Invoker<T>> copyinvokers = invokers;
checkInvokers(copyinvokers, invocation);
String methodName = RpcUtils.getMethodName(invocation);
int len = getUrl().getMethodParameter(methodName, Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
if (len <= 0) {
len = 1;
}
...

Actual Result

Get the default retires cause use incorrect method name.

public Result doInvoke(Invocation invocation, final List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
List<Invoker<T>> copyinvokers = invokers;
checkInvokers(copyinvokers, invocation);
int len = getUrl().getMethodParameter(invocation.getMethodName(), Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
if (len <= 0) {
len = 1;
}
...

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

Just put your stack trace here!
Issue 1:
I have a small project open and, if I paste from an external source (browser, etc), it will crash Atom and will have start a new Atom process.

I'm on v.0.189.0

Let me know if you need any more detailed information if you cannot replicate it.

Issue 2:
I'm using Atom ver. 0.189.0 on Ubuntu 14.04.2 LTS. When I copy a piece of text in atom and I try to paste it the right-click menu either won't show up or will show up without giving me option to paste. The paste shortcut doesn't work either and it creates issues even if I try to copy and paste text from other programs (after I have coping something from atom). I have disable all the extra plugins, so it isn't a plugin issue. I didn't had this issue with the previous version (I am using webupd8 ppa). If I do a right click on a place where there isn't a text entry (meaning a place where it doesn't support paste anyway) the right click menu appears fine.
Issue 1:
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.):

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):

Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Kubernetes version (use kubectl version):

Environment:

Cloud provider or hardware configuration:

OS (e.g. from /etc/os-release):

Kernel (e.g. uname -a):

Install tools:

Others:

What happened:

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else do we need to know:

Issue 2:
http://kubekins.dls.corp.google.com:8080/view/Scalability/job/kubernetes-e2e-gke-large-cluster/49/consoleText

@gmarek @zmerlynn

There are 4 tests that failed in this run:

Guestbook application [It] should create and stop a working application [Conformance]

Generated release_1_3 clientset [It] should create pods, delete pods, watch pods

Kubectl client [k8s.io] Update Demo [It] should scale a replication controller [Conformance]

Networking [It] should function for intra-pod communication [Conformance]

We should understand those failures.
Issue 1:
I'm in the middle of a migration from C++ and I'm having a hard time in understanding Julia "slices".

I have a vector a. When I do b=a[1:2] and b[1] = 10 for example, a is not affected.

That is, the "slicing" operation a[1:2] creates a copy instead of working with the original data.

Is this a bug or intended behavior?

If it is intended behavior, what is the correct way of getting a reference to a piece of the original vector? (whose type is still Vector, not SubArray; I have functions with explicit type annotations for type safety).

Issue 2:
I would prefer that range indexing of an Array (e.g. X[1:10, :]) created a SubArray (a view/reference), not a copy. This seems more in the spirit of Julia's pass-by-reference semantics, and would eliminate some of the performance gotchas with range indexing.

It might also make future loop-devectorization optimization easier, because subarray references can be devectorized back into references to the original array without worrying that you will be changing the semantics.

It would reduce Matlab compatibility, but we already do that with pass-by-reference and so I doubt many users will be surprised by having the same reference semantics for range indexing.

This is something that has come up informally several times on the mailing list, but I didn't see any issue for it.
Issue 1:
I have this data:

print(vars(features_norm))

{'_data': BlockManager
Items: Index(['SWdown', 'Tair', 'Qair', 'Rainf', 'Wind'], dtype='object')
Axis 1: <class 'pandas.tseries.index.DatetimeIndex'>
[2002-01-01 00:30:00, ..., 2006-01-01 00:00:00]
Length: 70128, Freq: 30T, Timezone: None
FloatBlock: [SWdown, Tair, Qair, Rainf, Wind], 5 x 70128, dtype: float64, 'is_copy': None, '_item_cache': {}, '_iloc': <pandas.core.indexing._iLocIndexer object at 0x7f34e7c3bc10>}

and when I run this:

db = sk.cluster.MeanShift().fit(np.array(features_norm))

My whole computer slows to a complete halt in a couple of seconds (too fast to kill python). I'm running IPython 1.1.0 on Python 3.3.2+ on Kubuntu Saucy 64-bit, on an 8 core intel, with 8Gb of RAM.

Sorry for the somewhat useless bug-report, but I don't get any error messages before the thing freezes. If there is anything I can do to get more information (preferably without freezing my system), please let me know.

Issue 2:
Hi, this it my first bug report, so I'm not exactly sure how much information is usually required here.

I've run the MeanShift algorithm on a cluster of approximately ~300,000 in size. It gives me an output of:

[user@host ~]$ python meanshifttest.py
Traceback (most recent call last):
File "meanshifttest.py", line 13, in <module>
ms = MeanShift().fit(X)
File "/home/user/anaconda/lib/python2.7/site-packages/sklearn/cluster/mean_shift_.py", line 280, in fit
cluster_all=self.cluster_all)
File "/home/user/anaconda/lib/python2.7/site-packages/sklearn/cluster/mean_shift_.py", line 99, in mean_shift

bandwidth = estimate_bandwidth(X)

File "/home/user/anaconda/lib/python2.7/site-packages/sklearn/cluster/mean_shift_.py", line 45, in estimate_bandwidth

d, _ = nbrs.kneighbors(X, return_distance=True)

File "/home/user/anaconda/lib/python2.7/site-packages/sklearn/neighbors/base.py", line 313, in kneighbors

return_distance=return_distance)

File "binary_tree.pxi", line 1313, in sklearn.neighbors.kd_tree.BinaryTree.query (sklearn/neighbors/kd_tree.c:10007)

File "binary_tree.pxi", line 595, in sklearn.neighbors.kd_tree.NeighborsHeap.init (sklearn/neighbors/kd_tree.c:4709)

MemoryError

I was encouraged to file a bug report from my stackoverflow question (http://stackoverflow.com/questions/20104999/python-meanshift-memory-error/20116682?noredirect=1#comment30125531_20116682).

~Austen
Issue 1:
Problem description

The text-overflow: ellipsis condition is no longer applying the correct overflow style to text int he TableRowColumn component

Steps to reproduce

Create a Table with a TableRowColumn that has a small width and fill it with a very long string and you'll see that it doesn't overflow correctly

Versions

Material-UI: 0.16.0-rc1

React: 15.2.1

Browser: Chrome

Workaround + Fix

We will need to add overflow: hidden to the TableRowColumn style in https://github.com/callemall/material-ui/blob/master/src/Table/TableRowColumn.js

i.e.

Previous

root: {
...
textOverflow: 'ellipsis',
},

Proposed

root: {
...
textOverflow: 'ellipsis',
overflow: 'hidden',
},

Happy to submit a PR for this minor fix.

Issue 2:
Problem description

0.15.4

0.16

Steps to reproduce

Provide a very long text to <TableRowColumn />: http://www.webpackbin.com/VkzfhMPRW

Seems to have been introduced by 252449d.

Versions

Material-UI: 0.16.0

React: 15.3.2

Browser: Chrome 53.0.2785.143 (64-bit)

If we remove the whiteSpace: nowrap, it will allow multiple lines, any idea on how we can fix this, @oliviertassinari ?
Issue 1:
I've a input element like <input type="file" webkitdirectory="" multiple="" name="files[]" id="files""> which prompts a user to select a folder. I need to get file names & paths of all the files within that folder.

var input = document.getElementById('files');
input.onchange = function(e) {
var files = e.target.files; // File list
for (var i = 0; i < files.length; ++i) {

var fpath = files[i].webkitRelativePath;
var ftype = files[i].type;
var fsize = files[i].size;

console.log(fname)
}
}

This works perfectly fine when run from chrome web browser as shown here: https://jsfiddle.net/7prshjfz/. However, when I try to run the same app via electron it gives ONLY the folder name and nothing else. When I tried to debug further, I released that when a folder is selected, only the folder name, size, modified etc details are available.

Therefore, clearly there is a different implementation of webkitdirectory in electron. Is this an intended implementation?

My Problem: I know I can use the dialog.showOpenDialog and read the fs using the directory path. But, I find this to be a bad solution for my case (or perhaps for anyone) because, I want my code to be minimal for the sake of the web app. I want to reuse as much of the functionality from the webapp with additional implementation in Electron and NodeJS. I would be grateful to know if there is any special implementation of webkitdirectory that works BOTH in an Internet Browser and Electron app with minimal modifications, for instance, to the above displayed code/ jsFiddle.

I'm not sure If I this is a missing feature/ bug or neither. Any feedback will be appreciated :)

Issue 2:
file . multiple webkitdirectory in chrome can get sub files.but atom-shell can select directory,sub file set only current directory? is bug?
Issue 1:
Symfony version(s) affected: 4.1.0

Description

When using the new name_prefix option, routes will be generate both with prefix and without prefix.

How to reproduce

In config/routes.yaml add a prefix for a controller folder

admin:
resource: ../src/Controller
type: annotation
name_prefix: admin_

And, by using debug:router command, you will see that a router named dashboard will be created 2 times.

------------------------------------------------------ -------- -------- ------ -----------------------------------------
Name Method Scheme Host Path
------------------------------------------------------ -------- -------- ------ -----------------------------------------
dashboard ANY ANY ANY /
admin_dashboard_index ANY ANY ANY /

Issue 2:
Please read this post:

https://groups.google.com/d/msg/symfony2/uRoYVaczJWI/NQgYt6m2mY0J
Issue 1:
Casting np.arrays to int32 converts np.nan to:

array(-2147483648, dtype=int32) on a local Mac M1 machine

array(0, dtype=int32) on a docker image running ubuntu

Reproducing code example:

On the following system:

ProductName:	macOS
ProductVersion:	11.2.3
BuildVersion:	20D91

The following code casts np.nan to -2147483648

>>> import numpy as np
>>> np.array(np.nan).astype(np.int32)
array(-2147483648, dtype=int32)

On a docker image with the following system:

# uname -srv
Linux 5.10.25-linuxkit #1 SMP PREEMPT Tue Mar 23 09:24:45 UTC 2021

The following code casts np.nan to 0

>>> import numpy as np
>>>np.array(np.nan).astype(np.int32)
array(0, dtype=int32)

Note: One can run docker run -it python:3 bash to replicate the environment, and pip install numpy which installs from numpy-1.21.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch6

NumPy/Python version information:

In our Mac M1 local machinge

>>> sys.version
'3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 15:59:12) \n[Clang 11.0.1 ]'
>>> np.__version__
'1.21.2'

In our Ubuntu image:

>>> sys.version
'3.7.11 (default, Jul 27 2021, 15:14:22) \n[GCC 10.2.0]'
>>> np.__version__
'1.21.2'

Issue 2:
With ndarray.astype(..., casting="unsafe") float arrays with NaN/inf will be converted to np.iinfo(dtype).min/max,

>>> np.array([1, np.nan], dtype=np.float32).astype(np.int32)
array([ 1, -2147483648], dtype=int32)
>>> np.array([1, np.inf], dtype=np.float32).astype(np.int32)
array([ 1, -2147483648], dtype=int32)

(there are also some inconsistencies there cf #6109). This is very bad in practical applications as output data will be wrong by orders of magnitude. Other casting options simply disallow casting float to int.

At the same time, casting from dtype=np.object works as expected,

>>> np.array([1, np.inf], dtype=np.object).astype(np.int32)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: cannot convert float infinity to integer

It could be useful to have some additional casting option allowing to convert int to float, but would error on NaN or inf. This could be done manually,

if array.dtype.kind == 'f' and np.dtype(dtype).kind == 'i':
# check for overflows and NaN
_assert_all_finite(array)
result = array.astype(dtype)

but having it in numpy would be useful.

I also wonder if there is really a case when not raising on such conversions is meaningful (even with casting='unsafe'). For instance pandas does this conversions as expected (using numpy dtypes),

>>> pd.Series([1, np.nan], dtype=np.float64).astype(np.int)
[...]
ValueError: Cannot convert non-finite values (NA or inf) to integer

Numpy/Python version information:

>>> import sys, numpy; print(numpy.__version__, sys.version)
1.16.4 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0]
Issue 1:
Suggestion moved over from codeplex.

The suggestion is to allow generic parameter overloads like the following:

declare module Backbone {
class Model{}
class Events{}
class ViewOptions<TModel extends Model> {}
class Collection<TModel extends Model> {}

// Generic parameter overload
class View extends View<Backbone.Model>;
class View<TModel extends Model> extends Events { // Don't take as duplicate identifier
constructor(options?: ViewOptions<TModel>);
model: TModel;
collection: Collection<TModel>;
}
}

// With Generics Parameter overloads, old non-generic consumer
// code works as before and does not need to change.
class MyView extends Backbone.View {
}
var myView = new MyView();
var model = myView.model; // model is of type Backbone.Model

// Can gradually introduce generic parameters to Views
class DerivedModel extends Backbone.Model {
}
var myView2 = new Backbone.View<DerivedModel>();
var model2 = myView2.model; // model2 is of type DerivedModel

This is important because this would allow people to introduce generics in their library declarations without breaking large amounts of existing code for the consumers. We do this a lot in C#, and it is compatible with TypeScript design because it won't make any changes in the resulting javascript, and works pretty much like method overloads in TypeScript.

Related discussion: https://typescript.codeplex.com/discussions/452741

Issue 2:
Access to the parent class's static methods and properties should be available from a derived class's static methods and properties via super (MDN reference). Typescript compiler currently emits an error for using super in a static context.

TypeScript Version:

1.8.7, also on Typescript playground though I don't know what version that is.

Code

class AppComponent {
public static title: string = 'This is an app';
public get title(): string {
return (<typeof AppComponent>this.constructor).title;
}
}

class ReloadedApp extends AppComponent {
public static title: string = `${super.title}: Reloaded`;
}

alert((new ReloadedApp).title);

Expected behavior:

I would expect this to compile and run correctly with no errors. Expected alert:

This is an app: Reloaded

Expected compiled (ES5) code:

var __extends = // __extends definition
var AppComponent = // AppComponent definition
var ReloadedApp = (function (_super) {
__extends(ReloadedApp, _super);
function ReloadedApp() {
_super.apply(this, arguments);
}
ReloadedApp.title = _super.title + ": Reloaded";
return ReloadedApp;
}(AppComponent));
alert((new ReloadedApp).title);

Actual behavior:

Compiles and runs correctly, but emits error:

error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.