WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
$ cat x.go
package main

import "crypto/hmac"

func main() {
hmac.NewMD5(nil) // foo
}
$ gofix x.go
x.go:9:2: expected 1 expression
x.go:10:7: expected statement, found ')'
$

Don't know whether it is specific to the hmac fix
or a bug in the printer. Probably the latter, sigh.

Issue 2:
by mazdak@chango.com:

CGO file referring to string.h and using the memcpy function gives the following error:

cannot use (type C.size_t) as type C.ulong in function argument

Sample Code:

package main

/*
#include <stdlib.h>
#include <string.h>
*/
import "C"

import (
"unsafe"
"fmt"
)

func main() {
var ksiz C.size_t
ksiz = C.size_t(6)
k := make([]byte, ksiz)
kp := C.CString("string")
C.memcpy(unsafe.Pointer(&k[0]), unsafe.Pointer(kp), C.ulong(ksiz))
fmt.Println(k)
}

What is the expected output?

Compilation without error. Output:
[115 116 114 105 110 103]

What do you see instead?

# command-line-arguments
./memcpytest.go:17: cannot use ksiz (type C.size_t) as type C.ulong in function argument

Which compiler are you using (5g, 6g, 8g, gccgo)?

CC=clang go build

Which operating system are you using?

ProductName: Mac OS X
ProductVersion: 10.9
BuildVersion: 13A598
Xcode 5.0.1
Build version 5A2034a

Which version are you using? (run 'go version')

go version devel +47b2b07a837f Fri Oct 11 16:39:40 2013 -0700 darwin/amd64
Issue 1:
I am trying to limit the maxlength of text type input field to specific number but it's not working.

Here is what I am trying

<TextField
InputProps={{ placeholder: '#'}}
type='text'
value = { _some state_ }
onChange = { _someFunction_ }) }
maxLength = "1"
/>

Versions

Material-UI: 1.0.0-beta.3

React: 15.6.1

Browser: chrome

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

Following the docs it should be possible to overwrite the fullWidth class name on the Button component. However, the fullWidth key is missing from the ButtonClassKey. Resulting in the following error:

Object literal may only specify known properties, and 'fullWidth' does not exist in type 'Partial<Record<ButtonClassKey, CSSProperties>>'.

Version: 1.0.0-beta.33
Issue 1:
Migrated issue, originally created by Anonymous

Hello everyone,

picture a common code location within a company, outside of any application, where database entities would be stored for common use in different applications within that company. In that common area you would store base objects of database entities such as a base object for a contract. That contract base object would be declared using declarative base and would use table information previously gathered through sqlautocode. Also it would include manual relation setups, such as the product this contract is bound to. Optionally it may also contain common logic.

In your application you would inherit from this contract base object and add your application-specific logic to it. The goals of this setup would be: Keep your company wide-used objects in a common place, avoid redundancies.

This pretty much works with SA, as declarative base was designed with inheritance in mind. (kudos!) What does not work, however, is using a custom polymorphic map, when this map would be set up on first inheriting from the base object (you wouldn't want to set up polymorphic mapping in your base object if you don't need this kind of differentiation of your contract objects in all of your applications).

Example scenario:

class ContractBase(Base):
""" Contract base """
__tablename__ = 'schema.contract'

product_list = relation(...)

class Contract(ContractBase):
""" Contract """
__mapper_args__ = {'polymorphic_on': contract_table.c.contract_status_id,
'_polymorphic_map': ContractStatusPolymorphicMap()}

class ActiveContract(Contract):
""" Active contract """

class InactiveContract(Contract):
""" Inactive contract """

