Code retrieval
Collection
This collection contains models and datasets for code retrieval tasks • 9 items • Updated
query stringlengths 10 3.85k | ru_query stringlengths 9 3.76k | document stringlengths 17 430k | metadata dict | negatives listlengths 97 100 | negative_scores listlengths 97 100 | document_score stringlengths 5 10 | document_rank stringclasses 2 values |
|---|---|---|---|---|---|---|---|
Returns the value of the 'go_package' option of the first .proto file found in the same directory as projectFile | Возвращает значение опции 'go_package' первого файла .proto, найденного в той же директории, что и projectFile | func detectGoPackageForProject(projectFile string) (string, error) {
var goPkg string
projectDir := filepath.Dir(projectFile)
if err := filepath.Walk(projectDir, func(protoFile string, info os.FileInfo, err error) error {
// already set
if goPkg != "" {
return nil
}
if !strings.HasSuffix(protoFile, ".proto") {
return nil
}
// search for go_package on protos in the same dir as the project.json
if projectDir != filepath.Dir(protoFile) {
return nil
}
content, err := ioutil.ReadFile(protoFile)
if err != nil {
return err
}
lines := strings.Split(string(content), "\n")
for _, line := range lines {
goPackage := goPackageStatementRegex.FindStringSubmatch(line)
if len(goPackage) == 0 {
continue
}
if len(goPackage) != 2 {
return errors.Errorf("parsing go_package error: from %v found %v", line, goPackage)
}
goPkg = goPackage[1]
break
}
return nil
}); err != nil {
return "", err
}
if goPkg == "" {
return "", errors.Errorf("no go_package statement found in root dir of project %v", projectFile)
}
return goPkg, nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (g *Generator) GoFilePackage(depfile *fdep.DepFile) string {\n\treturn fproto_wrap.BaseName(g.GoWrapPackage(depfile))\n}",
"func (g *Generator) GoPackage(depfile *fdep.DepFile) string {\n\tfor _, o := range depfile.ProtoFile.Options {\n\t\tif o.Name == \"go_package\" {\n\t\t\treturn o.Value.String()\n\t\t}\... | [
"0.6514599",
"0.6418956",
"0.62568474",
"0.6100058",
"0.6059389",
"0.6033528",
"0.5760218",
"0.571393",
"0.56766814",
"0.56747204",
"0.55886865",
"0.55810106",
"0.55710924",
"0.5528127",
"0.5502348",
"0.55021805",
"0.5456921",
"0.5454185",
"0.54367715",
"0.54307157",
"0.54025... | 0.7273096 | 0 |
NewQueueManagerWithDefaults instantiates a new QueueManager object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set | NewQueueManagerWithDefaults создает новый объект QueueManager. Этот конструктор присваивает значения по умолчанию только тем свойствам, которые определены, но он не гарантирует, что свойства, требуемые API, будут заданы. | func NewQueueManagerWithDefaults() *QueueManager {
this := QueueManager{}
return &this
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func NewQueueManager(logger log.Logger, cfg config.QueueConfig, externalLabels labels.Labels, relabelConfigs []*relabel.Config, client StorageClient, flushDeadline time.Duration) *QueueManager {\n\tif logger == nil {\n\t\tlogger = log.NewNopLogger()\n\t} else {\n\t\tlogger = log.With(logger, \"queue\", client.Name... | [
"0.6368561",
"0.5929313",
"0.5928396",
"0.59103316",
"0.5819523",
"0.58130354",
"0.5753316",
"0.5739753",
"0.568538",
"0.5661701",
"0.5606484",
"0.5487868",
"0.54643965",
"0.5463153",
"0.54630005",
"0.5449085",
"0.544472",
"0.54301214",
"0.540289",
"0.5370558",
"0.535047",
... | 0.7690877 | 0 |
GetClusters returns the Clusters field value | GetClusters возвращает значение поля Clusters | func (o *QueueManager) GetClusters() []string {
if o == nil {
var ret []string
return ret
}
return o.Clusters
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (c *Config) GetClusters(ctx context.Context, quiet bool, filterMap map[string]string, clustersName ...string) (string, error) {\n\tc.Logger.Debugf(\"Sending parameters to server to get the clusters %q\", strings.Join(clustersName, \", \"))\n\n\tfilter := MapToSlice(filterMap)\n\n\treturn c.RunGRPCnRESTFunc(\"... | [
"0.7150111",
"0.70848936",
"0.7050372",
"0.69830257",
"0.69812804",
"0.68225586",
"0.6785897",
"0.67075115",
"0.67008924",
"0.66717374",
"0.6653548",
"0.6628853",
"0.65589386",
"0.6548702",
"0.6535888",
"0.6530604",
"0.6489139",
"0.6475645",
"0.6451163",
"0.6437961",
"0.64292... | 0.76226926 | 0 |
"GetClustersOk returns a tuple with the Clusters field value and a boolean to check if the value has(...TRUNCATED) | "GetClustersOk возвращает кортеж с значением поля Clusters и буле(...TRUNCATED) | "func (o *QueueManager) GetClustersOk() (*[]string, bool) {\n\tif o == nil {\n\t\treturn nil, false(...TRUNCATED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | ["func NewGetClustersOK() *GetClustersOK {\n\treturn &GetClustersOK{}\n}","func (o *ResourceLimits) (...TRUNCATED) | ["0.6719827","0.65017885","0.6465093","0.646219","0.6398727","0.63660103","0.63552487","0.63049424",(...TRUNCATED) | 0.8224033 | 0 |
GetAliasQueues returns the AliasQueues field value | GetAliasQueues возвращает значение поля AliasQueues | "func (o *QueueManager) GetAliasQueues() []AliasQueue {\n\tif o == nil {\n\t\tvar ret []AliasQueue\(...TRUNCATED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | ["func (o *QueueManager) GetAliasQueuesOk() (*[]AliasQueue, bool) {\n\tif o == nil {\n\t\treturn ni(...TRUNCATED) | ["0.69151425","0.6435573","0.6247431","0.6227677","0.6098082","0.59897524","0.58581173","0.5692911",(...TRUNCATED) | 0.7781025 | 0 |
"GetAliasQueuesOk returns a tuple with the AliasQueues field value and a boolean to check if the val(...TRUNCATED) | "GetAliasQueuesOk возвращает кортеж с значением поля AliasQueues и б(...TRUNCATED) | "func (o *QueueManager) GetAliasQueuesOk() (*[]AliasQueue, bool) {\n\tif o == nil {\n\t\treturn nil(...TRUNCATED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | ["func (o *QueueManager) GetAliasQueues() []AliasQueue {\n\tif o == nil {\n\t\tvar ret []AliasQueue(...TRUNCATED) | ["0.62684894","0.6182187","0.6036427","0.5732854","0.55811864","0.5505796","0.5485279","0.54428786",(...TRUNCATED) | 0.8438502 | 0 |
GetRemoteQueues returns the RemoteQueues field value | GetRemoteQueues возвращает значение поля RemoteQueues | "func (o *QueueManager) GetRemoteQueues() []RemoteQueue {\n\tif o == nil {\n\t\tvar ret []RemoteQue(...TRUNCATED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | ["func (o *QueueManager) GetRemoteQueuesOk() (*[]RemoteQueue, bool) {\n\tif o == nil {\n\t\treturn (...TRUNCATED) | ["0.71619385","0.61695373","0.6127869","0.6031343","0.5995589","0.5916818","0.58918214","0.5793508",(...TRUNCATED) | 0.76292956 | 0 |
"GetRemoteQueuesOk returns a tuple with the RemoteQueues field value and a boolean to check if the v(...TRUNCATED) | "GetRemoteQueuesOk возвращает кортеж с значением поля RemoteQueues и (...TRUNCATED) | "func (o *QueueManager) GetRemoteQueuesOk() (*[]RemoteQueue, bool) {\n\tif o == nil {\n\t\treturn n(...TRUNCATED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | ["func (o *QueueManager) GetRemoteQueues() []RemoteQueue {\n\tif o == nil {\n\t\tvar ret []RemoteQu(...TRUNCATED) | ["0.63053876","0.61726433","0.5913533","0.5784514","0.57285035","0.533683","0.53098166","0.52802896"(...TRUNCATED) | 0.8458737 | 0 |
GetClusterQueues returns the ClusterQueues field value | GetClusterQueues возвращает значение поля ClusterQueues | "func (o *QueueManager) GetClusterQueues() []ClusterQueue {\n\tif o == nil {\n\t\tvar ret []Cluster(...TRUNCATED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | ["func (o *QueueManager) GetClusterQueuesOk() (*[]ClusterQueue, bool) {\n\tif o == nil {\n\t\tretur(...TRUNCATED) | ["0.6691833","0.6425696","0.6164038","0.6133957","0.6117693","0.6031181","0.60217136","0.5825728","0(...TRUNCATED) | 0.741813 | 0 |
"GetClusterQueuesOk returns a tuple with the ClusterQueues field value and a boolean to check if the(...TRUNCATED) | "GetClusterQueuesOk возвращает кортеж с значением поля ClusterQueues (...TRUNCATED) | "func (o *QueueManager) GetClusterQueuesOk() (*[]ClusterQueue, bool) {\n\tif o == nil {\n\t\treturn(...TRUNCATED) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | ["func (o *QueueManager) GetAliasQueuesOk() (*[]AliasQueue, bool) {\n\tif o == nil {\n\t\treturn ni(...TRUNCATED) | ["0.64735645","0.64523965","0.6035547","0.58038056","0.53999776","0.53208125","0.5234418","0.5219659(...TRUNCATED) | 0.832443 | 0 |
The part of CoRNStack Dataset translated into Russian. Translation was done with Qwen3 model.
Samples that satisfy the dual consistency filtering condition (samples where the document_rank is 0 or 1 and document_score > 0.7) were translated.
Source code you can find here. For support please: fedor.yaronskiy@gmail.com