messages
listlengths
2
2
language
stringclasses
8 values
prompt_type
stringclasses
2 values
lint_errors
int64
0
129
⌀
cyclomatic_complexity
int64
0
32
⌀
license
stringclasses
7 values
commit
stringlengths
40
40
repos
stringlengths
5
116k
new_file
stringlengths
4
220
status
stringclasses
6 values
error
stringlengths
26
74
⌀
is_valid_syntax
bool
2 classes
[ { "role": "user", "content": "Here is the current file:\n```go\npackage codabar\n\nimport (\n\t\"image/color\"\n\t\"testing\"\n)\n\nfunc Test_Encode(t *testing.T) {\n\t_, err := Encode(\"FOOBAR\")\n\tif err == nil {\n\t\tt.Error(\"\\\"FOOBAR\\\" should not be encodable\")\n\t}\n\n\ttestEncode := func(txt, t...
go
edit
6
6
mit
33202215fe2182bb02afbe8220b4ed60f54f9833
boombuler/barcode
codabar/encoder_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build windows\n\npackage config\n\nimport (\n\t\"os\"\n\t\"path\"\n)\n\nfunc defaultDirectory() string {\n\tbase := path.Base(os.Args[0])\n\text := path.Ext(base)\n\n\tdrv := os.Getenv(\"SystemDrive\")\n\tpdDir := \"ProgramData\"\n\tname :=...
go
edit
0
1
mit
1c23c3eae8b9e073fecb0234d3e818fc1305a54c
codemodus/config
defdir_windows.go
rejected_duplicate
Near-duplicate of sample 119688
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage codec\n\nimport (\n\t\"github.com/luopengift/transport\"\n \"time\"\n)\n\n// add a enter symbol at end of line, classic written into file\ntype DebugInjectHandler struct {\n\t*transport.Inject\n}\n\nfunc (h *DebugInjectHandler) Init(...
go
edit
3
1
apache-2.0
2c77d1855e3366aa0a2bd7d0f9d37f06a23db71a
luopengift/transport,luopengift/transport,luopengift/transport
plugins/codec/inject.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage version\n\n// Flag contains extra info about the version. It is helpul for tracking\n// versions while developing. It should always be empty on the master branch.\n// This is inforced in a continuous integration test.\nconst Flag = \"ex...
go
edit
0
2
apache-2.0
c6a87b05076c8bbbd26264aa813607a6ec01dc75
babbleio/babble,babbleio/babble
src/version/version.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\n\t\"github.com/gsamokovarov/jump/scoring\"\n)\n\n// ReadEntries returns the current entries for the config.\n//\n// If the scores file is empty, the returned entries are empty.\nfunc ...
go
edit
12
5
mit
ff05bb523b574b14c16dc8ac5744ab2d7a08a9b7
gsamokovarov/jump
config/entries.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2015 The Gogs Authors. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage gitea\n\n// MarkdownOption markdown options\ntype MarkdownOption struc...
go
edit
3
1
mit
439ea6ca7522d30ca0c0f43ce419e65c93fb32f5
go-gitea/go-sdk
gitea/miscellaneous.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage watchdog\n\nimport (\n\t\"time\"\n)\n\n// BackOff is the interface to a back-off interval generator.\ntype BackOff interface {\n\t// Mark the next call to NextInterval as the \"first\" retry in a sequence.\n\t// If the generated interva...
go
edit
0
1
mit
7a6c04f8b0fda0f1dc60106f63e09d414868925d
efritz/watchdog
backoff.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sort_test\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/goSTL/sort\"\n)\n\nfunc main() {\n\tsample := []int{3, 138, 1, 674, 213, 23, 5, 2}\n\tfmt.Println(sample)\n\n\tsort.HeapSortInt(sample)\n\tfmt.Println(sample)\n\t//Output:\n\t//[3 138 1...
go
edit
0
1
mit
23b15a9e45afbab9fce59d4a382b2a253ceaac71
go-Algorithm/sort,goSTL/sort
example_HeapSortInt_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\nimport \"os\"\nimport \"os/exec\"\nimport \"strconv\"\nimport \"time\"\n\n\nfunc main() {\n cmd := exec.Command(\"paplay\", \"/usr/share/sounds/freedesktop/stereo/complete.oga\")\n cmd.Start()\n\n var in...
go
edit
6
4
mit
427a9b6b1a50cc5d58ed0a760d3186f0f475c409
Cosiek/ding
src/main.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage hamming\n\nimport (\n\t\"testing\"\n)\n\nvar testCases = []struct {\n\texpected int\n\tstrandA, strandB string\n\tdescription string\n}{\n\t{0, \"\", \"\", \"no difference between empty strands\"},\n\t{2, \"AG\", \"CT\", \"...
go
edit
3
3
mit
bb5f4a4d978df3c8856d6a1b9764bbbd9e09bab7
exercism/xgo,leenipper/xgo,leenipper/xgo,pminten/xgo,robphoenix/exercism-go,robphoenix/exercism-go,pminten/xgo,exercism/xgo
assignments/go/hamming/hamming_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"goof/plugs\"\n\t\"github.com/codegangsta/cli\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar (\n\t\tplug string\n\t\tdebug bool\n\t)\n\n\tapp := cli.NewApp()\n\tapp.Name = \"goof\"\n\tapp.Usage = \"Extracts blogs f...
go
edit
0
5
mit
df3a2d70505c11b1b832101e718fd084418175fb
umayr/goof
runner.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n//go:build linux || zos\n\npackage tcp\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"time\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// SetUserTimeout sets the TCP user timeout on a connection's socket.\nfunc SetUserTimeout(conn *net.TCPConn, timeout time...
go
edit
0
3
apache-2.0
a97c12b6f2b20a72701bf82c68ab7bb524123e1f
lxc/lxd,lxc/lxd,lxc/lxd,lxc/lxd,lxc/lxd,lxc/lxd,lxc/lxd
shared/tcp/tcp_timeout_user.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage types\n\nimport sdk \"github.com/cosmos/cosmos-sdk/types\"\n\nfunc (disabledValidator ProposedDisableValidator) HasApprovalFrom(address sdk.AccAddress) bool {\n\taddrStr := address.String()\n\tfor _, approval := range disabledValidator....
go
edit
0
3
apache-2.0
2c2004859bfb38fde111d3a5f1c0d4df3d501c07
zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger
x/validator/types/proposed_disable_validator.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage errors\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n)\n\ntype HttpError struct {\n\tCode int `json:\"code\"`\n\tMessage string `json:\"message\"`\n}\n\nvar HttpErrors map[string]*HttpError = map[string]*HttpError {\n\t\"Error...
go
edit
0
1
mit
98bae9747cc550a1d7a0038d1785591f863e762f
xaviergodart/gydro
errors/http_error.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sensu\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\n// ...\nfunc (api *API) doRequest(req *http.Request) ([]byte, *http.Response, error) {\n\tif api.User != \"\" && api.Pass != \"\" {\n\t\treq.SetBasicAuth...
go
edit
6
7
mit
63359ad89250d9e60f719d2accdc93e21d8ea004
sensu/uchiwa,palourde/uchiwa,sensu/uchiwa,palourde/uchiwa,sensu/uchiwa,sensu/uchiwa,sensu/uchiwa,palourde/uchiwa,palourde/uchiwa,palourde/uchiwa
uchiwa/sensu/request.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !windows,!darwin,!linux\n\npackage credentials\n\nconst defaultCredentialsStore = \"\"\n\n```\n\nApply this change: Fix compilation of defaultCredentialStore() on unsupported platforms\n\nSigned-off-by: Ivan Markin <<EMAIL>>" }, {...
go
edit
0
1
apache-2.0
57c51c8af30bbe791e513bc0de32e99349459269
thaJeztah/cli,thaJeztah/cli,docker/cli,docker/cli,cpuguy83/cli,dnephin/cli,cpuguy83/cli,dnephin/cli
cli/config/credentials/default_store_unsupported.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage manager\n\nimport (\n\t\"strings\"\n\n\t\"github.com/pkg/errors\"\n)\n\nfunc trimExeSuffix(s string) (string, error) {\n\texe := \".exe\"\n\tif !strings.HasSuffix(s, exe) {\n\t\treturn \"\", errors.Errorf(\"lacks required %q suffix\", e...
go
edit
0
3
apache-2.0
1337895751efda0a928dcf40a58db6577513c513
cpuguy83/cli,thaJeztah/cli,docker/cli,docker/cli,cpuguy83/cli,thaJeztah/cli
cli-plugins/manager/suffix_windows.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage middleware\n\nimport (\n\t\"github.com/labstack/echo\"\n\t\"strings\"\n\t\"net/http\"\n\t\"log\"\n)\n\nfunc ServerInfo(pipe echo.HandlerFunc) echo.HandlerFunc{\n\treturn func (c echo.Context) error{\n\t\tc.Response().Header().Set(echo.H...
go
edit
0
4
apache-2.0
16d1b7e80e99b1ac4fac8a822d4fc252fdd24058
EthanG78/golang_chat,EthanG78/GoChat,EthanG78/GoChat
middleware/middleware.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage funcs\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/sacloud/usacloud/command\"\n\t\"github.com/sacloud/usacloud/command/params\"\n)\n\nfunc PrivateHostCreate(ctx command.Context, params *params.CreatePrivateHostParam) error {\n\n\tclient := ...
go
edit
0
4
apache-2.0
c074f635f3681f2fb29d4350e34a528a18fbce1e
sacloud/usacloud,yamamoto-febc/usacloud,sacloud/usacloud,yamamoto-febc/usacloud
command/funcs/private_host_create.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mux\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\ntype WrapperFunc func(handlerFunc http.Handler) http.Handler\n\n// Wraps handler func with slice of wrapper functions one by one.\nfunc Wrap(h http.Handler, wrappers ...Wrappe...
go
edit
3
2
mit
b720c2a8257f5a21c73b71db9477bcb6d8ee5ec7
DVI-GI-2017/Jira__backend
mux/wrapper.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cayley\n\nimport (\n\t\"github.com/google/cayley/graph\"\n\t_ \"github.com/google/cayley/graph/memstore\"\n\t\"github.com/google/cayley/graph/path\"\n\t\"github.com/google/cayley/quad\"\n\t_ \"github.com/google/cayley/writer\"\n)\n\ntyp...
go
edit
0
3
apache-2.0
3b58ae999465bc124b290803708926b2681e2199
pombredanne/cayley,sayden/cayley,sdaros/cayley,ominux/cayley,skynet/cayley,dtkav/cayley,karabijavad/cayley,posenhuang/cayley,mjolk/cayley,panamafrancis/cayley,beni55/cayley,beni55/cayley,azylman/cayley,sdaros/cayley,azylman/cayley,HomeMango0310/cayley,dushmis/cayley,barakmich/cayley,barakmich/cayley,googlearchive/cayle...
imports.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage prefer\n\ntype filterable func(identifier string) bool\n\ntype Configuration struct {\n\tidentifier string\n\tloaders map[Loader]filterable\n\tserializers map[Serializer]filterable\n}\n\nfunc NewConfiguration(identifier string) *Co...
go
edit
12
4
mit
291d0d7f303310c6731eba5fe754b760877d53aa
LimpidTech/prefer.go
prefer.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n)\n\ntype Checker func(*MonitorConf) (bool, error)\n\nfunc checkHTTPStatus(mc *MonitorConf) (bool, error) {\n\tresp, err := http.Get(\"http://\" + mc.Url)\n\tif err != nil {\n\t\treturn false, err\n\t}\...
go
edit
6
3
mit
ecb300f62aff2f5b303891c89c7abed58c8cbcd3
oguzbilgic/pandik,arthurpro/pandik
checker.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage audited_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/jinzhu/gorm\"\n\t\"github.com/qor/qor/audited\"\n\t\"github.com/qor/qor/test/utils\"\n)\n\ntype Product struct {\n\tgorm.Model\n\tName string\n\taudited.AuditedModel\n...
go
edit
6
3
mit
be4287f8cbaeb71dbcfffb7c676de5875cc29a57
qor/qor,qor/qor,qor/qor
audited/audited_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*-\n * Copyright (c) 2016, Jörg Pernfuß <<EMAIL>>\n * All rights reserved\n *\n * Use of this source code is governed by a 2-clause BSD license\n * that can be found in the LICENSE file.\n */\n\npackage msg\n\ntype Result struct {\n\tType str...
go
edit
3
0
bsd-2-clause
ad4045f913a64aba0adc5c7da8484d1772497c9d
1and1/soma
lib/msg/result.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage webserver\n\nimport (\n \"fmt\"\n \"reflect\"\n)\n\n/*\nInteracts with urls.go to route requests to their corresponding functions.\nWires the capture groups from a url's regex to the callbacks arguments\n*/\n\ntype router struct {...
go
edit
0
2
mit
30ece74c19d39788d2a48bee0771c2f5892bfdd5
edbrown23/SubtleLion
src/webserver/router.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage goexamplepackage\nimport \"fmt\"\nfunc DoTest(foo int) int {\n fmt.Println(\"Example:\", foo)\n return 42\n}\n\n```\n\nApply this change: Change from DoTest to DoExample." }, { "role": "assistant", "content": "packag...
go
edit
0
1
mit
be5f62b4f294fcc4ef0c661e01e974c0e3479dc7
digitallumens/goexamplepackage,digitallumens/goexamplepackage
example.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage opts\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\ntype IpOpt struct {\n\t*net.IP\n}\n\nfunc NewIpOpt(ref *net.IP, defaultVal string) *IpOpt {\n\to := &IpOpt{\n\t\tIP: ref,\n\t}\n\to.Set(defaultVal)\n\treturn o\n}\n\nfunc (o *IpOpt) Set(val s...
go
edit
3
2
apache-2.0
a1f16a3738c1646b7d0376d7f2e26222351db073
AdamOssenford/docker-pi,AdamOssenford/docker-pi,AdamOssenford/docker-pi
opts/ip.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// Sanitises to make a filesystem-safe name.\nfunc sanitiseForFilesystem(s string) string {\n\treturn strings.Replace(s, \"/\", \"-\", -1)\...
go
edit
3
3
mit
8abeafd01af3cea015ce624da4be5686096a53f0
chrishulbert/gondola
helpers.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2015 The Cockroach Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http...
go
edit
9
1
apache-2.0
ea97dcfb5a44e19ec8ac8cc6de71edce93ceb70e
paperstreet/cockroach,arjun4084346/cockroach,cuongdo/cockroach,arjun4084346/cockroach,veteranlu/cockroach,bg451/cockroach,vivekmenezes/cockroach,cuongdo/cockroach,il9ue/cockroach,maxlang/cockroach,maxlang/cockroach,vaibhavarora/cockroach,glycerine/cockroach,bg451/cockroach,maxlang/cockroach,maxlang/cockroach,il9ue/cock...
util/log/flags.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n\t\"github.com/astaxie/beego\"\n)\n\ntype MainController struct {\n\tbeego.Controller\n}\n\nfunc (this *PingController) Prepare() {\n this.Ctx.Output.Context.ResponseWriter.Header().Set(\"X-Docker-Registry-Vers...
go
edit
0
1
mit
3144607263b91c2ea93a5dfc91dcf9a6c4c3f133
astaxie/docker-registry,yonh/wharf,maquanyi/wharf,maquanyi/wharf,yonh/wharf
controllers/default.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage handlers\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\thtml \"html/template\"\n\t\"net/http\"\n)\n\nvar helloTemplate *html.Template\n\nfunc init() {\n\tfmt.Println(\"Try: /hello/world\")\n\tvar err error\n\thelloTemplate, err = html.P...
go
edit
6
3
mit
d48fa7d17d05debaa6a4cb3e8c6bbadcbc3dc534
mattetti/go-web-api-demo
handlers/hello_world.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Implements a Logstash client via TCP or UDP.\n\npackage logostash\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io\"\n\t\"net\"\n)\n\ntype Client struct {\n\tConn *net.Conn\n}\n\nfunc NewClient(network, address string) (*Client, error) ...
go
edit
0
4
mit
e4a72adeb7e2eda77a6d875f893c918e3742d7d1
DavidHuie/logostash
logostash.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage hyperdb_test\n\nimport (\n\t. \"github.com/mysza/hyperdb\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"DB\", func() {\n\n})\n\n```\n\nApply this change: Add test for opening default and nam...
go
edit
24
1
mit
d9c818c0c16aa9861744c3e4f63211aca6c7d1a6
mysza/hyperdb
db_test.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage lib\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\nfunc (bigv *Client) GetVirtualMachine(name VirtualMachineName) (vm *VirtualMachine, err error) {\n\tvm = new(VirtualMachine)\n\tpath := fmt.Sprintf(\"/accounts/%s/groups/%s/virtual_m...
go
edit
6
4
mit
bd6712b060cdcccec0d2964bb483c84df8be3cf0
BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client
lib/virtual-machines.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage dockercommand\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestShortDockerPs(t *testing.T) {\n\tdocker, err := NewDockerForTest()\n\tif err != nil {\n\t\tt.Fatalf(\"err: %s\", err)\n\t}\n\n\tcontaine...
go
edit
15
5
mit
6959eadc583dfbffab451edcf86328c9a984de22
bywan/go-dockercommand
ps_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage dns\n\nimport (\n\t\"encoding/binary\"\n\t\"testing\"\n)\n\nfunc TestPack(t *testing.T) {\n\tm := &Message{\n\t\tQName: \"www.sekimura.org.\",\n\t\tQtype: QtypeA,\n\t\tQclass: QclassIN,\n\t}\n\tb, err := Pack(m)\n\tif err != nil {\n\t...
go
edit
24
11
mit
401d3e9cd536067acfd5494e26eb6ff68ca9e649
sekimura/dns
pack_test.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage somaproto\n\ntype ProtoRequestServer struct {\n\tServer ProtoServer `json:\"server,omitempty\"`\n\tFilter ProtoServerFilter `json:\"filter,omitempty\"`\n\tPurge bool `json:\"purge,omitempty\"`\n}\n\ntype ProtoResultS...
go
edit
3
0
bsd-2-clause
5ca31e083e651d26a59cf75194523169a4b53f0a
1and1/soma
servers.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate tiny;\n\nuse tiny::Tiny;\n\nfn main() {\n Tiny::run(\"tiny_test\".to_owned(), \"tiny@tiny\".to_owned(), \"yada yada\".to_owned());\n}\n\n```\n\nApply this change: Fix hostname, some IRC servers doesn't accept @ in hostnames" ...
rust
edit
0
1
mit
e7f54d364cb5c23fcef1feade6b05cb9bbb44e2a
osa1/tiny,osa1/tiny
bin/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse {Segment, Attempt, TimingMethod, TimeSpan};\nuse super::ComparisonGenerator;\n\n#[derive(Copy, Clone, Debug)]\npub struct LastFinishedRun;\n\npub const NAME: &'static str = \"Last Finished Run\";\n\nfn generate(segments: &mut [Segment], a...
rust
edit
5
5
apache-2.0
636976b1be7b15e171532b18514a6d0b678f1647
CryZe/livesplit-core,CryZe/livesplit-core
src/comparison/last_finished_run.rs
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage ergo\n\ntype Handler interface {\n\tServeHTTP(*Response, *Request)\n}\n\ntype HandlerFunc func(*Response, *Request)\n\nfunc (f HandlerFunc) ServeHTTP(w *Response, r *Request) {\n\tf(w, r)\n}\n\n// Operation\n\ntype Operation struct {\n\...
go
edit
15
1
mit
b34fbe50956e2efc01bc911e287f979fd4a5cea8
wlMalk/ergo
operation.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![no_std]\n\n#[macro_use]\nextern crate enum_map;\n\nuse enum_map::EnumMap;\n\n#[derive(Debug, EnumMap, PartialEq)]\nenum Discriminants {\n A = 2,\n B = 0,\n C = 1,\n}\n\n#[test]\nfn discriminants() {\n let mut map = EnumMap::new...
rust
edit
0
1
apache-2.0
f13c04e4fb86c1836b3bc25f9d921ad981e2f995
xfix/enum-map
enum-map/tests/discriminants.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse engine::{Map, Tile};\nuse engine::builders::{MapBuilder, MapBuildError, MapBuildResult};\n\nuse std::iter::{IteratorExt};\n\npub struct MapFromString {\n s: String,\n}\n\nimpl MapFromString {\n\n pub fn new(s: &str) -> MapFromString...
rust
edit
0
2
bsd-3-clause
d5f6686c8dfe4b27c45c7278101bce6c5a3494cb
jgilchrist/rslike
src/engine/builders/string_builder.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate itertools;\n\nuse itertools::Itertools;\n\nfn main() {\n println!(\"24 days of Rust - itertools (day 7)\");\n let mut words = \"hello supercalifragilisticexpialidocious programmer\".split(|c| c == ' ');\n w...
rust
edit
0
2
mit
9e2a86ca81467a4f07a4467848ce53cdbb1da1c0
zsiciarz/24daysofrust,folkengine/24daysofrust,zsiciarz/24daysofrust,zsiciarz/24daysofrust,folkengine/24daysofrust,folkengine/24daysofrust
src/day7.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::error;\n\nuse fat;\n\npub fn detail_file(args: &[String])\n -> Result<(), Box<error::Error>>\n{\n if args.len() < 2 {\n return Err(From::from(\"expected <file> <image> filename\"));\n }\n\n let image_fn = args[0].c...
rust
edit
1
6
mit
8daa053af3528f05188e8a42f3c7af21eed3bd06
zanesterling/fatr
src/detail.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Print fortune using fortune command" }, { "role": "assistant", "content": "use std::io::Write;\nuse std::process::Command;\n\nconst FORTUNE: &str = \"fortune\";\n\nfn main() {\n println!(\"[FORTUNE COOKIE]\");\n println!(\"{}...
rust
new_file
2
1
mit
04945fdcd326ec07ad73397064073734a23a1328
dcoles/experiments,dcoles/experiments,dcoles/experiments,dcoles/experiments
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io;\nuse byteorder::WriteBytesExt;\nuse super::{MessageType, WriteTo};\nuse super::messages::{AddEntry, EntryExpired, Entry, RemoveEntry};\n\npub enum Message {\n Ping,\n AddEntry(AddEntry),\n RemoveEntry(RemoveEntry),\n ...
rust
edit
0
3
mit
a3fcb3f9467fbec459d0487e7bc9b0d208b97346
bash/radium,bash/radium,bash/radium
src/radium_protocol/src/message.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::{self, Write};\n\nfn main() {\n println!(\"Welcome to Chifir!\");\n println!(\"\");\n println!(\"Type 'help' to get started.\");\n\n loop {\n print!(\"> \");\n io::stdout().flush().unwrap();\n\n l...
rust
edit
0
2
mit
36c366d9ec082d9063226de06e8ee9b450b18735
onefrankguy/chifir
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"os\"\n \"github.com/mattn/go-gtk/gtk\"\n \"ghighlighter/windows\"\n \"ghighlighter/models\"\n \"ghighlighter/utils\"\n)\n\nfunc main() {\n initializeEnvironment()\n gtk.Init(nil)\n\n mainWindow :=...
go
edit
0
3
mit
b926d476dff7752973c37631488bca21d498d085
chdorner/ghighlighter
src/ghighlighter/ghighlighter/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\nuse std::io::prelude::*;\nuse std::io::BufReader;\nuse std::collections::HashMap;\nuse std::path::PathBuf;\nuse std::fs::File;\n\nstatic OVERRIDES_PATH : &'static str = \".multirust/overrides\";\n\nfn main() {\n let home = e...
rust
edit
2
4
mit
a1adfa8cb94597fccf485cdcbdbbba79da8ae19b
badboy/rustup-version-name,badboy/rustup-version-name
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2017 Serde Developers\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n...
rust
edit
0
1
apache-2.0
3dad80b406697b086e566dfa9af4eca96f9a150d
google/serde_json_lenient,bolinfest/serde-jsonrc,serde-rs/json
tests/preserve_order.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate httpd = \"tiny-http\";\n\nuse std::io::net::tcp::TcpStream;\n\n#[test]\nfn basic_handling() {\n let (server, port) = httpd::Server::new_with_random_port().unwrap();\n\n let mut stream = std::io::net::tcp::TcpStream::connect...
rust
edit
null
null
apache-2.0
378f292be394c055a852f9482cb0a7358a88b741
frewsxcv/tiny-http,bomattin/tiny-http,bomattin/tiny-http,tiny-http/tiny-http,bomattin/tiny-http,frewsxcv/tiny-http
tests/simple-test.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::Position;\nuse super::Range;\n\npub struct GapBuffer {\n data: String,\n}\n\npub fn new(mut data: String) -> GapBuffer {\n // Ensure that the data has enough room to grow without reallocating.\n let data_length = data.len(...
rust
edit
0
1
mit
d7dc9acaadd49bd6b539e03a62bbd2957a9cef8f
jmacdonald/scribe
src/buffer/gap_buffer.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![deny(unused_must_use)]\n\n#[macro_use]\nextern crate diesel;\n\nuse diesel::*;\n\ntable! {\n stuff (b) {\n b -> Bool,\n }\n}\n\n\nfn main() {\n use stuff::table as st;\n use stuff::b;\n\n st.select(b); //~ ERROR unuse...
rust
edit
0
1
apache-2.0
3b0afd3023a0b449817f30dbd78ea8be73636822
diesel-rs/diesel,sgrif/diesel,diesel-rs/diesel,sgrif/diesel
diesel_compile_tests/tests/compile-fail/must_use_query_methods.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate chrono;\nextern crate env_logger;\nextern crate log;\n\nuse self::chrono::prelude::*;\n\nuse self::env_logger::fmt::Formatter;\nuse self::env_logger::Builder;\nuse self::log::{LevelFilter, Record};\nuse std::io::Write;\nuse std::...
rust
edit
0
2
mit
47a5cc7442e4eb8815d6cfda79ae87aa9aaf2fbe
fede1024/rust-rdkafka,fede1024/rust-rdkafka,fede1024/rust-rdkafka,thijsc/rust-rdkafka,thijsc/rust-rdkafka
examples/example_utils.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::ops::Add;\n\npub mod point;\npub mod rect;\n\npub type Point<T> = point::Point<T>;\npub type Rect<T> = rect::Rect<T>;\n\ntrait One<T>\n where T: Add<i32, Output=T> +\n Default\n{\n fn one() -> T {\n T::defaul...
rust
edit
1
3
mit
4533ae53cf76d6533a03153628b5a29439b465a5
Vectorious/geom-rs,Vectorious/geom-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Add code from Gist. Slight modifications to naming, visibility, and use of $crate" }, { "role": "assistant", "content": "pub struct HNil;\n \npub struct HCons<H, T> {\n pub head: H,\n pub tail: T\n}\n\npub trait Contains<A> {...
rust
new_file
2
1
bsd-3-clause
d381842d3217707c44129361715e78bbd94c3f8b
Sgeo/hlist-old
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate iron;\nextern crate rustc_serialize;\n\nuse iron::headers::ContentType;\nuse iron::prelude::*;\nuse iron::status;\nuse diesel::prelude::*;\nuse rustc_serialize::json;\nuse database;\n\npub fn index(_: &mut Request) -> IronResult<...
rust
edit
0
1
mit
25d569268f1f3b15ccd0a8532ff9d09a78e5f3e7
rlustin/lugh,rlustin/lugh,rlustin/lugh
src/api.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse vmx;\nuse collections::vec::Vec;\nuse core::sync::atomic::{ATOMIC_U16_INIT, AtomicU16, Ordering};\nuse spin;\n\n\nstatic CPU_COUNT: spin::Once<u16> = spin::Once::new();\nstatic CPU_ASSIGNMENT: AtomicU16 = ATOMIC_U16_INIT;\n\n\npub fn init...
rust
edit
3
2
mit
22ef0369784bab0727b9fc09027aef27dd7eb93d
iankronquist/rustyvisor,iankronquist/rustyvisor,iankronquist/rustyvisor
src/cpu.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse value::Value;\nuse block::BasicBlock;\nuse ffi::core;\n\n/// A PHI node represents a value which is selected based on the predecessor of the current block.\npub type PhiNode = Value;\n\nimpl PhiNode {\n /// Adds an incoming value to th...
rust
edit
0
2
bsd-3-clause
5abc1fb9ff6612ce6804f3f7476626a26239b1f1
nwoeanhinnogaehr/llvm-rs
src/phi.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"strings\"\n\n\t\"github.com/hackebrot/go-librariesio/librariesio\"\n)\n\nfunc loadFromEnv(keys ...string) (map[string]string, error) {\n\tenv := make(map[string]string)\n\n\tfor _, key := ran...
go
edit
0
3
mit
f4d7526e6e9bfda640c33de58462fad80e53ba9d
hackebrot/go-librariesio
librariesio/cmd/librariesio/main.go
rejected_duplicate
Near-duplicate of sample 117877
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! # Keyring library\n//!\n//! Allows for setting and getting passwords on Linux, OSX, and Windows\n\n// Configure for Linux\n#[cfg(target_os = \"linux\")]\nextern crate secret_service;\n#[cfg(target_os = \"linux\")]\nmod linux;\n#[cfg(targe...
rust
edit
1
2
apache-2.0
c56e221540c4df6e33abb3e55bd92ab9f719a37c
hwchen/keyring-rs,hwchen/keyring-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate gcc;\n\nfn main() {\n let target = std::env::var(\"TARGET\").unwrap();\n\n let mut config = gcc::Config::new();\n config.file(\"mdb/libraries/liblmdb/mdb.c\")\n .file(\"mdb/libraries/liblmdb/midl.c\");\n\n if...
rust
edit
0
2
mit
f5b8c5669bb8c712f1608bc5bc84f8946cce4c6f
vhbit/lmdb-rs,vhbit/lmdb-rs
liblmdb-sys/build.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: net/eth: Add definition of type EtherTypeExtractor" }, { "role": "assistant", "content": "//! Implementation of Ethernet related Extractors\n\nuse net::Packet;\n\nuse net::defs::{Rule, EtherType};\n\nuse net::conn::filter::Extracto...
rust
new_file
0
1
mit
a77564a3ff2084a3dc129cc476280050ae1d48d5
uni-rs/uni.rs
src/net/eth/extractor.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate pandoc;\n\nuse std::path::PathBuf;\n\n#[test]\nfn creation() {\n use pandoc::PandocOption::*;\n use pandoc::OutputKind;\n let mut pandoc = pandoc::new();\n\n pandoc.add_input(\"cake\");\n pandoc.set_output(OutputKi...
rust
edit
0
1
apache-2.0
f1b67d11f9e092a6686041cce16519793d0c5d25
oli-obk/rust-pandoc
tests/sanity.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage loader\n\ntype ModuleKind string\n\nconst (\n\tModuleKindIssueTracking ModuleKind = \"issue_tracking\"\n\tModuleKindCodeReview ModuleKind = \"code_review\"\n\tModuleKindReleaseNotes ModuleKind = \"release_notes\"\n)\n\ntype ConfigCo...
go
edit
0
0
mit
a9d6a57668fa8449d3588772cd6af33aa77a7801
salsaflow/salsaflow,salsaflow/salsaflow
config/loader/types.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::ptr;\n\nuse RadioToolButton;\nuse ToolItem;\nuse ffi;\nuse glib::object::Downcast;\nuse glib::translate::*;\n\nimpl RadioToolButton {\n pub fn new() -> RadioToolButton {\n assert_initialized_main_thread!();\n unsafe ...
rust
edit
4
1
mit
3a18a7c619ae271b0f0709b591d21ae80987822c
rust-gnome/gtk,EPashkin/rust-gnome-gtk,EPashkin/rust-gnome-gtk,rust-gnome/gtk
src/radio_tool_button.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![allow(deprecated)]\n\nuse std::fs::File;\nuse std::hash::{Hash, Hasher, SipHasher};\nuse std::io::Read;\n\npub fn to_hex(num: u64) -> String {\n hex::encode(&[\n (num >> 0) as u8,\n (num >> 8) as u8,\n (num >> 16) a...
rust
edit
0
2
apache-2.0
c3997d62d4979e9166fe71c5a5cbeedeb58d8cd0
nipunn1313/cargo,rustyhorde/cargo,vojtechkral/cargo,tsurai/cargo,tsurai/cargo,nipunn1313/cargo,rustyhorde/cargo,vojtechkral/cargo,eminence/cargo,rust-lang/cargo,tsurai/cargo,tsurai/cargo,rust-lang/cargo,tsurai/cargo,tshepang/cargo,eminence/cargo,eminence/cargo,rust-lang/cargo,tshepang/cargo,tshepang/cargo,nipunn1313/ca...
src/cargo/util/hex.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::mem;\nuse super::gl;\nuse super::gl_lib::types::*;\nuse super::Buffer;\n\npub struct Context;\n\nimpl Context {\n pub unsafe fn current_context() -> Self {\n Context\n }\n\n pub fn clear_color(&mut self, color: super:...
rust
edit
1
1
apache-2.0
47b96d5743d50e49808857d50fd6b142fba904a0
kylewlacy/glitter,kylewlacy/glitter
src/context.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Hints (suggestions at the right of the prompt as you type).\n\nuse crate::history::Direction;\nuse crate::Context;\n\n/// Hints provider\npub trait Hinter {\n /// Takes the currently edited `line` with the cursor `pos`ition and\n //...
rust
edit
0
6
mit
2750ed2cc2bef1769a395a8b00e366ecde41b93f
kkawakam/rustyline
src/hint.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse engine::{Actor, Map};\nuse util::units::{Direction, Point};\n\nuse std::path::Path;\n\npub struct World {\n pub player: Actor,\n pub actors: Vec<Actor>,\n pub map: Map,\n}\n\nimpl World {\n\n pub fn new() -> World {\n W...
rust
edit
0
2
bsd-3-clause
d68259456eaff0bc93c4ad812ce2e7c9bc82e477
jgilchrist/rslike
src/engine/world.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\n\n#[deriving(PartialEq, Show)]\npub struct Post {\n header: HashMap<String, String>,\n content: String\n}\n\nimpl Post {\n pub fn new(header: HashMap<String, String>, content: &str) -> Post {\n ...
rust
edit
1
1
bsd-3-clause
b1c61dcc0fc331b544aa49495a37f1063d974dd9
indiv0/ferrum
src/post.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: :sparkles: Make possible to recevie commands" }, { "role": "assistant", "content": "extern crate clap;\n#[macro_use]\nextern crate serde_derive;\nextern crate serde_json;\nextern crate toml;\n\nmod config;\nmod workflow;\n\nuse cla...
rust
new_file
1
1
mit
5534ed6d76edd478663290a17d4d399e85446d1d
dorayakikun/alfred_jira_workflow
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\nextern crate mprovision;\nextern crate clap;\n\nuse std::fs;\nuse clap::{Arg, App, AppSettings, SubCommand};\n\nfn main() {\n let count_subcommand = SubCommand::with_name(\"count\")\n .about(\"Counts provisi...
rust
edit
0
3
mit
c610e4d77216b3fc61980eda46a485cff6dfca44
zummenix/mprovision
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod vm;\nmod command;\nmod parse;\nmod program;\n\nuse std::io::{Write, Read};\nuse std::env;\nuse std::path::Path;\nuse std::fs::File;\n\nuse vm::VM;\nuse program::Program;\nuse parse::parse;\n\n\nfn main() {\n let vm = VM::new();\n le...
rust
edit
1
3
mit
8e5427556a1812983504dc8d5fee723cdc4e913f
nafarlee/thoughtfuck
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub struct Gauge<T> {\n pub value: T\n}\n\n\nimpl<T> Gauge<T> {\n pub fn update(&mut self, value: T) {\n self.value = value\n }\n\n pub fn snapshot(self) -> Gauge<T> {\n Gauge { value: self.value }\n }\n}\n\n\n#[c...
rust
edit
0
2
apache-2.0
b96b5f888c060b1afc7b0c0463d3e18d7d01df09
ekarlso/rust-metrics,ekarlso/rust-metrics
src/gauge.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rand;\n\nconst N: usize = 3;\n\nstruct MetricHolder {\n // TODO: make N a part of the metric holder and use a vector\n // also improve by persisting the sum instead of doing avg every time\n history: [u32; N],\n count...
rust
edit
3
3
mit
57f7653d7bcb2274a0382c6b7040137ee9f7da04
lyuboraykov/rust-exercises
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// This code is editable and runnable!\nfn main() {\n // A simple integer calculator:\n // `+` or `-` means add or subtract by 1\n // `*` or `/` means multiply or divide by 2\n\n let program = \"+ + * - /\";\n let mut accumulat...
rust
edit
1
3
apache-2.0
2644dac3de9caa7f4751459c9b8bf731edcbabf6
AndrewBrinker/rust-www,azerupi/rust-www,AndrewBrinker/rust-www,ituxbag/rust-www,AndrewBrinker/rust-www,jFransham/rust-www,starsep/rust-www,starsep/rust-www,azerupi/rust-www,ituxbag/rust-www,ituxbag/rust-www,starsep/rust-www,ituxbag/rust-www,ituxbag/rust-www,ituxbag/rust-www,jFransham/rust-www,azerupi/rust-www,starsep/r...
_includes/example.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io;\nuse std::io::{Read, Write};\nuse std::fs::File;\n\n\npub fn write_file(filename: &str, contents: &Vec<u8>) -> io::Result<()> {\n let mut file = try!(File::create(filename));\n Ok(try!(file.write_all(contents)))\n}\n\n\npub...
rust
edit
null
null
apache-2.0
b5eb6848a15f9a31a1b2f45e0e6f3995e5f9a5ca
despawnerer/langid-rs
src/utils.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Reads input from a microphone and mirrors it to a speaker ad nauseum.\n\nextern crate oxcable;\n\n#[cfg(not(test))]\nfn main() {\n use oxcable::types::Device;\n use oxcable::io::wav;\n println!(\"Mirroring wav/song.wav input to w...
rust
edit
0
2
apache-2.0
6c7ca374e41e489aa1c62cd327f0c8acfb34ec0f
thenyeguy/oxcable,thenyeguy/oxcable,oxcable/oxcable,oxcable/oxcable
src/bin/wav_mirror.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// vim: tw=80\n//! bare functions can use non-public types, as long as the object's visibility is compatible.\n\n// mocking modules requires the proc_macro_hygiene feature in the _consumer_\n// code\n#![cfg_attr(feature = \"nightly\", feature...
rust
edit
1
1
apache-2.0
c48db3d6b3ee61f21969ea090999f5244385c90d
asomers/mockall,asomers/mockall
mockall/tests/automock_module_nonpub.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright (c) 2015-2016 William (B.J.) Snow Orvis\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n/...
rust
edit
1
2
apache-2.0
c6e9cb5a5ecf89bd93ebc0b6138fef9751030ce9
aetherknight/fractal-rs,aetherknight/fractal-rs,aetherknight/fractal-rs,aetherknight/fractal-rs
fractal-piston/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate pretty_assertions;\n\nuse std::fs::File;\nuse std::io::Read;\nuse std::process::Command;\n\n#[test]\nfn fmt_repl() {\n let source = \"src/repl.glu\";\n\n let mut before = String::new();\n File::open(source)...
rust
edit
0
1
mit
4431d62b6b32de5d9dec9249282cc16dc3b8843e
Marwes/embed_lang,gluon-lang/gluon,gluon-lang/gluon,Marwes/embed_lang
repl/tests/tests.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub mod cpu;\npub mod ioapic;\npub mod local_apic;\npub mod pic;\npub mod pit;\npub mod rtc;\npub mod serial;\n#[cfg(feature = \"acpi\")]\npub mod hpet;\n#[cfg(feature = \"system76_ec_debug\")]\npub mod system76_ec;\n\nuse crate::paging::Kern...
rust
edit
1
2
mit
6f6648c4d20b8a23971e07167a3504cc0a94cb29
redox-os/kernel,redox-os/kernel,redox-os/kernel
src/arch/x86/device/mod.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: bitstream: Add tagl and tagb macros\n\nThey are yet another building block useful to write demuxers." }, { "role": "assistant", "content": "pub mod bitread;\npub mod byteread;\npub mod bytewrite;\n\n#[macro_export]\nmacro_rules! ta...
rust
new_file
1
1
mit
88dda3f59f023022c976d0e7f81fdf6eac24f0a3
rust-av/rust-av
src/bitstream/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::{ffi::CStr,\n mem};\n\nuse libc;\n\nuse crate::{error::{Error,\n Result},\n os::system::Uname};\nuse errno::errno;\n\npub fn uname() -> Result<Uname> { unsafe { uname_libc() } }\n\nunsafe fn una...
rust
edit
1
2
apache-2.0
2ee74d80db764166902ca982300ed71510bb4bd0
rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat
components/core/src/os/system/linux.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nfn value(c: char) -> u32 {\n match c {\n 'a' | 'e' | 'i' | 'o' | 'u' | 'l' | 'n' | 'r' | 's' | 't' => 1,\n 'd' | 'g' => 2,\n 'b' | 'c' | 'm' | 'p' => 3,\n 'f' | 'h' | 'v' | 'w' | 'y' => 4,\n 'k' => 5,\n ...
rust
edit
0
2
mit
700291f3bf1b2ef0f25facaadf6837d3b17a01ad
ragnese/exercism-rust
scrabble-score/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::marker::PhantomData;\n\n#[derive(Copy, Clone)]\npub enum ColorType {\n RGBA(u8),\n}\npub struct ImageBuffer<T, U = ()>(U, PhantomData<T>);\npub struct Rgba<T>(PhantomData<T>);\n\npub mod png {\n use super::ColorType;\n use s...
rust
edit
0
2
apache-2.0
33eb863c5c3e906a3518c9dc1157411684a0d9d3
CryZe/livesplit-core,CryZe/livesplit-core
src/platform/wasm/imagelib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse rustyline::validate::MatchingBracketValidator;\nuse rustyline::{Editor, Result};\nuse rustyline_derive::{Completer, Helper, Highlighter, Hinter, Validator};\n\n#[derive(Completer, Helper, Highlighter, Hinter, Validator)]\nstruct InputVali...
rust
edit
0
3
mit
99082661372765123989e3bfe4972efc9ee1be75
kkawakam/rustyline
examples/input_multiline.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// check-pass\n\n#![doc(no_default_passes, passes = \"collapse-docs unindent-comments\")]\n\nstruct SomeStruct;\n\npub struct OtherStruct;\n\n```\n\nApply this change: Remove deleted pass from rustdoc test suite\n\n`src/test/rustdoc-ui/deprec...
rust
edit
2
0
apache-2.0
6dc99346413292f85cfe572f3ced29242c36e8e7
graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/rustdoc-ui/deprecated-attrs.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\tsci \"github.com/samuell/scipipe\"\n)\n\nfunc main() {\n\t// Init barReplacer task\n\tbarReplacer := sci.Sh(\"sed 's/foo/bar/g' {i:foo2} > {o:bar}\")\n\t// Init function for generating output file pattern\...
go
edit
0
3
mit
4b9eec64fc4cfbc4487d955045956a901425c30e
samuell/scipipe,scipipe/scipipe,scipipe/scipipe
examples/ex02multifile/ex02multifile.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\nuse std::io::*;\nuse std::net::*;\n\nfn main() {\n let addr = env::args().nth(1).unwrap_or(\"127.0.0.1:12345\".to_string());\n let addr = addr.parse::<SocketAddr>().unwrap();\n let l = TcpListener::bind(&addr).unwrap()...
rust
edit
3
3
mit
d1671c3ff1cc35112be6e78dc767ab54781b9a88
aturon/async-benches
tcp-throughput/server/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(staged_api)]\n#![feature(test)]\n#![unstable(feature = \"test\", issue = \"0\")]\n\nextern crate test;\n\npub use test::*;\n\npub fn custom_api() {\n}\n\n```\n\nApply this change: Use issue = \"none\" instead of \"0\"" }, { ...
rust
edit
2
1
apache-2.0
0dd60d5df97caa2f11f85d440be1f2d05f74fcff
vojtechkral/cargo,eminence/cargo,tsurai/cargo,rust-lang/cargo,vojtechkral/cargo,vojtechkral/cargo,rust-lang/cargo,rust-lang/cargo,tsurai/cargo,tshepang/cargo,tsurai/cargo,rust-lang/cargo,tshepang/cargo,eminence/cargo,vojtechkral/cargo,eminence/cargo,tshepang/cargo,nipunn1313/cargo,nipunn1313/cargo,rustyhorde/cargo,tsur...
tests/testsuite/mock-std/src/libtest/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(collections, fs, io, path)]\n\nextern crate tcod;\n\npub mod engine;\npub mod gui;\npub mod util;\n\n```\n\nApply this change: Remove unused `fs` feature gate" }, { "role": "assistant", "content": "#![feature(collection...
rust
edit
1
0
bsd-3-clause
ac04581edc9310ad55125efbd10d17ace00e7300
jgilchrist/rslike
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse command::Command;\nuse vm::VM;\n\n\npub struct Program {\n instructions: Vec<Command>,\n instruction_pointer: Option<usize>,\n current_depth: u64,\n pub status: ProgramStatus,\n}\n\n#[derive(Clone, Copy, PartialEq, Debug)]\npu...
rust
edit
0
2
mit
dd319f3e78fa0295e0e37070ceaa96796e64561f
nafarlee/thoughtfuck
src/program.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmacro_rules! skip_bytes (\n ($input: expr, $length: expr, $offset: expr) => (\n {\n match take!($input, $length) {\n IResult::Done(i, bytes) => {\n let head = bytes[0] << $offset;\n let tail =...
rust
edit
1
0
bsd-3-clause
7541ae05442ec590268289c840fbf79d2eb53ace
sourrust/flac
src/utility/macros.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Provides drilldown related procedures.\n//! This module will be used with `SelectCommand` type by `+` operation\n//! to concatinate `select` and `drilldown` queries.\n//!\n//! Also this module support `pseudo_table` and `staged_columns` m...
rust
edit
1
0
mit
42dfcf71cb9b3575f291e383ae59648363fe76bd
cosmo0920/ruroonga_command
src/selectable/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(macro_rules)]\n#![feature(unboxed_closures)]\n\nuse std::fmt;\n\npub use api::IntoLogger;\npub use api::Logger;\npub use config::Logger as LoggerConfig;\npub use config::Output as LoggerOutput;\n\nmod config;\nmod api;\nmod loggers...
rust
edit
1
2
mit
0c1545406f4cfe70e0bd5ddc40cb0c5044bc037f
daboross/fern-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Represents the eight bit header field in IPv4/IPv6 that defines what protocol the payload has.\n/// See [this list] for the full definition.\n///\n/// [this list]: https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers\n#[derive(Debug,...
rust
edit
0
2
apache-2.0
e23d25a465f8e6d99c2ff7296c7736de8536596a
faern/rips
packets/src/ip.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate iron;\nextern crate time;\n\nuse iron::prelude::*;\nuse iron::{BeforeMiddleware, AfterMiddleware, typemap};\nuse time::precise_time_ns;\n\npub struct RequestLogger;\n\nimpl typemap::Key for RequestLogger { type Value = u64; }\n\n...
rust
edit
0
1
mit
176961258d1a174c75a1bef2990b55c600a94c73
rlustin/lugh,rlustin/lugh,rlustin/lugh
src/logger.rs
accepted
null
true