(This is a fictional scenario. Please don't care about its use in general and use of a custom polymorphic map in particular.)

In this scenario the polymorphic_on mapper argument is being used. The polymorphic_map argument, however, is "ignored", as it is being overwritten in the _configure_inheritance() call:

self.polymorphic_map = self.inherits.polymorphic_map

I guess we should only overwrite self.polymorphic_map in _configure_inheritance() if self.inherits.polymorphic_map is not the default (f.e. self.inherits.polymorphic_map is not None and self.polymorphic_map is only being set in the constructor if self.polymorphic_on is not None).

Best Regards,

Thomas Wiebe

Issue 2:
Migrated issue, originally created by Shengjing Zhu (@zhsj)

sqlalchemy.types.JSON only supports PostgreSQL and MySQL. But since SQLite 3.9, it has json support, https://sqlite.org/json1.html

I hope sqlalchemy can support json1 too.
Issue 1:
Code Sample, a copy-pastable example if possible

pd.DataFrame(index=pd.MultiIndex.from_product([range(3), range(3)])).drop(5) # Raises
pd.DataFrame(index=pd.MultiIndex.from_product([range(3), range(3)])).drop(5, level=0) # Same operation, does nothing, but silently

Problem description

Since one expects drop() to always raise an error if the requested label is not found, this can be misleading.

It is not even a matter of partial vs. full labels, since the first example above has a partial label.

Expected Output

The same.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: 2a0e54b

python: 3.5.3.final.0

python-bits: 64

OS: Linux

OS-release: 4.9.0-4-amd64

machine: x86_64

processor:

byteorder: little

LC_ALL: None

LANG: it_IT.UTF-8

LOCALE: it_IT.UTF-8

pandas: 0.22.0.dev0+251.g2a0e54bc8.dirty

pytest: 3.2.3

pip: 9.0.1

setuptools: 36.7.0

Cython: 0.25.2

numpy: 1.12.1

scipy: 0.19.0

pyarrow: None

xarray: None

IPython: 6.2.1

sphinx: 1.5.6

patsy: 0.4.1

dateutil: 2.6.1

pytz: 2017.2

blosc: None

bottleneck: 1.2.0dev

tables: 3.3.0

numexpr: 2.6.1

feather: 0.3.1

matplotlib: 2.0.0

openpyxl: None

xlrd: 1.0.0

xlwt: 1.1.2

xlsxwriter: 0.9.6

lxml: None

bs4: 4.5.3

html5lib: 0.999999999

sqlalchemy: 1.0.15

pymysql: None

psycopg2: None

jinja2: 2.10

s3fs: None

fastparquet: None

pandas_gbq: None

pandas_datareader: 0.2.1

Issue 2:
Code Sample, a copy-pastable example if possible

import pandas as pd

s = pd.Series(
[1, 2, 3, 4],
index=['a', 'a', 'b', 'b'],
dtype=object
)
print(s.groupby(lambda x: x).sum()) # Works fine.
print(s.groupby(lambda x: x).mean()) # Raises `DataError`.

Problem description

GroupBy objects behave differently for different aggregation functions when used on non-numeric data types. mean (amongst others) re-raises on GroupByError while sum (amongst others) falls back on np.sum.

The expected behavior would be that all such functions either fall back on their numpy equivalent or re-raise on DataError for non-numeric data.

Expected Output

All such functions should either fall back on their numpy equivalent or re-raise on DataError for non-numeric data.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None

python: 3.5.2.final.0

python-bits: 64

OS: Linux

OS-release: 4.4.0-119-generic

machine: x86_64

processor: x86_64

byteorder: little

LC_ALL: None

LANG: en_US.UTF-8

LOCALE: en_US.UTF-8

pandas: 0.22.0

pytest: None

pip: 9.0.1

setuptools: 34.2.0

Cython: None

numpy: 1.14.0

scipy: 1.0.0

pyarrow: None

xarray: None

IPython: 5.2.2

sphinx: None

patsy: None

dateutil: 2.6.1

pytz: 2017.3

blosc: None

bottleneck: None

tables: None

numexpr: None

feather: None

matplotlib: 2.0.0

openpyxl: None

xlrd: None

xlwt: None

xlsxwriter: 0.7.3

lxml: None

bs4: 4.4.1

html5lib: 0.9999999

sqlalchemy: None

pymysql: None

psycopg2: None

jinja2: 2.9.5

s3fs: None

fastparquet: None

pandas_gbq: None

pandas_datareader: None
Issue 1:
I found a problem on checkbox button on touch devices (precisely iOS).

just to be clear i'm talking about this:

<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary">
<input type="checkbox"> Option 1
</label>
<label class="btn btn-primary">
<input type="checkbox"> Option 2
</label>
<label class="btn btn-primary">
<input type="checkbox"> Option 3
</label>
</div>

when you select and then deselect the button the style remain selected until you click on another button.

I think the problem is the rollover effect that on touch devices stays on after a click. it probably should be removed when on touch devices.

Issue 2:
On a mobile device, when tapping a button such as the dropdown menu button in the top right hand corner of the getbootstrap.com site, unless you navigate away from the page, the button stays in the hover state. Found similar issue on stackoverflow:

http://stackoverflow.com/questions/15305914/bootstrap-buttons-get-stuck-down-on-mobile-devices
Issue 1:
https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gce-federation/5234/

Failed: Up {e2e.go}

error running up: exit status 1

Previous issues for this test: #33357 #33377 #33993 #34033

Issue 2:
https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gce-federation/4526/

Failed: Up {e2e.go}

error running up: exit status 1

Previous issues for this test: #33357 #33377
Issue 1:
TypeScript Version:

1.8.7

Code

'use strict';

class User {
firstName: string;
lastName: string;

static getInstance() {
return new this();
}
}

class StaffUser extends User {
position: string;
}

let staffUser = StaffUser.getInstance();

console.log(staffUser.position); // error TS2339: Property 'position' does not exist on type 'User'

Expected behavior:

staffUser should be of type StaffUser, not simply User.

Actual behavior:

The compiler doesn't guess that getInstance in StaffUser returns instances of StaffUser.

Issue 2:
When trying to implement a fairly basic, but polymorphic, active record style model system we run into issues with the type system not respecting this when used in conjunction with a constructor or template/generic.

I've posted before about this here, #5493, and #5492 appears to mention this behavior also.

And here is an SO post this that I made:

http://stackoverflow.com/questions/33443793/create-a-generic-factory-in-typescript-unsolved

I have recycled my example from #5493 into this ticket for further discussion. I wanted an open ticket representing the desire for such a thing and for discussion but the other two are closed.

Here is an example that outlines a model Factory which produces models. If you want to customize the BaseModel that comes back from the Factory you should be able to override it. However this fails because this cannot be used in a static member.

// Typically in a library
export interface InstanceConstructor<T extends BaseModel> {
new(fac: Factory<T>): T;
}

export class Factory<T extends BaseModel> {
constructor(private cls: InstanceConstructor<T>) {}

get() {
return new this.cls(this);
}
}

export class BaseModel {
// NOTE: Does not work....
constructor(private fac: Factory<this>) {}

refresh() {
// get returns a new instance, but it should be of
// type Model, not BaseModel.
return this.fac.get();
}
}

// Application Code
export class Model extends BaseModel {
do() {
return true;
}
}

// Kinda sucks that Factory cannot infer the "Model" type
let f = new Factory<Model>(Model);
let a = f.get();

// b is inferred as any here.
let b = a.refresh();

Maybe this issue is silly and there is an easy workaround. I welcome comments regarding how such a pattern can be achieved.
Issue 1:
Bug summary

When animating a scatter changing only the azimuth the plot will not be updated unless the mouse is clicked on the plot.

Might be platform specific on a apple silicon version 3.5.1

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation

data = [np.random.random_sample((300, 3)) for _ in range(10)]
x, y, z = data[0][:, 0], data[0][:, 1], data[0][:, 2]

def update_pov(num):
ax.view_init(elev=10., azim=num % 360)

return graph,

fig = plt.figure(figsize=(5, 5))
ax = fig.add_subplot(111, projection="3d")
graph = ax.scatter(x, y, z, color='orange')

ax.set_xlim3d(0, 1)
ax.set_ylim3d(0, 1)
ax.set_zlim3d(0, 1)

ani = animation.FuncAnimation(fig, update_pov, frames=200, interval=50, blit=False)
plt.show()

Actual outcome

https://youtu.be/3l7gMHrwkqQ

in the video it is only animating when I click on the mousepad

Expected outcome

animations should flow independently of mouse clicks

Additional information

No response

Operating system

MacOS on Apple silicon

Matplotlib Version

3.5.1

Matplotlib Backend

MacOSX

Python version

Python 3.9.2

Jupyter version

No response

Installation

pip

Issue 2:
Bug report

Bug summary

Python 2.7.14

Mac OS X El Capitan, v10.11.6

Matplotlib v2.2.2 (same for v2.0.0)

I was trying to reproduce the rotating 3D plot from this example:

https://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html

(also copied below)

However, the plot displayed the initial view, got stuck, and then finished without any errors. I later found that if I use another computer with an old matplotlib version (v1.5.3), the code runs correctly. I used pip to install different versions of matplotlib.

Code for reproduction

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# load some test data for demonstration and plot a wireframe
X, Y, Z = axes3d.get_test_data(0.1)
ax.plot_wireframe(X, Y, Z, rstride=5, cstride=5)

# rotate the axes and update
for angle in range(0, 360):
ax.view_init(30, angle)
plt.draw()
plt.pause(.001)
Issue 1:

Issue 2:
Hello All,

I am a big fan of Requests, and have just upgraded from v0.14.0 on Python 3.2.3 to v0.14.2 on Python 3.3.0. I think that the upgrade to Requests broke my code when using a requests.session() object. I use Fiddler for some transport debugging, which is why I'm using the loopback address on port 8888.

Please note that everything works as expected if I use a requests.post() object instead of using a requests.session() object for the request (obviously bypassing the proxy).

My code looks as follows:

s = requests.session(proxies={'http': '127.0.0.1:8888'})
r = s.post(url, data=soap_req, headers=headers)

The call to s.post() results in a KeyError: None exception in connection_from_host() in class PoolManager in poolmanager.py.

The offending line is:

pool_cls = pool_classes_by_scheme[scheme]

Debugging shows pool_key = (None, '127.0.0.1', 8888)

What puzzles me is that scheme shows up as None (as shown in the 1st element in the tuple above). Debugging indeed verifies scheme is NoneType, which makes no sense, since it has a default value of 'http' when it enters the method.

I would appreciate anyone who can shed light and/or provide a fix for the above. I'm at the limit of my debugging skills. Please advise if you need more info from my side for further troubleshooting.

Thanks in advance,

Jean-Marc
Issue 1:
Elasticsearch version:

2.1.1

JVM version:

1.8.0_60

OS version:

Mac OS yosemite

Description of the problem including expected versus actual behavior:

If I'm testing undefined analyser the request will hang, instead it should return an error.

curl -XGET 'localhost:9200/_analyze' -d ' {"analyzer" : "path_analyzer", "text" : "config/initialize/gitlab.yml" }'

Steps to reproduce:

run curl -XGET 'localhost:9200/_analyze' -d ' {"analyzer" : "path_analyzer", "text" : "config/initialize/gitlab.yml" }'

Provide logs (if relevant):

[2016-02-25 12:11:20,699][ERROR][transport ] [Tomazooma] failed to handle exception for action [indices:admin/analyze[s]], handler [org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$1@1da2dd9e]
java.lang.NullPointerException
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:195)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.access$700(TransportSingleShardAction.java:115)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$1.handleException(TransportSingleShardAction.java:174)
at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:821)
at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:799)
at org.elasticsearch.transport.TransportService$4.onFailure(TransportService.java:361)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Describe the feature:

