id stringlengths 64 64 | pair_id stringlengths 64 64 | question large_stringlengths 7 27.8k | answer large_stringlengths 9 5.47M | question_type stringclasses 1
value | answer_type stringclasses 1
value | task stringclasses 1
value | language stringclasses 1
value | query_language stringclasses 1
value | label int8 1 1 | relevance_score float64 1 1 | source stringclasses 1
value | source_config stringclasses 1
value | source_split stringclasses 1
value | source_revision stringclasses 1
value | source_row_id stringlengths 22 26 | query_id stringlengths 22 26 | answer_id stringlengths 22 26 | license stringclasses 1
value | repository stringclasses 1
value | path stringclasses 1
value | url stringclasses 1
value | metadata large_stringlengths 410 1.72k | record_kind stringclasses 1
value | split stringclasses 1
value | content_id unknown |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d3dbe71f6945fece7d6368a30c244b157585a1822bba4e0f00ccaeb1f2f72f92 | cbb9b04505e1401cb9304c621b5aabf44031cebbb988f50cbc49fcfaa0f2066b | Returns the value of the 'go_package' option of the first .proto file found in the same directory as 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, ".prot... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:0 | shard-00000.jsonl.gz:0 | shard-00000.jsonl.gz:0 | apache-2.0 | {"document_rank":"0","document_score":"0.7273096","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["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.557109... | default | train | "lCmkKc+r3F2hKuZ8JqHl06KYJHPDYyGDcd4TVb6SUt8=" | |||
68f15f66884e7b46a8b3e989ea20b9eb869c9a1e7ba42cde11a2a467ba10a237 | bbf7737083650150a507225633b166fb064379bbb98b26819a0b909f2773c8d2 | NewQueueManager instantiates a new QueueManager object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed | func NewQueueManager(name string, clusters []string, aliasQueues []AliasQueue, remoteQueues []RemoteQueue, clusterQueues []ClusterQueue, ) *QueueManager {
this := QueueManager{}
this.Name = name
this.Clusters = clusters
this.AliasQueues = aliasQueues
this.RemoteQueues = remoteQueues
this.ClusterQueues = clusterQu... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:1 | shard-00000.jsonl.gz:1 | shard-00000.jsonl.gz:1 | apache-2.0 | {"document_rank":"1","document_score":"0.6490378","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6894487","0.6460588","0.6222042","0.61513555","0.6091006","0.606205","0.60386145","0.6006943","0.59639966","0.594565","0.5942067","0.59363455","0.5910915"... | default | train | "G13c10VC87rGmTHeTysGuRIWGzTnSy/T2tC9jPhhhEg=" | |||
d760f4a4eaf2164cb055e5f9db84617d7dfe237865d07a63194a351e4f153976 | c695145a6f53a9c77712e47273f41dc4ad1908f10798a6a09a649bc8f1bc066c | 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 | func NewQueueManagerWithDefaults() *QueueManager {
this := QueueManager{}
return &this
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:2 | shard-00000.jsonl.gz:2 | shard-00000.jsonl.gz:2 | apache-2.0 | {"document_rank":"0","document_score":"0.7690877","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["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"... | default | train | "KdJcdZJreO6nGVqHxUyrmFhiPQ44hZojAiPw0egBNhQ=" | |||
b538c939ca5d80301c2bda6c4b3d7522a040b3900502ec6326a1fdae541fc51f | 701741be39dc4bc28c2755fd1784804f7ce2877d4e331003c027762b4e065081 | GetName returns the Name field value | func (o *QueueManager) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:3 | shard-00000.jsonl.gz:3 | shard-00000.jsonl.gz:3 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.8270152","0.79907626","0.7765679","0.76368356","0.7604266","0.7600852","0.75710016","0.7564642","0.7548394","0.75191027","0.7517443","0.7511258","0.7505484","0... | default | train | "UFSA8CARhR1ES+QESUdLtT2jhfzFfxLaFdmX5A+mdkU=" | |||
f181a79324b599c57d2ec7cc6816d2b037af5a8876f000ee646787b0e7816d42 | 706b1dff0f6f1aaad65cbfe081fefade361243570bc19248a183c84ebd0602ab | GetNameOk returns a tuple with the Name field value and a boolean to check if the value has been set. | func (o *QueueManager) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:4 | shard-00000.jsonl.gz:4 | shard-00000.jsonl.gz:4 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.78737646","0.7743277","0.76780003","0.76587296","0.7625746","0.7576448","0.7566445","0.754901","0.7547995","0.7547995","0.7546563","0.7531728","0.74989444","0.... | default | train | "nol5CEYdNfS9iV06xzeVnmYm3Ou5o/WLwd+F8/yi0rk=" | |||
5ddba455ab957fcd7dcb618bda7b462291f3cfa67cb03aceb7aa76ae852c5e02 | ac2150588dcc816bf8fd3fe1d3d514c95dce483e2e72e38bd11d80df747bb7d9 | SetName sets field value | func (o *QueueManager) SetName(v string) {
o.Name = v
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:5 | shard-00000.jsonl.gz:5 | shard-00000.jsonl.gz:5 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6978644","0.67127097","0.6554158","0.6535701","0.648949","0.6488116","0.64872724","0.64611167","0.641035","0.63914317","0.6386742","0.6377272","0.63651955","0.... | default | train | "sNvmdGe6JHoGZlAdJyuwS/HNKxZhjzh1Uy5LC5DFYxE=" | |||
2e666b7bec99489a2132811f223f59fa353709583a836fd3ef75a70ea334a7a4 | 89ccab462f1123666dac2550588fdcd7c474c774b0a501d0035b818c5939691d | GetClusters returns the Clusters field value | func (o *QueueManager) GetClusters() []string {
if o == nil {
var ret []string
return ret
}
return o.Clusters
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:6 | shard-00000.jsonl.gz:6 | shard-00000.jsonl.gz:6 | apache-2.0 | {"document_rank":"0","document_score":"0.76226926","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["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.65... | default | train | "5XfrfMdw/fK16qYZ3Lfl4Mvp3u7ErAM42EC3xg3uNrM=" | |||
bc1f0e9264f37d745fa29782a09d6df89789bba844c0f6989835a68d15f13f30 | 25a9b7328c6535b3b2885510230f3e1fdebbfdf10c36585843e0ce3de7e8d95a | GetClustersOk returns a tuple with the Clusters field value and a boolean to check if the value has been set. | func (o *QueueManager) GetClustersOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.Clusters, true
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:7 | shard-00000.jsonl.gz:7 | shard-00000.jsonl.gz:7 | apache-2.0 | {"document_rank":"0","document_score":"0.8224033","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6719827","0.65017885","0.6465093","0.646219","0.6398727","0.63660103","0.63552487","0.63049424","0.627333","0.62654936","0.62586135","0.6258082","0.621213... | default | train | "vr8WMVDFD9yjW2wTJEvcQskn0+X0kX6cyRqdwlj3FqU=" | |||
2379b1e722d454fb2c3a6f62bc0e4634038687b581a8feb8ce95b6f61a5edc70 | 4344f8cf1fb7d77725f89e4d706a2e2ab37fe154897e4281a85645b667f49dbd | SetClusters sets field value | func (o *QueueManager) SetClusters(v []string) {
o.Clusters = v
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:8 | shard-00000.jsonl.gz:8 | shard-00000.jsonl.gz:8 | apache-2.0 | {"document_rank":"0","document_score":"0.680183","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.623222","0.5735698","0.55403745","0.5447475","0.5413994","0.5402886","0.53507334","0.5320656","0.5263007","0.5236094","0.52265227","0.52218485","0.52067995... | default | train | "DlEJVth/B57vnUg3piWNJYFvJhWYoP+4qdxV2MhZM8g=" | |||
834d5a95faf9990af1ebba514268f41764d41c22dc2dbccd1766403fe82a1641 | 9c47b480a2f985b9a7f1d00139ad1425155b9e9deaede0a0877ddbbcbd5faa84 | GetAliasQueues returns the AliasQueues field value | func (o *QueueManager) GetAliasQueues() []AliasQueue {
if o == nil {
var ret []AliasQueue
return ret
}
return o.AliasQueues
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:9 | shard-00000.jsonl.gz:9 | shard-00000.jsonl.gz:9 | apache-2.0 | {"document_rank":"0","document_score":"0.7781025","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.69151425","0.6435573","0.6247431","0.6227677","0.6098082","0.59897524","0.58581173","0.5692911","0.56441885","0.5639317","0.5635707","0.54951936","0.54639... | default | train | "qnD1aWfe48gAglbPwUWbhG1ZH7/2P4dB+t6z2SCfn44=" | |||
f94e7c3d41fb29ba6fee4bccdcc3a4f181ed51eddb2f4462be7ebacd72ec61c2 | 93852321aefa674f692b0f4929fa2cd367961a0b014df38f5bf529d99ce35149 | GetAliasQueuesOk returns a tuple with the AliasQueues field value and a boolean to check if the value has been set. | func (o *QueueManager) GetAliasQueuesOk() (*[]AliasQueue, bool) {
if o == nil {
return nil, false
}
return &o.AliasQueues, true
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:10 | shard-00000.jsonl.gz:10 | shard-00000.jsonl.gz:10 | apache-2.0 | {"document_rank":"0","document_score":"0.8438502","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.62684894","0.6182187","0.6036427","0.5732854","0.55811864","0.5505796","0.5485279","0.54428786","0.535559","0.5352854","0.52992433","0.5274927","0.5233722... | default | train | "wE2nh7ZoYIBYpyoL0/kaC5Z6ub2jruBwc/BqoFDEbXA=" | |||
aa2f2c58f25f96ef0a43269b26125fe7e15e5a959bb8dfd6749ed5e0109362c7 | f3aba8a651a0e8dcf868bd569f671b8bdbca4ce6260238cb75be6771a9912b02 | SetAliasQueues sets field value | func (o *QueueManager) SetAliasQueues(v []AliasQueue) {
o.AliasQueues = v
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:11 | shard-00000.jsonl.gz:11 | shard-00000.jsonl.gz:11 | apache-2.0 | {"document_rank":"0","document_score":"0.6917118","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.58699656","0.5864439","0.5774504","0.57054865","0.56945664","0.5664903","0.5560596","0.5487568","0.54635847","0.54438704","0.54421866","0.54008865","0.536... | default | train | "mlvYfIxHl0c3yuUjH/YtcvbTOHgI/R2U3zE78+51DJQ=" | |||
1db5c5ee91708a9d88e428bd932967f7e9d0fa522714402b83e7b2f59bdc7cc4 | 845559559d27b2d26a8899046468f0521e13d0f7cb312fe4cf1b07f2f44c12d1 | GetRemoteQueues returns the RemoteQueues field value | func (o *QueueManager) GetRemoteQueues() []RemoteQueue {
if o == nil {
var ret []RemoteQueue
return ret
}
return o.RemoteQueues
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:12 | shard-00000.jsonl.gz:12 | shard-00000.jsonl.gz:12 | apache-2.0 | {"document_rank":"0","document_score":"0.76292956","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.71619385","0.61695373","0.6127869","0.6031343","0.5995589","0.5916818","0.58918214","0.5793508","0.57635283","0.57260025","0.57182837","0.56593096","0.55... | default | train | "309ouiRvA7FUw+0MpIE4qAKvs7kYxWWoGLbGLf6bCDc=" | |||
18571a055ba77b209e5d962a9ecbc6ef77304811ec956507fceeb3f438c50036 | 2a64739bae92c6147b8fb0754ab7b8a002183d777ea983e8539c5bb4216a4f84 | GetRemoteQueuesOk returns a tuple with the RemoteQueues field value and a boolean to check if the value has been set. | func (o *QueueManager) GetRemoteQueuesOk() (*[]RemoteQueue, bool) {
if o == nil {
return nil, false
}
return &o.RemoteQueues, true
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:13 | shard-00000.jsonl.gz:13 | shard-00000.jsonl.gz:13 | apache-2.0 | {"document_rank":"0","document_score":"0.8458737","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.63053876","0.61726433","0.5913533","0.5784514","0.57285035","0.533683","0.53098166","0.52802896","0.5174174","0.5162988","0.5104646","0.50820893","0.50446... | default | train | "d2gwXAXSg0qvNou74TduW762wLpKaROwpR2XlYANubE=" | |||
a7068f435d6803ab9d52638f067ed2c123f28d131d674915cf91f217ae31a3fe | 28f55b51a2cff9a79928bd9b140204a1a76920879c429b10b20e33affdd08136 | SetRemoteQueues sets field value | func (o *QueueManager) SetRemoteQueues(v []RemoteQueue) {
o.RemoteQueues = v
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:14 | shard-00000.jsonl.gz:14 | shard-00000.jsonl.gz:14 | apache-2.0 | {"document_rank":"0","document_score":"0.68890077","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6111192","0.59353924","0.5917593","0.59074235","0.584018","0.5630969","0.56206805","0.5559726","0.547905","0.53623676","0.53450924","0.5335673","0.527478... | default | train | "U+COkAfBrZEcK2uDn/UiVloAESQdsBGbHOt8Zkeu3Og=" | |||
119962764ceb5ca01401cd08b0db31c1b900c85eb47b35ebdfbb9605f50ea471 | 16964698adf27d9833153db2248d44b168bebb4adb931004c7a0eb9940c24c97 | GetClusterQueues returns the ClusterQueues field value | func (o *QueueManager) GetClusterQueues() []ClusterQueue {
if o == nil {
var ret []ClusterQueue
return ret
}
return o.ClusterQueues
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:15 | shard-00000.jsonl.gz:15 | shard-00000.jsonl.gz:15 | apache-2.0 | {"document_rank":"0","document_score":"0.741813","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6691833","0.6425696","0.6164038","0.6133957","0.6117693","0.6031181","0.60217136","0.5825728","0.57695156","0.57689","0.5742274","0.56948394","0.55601054",... | default | train | "S+pIa++VfI1fcDGYI/Qee7aqxx2IdhQ9VRYHO5tWLhU=" | |||
4e79d51964278e189bea3cdf3731e688486dee1d7100932ba3c5f7624b082f53 | 1420b9e2e9679ed19b816333c8a1e039bcc2feb353d82034ee46bd48590cd175 | GetClusterQueuesOk returns a tuple with the ClusterQueues field value and a boolean to check if the value has been set. | func (o *QueueManager) GetClusterQueuesOk() (*[]ClusterQueue, bool) {
if o == nil {
return nil, false
}
return &o.ClusterQueues, true
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:16 | shard-00000.jsonl.gz:16 | shard-00000.jsonl.gz:16 | apache-2.0 | {"document_rank":"0","document_score":"0.832443","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.64735645","0.64523965","0.6035547","0.58038056","0.53999776","0.53208125","0.5234418","0.5219659","0.5205979","0.51352835","0.5088557","0.5061583","0.50474... | default | train | "gJXxHzaVYGlxzdfoS/rHJ39Zh3vFF95+EdJYkWJIicg=" | |||
20c0eca3782aa2352dc0d46f7599bc3d0866df490f3fc01df994b484284f3e2d | 3033967f6767d20f8882413df55731b581f0880b7563dd102e385dae92075a7b | SetClusterQueues sets field value | func (o *QueueManager) SetClusterQueues(v []ClusterQueue) {
o.ClusterQueues = v
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:17 | shard-00000.jsonl.gz:17 | shard-00000.jsonl.gz:17 | apache-2.0 | {"document_rank":"2","document_score":"0.6035805","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.60655606","0.60586584","0.5939442","0.58560574","0.57875776","0.5729049","0.5456519","0.54093945","0.52865255","0.5281743","0.5238613","0.520454","0.52021... | default | train | "zKcyxak2CPGu6EFxB4SmKaXXLwgKWeUoil7zAfCq3rE=" | |||
1dab70b44b4f45546cefc9fd0aa20c56ff7a0cf979ae71eab4dd79d3e991ad2e | 58d8d2bcc66d32c0b4f0fcd76f790d95a8d3d73fd8af039b176c1beeab447753 | Is the tiploc one for this station | func (bf *boardFilter) atStation(tpl string) bool {
for _, s := range bf.res.Station {
if s == tpl {
return true
}
}
return false
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:18 | shard-00000.jsonl.gz:18 | shard-00000.jsonl.gz:18 | apache-2.0 | {"document_rank":"11","document_score":"0.5378452","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.67006546","0.66539073","0.63916194","0.59491193","0.56473047","0.5592531","0.55731654","0.55731654","0.54852706","0.54088384","0.54081464","0.5377661","0... | default | train | "pit5D7Dk6wo9y5yprmlBAS5vt03BspFraCO5kVyZAaY=" | |||
5a968b459484613c7434a816828baa26f972e6d7f85916f089e0479150bf5975 | 27a334031684b90236ac2c4fb019d01f5462de018b40aa678f20f9bb90525f12 | Does the service call at a specific station | func (bf *boardFilter) callsAt(callingPoints []darwind3.CallingPoint, tpls []string) bool {
for _, cp := range callingPoints {
for _, tpl := range tpls {
if tpl == cp.Tiploc {
return true
}
}
}
return false
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:19 | shard-00000.jsonl.gz:19 | shard-00000.jsonl.gz:19 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.59751016","0.59400904","0.5820535","0.5803581","0.57665825","0.56083244","0.5489674","0.5329984","0.5267891","0.5153535","0.5140189","0.510179","0.50758654","0... | default | train | "A49oGrXFtGNbX4/IUmADaLKL7Wg6El0wuj4WrMZxvqs=" | |||
b23c92140ca6fd3ab8ee12396772445ad657ff071a12af56c14b2abee5963faa | e7c57cc777245201ec02e6186fe45406be3ea1be9ee3219d2a2611e19f269197 | Add a tiploc to the result so that it will be included in the tiploc map | func (bf *boardFilter) addTiploc(tiploc string) {
if tiploc != "" {
bf.tiplocs[tiploc] = nil
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:20 | shard-00000.jsonl.gz:20 | shard-00000.jsonl.gz:20 | apache-2.0 | {"document_rank":"0","document_score":"0.66976255","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6330537","0.5318772","0.49911645","0.49783835","0.48557892","0.48480755","0.48384988","0.48337668","0.47259057","0.47020352","0.4641511","0.4637678","0.4... | default | train | "DUtQaEvsSdslzaWQ67IWZPJHgDk4pV2MCugsfdz5HK8=" | |||
1a9fb8b31dab03b9482eb8d518328c22f84999e6668fed14bf81d82d82f9b6c2 | 701736c3fd4fffc6fb689155f27ba649e265d2bd2914c3880b4bf55162ba0b26 | Add a ViaResolveRequest to the response | func (bf *boardFilter) addVia(rid, dest string) *darwinref.ViaResolveRequest {
viaRequest := &darwinref.ViaResolveRequest{
Crs: bf.station.Crs,
Destination: dest,
}
bf.vias[rid] = viaRequest
return viaRequest
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:21 | shard-00000.jsonl.gz:21 | shard-00000.jsonl.gz:21 | apache-2.0 | {"document_rank":"17","document_score":"0.48631617","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.60127324","0.57031727","0.5662719","0.55577856","0.54912895","0.54861164","0.5339197","0.5312581","0.5171849","0.51083773","0.5107675","0.505698","0.502... | default | train | "PDih3MZNA8v3uw5pcLPMoyh7doeUaFVvYI3U9SWWsuI=" | |||
567544fa48f05c340e2eafc975bcf616644525c169f488e0f02c497742da9266 | e07f049999951c0fdcd786b7cca7cd8a2af3334140a0faf5e6b31d44c72416ad | Process calling points so that we generate the appropriate via and include their tiplocs | func (bf *boardFilter) processCallingPoints(s ldb.Service) {
if len(s.CallingPoints) > 0 {
viaRequest := bf.addVia(s.RID, s.CallingPoints[len(s.CallingPoints)-1].Tiploc)
for _, cp := range s.CallingPoints {
bf.addTiploc(cp.Tiploc)
viaRequest.AppendTiploc(cp.Tiploc)
}
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:22 | shard-00000.jsonl.gz:22 | shard-00000.jsonl.gz:22 | apache-2.0 | {"document_rank":"0","document_score":"0.72903216","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5804814","0.55561084","0.54828817","0.54530644","0.5207425","0.51024735","0.5098401","0.50678176","0.5043976","0.50209445","0.49973452","0.49861223","0.4... | default | train | "s+F0UhBMleOe6qKCbWqc4hP0F5eS5cQ+YGU5xUpepV0=" | |||
2b4fbbbff764a36dd38f2fc7062d5324c5f4c18f3b29d63ffb5d293c8e152ffd | 3e74e83807f32c6c2786e86f85e14cc80c6e909f8a155850e3674bb43e1c0d40 | Process any associations, pulling in their schedules | func (bf *boardFilter) processAssociations(s ldb.Service) {
for _, assoc := range s.Associations {
assoc.AddTiplocs(bf.tiplocs)
//if assoc.IsJoin() || assoc.IsSplit() {
ar := assoc.Main.RID
ai := assoc.Main.LocInd
if ar == s.RID {
ar = assoc.Assoc.RID
ai = assoc.Assoc.LocInd
}
// Resolve the sche... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:23 | shard-00000.jsonl.gz:23 | shard-00000.jsonl.gz:23 | apache-2.0 | {"document_rank":"0","document_score":"0.6897732","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.56238943","0.52930427","0.523047","0.5199952","0.5147988","0.5058819","0.50440824","0.5031958","0.50148183","0.49584836","0.492599","0.48424038","0.479395... | default | train | "LlitnUHiMHtRg7VqzUY+SQMdrqFfER5pBNWUzwbvM7A=" | |||
ccd683da03b0dded6391a5cdf367811a409dc1cd98e3d551584962de92e7faac | d2554bc2a3ca4d1a22dd75addfff8517d03e7acf4a9c58a93d5d3a04d9529f3f | acceptService returns true if the service is to be accepted, false if it's to be ignored | func (bf *boardFilter) acceptService(service ldb.Service) bool {
// Original requirement, must have an RID
if service.RID == "" {
return false
}
// remove terminating services
if bf.terminated && bf.atStation(service.Destination) {
return false
}
if bf.callAt && !bf.callsAt(service.CallingPoints, bf.callAt... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:24 | shard-00000.jsonl.gz:24 | shard-00000.jsonl.gz:24 | apache-2.0 | {"document_rank":"0","document_score":"0.75590676","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.63734","0.6060541","0.59677523","0.58842057","0.5720938","0.5569348","0.5523225","0.54433316","0.5340439","0.53300637","0.5299485","0.5284296","0.52749",... | default | train | "NygHu61FdkJZlLcIpoF1BVG94AxNSQiGpm4C4XGlh4g=" | |||
f4586dc35619fe2721d8afc874a193d7c7713b14ef72ffe30ade4bc6c4b21855 | 05841905ca7eb6d4391141906a59416d46872b6baa03eb051f7f55da487b3e69 | NewSettingsDialog(parent widgets.QWidget, flags) is automatically generated | func (sd *SettingsDialog) OpenSettingsDialog() {
if !sd.isDisplayInited {
sd.__init_display()
}
sd.populateFields()
sd.Open()
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:25 | shard-00000.jsonl.gz:25 | shard-00000.jsonl.gz:25 | apache-2.0 | {"document_rank":"5","document_score":"0.56048965","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6050621","0.6031621","0.5928538","0.58055913","0.57716674","0.51237786","0.5116521","0.51071554","0.5070288","0.49982792","0.4967534","0.4916568","0.4900... | default | train | "+/KM3tQk7jGfLM/2Gm7N/FNHSVOVcw8VLqzM6TOf61E=" | |||
cb3b08b83ae6279a9450127437c2f336267b6dfe00488365db80a289755a5a6e | e82eb025c9c8ca4e84185f279e18eec6f823e06073c61782c525d9e636eb66fd | / Send file to server in app dir, used for making dockercompose and nginx configuration available. | func Upload( src, dest string ) ( err error ) {
cfg, err := config.Read()
if err != nil { return }
connString := "leo-deploy@" + cfg.ServerName
dest = connString + ":apps/" + cfg.AppName + "/" + dest
fmt.Printf( "Copying %s into %s\n", src, dest )
out, err := exec.Command( "scp", src, dest ).CombinedOutput()
fm... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:26 | shard-00000.jsonl.gz:26 | shard-00000.jsonl.gz:26 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.68540484","0.64961594","0.6205975","0.6052243","0.5979095","0.5941416","0.5835912","0.58248794","0.5780296","0.5768345","0.5687944","0.5671151","0.56280226","0... | default | train | "FHnibZF1RLQXRfl0GePWRhx3A2wQzKUvc8GRPUl+O6g=" | |||
4e99cf5f2c74405d9e0ea4c2c323eab28b1f4dc47d3d39e16a4924e2d424e3d6 | 69ce265b6624fe47532b3858ffdf15bc215331a91ca83813dc084056e3ddbc07 | List all the known records | func (s *sqlStore) List(opts ...store.ListOption) ([]string, error) {
options := store.ListOptions{
Order: store.OrderAsc,
}
for _, o := range opts {
o(&options)
}
db, queries, err := s.db(options.Database, options.Table)
if err != nil {
return nil, err
}
pattern := "%"
if options.Prefix != "" {
patte... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:27 | shard-00000.jsonl.gz:27 | shard-00000.jsonl.gz:27 | apache-2.0 | {"document_rank":"43","document_score":"0.58201265","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6895555","0.6680016","0.66310436","0.6533258","0.6475071","0.64534694","0.64447963","0.6441886","0.64385545","0.63736784","0.6371333","0.6340122","0.630... | default | train | "u8idJd86hfqeOAcDS2STEh/7rIghDyu+qsDsCHzTVyc=" | |||
67dad1396113cfefb91e5bc97dfdf4ce2cac6d661c0c96653986cfe25699348e | 539ebef99f8279cac6b0814f6eca4d13521170ad238c8838765a455bbc5e46df | rowsToRecords converts from pgx.Rows to []store.Record | func (s *sqlStore) rowsToRecords(rows pgx.Rows) ([]*store.Record, error) {
var records []*store.Record
for rows.Next() {
var expiry *time.Time
record := &store.Record{}
metadata := make(Metadata)
if err := rows.Scan(&record.Key, &record.Value, &metadata, &expiry); err != nil {
return records, err
}
... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:29 | shard-00000.jsonl.gz:29 | shard-00000.jsonl.gz:29 | apache-2.0 | {"document_rank":"0","document_score":"0.8269437","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6726777","0.67042124","0.62163883","0.6109386","0.6026409","0.59923404","0.58899695","0.58857733","0.5779613","0.5778647","0.5747893","0.56930035","0.5691... | default | train | "d3p3D/lChuuDsA67rY4hOyOQH7cToKyTyAOY43M6pZ8=" | |||
d858a0756c070fdca642045c8bcebae2257447b5e4ba4a22b217bb081ba578f7 | ed12537caeb2afcfa38335c847354742cf630518265b00190aad923f426f3c1c | Read a single key | func (s *sqlStore) Read(key string, opts ...store.ReadOption) ([]*store.Record, error) {
options := store.ReadOptions{
Order: store.OrderAsc,
}
for _, o := range opts {
o(&options)
}
db, queries, err := s.db(options.Database, options.Table)
if err != nil {
return nil, err
}
// read one record
if !optio... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:30 | shard-00000.jsonl.gz:30 | shard-00000.jsonl.gz:30 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7725113","0.7333868","0.7230678","0.7222155","0.7193259","0.71848077","0.71133333","0.7095759","0.7083336","0.6862008","0.68467087","0.68404","0.67486924","0.6... | default | train | "F0FLTxG3rsCeFLREyqtPi8ctnHn/m6ReiL85JYBBGaY=" | |||
135946652f622785e1ad3d86d5d2352aae9a948318cdf8f2e997a31763dcc5ba | f894610def6807aa3cd67bd15523fa94ba3b2496e5576087f775911578be41bd | Delete records with keys | func (s *sqlStore) Delete(key string, opts ...store.DeleteOption) error {
var options store.DeleteOptions
for _, o := range opts {
o(&options)
}
db, queries, err := s.db(options.Database, options.Table)
if err != nil {
return err
}
_, err = db.Exec(s.options.Context, queries.Delete, key)
return err
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:31 | shard-00000.jsonl.gz:31 | shard-00000.jsonl.gz:31 | apache-2.0 | {"document_rank":"77","document_score":"0.56412256","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6760398","0.66280895","0.65578467","0.65088505","0.6401223","0.63470906","0.63015383","0.6252232","0.6213148","0.6193571","0.6180504","0.61795783","0.61... | default | train | "J+nz5Ycjd0cNtAMfVavGFbrVE/8eie9tzlfREZmWDKY=" | |||
332878f875fce3de7fe13a270bb9a715cc44e50922e12d119ba9385c0d03f032 | f646016808a1e0295199fbfe05ff56d764d04ce1dc5c51aabbeec5a17111dc0b | NewStore returns a new micro Store backed by sql | func NewStore(opts ...store.Option) store.Store {
options := store.Options{
Database: defaultDatabase,
Table: defaultTable,
}
for _, o := range opts {
o(&options)
}
// new store
s := new(sqlStore)
s.options = options
s.databases = make(map[string]DB)
s.re = regexp.MustCompile("[^a-zA-Z0-9]+")
go s... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:32 | shard-00000.jsonl.gz:32 | shard-00000.jsonl.gz:32 | apache-2.0 | {"document_rank":"39","document_score":"0.6265493","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7291816","0.6905972","0.6899488","0.67929655","0.67790884","0.67777205","0.6675343","0.665811","0.6637835","0.66238797","0.6618824","0.66062766","0.66013... | default | train | "aN4oDkEZtPQhMx6DY2iKUJPH7dVSDgoTbBEvwb3ftqk=" | |||
86c97ee8d061976ced02c8046a85c3ff9e42ac2b35d9e087d1bff3565f05f914 | fbf149dcafbf95d2f700a77415888fe2511e79b68ab2487273aa5a37ad0ee28f | Easier getters to check whether those commands should be started or not | func (d *DB) startHourly(key string) bool {
// Try to load this key, if not present then it can be started
lastCall, err := d.loadTime(key)
if err != nil {
Log.Println("Command: ", key, " was never called")
return true
}
return int(time.Since(lastCall).Hours()) > 0
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:33 | shard-00000.jsonl.gz:33 | shard-00000.jsonl.gz:33 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6994663","0.6508269","0.6502186","0.63603437","0.6129595","0.6112796","0.6082147","0.60248846","0.6018903","0.5977348","0.5970306","0.5944507","0.59397984","0.... | default | train | "VFEcC+0zIs8+Gqvdm+YRj0cXVN19ItzDo0iI8UfXggM=" | |||
678b9f71f346ccc7a6b81a5892af59240d46129e69ea64b4bce23fbdaf46ea43 | 23d8f9047a84c3e70e2bf31b11267af829a75504386b319c8bd9d93ec09e21db | findConflict finds the index of the conflict. It returns the first pair of conflicting entries between the existing entries and the given entries, if there are any. If there is no conflicting entries, and the existing entries contains all the given entries, zero will be returned. If there is no conflicting entries, but... | func (l *LogStore) findConflict(entries []*pb.Entry) uint64 {
// TODO: 会有第0个冲突么?
for _, ne := range entries {
if !l.matchTerm(ne.Index, ne.Term) {
if ne.Index <= l.lastIndex() {
l.logger.Info("log found conflict",
zap.Uint64("conflictIndex", ne.Index),
zap.Uint64("conflictTerm", ne.Term),
zap.... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:34 | shard-00000.jsonl.gz:34 | shard-00000.jsonl.gz:34 | apache-2.0 | {"document_rank":"0","document_score":"0.6421718","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.46936142","0.42734542","0.42118675","0.41973543","0.41771796","0.41696936","0.41489935","0.41426665","0.41424075","0.41103593","0.4097609","0.40779626","0... | default | train | "flegs6stdcHjNhiemQOd+RDAM9PcH8F9UtsQxnDfFBU=" | |||
70eba278de82f88891b6ee7fe5a57e638f70ca412b70f176cdf5c5f1f17be1d9 | cf1c45e31245be59f2ca75a540fe1770a7be45d2967fda27c93827fa67c00d15 | New creates a new crawler | func New(ctx context.Context, logger yolo.Logger, client *http.Client, filter FilterFunc, mapper Mapper) *Crawler {
return &Crawler{
ctx: ctx,
logger: logger,
client: client,
filter: filter,
mapper: mapper,
visitChan: make(chan visit, visitChanBuffer),
toVisit: make(map[string]struct{}),
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:35 | shard-00000.jsonl.gz:35 | shard-00000.jsonl.gz:35 | apache-2.0 | {"document_rank":"8","document_score":"0.69358087","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.73082036","0.72865236","0.7228419","0.7207095","0.719269","0.70568573","0.7003078","0.6945463","0.68530333","0.6658365","0.6632175","0.6534232","0.639279... | default | train | "AK+2nGvSzCdRoGv2/7ZtAB0JVonRWKnFg0cZYTWM9sE=" | |||
04372c735c3604369cc3e0536f1724c8da808fe6f6251a0c98953ea91cc7cb88 | 99afbb2f7b4e6cc3fa738b4d4376f5fe08eeb7955c88ab10da793ca160a2875c | Add adds one or more previously unadded urls to crawler to visit. source can be nil to indicate root. Returns a list of errors if any occured. | func (c *Crawler) Add(source *url.URL, uri ...*url.URL) []error {
var errs []error
for _, u := range uri {
var err error
u := u
u.Fragment = "" // reset fragment, we don't want it messing our visited list
if source != nil {
u = source.ResolveReference(u)
}
if u.Scheme != "http" && u.Scheme != "http... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:36 | shard-00000.jsonl.gz:36 | shard-00000.jsonl.gz:36 | apache-2.0 | {"document_rank":"0","document_score":"0.7516235","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5309802","0.52734095","0.52264124","0.5196098","0.51324165","0.5123398","0.5056944","0.496427","0.49161023","0.48829758","0.48795125","0.4875261","0.48127... | default | train | "byh0P/emzk+MxvZ78vVO+VTtO3bbA5qcPTokKxdmfdw=" | |||
a8e8c4d1ab259f7eb676e4cf6a84ded36e10fc860782e7c32a45354b9bb63368 | d7998c3c412d564a3e5f1800d2bcc304237e33feb04daa5605ff5eca58a310fc | Run launches the worker pool and blocks until they all finish. | func (c *Crawler) Run(numWorkers int) {
// Here we create a new cancellable context to control goroutines and requests.
// We can't just rely on the parent context because we want to shutdown goroutines if there's no activity for some time.
// Closing the channel would introduce "send on closed chan" errors since c... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:37 | shard-00000.jsonl.gz:37 | shard-00000.jsonl.gz:37 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.8138579","0.7590641","0.7388474","0.7091481","0.70803887","0.7080261","0.6920038","0.6850398","0.67854327","0.67674756","0.67474246","0.668862","0.6676274","0.... | default | train | "smisVwUEEdpRy+BBJfMHupRQ8cnswiSAXOtc5fSEdMo=" | |||
6c5d9945e8400eb4efbb66d4275faedee43bc3284dfa7ef421d99bd360629396 | 715fd5525697dea5ad78df0258a0fa9933dcd97adab7c57561fd806a6c8ad310 | getSourcegraphVersion queries the Sourcegraph GraphQL API to get the current version of the Sourcegraph instance. | func (svc *Service) getSourcegraphVersion(ctx context.Context) (string, error) {
var result struct {
Site struct {
ProductVersion string
}
}
ok, err := svc.client.NewQuery(sourcegraphVersionQuery).Do(ctx, &result)
if err != nil || !ok {
return "", err
}
return result.Site.ProductVersion, err
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:38 | shard-00000.jsonl.gz:38 | shard-00000.jsonl.gz:38 | apache-2.0 | {"document_rank":"0","document_score":"0.80999446","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5781868","0.5636606","0.5636606","0.5576799","0.55693847","0.5562794","0.55050653","0.549268","0.54771435","0.5471268","0.5450064","0.5450064","0.5440955... | default | train | "3lnIlSwVfqLMADIRk40qLRzkOSiGQs0NkL1qONCnbmk=" | |||
b87f2b5756dedc954f6d8fa9c28e21acb435539e55a49d6d6261a807b2bb8b96 | e51b765b4b72c7322f6dcbb16a9e0f302f07a884c1b2a5571aa952e687cc313d | DetermineFeatureFlags fetches the version of the configured Sourcegraph instance and then sets flags on the Service itself to use features available in that version, e.g. gzip compression. | func (svc *Service) DetermineFeatureFlags(ctx context.Context) error {
version, err := svc.getSourcegraphVersion(ctx)
if err != nil {
return errors.Wrap(err, "failed to query Sourcegraph version to check for available features")
}
return svc.features.setFromVersion(version)
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:39 | shard-00000.jsonl.gz:39 | shard-00000.jsonl.gz:39 | apache-2.0 | {"document_rank":"0","document_score":"0.78591985","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6283442","0.58581585","0.5759627","0.56996477","0.56361234","0.5633944","0.5601203","0.5553357","0.5548972","0.55474377","0.53957814","0.53191704","0.527... | default | train | "4JwtWW5T31me9p5Cst2+uRyEdGHFgrcYDH6LYx/kPZ0=" | |||
92415a7fe1b9a79c4423a58f7daf90b1e249aba296df280f806712d77b9eed40 | 7f4bfbb167a1b43ea50c14defd1432bfb590e6cd7d5df27a51b7f71b2df483df | Handler maps the different existing endpoints with the functions they must call | func Handler(a adding.Service, l listing.Service, d deleting.Service) *gin.Engine {
router := gin.Default()
router.GET("/movies", listMovies(l))
router.GET("/movies/:id", getMovie(l))
router.POST("/movies", addMovie(a))
router.DELETE("/movies/:id", deleteMovie(d))
return router
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:40 | shard-00000.jsonl.gz:40 | shard-00000.jsonl.gz:40 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.66714734","0.6644675","0.635691","0.6305351","0.62427664","0.6203105","0.61850226","0.61681867","0.616791","0.6160118","0.6154112","0.6140186","0.61255753","0.... | default | train | "6E04GWg7/eKbIpd4BFbdd+f586+en2d8obIib6omevU=" | |||
5ade659aa8bc946d62d04d48f6de26d6786ec674af4bc00488a11a98250660ee | 2611ede268480717b6d55bf47c993c0e9d0eb7a242468b41a3615dd86586f8a0 | ApplyOptions applies given opts and returns the resulting Options. This function should not be used directly by end users; it's only exposed as a side effect of Option. | func ApplyOptions(opt ...Option) Options {
opts := Options{
MaxTraversalLinks: math.MaxInt64, //default: traverse all
MaxAllowedHeaderSize: carv1.DefaultMaxAllowedHeaderSize,
MaxAllowedSectionSize: carv1.DefaultMaxAllowedSectionSize,
}
for _, o := range opt {
o(&opts)
}
// Set defaults for zero valued... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:41 | shard-00000.jsonl.gz:41 | shard-00000.jsonl.gz:41 | apache-2.0 | {"document_rank":"7","document_score":"0.6390833","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7181345","0.7011728","0.66453886","0.6608931","0.66003937","0.6593034","0.6515448","0.6360162","0.6322618","0.63175213","0.6217988","0.6186789","0.6160557... | default | train | "i+sEgrCxGXzC8P2rHOsisWpL3o3/SmuQaqdjOfCRwjY=" | |||
a156bfba496918b061650df20fad7c4cb0c0a0ef37980507c18e024080d43a61 | 37ea4fecea325fca1bae378444df0b1535b556eb77548d770303c367534d2396 | ZeroLengthSectionAsEOF sets whether to allow the CARv1 decoder to treat a zerolength section as the end of the input CAR file. For example, this can be useful to allow "null padding" after a CARv1 without knowing where the padding begins. | func ZeroLengthSectionAsEOF(enable bool) Option {
return func(o *Options) {
o.ZeroLengthSectionAsEOF = enable
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:42 | shard-00000.jsonl.gz:42 | shard-00000.jsonl.gz:42 | apache-2.0 | {"document_rank":"0","document_score":"0.81493616","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.52038777","0.4886099","0.46940255","0.45598406","0.45515433","0.44806105","0.44333175","0.44333175","0.44333175","0.44333175","0.44333175","0.4400239","0... | default | train | "hCOAGCy/QCQ0zL2q7oYR+Zej7v5pBcQFtP1oB5rlCUE=" | |||
64c2f4604a2b4ad0f4056df14a924519f52c250eaeb8dac56c30838c1be0e022 | 53fbd3b04b2fa7f0cc14528a1d835f570822b3ee06df96499191fabe1d52eced | UseDataPadding sets the padding to be added between CARv2 header and its data payload on Finalize. | func UseDataPadding(p uint64) Option {
return func(o *Options) {
o.DataPadding = p
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:43 | shard-00000.jsonl.gz:43 | shard-00000.jsonl.gz:43 | apache-2.0 | {"document_rank":"0","document_score":"0.7320334","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5258283","0.4555469","0.4480234","0.44573864","0.43533745","0.4337491","0.4326558","0.42585558","0.42437828","0.42047027","0.41544282","0.41253066","0.412... | default | train | "88BYD5fIgvbkP7WQQzO6bHYq3uf2lQEe0te/dyX0/40=" | |||
f1839b2b7667e8c5266751678c7bb94444e87a3c476748137956898197119d37 | 5206bd27849cbefba21c6bca535050dd887ccf4ca645b94e3c2e103d07e79332 | UseIndexPadding sets the padding between data payload and its index on Finalize. | func UseIndexPadding(p uint64) Option {
return func(o *Options) {
o.IndexPadding = p
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:44 | shard-00000.jsonl.gz:44 | shard-00000.jsonl.gz:44 | apache-2.0 | {"document_rank":"0","document_score":"0.7548068","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.496226","0.49470598","0.49359372","0.4929836","0.48813668","0.48754716","0.48505393","0.47770718","0.47507846","0.4717412","0.47086638","0.47060275","0.46... | default | train | "qtJR4H7EPwQ9pkQtX9RtpSEVzokUj2OZOhq5mJ6c7Z4=" | |||
49548e4a18ff444c0889a872515428bb7dab44a14a1c7d4a0839347a59285b90 | 7c3d401fc692b2c04d0e2eef1aa6b4cea93cc5a98faa4fdf68ea4778ecc6b2a6 | UseIndexCodec sets the codec used for index generation. | func UseIndexCodec(c multicodec.Code) Option {
return func(o *Options) {
o.IndexCodec = c
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:45 | shard-00000.jsonl.gz:45 | shard-00000.jsonl.gz:45 | apache-2.0 | {"document_rank":"0","document_score":"0.8574102","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5502938","0.52192473","0.51957196","0.51697326","0.5116415","0.5042837","0.50319487","0.48964846","0.48657367","0.48536038","0.48389342","0.4827276","0.48... | default | train | "tWmnBC27Nw46Euw+oznZoGwQCljuPWJ90wBo3rnfc1o=" | |||
34e264116b07ec4c8ebf7cb5880308decd12cb04bbe35b70a5fe17589c5ff2a9 | 4fa4c248564264c10e2f9fd2dcab73f1ac1879476a47f8a433dec01236260e20 | WithoutIndex flags that no index should be included in generation. | func WithoutIndex() Option {
return func(o *Options) {
o.IndexCodec = index.CarIndexNone
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:46 | shard-00000.jsonl.gz:46 | shard-00000.jsonl.gz:46 | apache-2.0 | {"document_rank":"0","document_score":"0.7322742","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.62528235","0.6120058","0.6103179","0.5899328","0.5636369","0.56347483","0.56101","0.5556883","0.54259133","0.5418361","0.54178435","0.53887594","0.5346785... | default | train | "pjBx3md5Feqjs+IChzxsnZ3KLBphXgoEvzZdxKDlYY8=" | |||
f52274dfd7db4e9c9349dc88c04dfbacb034263a567366199214367bdb70f2fd | fc77f0ccb88e7b861c13be729b44e3715e200ec4a52b6782ddd5ffb4189efa4e | StoreIdentityCIDs sets whether to persist sections that are referenced by CIDs with multihash.IDENTITY digest. When writing CAR files with this option, Characteristics.IsFullyIndexed will be set. By default, the blockstore interface will always return true for Has() called with identity CIDs, but when this option is tu... | func StoreIdentityCIDs(b bool) Option {
return func(o *Options) {
o.StoreIdentityCIDs = b
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:47 | shard-00000.jsonl.gz:47 | shard-00000.jsonl.gz:47 | apache-2.0 | {"document_rank":"0","document_score":"0.7659749","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5328413","0.48285127","0.46915764","0.460706","0.45859408","0.45038688","0.4317314","0.43106538","0.4235155","0.42342368","0.42137128","0.41937977","0.418... | default | train | "2AgIIFs5+8j9cyEwjMMY7jBijtfi3KDe9XLkQqQ7gNs=" | |||
e63578021808ddfb3fdab619b5ab9bfbba9c206e5280f66c32573be89d203379 | bdd4ba801eaa00977ca2786f36eca31ed8c17b628ce9c350086dae110682d860 | MaxIndexCidSize specifies the maximum allowed size for indexed CIDs in bytes. Indexing a CID with larger than the allowed size results in ErrCidTooLarge error. | func MaxIndexCidSize(s uint64) Option {
return func(o *Options) {
o.MaxIndexCidSize = s
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:48 | shard-00000.jsonl.gz:48 | shard-00000.jsonl.gz:48 | apache-2.0 | {"document_rank":"0","document_score":"0.8566187","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.54128367","0.5239222","0.5225754","0.5207175","0.517067","0.5167994","0.51654756","0.514978","0.5139812","0.5123632","0.51004505","0.5087268","0.50867826"... | default | train | "3kkvJ5hprzvf50btPz9XGHtdZvkW4x4rtcz9BxY7lRY=" | |||
54ed7c602868bd16dfdd4dbd49d8361886e9964a9d4ad818aeb91d10e03fccc2 | c5aa12ad1c7dd0f0c2aef0a27ed05f690d47175f467f7c778f0b2a5924befc2e | WithTraversalPrototypeChooser specifies the prototype chooser that should be used when performing traversals in writes from a linksystem. | func WithTraversalPrototypeChooser(t traversal.LinkTargetNodePrototypeChooser) Option {
return func(o *Options) {
o.TraversalPrototypeChooser = t
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:49 | shard-00000.jsonl.gz:49 | shard-00000.jsonl.gz:49 | apache-2.0 | {"document_rank":"0","document_score":"0.7862286","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.39877933","0.39078513","0.38892928","0.374556","0.37302673","0.36932385","0.35834628","0.33725303","0.336618","0.33358172","0.33044896","0.32975402","0.32... | default | train | "JGyJ6uqgAQ3Rv+v940/3VzGtUKZkYEf+62302k7FYCM=" | |||
2d590df77b63c57d996d7b22d4ad081eadda6ad9e2b4b06fdbe475f91e3d3a24 | 03e53c648522de0fa9bb634e27e58345c8c162747fd720c7a80e464ddb3b61f7 | WithTrustedCAR specifies whether CIDs match the block data as they are read from the CAR files. | func WithTrustedCAR(t bool) Option {
return func(o *Options) {
o.TrustedCAR = t
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:50 | shard-00000.jsonl.gz:50 | shard-00000.jsonl.gz:50 | apache-2.0 | {"document_rank":"0","document_score":"0.7244435","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5050521","0.46469218","0.44809136","0.4400281","0.43353248","0.43324968","0.42241368","0.41937608","0.41843116","0.41048527","0.4037473","0.40296867","0.4... | default | train | "CetwgZ805YRDlbEJmIKoL5tQTLNTloC5s27l5Mgp7vE=" | |||
694d5b33a3d9468394617c995f688ed1b324ca54142c977a3aa8ca70d8243f2a | a2828f04dbc8970c6c15e0728c4fbe00a69ba74c786697b3369ac015091323d0 | MaxAllowedHeaderSize overrides the default maximum size (of 32 MiB) that a CARv1 decode (including within a CARv2 container) will allow a header to be without erroring. | func MaxAllowedHeaderSize(max uint64) Option {
return func(o *Options) {
o.MaxAllowedHeaderSize = max
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:51 | shard-00000.jsonl.gz:51 | shard-00000.jsonl.gz:51 | apache-2.0 | {"document_rank":"0","document_score":"0.7392962","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.67647296","0.63822037","0.60273457","0.5796491","0.5741116","0.5712794","0.5712794","0.55037737","0.54724437","0.54210025","0.54210025","0.54165447","0.53... | default | train | "eIaDU7+G1nE4y+doDbQ1zso0eW7SouLbRuBy0j5Uyc8=" | |||
0e0bb1f5e12835b521dda7bb737f58e99de3167290674b0333daad736605e1e4 | 9b4e70c87896875e0a864031300ff91462adb9d7e012de409a12200706a0585a | MaxAllowedSectionSize overrides the default maximum size (of 8 MiB) that a CARv1 decode (including within a CARv2 container) will allow a header to be without erroring. Typically IPLD blocks should be under 2 MiB (ideally under 1 MiB), so unless atypical data is expected, this should not be a large value. | func MaxAllowedSectionSize(max uint64) Option {
return func(o *Options) {
o.MaxAllowedSectionSize = max
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:52 | shard-00000.jsonl.gz:52 | shard-00000.jsonl.gz:52 | apache-2.0 | {"document_rank":"0","document_score":"0.6830897","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.64527285","0.56640345","0.5559902","0.5421008","0.5421008","0.5341554","0.5331863","0.53089076","0.519577","0.5166597","0.51638806","0.5088928","0.5074577... | default | train | "0Y0UE6G9S4pkltX6PY6zPM+zrc2JfBnAApC+VuZn8jY=" | |||
df40e4140b039894628cf98b9b9c9a81a27c53dc298b7d93b76fa33086b6a362 | d091425ca9a89d717fd2acede4a1beed2fbd6c282dd9f8e5370f9f69e1fb59b6 | WriteAsCarV1 is a write option which makes a CAR interface (blockstore or storage) write the output as a CARv1 only, with no CARv2 header or index. Indexing is used internally during write but is discarded upon finalization. Note that this option only affects the storage interfaces (blockstore or storage), and is ignor... | func WriteAsCarV1(asCarV1 bool) Option {
return func(o *Options) {
o.WriteAsCarV1 = asCarV1
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:53 | shard-00000.jsonl.gz:53 | shard-00000.jsonl.gz:53 | apache-2.0 | {"document_rank":"0","document_score":"0.8315218","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.48664775","0.44362253","0.43605676","0.43476164","0.4318693","0.42778337","0.42568678","0.4225701","0.4217781","0.41908678","0.41819924","0.41723937","0.4... | default | train | "7sXvYl1a9w88ThmOVeinTPdvCVNYc4Dga2EapXI9WLQ=" | |||
1ef79589a9f3fb5e2601b7c7bc3fe0e7324cd0f64260e1cbe5509d08475023a6 | 13ed405d2df9e0beffe37a774067c47ec6f7f97c4cd26ae7d4f723f08e2a6da3 | AllowDuplicatePuts is a write option which makes a CAR interface (blockstore or storage) not deduplicate blocks in Put and PutMany. The default is to deduplicate, which matches the current semantics of goipfsblockstore v1. Note that this option only affects the storage interfaces (blockstore or storage), and is ignored... | func AllowDuplicatePuts(allow bool) Option {
return func(o *Options) {
o.BlockstoreAllowDuplicatePuts = allow
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:54 | shard-00000.jsonl.gz:54 | shard-00000.jsonl.gz:54 | apache-2.0 | {"document_rank":"0","document_score":"0.8344131","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5433435","0.51779854","0.5121265","0.45189086","0.44898877","0.43579203","0.43035212","0.42886138","0.4212644","0.4183098","0.4140767","0.4131019","0.4093... | default | train | "57KbaI65DQ94Gpq/UlFgoxm0HN1kixP1rdtUzAyNil4=" | |||
5652fbc5b119b13e06c673aa4f3f677c71629fd8321a54f4101a3fcc2f218ec5 | 1177293da3561ea3da469a118c49118914a65047222bbbd039ca51b563769d55 | Hours returns the duration as a floating point number of hours. | func (d Duration) Hours() float64 {
return time.Duration(d).Hours()
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:55 | shard-00000.jsonl.gz:55 | shard-00000.jsonl.gz:55 | apache-2.0 | {"document_rank":"2","document_score":"0.73899436","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.8240469","0.7533591","0.7021137","0.6808942","0.6702991","0.64857084","0.6369934","0.6315462","0.62868947","0.6244098","0.6225003","0.61721426","0.609861... | default | train | "d7M291xra1YEPKcLHZ0R4GDu495o9A+Q0tr0jgKujwY=" | |||
eeac6ecc4745a52e482a0e0b943f88e42a79eb6c701075da9c700e62e1b4fe3d | 755c1de479176d98cefc6e08a8fd81ba1835232bd78172e09ce6980fb15b305a | Minutes returns the duration as a floating point number of minutes. | func (d Duration) Minutes() float64 {
return time.Duration(d).Minutes()
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:56 | shard-00000.jsonl.gz:56 | shard-00000.jsonl.gz:56 | apache-2.0 | {"document_rank":"0","document_score":"0.6980067","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.67800033","0.67238533","0.671037","0.671037","0.6626685","0.64240044","0.6328356","0.61948246","0.6168142","0.6068626","0.6063561","0.6036192","0.6029605"... | default | train | "fYlkz0fm2Phkb8SB2gdrzEhEzqRC2RN7Jgg3HrGJT8M=" | |||
e1ecbac88dd0f2ad040765f95d20c100c66ddf39d18f1af79dfcd077fbc24875 | 2a1c580c43ec9dfb128653e523543192ac076d94203fa4aa0aae91aa1691bb52 | Nanoseconds returns the duration as an integer nanosecond count. | func (d Duration) Nanoseconds() int64 {
return time.Duration(d).Nanoseconds()
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:57 | shard-00000.jsonl.gz:57 | shard-00000.jsonl.gz:57 | apache-2.0 | {"document_rank":"0","document_score":"0.81052667","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7365707","0.71677697","0.71562576","0.7091952","0.68987876","0.68987876","0.68987876","0.68987876","0.6809148","0.66780186","0.66759145","0.6439207","0.6... | default | train | "s7+5Zp/9CjjsbrlHCt66HY9/aK5TWjd5DmOjDqHyuMA=" | |||
a5770af302db14fcc9c44b5c7042cabc847057271888ef350f580bc24d84ed91 | 96d966cde3c6722b109f8c0313c36cbee075f51e22e267d32e9bbd24c2fea520 | Returns a string representation of the duration in russian language | func (d Duration) String() (result string) {
var seconds, minutes, hours int
seconds = int(d.Seconds())
if seconds > 60 {
minutes = (seconds - seconds%60) / 60
seconds = seconds % 60
}
if minutes > 59 {
hours = (minutes - minutes%60) / 60
minutes = minutes - hours*60
result = numberInString(hours, false)... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:59 | shard-00000.jsonl.gz:59 | shard-00000.jsonl.gz:59 | apache-2.0 | {"document_rank":"13","document_score":"0.5642375","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6247409","0.61673176","0.58863103","0.58602095","0.58570576","0.5843788","0.57781535","0.57749504","0.5758013","0.5729817","0.57266206","0.56786615","0.5... | default | train | "sSqH8+7G9y92jwJDXNw1+33gLkJGWfoiKNIvrWQ0xhw=" | |||
953c2641076af9d5a8bcd94632f28638a2b1b403112558627d7fc33ea96d9396 | ca5ef3f996d418a44c42ae6f27510cebf9090a53ac9f174a220688bcc5a76978 | Returns a string representation of the approximate duration in russian language | func (d Duration) StringApproximate() (result string) {
var seconds, minutes, hours, days, months, years int
seconds = int(d.Seconds())
if seconds > 60 {
minutes = int(d.Minutes())
}
if minutes > 59 {
hours = int(d.Hours())
minutes = minutes - hours*60
}
if hours > 24 {
days = (hours - hours%24) / 24
h... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:60 | shard-00000.jsonl.gz:60 | shard-00000.jsonl.gz:60 | apache-2.0 | {"document_rank":"0","document_score":"0.6517362","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6004345","0.5819394","0.5691862","0.5682199","0.5630542","0.55865556","0.5574526","0.5537256","0.5509831","0.5462976","0.5461879","0.5460645","0.54367495"... | default | train | "DDPT5gwLdrGWUFMSyfsC3rRrLvhBnZj+TaMJPclWBEo=" | |||
a3e68095bc989570819059fb3a21bcd3bdf640f68874495d663d5296324216af | 44837fc5b71515216d4688e7a5d537b6a2797d68bc9866cc0d4e7932e53ca6ff | AddLabel adds a label to the specified PR or issue | func (fc *fakeClient) AddLabel(owner, repo string, number int, label string) error {
fc.added = append(fc.added, label)
fc.labels = append(fc.labels, label)
return nil
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:61 | shard-00000.jsonl.gz:61 | shard-00000.jsonl.gz:61 | apache-2.0 | {"document_rank":"3","document_score":"0.72734094","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.75481737","0.75481737","0.7350045","0.71433645","0.7023004","0.6740278","0.655589","0.64857525","0.6314333","0.62937886","0.62546927","0.62197626","0.619... | default | train | "RsNCyulS+uUI3+BARJBAMeS9keVzjlH5YOTrb7vghz0=" | |||
9892b33e61804655a810b3626f04f66091f35856bc21b6ec420fcb956d2de7c5 | 60651a9f4358eb475dc72c11726ecd57403d31471bd5b39c0d8b5ceef429ca23 | RemoveLabel removes the label from the specified PR or issue | func (fc *fakeClient) RemoveLabel(owner, repo string, number int, label string) error {
fc.removed = append(fc.removed, label)
// remove from existing labels
for k, v := range fc.labels {
if label == v {
fc.labels = append(fc.labels[:k], fc.labels[k+1:]...)
break
}
}
return nil
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:62 | shard-00000.jsonl.gz:62 | shard-00000.jsonl.gz:62 | apache-2.0 | {"document_rank":"2","document_score":"0.7706561","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7710544","0.7710544","0.7190297","0.7131391","0.69650364","0.6953825","0.68455964","0.66010845","0.65678805","0.6539643","0.63907325","0.63030523","0.6289... | default | train | "SQo3zfGhJ3TiBco3p0DSHpuMU7+PtSknBj2xedQzXj4=" | |||
adb1646a4b19e279ce5e80dd46f6ce6c21a8522252662d56d28e70f809e70eca | 2622082799137be61abd1d990a7b55b494a2843a0a7fc67f9014fcd1795cddd7 | GetIssueLabels gets the current labels on the specified PR or issue | func (fc *fakeClient) GetIssueLabels(owner, repo string, number int) ([]github.Label, error) {
var la []github.Label
for _, l := range fc.labels {
la = append(la, github.Label{Name: l})
}
return la, nil
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:63 | shard-00000.jsonl.gz:63 | shard-00000.jsonl.gz:63 | apache-2.0 | {"document_rank":"0","document_score":"0.8116904","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.8113356","0.7227975","0.70755315","0.7042123","0.70022243","0.6956072","0.69555527","0.6602383","0.65491056","0.65308553","0.6387276","0.63280463","0.6320... | default | train | "CJ7MnTX4CE056SiC3F7o2T2A8SxnfC7hBjjbAH+J/IE=" | |||
a6c7cb13883b58fcc72c37e942d4a7063ee7ab0364672de794b7e086240bd4ab | 0b8bf500ffdc7c37ea26683f961704b92b61cf378bbff358d3fa3c4992bdeb63 | CreateComment adds and tracks a comment in the client | func (fc *fakeClient) CreateComment(owner, repo string, number int, comment string) error {
fc.commentsAdded[number] = append(fc.commentsAdded[number], comment)
return nil
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:64 | shard-00000.jsonl.gz:64 | shard-00000.jsonl.gz:64 | apache-2.0 | {"document_rank":"1","document_score":"0.8281089","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.78270876","0.77825135","0.7703459","0.76506597","0.7603772","0.7488165","0.74705166","0.74413574","0.7431552","0.7339268","0.71487004","0.71214473","0.711... | default | train | "3J9s56MkaI4T3Ikr6K0+eg2pzNpfvz83Xi4iBdGBjqI=" | |||
677a5e28715ae9e9aa895c9e6ab99dc2cd339ed6babc37e9ba05b159d716cafb | e85c0161611b72a491b49bdb9a22398a499be27eaaa5c9ee40dd199e555fe6d4 | NumComments counts the number of tracked comments | func (fc *fakeClient) NumComments() int {
n := 0
for _, comments := range fc.commentsAdded {
n += len(comments)
}
return n
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:65 | shard-00000.jsonl.gz:65 | shard-00000.jsonl.gz:65 | apache-2.0 | {"document_rank":"1","document_score":"0.8412568","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.68079066","0.6796185","0.6678622","0.6601007","0.65994287","0.6564124","0.65543514","0.6539888","0.6526384","0.6513839","0.64962953","0.6486291","0.646165... | default | train | "pYt5D+AezkLx+zDXLOO05izQB6c1X3f4lMUHNC2puHY=" | |||
0b2668a324df6f8e95718a193183025f1b472efb1a8d4e0a3f6046aa4066f144 | bf21262bc98899f3ef242b5602dfa6d4e207394e2b8d01b8a126fa72e067e499 | NewOutput instantiates a new output plugin instance publishing to elasticsearch. | func (f elasticsearchOutputPlugin) NewOutput(
config *outputs.MothershipConfig,
topologyExpire int,
) (outputs.Outputer, error) {
// configure bulk size in config in case it is not set
if config.BulkMaxSize == nil {
bulkSize := defaultBulkSize
config.BulkMaxSize = &bulkSize
}
output := &elasticsearchOutput{... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:66 | shard-00000.jsonl.gz:66 | shard-00000.jsonl.gz:66 | apache-2.0 | {"document_rank":"0","document_score":"0.8399119","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6398827","0.6216201","0.61832756","0.6142493","0.600292","0.600292","0.58812755","0.5859912","0.57929546","0.57894796","0.578846","0.5770203","0.5722518",... | default | train | "it1uN1vS3eygtxcGvl2A9pUGL6lv3IY+0VG+QmCjYtA=" | |||
ecf92a4e4c614ec4b7bbb1c9bf6d920da73c2cc56031d6a8660ef99142ea8b1e | 6881e52796897993ba7594b880ee5952799ada5873b14b9983d09341e9383c89 | loadTemplate checks if the index mapping template should be loaded In case template loading is enabled, template is written to index | func loadTemplate(config outputs.Template, clients []mode.ProtocolClient) {
// Check if template should be loaded
// Not being able to load the template will output an error but will not stop execution
if config.Name != "" && len(clients) > 0 {
// Always takes the first client
esClient := clients[0].(*Client)
... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:67 | shard-00000.jsonl.gz:67 | shard-00000.jsonl.gz:67 | apache-2.0 | {"document_rank":"2","document_score":"0.63263446","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6890042","0.6643959","0.624839","0.62140644","0.61590606","0.60328317","0.6032525","0.5931923","0.58915156","0.58405447","0.583602","0.57904","0.5784774"... | default | train | "EAYtwXOlOyFsMrVQpk0KFV81mIaSZ7Co7lbojiPVE2Y=" | |||
c9420648b15fc0ca62f921f618df61367a6603c12e9116199ecb536448161b2c | 9f94dff7b88c18e0e6994a45dcf3ad32910c000e7f51242071b26475f9b2ec13 | New returns a new PagerDuty notifier. | func New(c *config.PagerdutyConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) {
client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "pagerduty", httpOpts...)
if err != nil {
return nil, err
}
n := &Notifier{conf: c, tmpl: t, logger: l, client: client}
... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:68 | shard-00000.jsonl.gz:68 | shard-00000.jsonl.gz:68 | apache-2.0 | {"document_rank":"0","document_score":"0.77650785","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7220423","0.7142861","0.6967976","0.68429434","0.6688869","0.6591405","0.65628475","0.65613985","0.6546102","0.6531209","0.6517486","0.6479263","0.646260... | default | train | "+PsauM+BGbXnmrrmWFC7sqTmpZ3G5yK3HUrpqgqnPQc=" | |||
c45c89e5f0f691535e992f0cc027dbe797d3460ceb152bc2f1252aa24e8cdc00 | 6da86207384e460239f10970a8bde48a2883ae3689018593c1180499c96381f5 | Notify implements the Notifier interface. | func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error) {
key, err := notify.ExtractGroupKey(ctx)
if err != nil {
return false, err
}
var (
alerts = types.Alerts(as...)
data = notify.GetTemplateData(ctx, n.tmpl, as, n.logger)
eventType = pagerDutyEventTrigger
)
if alerts.... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:69 | shard-00000.jsonl.gz:69 | shard-00000.jsonl.gz:69 | apache-2.0 | {"document_rank":"75","document_score":"0.6415623","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.8132382","0.79153454","0.73934114","0.73212564","0.72838044","0.7273848","0.72720206","0.7210515","0.71945655","0.7182227","0.7165415","0.7159474","0.711... | default | train | "KtEKk03MnY3kLNCODPnqFx9azeS0fI5VtgrjAnHooNo=" | |||
4586f53b3835dbe1575040c175215eb57d09fcb7466c86b303e2a196633b3fdb | 8c67b78960716d3d19ee9b2ea854424b9e1940cafbb3895c46f50172f846cfea | String returns a JSON representation of the model | func (o *Patchintegrationactionfields) String() string {
o.RequestMappings = []Requestmapping{{}}
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:70 | shard-00000.jsonl.gz:70 | shard-00000.jsonl.gz:70 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7602305","0.6521702","0.6492924","0.6464296","0.6367784","0.6342571","0.63273394","0.62768203","0.6276228","0.6276228","0.62744915","0.6235233","0.6219029","0.... | default | train | "1Z7NMm5IuiKy/wFtbqonaGulMNAcrcxNnmXkcvYE5+g=" | |||
d8ec468bc67c07c401529a822102c1734cee82d70ec6d415cf737f9555f5c568 | d733ed246230e65ec8a97d796e5b3dacc300a01e8ad7be0027ed5a666531e7dc | / Outgoing connections Using an outgoing connection is a snap. A `net.Conn` satisfies the io.Reader and `io.Writer` interfaces, so we can treat a TCP connection just like any other `Reader` or `Writer`. Open connects to a TCP Address. It returns a TCP connection armed with a timeout and wrapped into a buffered ReadWrit... | func Open(addr string) (*bufio.ReadWriter, error) {
// Dial the remote process.
// Note that the local port is chosen on the fly. If the local port
// must be a specific one, use DialTCP() instead.
log.Println("Dial " + addr)
conn, err := net.Dial("tcp", addr)
if err != nil {
return nil, errors.Wrap(err,... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:71 | shard-00000.jsonl.gz:71 | shard-00000.jsonl.gz:71 | apache-2.0 | {"document_rank":"5","document_score":"0.6163392","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.69614923","0.6535082","0.6439303","0.63323253","0.6207398","0.6090019","0.6024686","0.5997635","0.59855705","0.5922736","0.5920382","0.5903573","0.5891919... | default | train | "oYOorCE08EXwOZh8RModg6wrrO626YTxVB56xuBnpOM=" | |||
893a826e94717fedad05900f2bb28bd1026a863217e81237c573bb5461d90cb5 | baee38d9ba252b551e9fcc61443721060873d56482ddb59094d916507f6565f8 | NewEndpoint creates a new endpoint. To keep things simple, the endpoint listens on a fixed port number. | func NewEndpoint() *Endpoint {
// Create a new Endpoint with an empty list of handler funcs.
return &Endpoint{
handler: map[string]HandleFunc{},
}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:72 | shard-00000.jsonl.gz:72 | shard-00000.jsonl.gz:72 | apache-2.0 | {"document_rank":"0","document_score":"0.74718064","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.74292636","0.72935945","0.72410816","0.7215659","0.71920615","0.711459","0.70928013","0.705746","0.69879735","0.6974851","0.69721305","0.68303615","0.672... | default | train | "LLTuZj+hSBk9LNSVoiPgzzIAlVBjMCH5Facx761Ni1Y=" | |||
a3a302c67768e0322612699acf71dc43abb2ff2cb4b8ca189cdd7006a4b1d20a | a03fc8d0b12bd6e8fa29db1f3f8c36be37c48278bf9255cc943e54a997729f85 | AddHandleFunc adds a new function for handling incoming data. | func (e *Endpoint) AddHandleFunc(name string, f HandleFunc) {
e.mutex.Lock()
e.handler[name] = f
e.mutex.Unlock()
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:73 | shard-00000.jsonl.gz:73 | shard-00000.jsonl.gz:73 | apache-2.0 | {"document_rank":"0","document_score":"0.781103","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6896334","0.6849562","0.67962635","0.6719276","0.6719276","0.6719276","0.6665553","0.66522294","0.66437876","0.64656377","0.6382179","0.63733864","0.635129... | default | train | "rl+773w0SK/Yithw76Br7ecJZzGq+HqXWHVOKO4cD38=" | |||
c71cb375d19875304f79c95bdfaaf298a45474d2abeed7df102fe4ed5ed28a80 | 54a2b164691f9333320b815c1cf64c3a66a8b26683e160ec5e5dfbca75a78bf8 | Listen starts listening on the endpoint port on all interfaces. At least one handler function must have been added through AddHandleFunc() before. | func (e *Endpoint) Listen() error {
var err error
e.listener, err = net.Listen("tcp", Port)
if err != nil {
return errors.Wrapf(err, "Unable to listen on port %s\n", Port)
}
log.Println("Listen on", e.listener.Addr().String())
for {
log.Println("Accept a connection request.")
conn, err := e.listene... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:74 | shard-00000.jsonl.gz:74 | shard-00000.jsonl.gz:74 | apache-2.0 | {"document_rank":"0","document_score":"0.6941947","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.66203743","0.66116935","0.6564344","0.6537847","0.65230536","0.64692837","0.6373706","0.6306666","0.6273131","0.6236138","0.6213746","0.6199536","0.615318... | default | train | "O/y4BFWRWmNEBp607GnseGb/a6JrgttK48DPr63O3jk=" | |||
94627a172558fb5520ef96366f00138d4b5811fd46d8bbce3c9d9a5c070db11f | 5fd94ec2d889d1c638708f9a760c6210971c7f9bd20a7cae9eb217a2148fc2f4 | handleMessages reads the connection up to the first newline. Based on this string, it calls the appropriate HandleFunc. | func (e *Endpoint) handleMessages(conn net.Conn) {
// Wrap the connection into a buffered reader for easier reading.
rw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn))
defer conn.Close()
// Read from the connection until EOF. Expect a command name as the
// next input. Call the handler ... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:75 | shard-00000.jsonl.gz:75 | shard-00000.jsonl.gz:75 | apache-2.0 | {"document_rank":"0","document_score":"0.71781325","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6561378","0.6528215","0.64411","0.64160395","0.6366687","0.6283122","0.6273615","0.6269291","0.6257093","0.6256277","0.61980337","0.6155845","0.6121732",... | default | train | "BE2nKVdc3ipDtxdtr4JXf8yUB476Vy2xIP+CMksFKcw=" | |||
c73cd01e63f31a472da59f05ee43be59c5ecfe06c098e306f9c0559fd1f7cd86 | 062ca1d6fd3a9a83e24124f3458d3ece59d56c55f6ac32b7789b78572a03cc4d | / Now let's create two handler functions. The easiest case is where our adhoc protocol only sends string data. The second handler receives and processes a struct that was sent as GOB data. handleStrings handles the "STRING" request. | func handleStrings(rw *bufio.ReadWriter) {
// Receive a string.
log.Print("Receive STRING message:")
s, err := rw.ReadString('\n')
if err != nil {
log.Println("Cannot read from connection.\n", err)
}
s = strings.Trim(s, "\n ")
log.Println(s)
_, err = rw.WriteString("Thank you.\n")
if err != nil {
... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:76 | shard-00000.jsonl.gz:76 | shard-00000.jsonl.gz:76 | apache-2.0 | {"document_rank":"0","document_score":"0.677268","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6016482","0.5864663","0.58399796","0.5835402","0.5817867","0.57098216","0.57005876","0.5564361","0.5549767","0.5534213","0.55311394","0.55142814","0.550671... | default | train | "6HulWFrs8s7NnjtsNpkwK244+Zl32zyc/6AYaEMjdag=" | |||
d94f74e73d1a14f7e8bce9f15d3524b224ef468cb13a2b60cf47fb1bea3ffc84 | 0760406b8fb07235e46349c0cbe33695244b368fca9369938d939677f6d24de4 | handleGob handles the "GOB" request. It decodes the received GOB data into a struct. | func handleGob(rw *bufio.ReadWriter) {
log.Print("Receive GOB data:")
var data complexData
// Create a decoder that decodes directly into a struct variable.
dec := gob.NewDecoder(rw)
err := dec.Decode(&data)
if err != nil {
log.Println("Error decoding GOB data:", err)
return
}
// Print the complex... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:77 | shard-00000.jsonl.gz:77 | shard-00000.jsonl.gz:77 | apache-2.0 | {"document_rank":"0","document_score":"0.8036416","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6926054","0.66555226","0.6592844","0.6570786","0.6549313","0.64678264","0.6391482","0.62011355","0.6196608","0.61929303","0.61607766","0.59881604","0.5935... | default | train | "/RMtgMzeh8B3fYuBJ8yHdJE0qCSpKV/Ff670iORylFs=" | |||
a83319637bd5b19187281e3ea41f35b72153094540a5139de15ae1ae301f05a6 | bae73218b4b86afc9fc6e88675f25266024ac6997f13b7608804bdb693b938cb | / The client and server functions With all this in place, we can now set up client and server functions. The client function connects to the server and sends STRING and GOB requests. The server starts listening for requests and triggers the appropriate handlers. client is called if the app is called with connect=`ip ad... | func client(ip string) error {
// Some test data. Note how GOB even handles maps, slices, and
// recursive data structures without problems.
testStruct := complexData{
N: 23,
S: "string data",
M: map[string]int{"one": 1, "two": 2, "three": 3},
P: []byte("abc"),
C: &complexData{
N: 256,
S: "... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:78 | shard-00000.jsonl.gz:78 | shard-00000.jsonl.gz:78 | apache-2.0 | {"document_rank":"2","document_score":"0.6478236","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6618485","0.65211356","0.646171","0.638421","0.6304717","0.6287283","0.6227207","0.6171384","0.6169162","0.60877883","0.6082746","0.6051843","0.6039413","... | default | train | "46W2Llz8VA6kxAVLQXwhBaMIXOCvOvFuohzrn1WHTys=" | |||
381e955232ad1391641c2be5d43bc426453f99bc36f0d22c83570628d457540b | 525a376e65feb5d1fa278c382bad04405e89c6d743b1d5bc1b19a934eedf51f8 | server listens for incoming requests and dispatches them to registered handler functions. | func server() error {
endpoint := NewEndpoint()
// Add the handle funcs.
endpoint.AddHandleFunc("STRING", handleStrings)
endpoint.AddHandleFunc("GOB", handleGob)
// Start listening.
return endpoint.Listen()
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:79 | shard-00000.jsonl.gz:79 | shard-00000.jsonl.gz:79 | apache-2.0 | {"document_rank":"1","document_score":"0.6814072","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.68494654","0.6800467","0.67156327","0.6608716","0.65980685","0.6566974","0.6520821","0.64973724","0.6458118","0.6454185","0.64205277","0.64116293","0.6407... | default | train | "AOX7uT5kh/MeF/7hUSN86sMuCsTCDUAbGrA/gPZDqAs=" | |||
f2777991622ff1a6b2800ccb436c7a9e0649dc641c3e9cd3d3515f502047fd1a | 5f15789de9136b78032bc8be209c231e9df2c32368da60d2012c5f275318d8ab | / Main Main starts either a client or a server, depending on whether the `connect` flag is set. Without the flag, the process starts as a server, listening for incoming requests. With the flag the process starts as a client and connects to the host specified by the flag value. Try "localhost" or "127.0.0.1" when runnin... | func main() {
connect := flag.String("connect", "", "IP address of process to join. If empty, go into listen mode.")
flag.Parse()
// If the connect flag is set, go into client mode.
if *connect != "" {
err := client(*connect)
if err != nil {
log.Println("Error:", errors.WithStack(err))
}
log.P... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:80 | shard-00000.jsonl.gz:80 | shard-00000.jsonl.gz:80 | apache-2.0 | {"document_rank":"0","document_score":"0.80571264","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.70549303","0.6946936","0.670047","0.6645153","0.6628611","0.66251695","0.6601195","0.6575071","0.6574852","0.6552101","0.6540078","0.64823025","0.6449750... | default | train | "S8BlNdOqbvcNoJG943gcJVWG1eK3F/8DiQ3bpOivahU=" | |||
94692a61aed8e89c2ccaf1bc84dd9692ee2e93a83cdc6043c7067ba23e62b543 | 0f22fee0c8750e82e39e48cc9df68b12c71824e628c6299dba27c9c0b4ecc6e4 | The Lshortfile flag includes file name and line number in log messages. | func init() {
log.SetFlags(log.Lshortfile)
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:81 | shard-00000.jsonl.gz:81 | shard-00000.jsonl.gz:81 | apache-2.0 | {"document_rank":"0","document_score":"0.60543543","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.5979167","0.5713366","0.56390464","0.5635513","0.5625114","0.5615503","0.5562804","0.55347633","0.5523255","0.541619","0.54031026","0.536245","0.53480095... | default | train | "L2AluuAiaIePFvU7sEJArj3Hq13oh4zsCHmqke7dxig=" | |||
8b4a1412a3a1201fe5caba426981652463f9ec3f90eff85ab1373b8d225704a0 | 36fab9ba6a4f77f3d69b90d84b814aae420fd3e2189e907d11ab07569f2c8bca | NewHealthController creates a health controller. | func NewHealthController(service *goa.Service) *HealthController {
return &HealthController{Controller: service.NewController("HealthController")}
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:82 | shard-00000.jsonl.gz:82 | shard-00000.jsonl.gz:82 | apache-2.0 | {"document_rank":"1","document_score":"0.80731326","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.81887347","0.80589396","0.7891792","0.77446157","0.68483025","0.677226","0.67417073","0.6698271","0.6693059","0.66468036","0.6549667","0.6535941","0.6533... | default | train | "m5Yko+29F7IVH51XDIsg4fvMAtc87yi2z+E/FEwVUgc=" | |||
79b9e022ab85c59a4c5f357449b159c2436a27687c72ea197130a943fc609b56 | 9b47ac5fc6f68024fff017805cd7c690f7715e7f9259084cc6d61288d1a64258 | Health runs the health action. | func (c *HealthController) Health(ctx *app.HealthHealthContext) error {
// HealthController_Health: start_implement
ver := "unknown"
semVer, err := semver.Make(MajorMinorPatch + "-" + ReleaseType + "+git.sha." + GitCommit)
if err == nil {
ver = semVer.String()
}
return ctx.OK([]byte("Health OK: " + time.Now().S... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:83 | shard-00000.jsonl.gz:83 | shard-00000.jsonl.gz:83 | apache-2.0 | {"document_rank":"0","document_score":"0.67453545","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6713238","0.6543138","0.6531063","0.64671564","0.638338","0.6375378","0.63475406","0.63455915","0.6333624","0.6295893","0.6284236","0.62841773","0.628139... | default | train | "S0yn7dBn8T1e5fLsmJHo0D9shZovH/kHjjhebujL8kI=" | |||
ecce2ba048f47bceeeff30cd900606fa776192d89e36139a31efa809ae48d341 | 03dfd19f153ba5d0e1416498605064ee71a909aeae8816bb4349123e129d62d1 | NewGenerator starts foreground goroutine which generates sequence of unsigned ints and puts them in input channel, also it returnes stop channel which need to be triggered when generator need to be stopped | func NewGenerator(input chan<- uint) chan<- bool {
stop := make(chan bool)
go func() {
var current uint = 1
for {
select {
case input <- current:
current++
case <-stop:
close(input)
return
}
}
}()
return stop
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:84 | shard-00000.jsonl.gz:84 | shard-00000.jsonl.gz:84 | apache-2.0 | {"document_rank":"0","document_score":"0.7869876","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6641966","0.6627279","0.65606636","0.6544673","0.6534481","0.646908","0.63416237","0.6290985","0.62610847","0.6223949","0.6180005","0.6167735","0.6167735"... | default | train | "lo6xCImPUzd2qFOjfhnL2kQIDSHNqFxgH5KwJgzNM58=" | |||
9442f20e200ce4283011c024a931a89c5aea456780a7b3342da965bac58f803f | 1dfd201e605d8bd473104a52bde9ef3ada02e8ca02e58fab8c54a830d3bed2de | Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded. | func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
}
return nil, fmt.Errorf("Asset %s not foun... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:85 | shard-00000.jsonl.gz:85 | shard-00000.jsonl.gz:85 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7347324","0.7267579","0.710425","0.710425","0.710425","0.710425","0.710425","0.710425","0.710425","0.710425","0.710425","0.710425","0.710425","0.710425","0.710... | default | train | "2ohHztTWAjCbLsNVZJ7S0Mrher3xr9741Wp2s88rldE=" | |||
4bc271b53c1df35835ac30edb49024def46bbda54287290bd14ea2bd0a3d1af7 | dd921309880f40798e7bbce3fc2bb26c6ec234558b50fae4f8644533cd3246f6 | MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables. | func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:86 | shard-00000.jsonl.gz:86 | shard-00000.jsonl.gz:86 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.7499818","0.749... | default | train | "XNUWwabBn5Dk2+GfB/zIx+aBGXmF3Oas2kK975g4Hyw=" | |||
3a075dbac356a3f103d06fc3180c7a7bb70c729bd62e27a6176ebaa9e9865de9 | 62389b11427a2fac82167223661d44144987ea994a1d0c806d6fc1f54fa960d3 | AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded. | func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("Asset... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:87 | shard-00000.jsonl.gz:87 | shard-00000.jsonl.gz:87 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.81356746","0.81356746","0.81356746","0.81356746","0.81356746","0.81356746","0.81356746","0.81356746","0.81356746","0.81356746","0.81356746","0.81356746","0.813... | default | train | "nL/bNV4eSvm3wIZv5SJeatUDm7hOgFVWPkJCDFIvePo=" | |||
987602144fd0d70132cddf8f8dc97fe2e49ee0b6e39289603dec1d0b6e27c8bd | 650ef927213d7f05a4a35b7c48fb4a01f0d605fb0eb6c91721f500f9e00c3fcd | RestoreAssets restores an asset under the given directory recursively | func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:90 | shard-00000.jsonl.gz:90 | shard-00000.jsonl.gz:90 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.798857","0.798857","0.798857","0.798857","0.798857","0.7979806","0.7979806","0.7979806","0.7979806","0.7979806","0.7979806","0.7979806","0.7979806","0.7979806"... | default | train | "at68HUuVFMUFdXbyFoSjxR16GHOcWlVOGa5N4dBVtSI=" | |||
62b84d7d09fae706647b26f7496bab27a755f5571f95d396511f68a662599aa5 | 0da85613b2dc136b30ce90b98b56bf9b0dc1308d2c8ca2ee3d2c48920b44b293 | Copyright 2018 Information Trust Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distrib... | func (s *service) Start() error {
log.Debug("Starting Proc")
s.pipe, _ = s.Proc.StdoutPipe()
e := s.Proc.Start()
if e != nil {
return e
}
s.isRunning = true
log.Debug("Waiting")
e = s.Proc.Wait()
return e
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:91 | shard-00000.jsonl.gz:91 | shard-00000.jsonl.gz:91 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7211902","0.6758328","0.65226424","0.6358648","0.59837586","0.5968245","0.57826364","0.5782253","0.5769097","0.56659955","0.5599327","0.5580922","0.55571395","... | default | train | "qlKK6TnWMfZRj7MxcqJmncHnmq0A73epKSYx1ZHm1Os=" | |||
b350ff101c44ff4f9e6e9e549eb00b8d6a2a6cc2a48e327d0be10d8adee14a75 | 6bbb7e7c275942c164b41fbf999cca5ed8b7b3e90f422e8621759327f11bc315 | Titleizes given name to match | func toFieldName(name string) string {
name = strings.Title(name)
// NOTE: golint prefers method names use "ID" instead of "Id".
re := regexp.MustCompile("Id([A-Z]|$)")
return re.ReplaceAllString(name, "ID${1}")
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:92 | shard-00000.jsonl.gz:92 | shard-00000.jsonl.gz:92 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7358443","0.7263768","0.6653588","0.66427946","0.6610177","0.65596616","0.6526799","0.6518762","0.64714485","0.64706373","0.6443669","0.6421691","0.638007","0.... | default | train | "1A7IRCMG2/I08F8JnibBNXBOdi7fP5Q5LLmTnVwITsE=" | |||
dfc3ac9bcac7e73a328047e3e6a45bb58746e44023644730e4238a90d00fd038 | a798059bbb0c7c6678fe23680602f66e45a9858e72bf908bb438943a6b4b4716 | genFields generates fields config for given AST | func genFields(fs []*ast.FieldDefinition) *jen.Statement {
//
// Generate config for fields
//
// == Example input SDL
//
// type Dog {
// name(style: NameComponentsStyle = SHORT): String!
// givenName: String @deprecated(reason: "No longer supported; please use name field.")
// }
//
// == ... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:93 | shard-00000.jsonl.gz:93 | shard-00000.jsonl.gz:93 | apache-2.0 | {"document_rank":"0","document_score":"0.7535413","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.62704337","0.6208788","0.61161774","0.588618","0.5744872","0.5581054","0.556311","0.55467135","0.5487712","0.5455513","0.54416054","0.54179704","0.5410756... | default | train | "5f87SvEbdTOPwd3F99diJkNJ8DiFp0Agq/dA7c60SRw=" | |||
1e63be8de332333558f27c59028e81d03b4e86c7d3db397b4f1dd6bf4d10912c | 02b375b4cb8946530c1dc90174cbbb7102c4cd6ff67be0c93e16cbbc314b28bf | genField generates field config for given AST | func genField(field *ast.FieldDefinition) *jen.Statement {
//
// Generate config for field
//
// == Example input SDL
//
// interface Pet {
// "name of the pet"
// name(style: NameComponentsStyle = SHORT): String!
// """
// givenName of the pet ★
// """
// givenName: String... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:94 | shard-00000.jsonl.gz:94 | shard-00000.jsonl.gz:94 | apache-2.0 | {"document_rank":"0","document_score":"0.757106","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6892996","0.59916204","0.57207865","0.57188165","0.56753683","0.5636733","0.5596574","0.55853677","0.5520538","0.5467922","0.5415466","0.53430325","0.53384... | default | train | "m4jDOFckXdCxO404bdgEy3tioSsX0pJzy5+4cQ73BrE=" | |||
0d9df800afb840d894de78ae6ca2d1079bd4e7da564b2a978659640cf55c49ad | 9ba4a90bb5d35aade372cc6494f45006b8e24f69c95c4eb03caa2f427ef1f304 | genArguments generates argument field config for given AST | func genArguments(args []*ast.InputValueDefinition) *jen.Statement {
//
// Generate config for arguments
//
// == Example input SDL
//
// type Dog {
// name(
// "style is stylish"
// style: NameComponentsStyle = SHORT,
// ): String!
// }
//
// == Example output
//
// Fiel... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:95 | shard-00000.jsonl.gz:95 | shard-00000.jsonl.gz:95 | apache-2.0 | {"document_rank":"0","document_score":"0.7882007","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6473212","0.5893512","0.52816784","0.5240693","0.5222666","0.51920587","0.50385666","0.5037734","0.50329053","0.5010324","0.50005144","0.49702114","0.4968... | default | train | "sK0gcEBTZvnV2xvgsD49z8syUSG5G9Z1BX84XWg/Cd8=" | |||
5f478ebb4ce52bceb9da9a76be724aa07c873a27670ef75f893e6125388b8e4e | 00cfcfa641f3e7c766df4f8cdd0bea00698caa133321b134b96c80c9fbd68278 | genArgument generates argument config for given AST | func genArgument(arg *ast.InputValueDefinition) *jen.Statement {
//
// Generate config for argument
//
// == Example input SDL
//
// type Dog {
// name(
// "style is stylish"
// style: NameComponentsStyle = SHORT,
// ): String!
// }
//
// == Example output
//
// &Argument... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:96 | shard-00000.jsonl.gz:96 | shard-00000.jsonl.gz:96 | apache-2.0 | {"document_rank":"0","document_score":"0.793481","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.73820037","0.57308537","0.55290264","0.5522804","0.5506649","0.5157852","0.5125404","0.5091101","0.504007","0.5006817","0.49592155","0.49067444","0.4902247... | default | train | "GZ3MUQu4Lxbcl3VgzRr8mTXrGIFbyVGpqkpLltRWbec=" | |||
114918b64f96ff4190c68e9ec6c27d85029071869f44e6764f097018c8dc507b | 36c9a6f3e86a0cc1ecfada0fdfb7552edc672b566a397c26af37213b32396a2d | AddReceipt adds receipt for user. | func (client Client) AddReceipt(userId string, text string) error {
addReceiptUrl := client.backendUrl + "/internal/receipt"
request := addReceiptRequest{ReceiptString: text, UserId: userId}
reader, err := getReader(request)
if err != nil {
return err
}
response, err := http.Post(addReceiptUrl, "text/javascrip... | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:97 | shard-00000.jsonl.gz:97 | shard-00000.jsonl.gz:97 | apache-2.0 | {"document_rank":"0","document_score":"0.7855252","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.65677184","0.6518654","0.54841864","0.54648083","0.5241363","0.5195453","0.51696557","0.51665854","0.5155161","0.514535","0.5085661","0.50395","0.5033886"... | default | train | "actoNMWV44nUOkPGvRrrtnsFDuq+653VMJKBEn4jnPk=" | |||
d97e60742c2a6d036ead78de6b76e8c986d97c19ea2dc0dc6d8d511879a66d34 | 468b0475410f08e28748fac2b4b4fad04c389ad765c28cbbb7532492ed8b5531 | Contain Returns true if slice contains string. | func Contain(list []string, str string) bool {
for _, s := range list {
if s == str {
return true
}
}
return false
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:98 | shard-00000.jsonl.gz:98 | shard-00000.jsonl.gz:98 | apache-2.0 | {"document_rank":"-1","document_score":"0.0","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.783324","0.76756775","0.76235545","0.74297565","0.7393863","0.73772204","0.7371275","0.7368948","0.72871715","0.72871715","0.72871715","0.72871715","0.72871715... | default | train | "JTG7y0rxjd2cVM6KXvHcIrm6GA2Ns3y6Tv3tla8I/0A=" | |||
8ce6110a44a908b5fe8704d7822cfc30f9fb9df11548a1d97c97b2d892e3a54c | 78ed716ff17996635df915cd9d17b9b94eaeb04b8bbeafe0272e4cd50e3e92b4 | MergeUnique Merges `source` string slice into `dest` and returns result. Inserts from `source` only when `dest` does not `Contain` given string. | func MergeUnique(dest, source []string) []string {
for _, str := range source {
if !Contain(dest, str) {
dest = append(dest, str)
}
}
return dest
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:99 | shard-00000.jsonl.gz:99 | shard-00000.jsonl.gz:99 | apache-2.0 | {"document_rank":"0","document_score":"0.7760827","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.64953166","0.5654552","0.5652756","0.55148536","0.53828245","0.53584385","0.5342289","0.5150319","0.513586","0.5078584","0.50460446","0.50121546","0.50001... | default | train | "Jnqb0OaIPun42OrjgIoZPiQgyUrZwiTAIVSY0pzCjnU=" | |||
28c8f96da32fca9268edd3aed82f7b6ad6d8abe0ad681fb7941b83bf801be0f4 | f9b70113bac69efb4c70edb02fed446b016efb3613eafde160f12ef481f6fd52 | Validate returns an error if key is empty | func (kv BatchKeyRotateKV) Validate() error {
if kv.Key == "" {
return errInvalidArgument
}
return nil
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:100 | shard-00000.jsonl.gz:100 | shard-00000.jsonl.gz:100 | apache-2.0 | {"document_rank":"2","document_score":"0.693187","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.75002897","0.69816774","0.690423","0.6776137","0.6737957","0.662673","0.65838337","0.6549191","0.64973724","0.64879715","0.6456016","0.6449215","0.64477557... | default | train | "1y0+wRBEH8eoId3fijXDBRCvRCgwYtG2tu9qI7mJSJY=" | |||
5599ca81c9ba37bba0005c844bfa538ce0f55beff5f86ef29f14a56f484d6f61 | 467d2bb8fccdc36b4278dbf0ca77a75be613e1f4bc96f34cd9239c451c0c42ac | Empty indicates if kv is not set | func (kv BatchKeyRotateKV) Empty() bool {
return kv.Key == "" && kv.Value == ""
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:101 | shard-00000.jsonl.gz:101 | shard-00000.jsonl.gz:101 | apache-2.0 | {"document_rank":"0","document_score":"0.65100455","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.6333462","0.6198159","0.61713","0.6114734","0.59245336","0.5807965","0.5784596","0.55849326","0.55599976","0.5501188","0.5485564","0.54497916","0.5416103... | default | train | "jamWazpA4822j/QVP3YjcpceOX4TRRACkYzbtYaoKGM=" | |||
098642d966b81afc1aac81e6fb1da8e75072b73efc597c68d515c397604f05ca | c51dc00657aa4e63a90aaf6817c04e12582c86595d27906820dca7f7e1962d98 | Match matches input kv with kv, value will be wildcard matched depending on the user input | func (kv BatchKeyRotateKV) Match(ikv BatchKeyRotateKV) bool {
if kv.Empty() {
return true
}
if strings.EqualFold(kv.Key, ikv.Key) {
return wildcard.Match(kv.Value, ikv.Value)
}
return false
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:102 | shard-00000.jsonl.gz:102 | shard-00000.jsonl.gz:102 | apache-2.0 | {"document_rank":"0","document_score":"0.71222144","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.7097848","0.69746256","0.6162469","0.6156034","0.60447186","0.599638","0.5879797","0.5872499","0.5860298","0.58108395","0.57897544","0.57737875","0.57476... | default | train | "5G6hpFqPqKaDeE3S0w2O1Thx7cmJXXF7FcNnFcdT1NU=" | |||
bdf4083d2da210a4e3c92318ed75b0b6ecd371a43dbf6825d9d4a551ae752e06 | ef70346175e1284d4249db694b6c77b0b09cbc4b5b2c009f6d83590bc2054faa | Validate validates input replicate retries. | func (r BatchKeyRotateRetry) Validate() error {
if r.Attempts < 0 {
return errInvalidArgument
}
if r.Delay < 0 {
return errInvalidArgument
}
return nil
} | text | code | text_to_code | go | en | 1 | 1 | nomic-ai/cornstack-go-v1 | default | train | 570a654bad26af77c7a9f8d719ff3549105da5f9 | shard-00000.jsonl.gz:103 | shard-00000.jsonl.gz:103 | shard-00000.jsonl.gz:103 | apache-2.0 | {"document_rank":"1","document_score":"0.6482321","metadata":{"objective":{"paired":[],"self":[],"triplet":[["query","document","negatives"]]}},"negative_scores":["0.74960744","0.57643306","0.5702115","0.55220336","0.5487586","0.5443635","0.52778167","0.5185343","0.51229566","0.5120975","0.5108453","0.5068902","0.50688... | default | train | "JJPgx2Lte1m4PbNoRpAdx0Dq3KNv92Mm9Axf3TbM950=" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.