Issue 2:
My goal is to access elasticsearch data from other domain, am I missing anything over here?

I set the config in elasticsearch.yml file which looks like this

http.cors.enabled: true
http.cors.allow-origin: "/.*/"
http.cors.allow-credentials: true
http.cors.allow-headers: "Authorization, X-Requested-With, Content-Type, Content-Length"

after set the config I restart elasticsearch

now I want to do xhr call from other domain

var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://127.0.0.1:9200/_search', true);
xhr.withCredentials = true;
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Authorization', 'Basic ' + btoa('admin:admin'));
xhr.send('{"query":{"match_all":{}}}');

It responds with following error

XMLHttpRequest cannot load http://127.0.0.1:9200/_search. Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response.
Issue 1:
I know ES Module support is WIP, just having a few questions when quickly going through the code (I'll later do more experiments myself):

With isolate::execute_mod, seems that it is fetching source code every single time even with the same source file

deno/src/isolate.rs

Lines 239 to 240
in
4f62a56

let js_source = CString::new(out.js_source().clone()).unwrap();

let js_source_ptr = js_source.as_ptr() as *const i8;

and repeatedly compile

deno/libdeno/binding.cc

Line 464
in
4f62a56

auto maybe_module = CompileModule(context, js_filename, source);

and repeatedly register

deno/libdeno/binding.cc

Line 395
in
4f62a56

d->RegisterModule(js_filename, module);

Given the assumption that IdentityHash is unique, I'm not quite sure if this is considered unnecessary overhead if a previously compiled module is already available? (or possibly such action is deliberate?)

(As to IdentityHash, it seems Node is using a multimap when working with it, so I would assume it still has quite a chance of collision... Probably we could use a similar design (that keeps a reference of the module along with the filename as map value) to circumvent the problem)

Also, similar things happens with ResolveOk, with which we pass in the source code every time but might not be even used:

deno/libdeno/binding.cc

Lines 431 to 437
in
4f62a56

void DenoIsolate::ResolveOk(const char* filename, const char* source) {

CHECK(resolve_module_.IsEmpty());

auto count = module_map_.count(filename);

if (count == 1) {

auto module = module_map_[filename].Get(isolate_);

resolve_module_.Reset(isolate_, module);

} else {

Issue 2:
Enter import "" into your editor. Place the cursor after the first ". Now enter ../. The import now probably contains ../deps.ts/ or a reference to some other JS file in the parent directory of the file you were trying.

(I'd add a screen capture, but I can't get my screen recording to work anymore).

This effectively means you can not manually type out specifiers unless you press Esc between every key stroke. Highly frustrating.
Issue 1:
I would suggest to be able to use namespaces with modules.

dummy1.ts file :

namespace MyLib {
export class Dummy1{
constructor(public name:string, public surname:string) {};
}
}

dummy2.ts file :

namespace MyLib {
export class Dummy2{
constructor(public name:string, public surname:string) {};
}
}

main.ts file :

import {Dummy1, Dummy2} from 'mylib'
function main() {
let dum1= new Dummy1("sds", "sdsq");
let dum2= new Dummy2("sf", "sdsfd");
}

By doing this, we could directly call exported data from common namespace by just calling the namespace in the import statement.

Furthermore, the code generator could generate only one mylib.js file containing the Dummy1 and Dummy2 classes with system.js convention.

Issue 2:
Opening this separate issue as suggested by @mhegazy in the PR mentioned below. I'm not the most informed on this issue but I am opening it because I do not want it to get lost/forgot.

Quoting @mhegazy here:

@ahejlsberg proposed a import * from "mod" syntax to do that a while back. and in this case it would be import * from namespace. the problem here is it makes it harder to do a syntactic transformation on a single file, as the compiler needs to have the full program information to know how things should be qualified. it is something that we are looking into, i would recommend filing a new issue for this instead of having the discussion on this PR.

The PR is just renaming internal modules to namespaces to avoid any confusion with ES6 modules. this is something we got feedback for regularly from customers.

Now that TypeScript has renamed internal modules to namespaces and has the namespace keyword (PR #2923) it would be nice to be able to import a namespace and then have access to the types defined on that namespace. Would this essentially just be a new syntax to do what /// <reference path> does?

What are the obstacles and concerns for this feature?
Issue 1:
in dubbo-spring-boot-sample-provider 0.1.0

i alter application.properties to application.yml

then i find dubbo.protocol.port: 12345 is not supported ,the port will be 20880

Issue 2:
spring-boot-version : 1.5.9.RELEASE

dubbo.version : 2.6.0

bug 出现场景：

1、使用了@EnableDubbo 注解

2、配置文件使用的是 “.yml” 格式的文件

bug出现原因：

在yml 文件中，值是有数据类型的区分的，如果直接这样判断，会导致有些值被忽略
Issue 1:
If you make a change, scroll so that line is off screen, and undo, the editor should scroll back to the changed line. This is the normal behavior (at least in OS X) and I rely on it heavily as I work.

Issue 2:
Steps to reproduce.

git checkout master

git checkout -b new_feature

Open Atom with no files loaded.

Open an existing file and modify it. Keep it open.

git commit -am "Modifying file"

git checkout master

At this point you'd expect to see that the edits which you made would be gone since you are now viewing a different branch. However, the edits show up and git diff even highlights them.

Also PR #1271 supposedly fixed #693 (Closing file buffers when a file gets removed via git i.e. switching branches, deleting, etc.) but that is not happening for me. When I switch branches and a file gets removed, it stays open in Atom with no indication that it's not supposed to be there.

Edit: Personally I think a file getting removed via git should automatically close the buffer, while a file getting removed in another way should prompt you. "This file no longer exists, do you want to keep it open?". This is how Notepad++ handles the situation and I think that is the best way.
Issue 1:
System info

Playwright Version: v1.31

Operating System: Windows 11

Browser: Edge/WebView2

Other info: It is probably for all system and browsers, but checked only in this one

Source code

I provided exact source code that allows reproducing the issue locally.

Test file (pseudocode)

it('should check element is not leaking', async ({ page }) => {
await Promise.all([
() => page.locator('//*[@id="should_not_leak'div"]').waitFor({ state: 'attached' }),
() => page.setContent(`<div id='should_not_leak'div></div>`)
])
});

Steps

[Run the test]

[...]

Expected

There is no detached div element at the end of the test

Actual

Playwright leaks element(s) found by locators, if there is waitFor called on them, due to internally used Handles and not disposing them.

Issue 2:
System info

Playwright Version: [1.31.1]

Operating System: [macOS 13.2]

Browser: [Google Chrome]

Screenshots of config file and terminal

Expected

Tests should run. I am using different roles, so authStates are being called and used in each file. (3rd screenshot)

Actual

Tests not running, all getting skipped. Tests run when I comment the dependencies option in config file under project setup.