query
stringlengths
7
3.85k
document
stringlengths
11
430k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns a string representation of the Tuple
func (this *Tuple) String() string { return fmt.Sprintf("%v", this.data) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Tuple) String() string {\n\tstart := \"(\"\n\tif t.IsPoint() {\n\t\tstart = \"p\" + start\n\t} else {\n\t\tstart = \"v\" + start\n\t}\n\treturn start + floatToString(t.x, 3) + \",\" + floatToString(t.y, 3) + \",\" + floatToString(t.z, 3) + \")\"\n}", "func (a Tuple) String() string {\n\tvar buf bytes.Bu...
[ "0.79209447", "0.77979815", "0.73687667", "0.7235998", "0.697652", "0.69273907", "0.6819455", "0.67232805", "0.6324634", "0.6154409", "0.61384434", "0.61242175", "0.61046237", "0.60856646", "0.60820186", "0.6044038", "0.6011396", "0.5978302", "0.5946973", "0.59240377", "0.591...
0.7824448
1
Pops the leftmost item from the Tuple and returns it
func (this *Tuple) PopLeft() interface{} { if this.Len() < 1 { return nil } ret := this.data[0] this.data = this.data[1:] return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *Tuple) PopRight() interface{} {\n\tif this.Len() < 1 {\n\t\treturn nil\n\t}\n\tidx := this.Offset(-1)\n\tret := this.data[idx]\n\tthis.data = this.data[:idx]\n\treturn ret\n}", "func (this *Tuple) Left(n int) *Tuple {\n\treturn this.Slice(0, n)\n}", "func pop(headP *Node) (*Node, *Node){\n // sani...
[ "0.7001776", "0.6395089", "0.6281589", "0.6274747", "0.6267232", "0.62015057", "0.6201386", "0.6188319", "0.61784905", "0.6177955", "0.61499226", "0.6148321", "0.6137886", "0.6126758", "0.61212844", "0.60814977", "0.60791075", "0.6074746", "0.60689086", "0.6036339", "0.603513...
0.7820287
0
Pops the rightmost item from the Tuple and returns it
func (this *Tuple) PopRight() interface{} { if this.Len() < 1 { return nil } idx := this.Offset(-1) ret := this.data[idx] this.data = this.data[:idx] return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *Tuple) PopLeft() interface{} {\n\tif this.Len() < 1 {\n\t\treturn nil\n\t}\n\tret := this.data[0]\n\tthis.data = this.data[1:]\n\treturn ret\n}", "func (this *Tuple) Right(n int) *Tuple {\n\tlength := this.Len()\n\tn = max(0, length-n)\n\treturn this.Slice(n, length)\n}", "func (pe PathExpression) ...
[ "0.71033895", "0.6737673", "0.6415144", "0.63615215", "0.6302642", "0.6233184", "0.6197565", "0.6194584", "0.61938787", "0.6181438", "0.6158734", "0.61554414", "0.614082", "0.6131531", "0.61124057", "0.6086503", "0.6063265", "0.60419124", "0.60412616", "0.6026922", "0.6026662...
0.7744744
0
Reverses the Tuple in place
func (this *Tuple) Reverse() { for i, j := 0, this.Len()-1; i < j; i, j = i+1, j-1 { this.data[i], this.data[j] = this.data[j], this.data[i] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (v Data) Reverse() {\n\tfor i, j := 0, len(v)-1; i < j; i, j = i+1, j-1 {\n\t\tv.Swap(i, j)\n\t}\n}", "func (elem *Items) Reverse() {\n\teLen := len(*elem)\n\tvar target int\n\tfor i := eLen/2 - 1; i >= 0; i-- {\n\t\ttarget = eLen - 1 - i\n\t\t(*elem)[i], (*elem)[target] = (*elem)[target], (*elem)[i]\n\t}\n...
[ "0.6308729", "0.62434167", "0.61875665", "0.6180136", "0.61434245", "0.6137719", "0.61085224", "0.6101406", "0.60955846", "0.6085571", "0.5981546", "0.5979525", "0.5948887", "0.5882405", "0.5828438", "0.5797321", "0.5781275", "0.57673466", "0.57639754", "0.57613766", "0.57434...
0.7713171
0
Returns true if the two items are logically "equal"
func TupleElemEq(lhsi interface{}, rhsi interface{}) bool { lhsv, rhsv := reflect.ValueOf(lhsi), reflect.ValueOf(rhsi) // IsNil panics if type is not interface-y, so use IsValid instead if lhsv.IsValid() != rhsv.IsValid() { return false } // TODO: this currently blows up if lhs can't be converted to same // type as rhs (e.g. int vs. string) switch lhsi.(type) { case nil: if rhsv.IsValid() { return false } case string: if lhsi.(string) != rhsi.(string) { return false } case int, int8, int16, int32, int64: if lhsv.Int() != rhsv.Int() { return false } case uint, uintptr, uint8, uint16, uint32, uint64: if lhsv.Uint() != rhsv.Uint() { return false } case float32, float64: if lhsv.Float() != rhsv.Float() { return false } case *Tuple: if lhsi.(*Tuple).Ne(rhsi.(*Tuple)) { return false } default: //if !lhsv.IsValid() && !rhsv.IsValid() { //return false //} // TODO: allow user-defined callback for unsupported types panic(fmt.Sprintf("unsupported type %#v for Eq in Tuple", lhsi)) } return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CheckEqual(src, trg *Item) bool {\n\ttype obj struct {\n\t\tsrc Attribute\n\t\ttrg Attribute\n\t}\n\tfor _, v := range []obj{\n\t\t{src.part, trg.part},\n\t\t{src.vendor, trg.vendor},\n\t\t{src.product, trg.product},\n\t\t{src.version, trg.version},\n\t\t{src.update, trg.update},\n\t\t{src.edition, trg.editio...
[ "0.6836704", "0.66877675", "0.66601247", "0.6523435", "0.64968175", "0.6491126", "0.6442374", "0.635766", "0.63138324", "0.62434494", "0.62421304", "0.623856", "0.62277097", "0.622744", "0.62098587", "0.62054527", "0.61846155", "0.6177692", "0.6167293", "0.6158573", "0.615431...
0.0
-1
Returns True if this Tuple is elementwise equal to other
func (this *Tuple) Eq(other *Tuple) bool { if this.Len() != other.Len() { return false } //return reflect.DeepEqual(this.data, other.data) for i := 0; i < this.Len(); i++ { lhsi, rhsi := this.Get(i), other.Get(i) if !TupleElemEq(lhsi, rhsi) { return false } } return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Equal(t, other Tuplelike) bool {\n\tfor idx, value := range t.Values() {\n\t\tif !inEpsilon(value, other.At(idx)) {\n\t\t\treturn false\n\t\t}\n\n\t}\n\treturn true\n}", "func (pair *eachPair) Equals(el interface {}) (bool) { \n other, ok := el.(*eachPair) \n if !ok { return false; }\n return pair == o...
[ "0.71708703", "0.66241527", "0.66111946", "0.6581941", "0.64175856", "0.6380936", "0.6297961", "0.61168104", "0.6090455", "0.60117775", "0.5978922", "0.5931099", "0.59009355", "0.5894657", "0.588204", "0.5870349", "0.5866866", "0.5862125", "0.5848202", "0.57785845", "0.577797...
0.7626882
0
Returns True if this Tuple is not elementwise equal to other
func (this *Tuple) Ne(other *Tuple) bool { return !this.Eq(other) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Equal(t, other Tuplelike) bool {\n\tfor idx, value := range t.Values() {\n\t\tif !inEpsilon(value, other.At(idx)) {\n\t\t\treturn false\n\t\t}\n\n\t}\n\treturn true\n}", "func (this *Tuple) Eq(other *Tuple) bool {\n\tif this.Len() != other.Len() {\n\t\treturn false\n\t}\n\t//return reflect.DeepEqual(this.da...
[ "0.6762844", "0.6520316", "0.61363983", "0.6020699", "0.59709007", "0.58789635", "0.5829467", "0.5783524", "0.5724496", "0.57088166", "0.56926435", "0.56523687", "0.5629067", "0.562703", "0.56179756", "0.5610695", "0.55907154", "0.5554059", "0.55388844", "0.5535817", "0.55343...
0.7201221
0
Returns true if the item lhsi is logically less than rhsi
func TupleElemLt(lhsi interface{}, rhsi interface{}) bool { lhsv, rhsv := reflect.ValueOf(lhsi), reflect.ValueOf(rhsi) if lhsv.IsValid() && !rhsv.IsValid() { // zero value is considered least return false } switch lhsi.(type) { case nil: if rhsv.IsValid() { return true } case string: if lhsi.(string) < rhsi.(string) { return true } case int, int8, int16, int32, int64: if lhsv.Int() < rhsv.Int() { return true } case uint, uintptr, uint8, uint16, uint32, uint64: if lhsv.Uint() < rhsv.Uint() { return true } case float32, float64: if lhsv.Float() < rhsv.Float() { return true } case *Tuple: if lhsi.(*Tuple).Lt(rhsi.(*Tuple)) { return true } default: // TODO: allow user-defined callback for unsupported types panic(fmt.Sprintf("unsupported type %#v for Lt in Tuple", lhsi)) } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (z *Int) Slt(x *Int) bool {\n\n\tzSign := z.Sign()\n\txSign := x.Sign()\n\n\tswitch {\n\tcase zSign >= 0 && xSign < 0:\n\t\treturn false\n\tcase zSign < 0 && xSign >= 0:\n\t\treturn true\n\tdefault:\n\t\treturn z.Lt(x)\n\t}\n}", "func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error) {\n\thalfOrder, ok :...
[ "0.5621557", "0.5612528", "0.5612528", "0.55929005", "0.5556854", "0.54670167", "0.54621255", "0.54328775", "0.54264414", "0.53702646", "0.53523916", "0.52703273", "0.5261488", "0.5219022", "0.51695013", "0.5155582", "0.51494825", "0.51494825", "0.51494825", "0.5135328", "0.5...
0.5042559
31
Returns True if this Tuple is elementwise less than other
func (this *Tuple) Lt(other *Tuple) bool { tlen, olen := this.Len(), other.Len() var n int if tlen < olen { n = tlen } else { n = olen } for i := 0; i < n; i++ { lhsi, rhsi := this.Get(i), other.Get(i) if TupleElemLt(lhsi, rhsi) { return true } else if !TupleElemEq(lhsi, rhsi) { return false } } // if we get here then they matched up to n if tlen < olen { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *Pair) Less (b *Pair) bool {\n return a.x < b.x\n}", "func TupleElemLt(lhsi interface{}, rhsi interface{}) bool {\n\tlhsv, rhsv := reflect.ValueOf(lhsi), reflect.ValueOf(rhsi)\n\tif lhsv.IsValid() && !rhsv.IsValid() {\n\t\t// zero value is considered least\n\t\treturn false\n\t}\n\tswitch lhsi.(type) {\...
[ "0.7582022", "0.7109866", "0.6894591", "0.6656535", "0.6587677", "0.65269125", "0.6474057", "0.6442686", "0.6441735", "0.6368265", "0.6335162", "0.63168746", "0.6275633", "0.6260398", "0.6260398", "0.6260398", "0.62527585", "0.62508184", "0.62507343", "0.62478435", "0.6191537...
0.6120704
27
Returns True if this Tuple is elementwise less than or equal to other
func (this *Tuple) Le(other *Tuple) bool { return this.Lt(other) || this.Eq(other) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *Pair) Less (b *Pair) bool {\n return a.x < b.x\n}", "func TupleElemLt(lhsi interface{}, rhsi interface{}) bool {\n\tlhsv, rhsv := reflect.ValueOf(lhsi), reflect.ValueOf(rhsi)\n\tif lhsv.IsValid() && !rhsv.IsValid() {\n\t\t// zero value is considered least\n\t\treturn false\n\t}\n\tswitch lhsi.(type) {\...
[ "0.7385708", "0.6908471", "0.6578247", "0.64186805", "0.64105165", "0.63843644", "0.63113457", "0.63012135", "0.6258522", "0.6246853", "0.62063974", "0.6198956", "0.61527395", "0.61383474", "0.6114954", "0.6096506", "0.6092556", "0.6092556", "0.6092556", "0.6070504", "0.60629...
0.67197317
2
Returns True if this Tuple is elementwise greater than other
func (this *Tuple) Gt(other *Tuple) bool { return !this.Le(other) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a Vec2) AnyGreater(b Vec2) bool {\n\treturn a.X > b.X || a.Y > b.Y\n}", "func (a Vec2) Greater(b Vec2) bool {\n\treturn a.X > b.X && a.Y > b.Y\n}", "func (n *Node) isGreaterThan(other *Node) bool {\n\treturn n.val.IsGreaterThan(other.val)\n}", "func (this *Tuple) Ge(other *Tuple) bool {\n\treturn !this...
[ "0.69344044", "0.68843794", "0.6558815", "0.6527433", "0.6401499", "0.63991106", "0.63838917", "0.6331737", "0.62254304", "0.6183774", "0.61705154", "0.6000766", "0.59986115", "0.5961094", "0.5937788", "0.5928268", "0.5914721", "0.58384776", "0.58122534", "0.5744468", "0.5716...
0.5762057
19
Returns True if this Tuple is elementwise greater than or equal to other
func (this *Tuple) Ge(other *Tuple) bool { return !this.Lt(other) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a Vec2) AnyGreater(b Vec2) bool {\n\treturn a.X > b.X || a.Y > b.Y\n}", "func (a Vec2) Greater(b Vec2) bool {\n\treturn a.X > b.X && a.Y > b.Y\n}", "func (a *Pair) Less (b *Pair) bool {\n return a.x < b.x\n}", "func (n *Node) isGreaterThan(other *Node) bool {\n\treturn n.val.IsGreaterThan(other.val)\n...
[ "0.67103213", "0.6682943", "0.6405361", "0.6349489", "0.6347604", "0.6269906", "0.6263092", "0.6047359", "0.6021726", "0.6013786", "0.59681875", "0.5929761", "0.58839434", "0.5878891", "0.5847747", "0.5798595", "0.57832897", "0.5777936", "0.5768222", "0.57614046", "0.57372475...
0.6474378
2
Returns the position of item in the tuple. The search starts from position start. Returns 1 if item is not found
func (this *Tuple) Index(item interface{}, start int) int { for i := start; i < this.Len(); i++ { if TupleElemEq(this.Get(i), item) { return i } } return -1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getIndItem (items [] string, finder string) int {\n\tfor i := 0; i < len(items); i++ {\n\t\tif items[i] == finder {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}", "func findPosition(value int, data []int) int {\n\tif len(data) == 0 {\n\t\treturn -1\n\t}\n\tfor index := 0; index < len(data); index++ {\n\t\tif...
[ "0.6777817", "0.6646685", "0.6631839", "0.6475447", "0.63192135", "0.62363327", "0.6098243", "0.6074247", "0.6062774", "0.6061379", "0.60531753", "0.60531753", "0.60531753", "0.60531753", "0.60531753", "0.60161793", "0.6008917", "0.6006638", "0.5988918", "0.5973541", "0.59564...
0.74833435
0
Returns the number of occurrences of item in the tuple, given starting position start.
func (this *Tuple) Count(item interface{}, start int) int { ctr := 0 for i := start; i < this.Len(); i++ { if TupleElemEq(this.Get(i), item) { ctr += 1 } } return ctr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func countingValleys(n int32, s string) int32 {\n\tstartAr := []int32{0}\n\tvar start int32\n\tvar valleyPoint int32 = 1\n\tfor _, elem := range s {\n\t\tchar := string(elem)\n\t\tcheckInt := true\n\t\tcheckInt = math.Signbit(float64(start))\n\t\tif char == \"D\" {\n\t\t\tstart = start - 1\n\t\t} else {\n\t\t\tsta...
[ "0.5463875", "0.5387405", "0.5212348", "0.5128807", "0.50549966", "0.49670365", "0.4928032", "0.4916265", "0.48942822", "0.4891153", "0.47932094", "0.47927457", "0.47873327", "0.47757578", "0.47515303", "0.47440237", "0.47414726", "0.47373933", "0.47335076", "0.4721766", "0.4...
0.7639275
0
Inserts data from other table into this, starting at offset start
func (this *Tuple) Insert(start int, other *Tuple) { this.InsertItems(start, other.data...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func insertIntoTable(ctx context.Context, sd StationData) error {\n\t// Get the current application ID, which is the same as the project ID.\n\t//projectID := appengine.AppID(ctx)\n\t//fmt.Println(projectID)\n\n\t// Create the BigQuery service.\n\tbq, err := bigquery.NewClient(ctx, \"pdxbike\")\n\tif err != nil {\...
[ "0.5563809", "0.55390996", "0.5367466", "0.52960044", "0.52340716", "0.5105631", "0.5099199", "0.50528187", "0.50201684", "0.49987578", "0.4963444", "0.49634376", "0.49370745", "0.49369252", "0.4891936", "0.4813999", "0.48111808", "0.47809646", "0.4778556", "0.47260755", "0.4...
0.57182276
0
Inserts items into this tuple, starting from offset start
func (this *Tuple) InsertItems(start int, items ...interface{}) { start = this.Offset(start) rhs := this.Copy().data[start:] this.data = append(this.data[:start], items...) this.data = append(this.data, rhs...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *Tuple) Insert(start int, other *Tuple) {\n\tthis.InsertItems(start, other.data...)\n}", "func (s *items) insertAt(index int, item Item) {\n\t*s = append(*s, nil)\n\tif index < len(*s) {\n\t\tcopy((*s)[index+1:], (*s)[index:])\n\t}\n\t(*s)[index] = item\n}", "func insertIntoPosition(data []string, i...
[ "0.7017136", "0.58420914", "0.5738992", "0.5642923", "0.56324965", "0.5616734", "0.5611215", "0.55662197", "0.55369467", "0.54622537", "0.5455527", "0.54492414", "0.54408133", "0.54373574", "0.54122126", "0.5382448", "0.5360022", "0.53573275", "0.5343377", "0.53135765", "0.53...
0.80089074
0
Appends all elements from other tuple to this
func (this *Tuple) Append(other *Tuple) { this.AppendItems(other.data...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *Tuple) AppendItems(items ...interface{}) {\n\tthis.data = append(this.data, items...)\n}", "func Add(t, other Tuplelike) Tuplelike {\n\tresult := []float64{}\n\n\tfor idx, value := range t.Values() {\n\t\tresult = append(result, value+other.At(idx))\n\t}\n\n\treturn Tuple(result)\n}", "func (b *App...
[ "0.63661397", "0.58355916", "0.56410396", "0.54085696", "0.5406405", "0.53868324", "0.53644", "0.53264797", "0.53212005", "0.53112465", "0.5262726", "0.52600545", "0.52031255", "0.5199285", "0.5136459", "0.51320195", "0.51014876", "0.5095561", "0.50813615", "0.5061924", "0.50...
0.74295527
0
Appends one or more items to end of data
func (this *Tuple) AppendItems(items ...interface{}) { this.data = append(this.data, items...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Repository) append(slice []models.Command, items ...models.Command) []models.Command {\n\tfor _, item := range items {\n\t\tslice = r.extend(slice, item)\n\t}\n\treturn slice\n}", "func (arr *ArrayList) Append(item ItemType) {\n if arr.length == arr.capacity {\n arr.resize(arr.capacity * 2)\n }\n ...
[ "0.63881624", "0.6340976", "0.60832125", "0.6061933", "0.60277545", "0.6017608", "0.60159856", "0.59959954", "0.5993144", "0.5986288", "0.59482485", "0.5875957", "0.5873964", "0.5836725", "0.5813423", "0.58130157", "0.57939684", "0.5792593", "0.578395", "0.57786715", "0.57769...
0.6661583
0
LoadConfig loads the configuration stored in `~/.mktmpio.yml`, returning it as a Config type instance.
func LoadConfig() *Config { config := Config{} defConf := DefaultConfig() file := FileConfig(ConfigPath()) env := EnvConfig() return config.Apply(defConf).Apply(file).Apply(env) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func LoadConfig(confPath string) (Config, error){\n var conf Config\n _, err := toml.DecodeFile(confPath, &conf)\n return conf, err\n}", "func LoadConfig(path string) error {\n\t// Lock mutex\n\tConfig.rw.Lock()\n\tdefer Config.rw.Unlock()\n\n\t// Decode the given file to the given interface\n\tif _, er...
[ "0.7161106", "0.715963", "0.7044221", "0.69785136", "0.69676", "0.69121885", "0.6904957", "0.68580604", "0.6838161", "0.68353057", "0.68080896", "0.677335", "0.6762483", "0.6710661", "0.66872114", "0.6685924", "0.66724914", "0.66655004", "0.6646761", "0.6641647", "0.6617407",...
0.0
-1
DefaultConfig returns a configuration with only the default values set
func DefaultConfig() *Config { config := new(Config) config.URL = MktmpioURL return config }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func defaultConfig() *config {\n\treturn &config{}\n}", "func Default() *Config {\n\treturn &defaultConfig\n}", "func defaultConfig() interface{} {\n\treturn &config{\n\t\tPools: make(pools),\n\t\tConfDirPath: \"/etc/cmk\",\n\t}\n}", "func defaultConfig() *config {\n\treturn &config{\n\t\tOperations: o...
[ "0.8259287", "0.8180411", "0.80875975", "0.8046045", "0.80177665", "0.7989454", "0.79624265", "0.7947094", "0.7923509", "0.79218996", "0.79001623", "0.7893205", "0.78920007", "0.7891704", "0.7888512", "0.7865028", "0.7835923", "0.7829766", "0.7825769", "0.78229904", "0.782248...
0.7605427
46
EnvConfig returns a configuration with only values provided by environment variables
func EnvConfig() *Config { config := new(Config) config.Token = os.Getenv("MKTMPIO_TOKEN") config.URL = os.Getenv("MKTMPIO_URL") return config }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func envConfig(c *cli.Context) error {\n\tvar err error\n\n\terr = setEnvOptStr(\"DOCKER_HOST\", c.GlobalString(\"host\"))\n\terr = setEnvOptBool(\"DOCKER_TLS_VERIFY\", c.GlobalBool(\"tlsverify\"))\n\terr = setEnvOptStr(\"DOCKER_API_VERSION\", DockerAPIMinVersion)\n\n\treturn err\n}", "func (g *Generator) Config...
[ "0.69667965", "0.68781495", "0.6656939", "0.6593634", "0.6542232", "0.6524963", "0.6486533", "0.64751476", "0.64419335", "0.63989925", "0.63914573", "0.63172793", "0.6315013", "0.6282576", "0.6251936", "0.62236834", "0.61967146", "0.6178627", "0.61679006", "0.6166197", "0.614...
0.6331278
11
FileConfig returns a configuration with any values provided by the given YAML config file
func FileConfig(cfgPath string) *Config { config := new(Config) cfgFile, err := ioutil.ReadFile(cfgPath) if err != nil { config.err = err } else { config.err = yaml.Unmarshal(cfgFile, config) } return config }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func LoadFileConfig(file string) (*Configuration, error) {\n\tlog.Printf(\"[DEBUG] Load configuration file: %s\", file)\n\tconfiguration := New()\n\tif _, err := toml.DecodeFile(file, configuration); err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Printf(\"[DEBUG] Configuration : %#v\", configuration)\n\tif configur...
[ "0.6919763", "0.6766569", "0.6732922", "0.6692703", "0.66245663", "0.6600291", "0.6581049", "0.6539759", "0.6483543", "0.6477833", "0.6439898", "0.64042306", "0.6398328", "0.63772", "0.63758934", "0.63520354", "0.633113", "0.6304878", "0.6298197", "0.62972575", "0.62972575", ...
0.77319026
0
Apply creates a new Config with nonempty values from the provided Config overriding the options of the base Config
func (c *Config) Apply(b *Config) *Config { newCfg := new(Config) if b.Token == "" { newCfg.Token = c.Token } else { newCfg.Token = b.Token } if b.URL == "" { newCfg.URL = c.URL } else { newCfg.URL = b.URL } return newCfg }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Config) Apply(cfg *Config) {\n\tif cfg == nil {\n\t\treturn\n\t}\n\n\tc.JrnlCtrlConfig.Apply(&cfg.JrnlCtrlConfig)\n\tc.PipesConfig.Apply(&cfg.PipesConfig)\n\n\tif cfg.BaseDir != \"\" {\n\t\tc.BaseDir = cfg.BaseDir\n\t}\n\tif cfg.HostHostId > 0 {\n\t\tc.HostHostId = cfg.HostHostId\n\t}\n\tif !reflect.DeepE...
[ "0.73127514", "0.67873657", "0.64981467", "0.649096", "0.6404134", "0.63580257", "0.6339305", "0.6257569", "0.6216042", "0.61683244", "0.6146557", "0.60011595", "0.5992788", "0.5992379", "0.59857476", "0.59723055", "0.5962117", "0.5898599", "0.58887976", "0.58766055", "0.5845...
0.7006665
1
ConfigPath returns the path to the user config file
func ConfigPath() string { if path, err := homedir.Expand(MKtmpioCfgFile); err == nil { return path } return "" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getConfigFilePath() string {\n\t// get current system user\n\tu, err := user.Current()\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\treturn path.Join(u.HomeDir, configFileName)\n}", "func UserConfigDir() (string, error)", "func configPath() (string, error) {\n\thome, err := sys.GetHomeDir()\n\tif err != n...
[ "0.78871745", "0.7830641", "0.76966554", "0.76597065", "0.7624136", "0.76101524", "0.75013083", "0.74757475", "0.7412091", "0.7372235", "0.7363509", "0.736189", "0.73549765", "0.73051214", "0.7268334", "0.7248684", "0.7237965", "0.72199416", "0.71782047", "0.7148685", "0.7067...
0.75068724
6
Save stores the given configuration in ~/.mktmpio.yml, overwriting the current contents if the file exists.
func (c *Config) Save(cfgPath string) error { cfgFile, err := yaml.Marshal(c) if err == nil { err = ioutil.WriteFile(cfgPath, cfgFile, 0600) } return err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c Configuration) Save() {\n\tbuf := new(bytes.Buffer)\n\tif err := toml.NewEncoder(buf).Encode(c); err != nil {\n\t\tlog.Fatalln(\"Failed to encode config\", err)\n\t}\n\tf, err := os.Create(configFile)\n\tif err != nil {\n\t\tlog.Fatalln(\"Failed to create file\", err)\n\t\treturn\n\t}\n\n\tw := bufio.NewWr...
[ "0.7148331", "0.68365914", "0.6825895", "0.6782348", "0.67542696", "0.66742766", "0.666755", "0.6634886", "0.6595215", "0.6586071", "0.6563475", "0.65591264", "0.6541441", "0.6478207", "0.64683884", "0.6382868", "0.6358131", "0.6343579", "0.6322763", "0.63109756", "0.6294303"...
0.6554888
12
getAlbums responds with the list of all albums as JSON.
func getCourses(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "List": "List of all courses!", }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getAlbums(c *gin.Context) {\n\tc.IndentedJSON(http.StatusOK, albums)\n}", "func (c Album) GetAlbums() revel.Result {\n\tre := albumService.GetAlbums(c.GetUserId())\n\treturn c.RenderJSON(re)\n}", "func getAlbums(c *gin.Context) {\n\n\tvar albums []album.Album\n\n\tdbClient.Select(&albums, \"SELECT id, tit...
[ "0.85289204", "0.83897734", "0.8245549", "0.8198997", "0.81667846", "0.7953926", "0.7672748", "0.7402946", "0.7328272", "0.7280202", "0.7192736", "0.71719384", "0.69887376", "0.6941905", "0.6801857", "0.6407454", "0.6396264", "0.6330194", "0.62474614", "0.62474173", "0.620282...
0.0
-1
AddInterfaceAPIRoutes adds Interface routes
func (s *RestServer) AddInterfaceAPIRoutes(r *mux.Router) { r.Methods("GET").Subrouter().HandleFunc("/", httputils.MakeHTTPHandler(s.listInterfaceHandler)) r.Methods("GET").Subrouter().HandleFunc("/{ObjectMeta.Tenant}/{ObjectMeta.Namespace}/{ObjectMeta.Name}", httputils.MakeHTTPHandler(s.getInterfaceHandler)) r.Methods("POST").Subrouter().HandleFunc("/", httputils.MakeHTTPHandler(s.postInterfaceHandler)) r.Methods("DELETE").Subrouter().HandleFunc("/{ObjectMeta.Tenant}/{ObjectMeta.Namespace}/{ObjectMeta.Name}", httputils.MakeHTTPHandler(s.deleteInterfaceHandler)) r.Methods("PUT").Subrouter().HandleFunc("/{ObjectMeta.Tenant}/{ObjectMeta.Namespace}/{ObjectMeta.Name}", httputils.MakeHTTPHandler(s.putInterfaceHandler)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (Interface) ApiRoutes() []string {\n\treturn []string{\n\t\t\"/api/objects/interface/bridge/\",\n\t\t\"/api/objects/interface/bridge/{ref}\",\n\t\t\"/api/objects/interface/bridge/{ref}/usedby\",\n\t\t\"/api/objects/interface/ethernet/\",\n\t\t\"/api/objects/interface/ethernet/{ref}\",\n\t\t\"/api/objects/inte...
[ "0.7264951", "0.6624757", "0.6317219", "0.6261901", "0.6214964", "0.6207461", "0.6187202", "0.6167769", "0.6119995", "0.609236", "0.60369056", "0.6035869", "0.5980018", "0.5899392", "0.5896274", "0.58896464", "0.5813988", "0.58109516", "0.57868725", "0.57825184", "0.5767284",...
0.8854116
0
FindGit returns the path to the Git binary found in the corresponding CIPD package. Calling this function from any Go package will automatically establish a Bazel dependency on the corresponding CIPD package, which Bazel will download as needed.
func FindGit() (string, error) { if !bazel.InBazelTest() { return exec.LookPath("git") } if runtime.GOOS == "windows" { return filepath.Join(bazel.RunfilesDir(), "external", "git_amd64_windows", "bin", "git.exe"), nil } else if runtime.GOOS == "linux" { return filepath.Join(bazel.RunfilesDir(), "external", "git_amd64_linux", "bin", "git"), nil } return "", skerr.Fmt("unsupported runtime.GOOS: %q", runtime.GOOS) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func FindGit(ctx context.Context) (string, int, int, error) {\n\tmtx.Lock()\n\tdefer mtx.Unlock()\n\tif git == \"\" {\n\t\tgitPath, err := osexec.LookPath(\"git\")\n\t\tif err != nil {\n\t\t\treturn \"\", 0, 0, skerr.Wrapf(err, \"Failed to find git\")\n\t\t}\n\t\tmaj, min, err := Version(ctx, gitPath)\n\t\tif err ...
[ "0.71428835", "0.5951756", "0.5907509", "0.5815976", "0.57849896", "0.55697924", "0.5395625", "0.5387797", "0.5077059", "0.5065078", "0.50566435", "0.50306296", "0.5012529", "0.500437", "0.49829805", "0.49811447", "0.498114", "0.495789", "0.49487612", "0.49331194", "0.4930485...
0.7978072
0
Perform various management operations on Submarine Pod and Submarine clusters to approximate the desired state
func (c *Controller) clusterAction(admin submarine.AdminInterface, cluster *rapi.SubmarineCluster, infos *submarine.ClusterInfos) (bool, error) { glog.Info("clusterAction()") var err error /* run sanity check if needed needSanity, err := sanitycheck.RunSanityChecks(admin, &c.config.submarine, c.podControl, cluster, infos, true) if err != nil { glog.Errorf("[clusterAction] cluster %s/%s, an error occurs during sanitycheck: %v ", cluster.Namespace, cluster.Name, err) return false, err } if needSanity { glog.V(3).Infof("[clusterAction] run sanitycheck cluster: %s/%s", cluster.Namespace, cluster.Name) return sanitycheck.RunSanityChecks(admin, &c.config.submarine, c.podControl, cluster, infos, false) }*/ // Start more pods in needed if needMorePods(cluster) { if setScalingCondition(&cluster.Status, true) { if cluster, err = c.updateHandler(cluster); err != nil { return false, err } } pod, err2 := c.podControl.CreatePod(cluster) if err2 != nil { glog.Errorf("[clusterAction] unable to create a pod associated to the SubmarineCluster: %s/%s, err: %v", cluster.Namespace, cluster.Name, err2) return false, err2 } glog.V(3).Infof("[clusterAction]create a Pod %s/%s", pod.Namespace, pod.Name) return true, nil } if setScalingCondition(&cluster.Status, false) { if cluster, err = c.updateHandler(cluster); err != nil { return false, err } } // Reconfigure the Cluster if needed hasChanged, err := c.applyConfiguration(admin, cluster) if err != nil { glog.Errorf("[clusterAction] cluster %s/%s, an error occurs: %v ", cluster.Namespace, cluster.Name, err) return false, err } if hasChanged { glog.V(6).Infof("[clusterAction] cluster has changed cluster: %s/%s", cluster.Namespace, cluster.Name) return true, nil } glog.Infof("[clusterAction] cluster hasn't changed cluster: %s/%s", cluster.Namespace, cluster.Name) return false, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d *DBGenerator) setSubclusterDetail(ctx context.Context) error {\n\tq := Queries[SubclusterQueryKey]\n\trows, err := d.Conn.QueryContext(ctx, q)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed running '%s': %w\", q, err)\n\t}\n\tdefer rows.Close()\n\n\t// Map to have fast lookup of subcluster name to inde...
[ "0.6054842", "0.593886", "0.5845953", "0.581711", "0.5627319", "0.5349552", "0.526581", "0.5252384", "0.52262604", "0.5159638", "0.5146171", "0.513784", "0.51282734", "0.5118211", "0.5116108", "0.5110766", "0.509067", "0.5069988", "0.5057845", "0.50446874", "0.5032809", "0....
0.5302026
6
applyConfiguration apply new configuration if needed: add or delete pods configure the submarineserver process
func (c *Controller) applyConfiguration(admin submarine.AdminInterface, cluster *rapi.SubmarineCluster) (bool, error) { glog.Info("applyConfiguration START") defer glog.Info("applyConfiguration STOP") asChanged := false // expected replication factor and number of master nodes cReplicaFactor := *cluster.Spec.ReplicationFactor cNbMaster := *cluster.Spec.NumberOfMaster // Adapt, convert CR to structure in submarine package rCluster, nodes, err := newSubmarineCluster(admin, cluster) if err != nil { glog.Errorf("Unable to create the SubmarineCluster view, error:%v", err) return false, err } // PodTemplate changes require rolling updates if needRollingUpdate(cluster) { if setRollingUpdateCondition(&cluster.Status, true) { if cluster, err = c.updateHandler(cluster); err != nil { return false, err } } glog.Info("applyConfiguration needRollingUpdate") return c.manageRollingUpdate(admin, cluster, rCluster, nodes) } if setRollingUpdateCondition(&cluster.Status, false) { if cluster, err = c.updateHandler(cluster); err != nil { return false, err } } // if the number of Pods is greater than expected if needLessPods(cluster) { if setRebalancingCondition(&cluster.Status, true) { if cluster, err = c.updateHandler(cluster); err != nil { return false, err } } glog.Info("applyConfiguration needLessPods") // Configure Submarine cluster return c.managePodScaleDown(admin, cluster, rCluster, nodes) } // If it is not a rolling update, modify the Condition if setRebalancingCondition(&cluster.Status, false) { if cluster, err = c.updateHandler(cluster); err != nil { return false, err } } clusterStatus := &cluster.Status.Cluster if (clusterStatus.NbPods - clusterStatus.NbSubmarineRunning) != 0 { glog.V(3).Infof("All pods not ready wait to be ready, nbPods: %d, nbPodsReady: %d", clusterStatus.NbPods, clusterStatus.NbSubmarineRunning) return false, err } // First, we define the new masters // Select the desired number of Masters and assign Hashslots to each Master. The Master will be distributed to different K8S nodes as much as possible // Set the cluster status to Calculating Rebalancing newMasters, curMasters, allMaster, err := clustering.DispatchMasters(rCluster, nodes, cNbMaster, admin) if err != nil { glog.Errorf("Cannot dispatch slots to masters: %v", err) rCluster.Status = rapi.ClusterStatusError return false, err } // If the number of new and old masters is not the same if len(newMasters) != len(curMasters) { asChanged = true } // Second select Node that is already a slave currentSlaveNodes := nodes.FilterByFunc(submarine.IsSlave) //New slaves are slaves which is currently a master with no slots newSlave := nodes.FilterByFunc(func(nodeA *submarine.Node) bool { for _, nodeB := range newMasters { if nodeA.ID == nodeB.ID { return false } } for _, nodeB := range currentSlaveNodes { if nodeA.ID == nodeB.ID { return false } } return true }) // Depending on whether we scale up or down, we will dispatch slaves before/after the dispatch of slots if cNbMaster < int32(len(curMasters)) { // this happens usually after a scale down of the cluster // we should dispatch slots before dispatching slaves if err := clustering.DispatchSlotToNewMasters(rCluster, admin, newMasters, curMasters, allMaster); err != nil { glog.Error("Unable to dispatch slot on new master, err:", err) return false, err } // assign master/slave roles newSubmarineSlavesByMaster, bestEffort := clustering.PlaceSlaves(rCluster, newMasters, currentSlaveNodes, newSlave, cReplicaFactor) if bestEffort { rCluster.NodesPlacement = rapi.NodesPlacementInfoBestEffort } if err := clustering.AttachingSlavesToMaster(rCluster, admin, newSubmarineSlavesByMaster); err != nil { glog.Error("Unable to dispatch slave on new master, err:", err) return false, err } } else { // We are scaling up the nbmaster or the nbmaster doesn't change. // assign master/slave roles newSubmarineSlavesByMaster, bestEffort := clustering.PlaceSlaves(rCluster, newMasters, currentSlaveNodes, newSlave, cReplicaFactor) if bestEffort { rCluster.NodesPlacement = rapi.NodesPlacementInfoBestEffort } if err := clustering.AttachingSlavesToMaster(rCluster, admin, newSubmarineSlavesByMaster); err != nil { glog.Error("Unable to dispatch slave on new master, err:", err) return false, err } if err := clustering.DispatchSlotToNewMasters(rCluster, admin, newMasters, curMasters, allMaster); err != nil { glog.Error("Unable to dispatch slot on new master, err:", err) return false, err } } glog.V(4).Infof("new nodes status: \n %v", nodes) // Set the cluster status rCluster.Status = rapi.ClusterStatusOK // wait a bit for the cluster to propagate configuration to reduce warning logs because of temporary inconsistency time.Sleep(1 * time.Second) return asChanged, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (service *retrierMockService) ApplyConfiguration(_ interface{}) error {\n\tservice.applyConfCount++\n\treturn nil\n}", "func (c *Controller) deployConfiguration(config *dynamic.Configuration) error {\n\tsel := labels.Everything()\n\n\tr, err := labels.NewRequirement(\"component\", selection.Equals, []string...
[ "0.61599785", "0.59701127", "0.5963785", "0.5922146", "0.58306885", "0.5824726", "0.5786718", "0.57252824", "0.5631203", "0.5620179", "0.5617887", "0.56011736", "0.55913275", "0.5550719", "0.55310565", "0.55141616", "0.550688", "0.54669976", "0.54614884", "0.54555297", "0.542...
0.71195805
0
manageRollingUpdate used to manage properly a cluster rolling update if the podtemplate spec has changed
func (c *Controller) manageRollingUpdate(admin submarine.AdminInterface, cluster *rapi.SubmarineCluster, rCluster *submarine.Cluster, nodes submarine.Nodes) (bool, error) { return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (view *ViewPodDemo) DemoRollingUpdate() {\n\n\tpod := view.randomPod()\n\tlog.Printf(\"Random pod: %v\", pod)\n\n\tnpart := strings.Split(pod.Name, \"-\")\n\tnewPrefix := fmt.Sprintf(\"%v-%x\", npart[0], rand.Intn(1<<16))\n\n\tseq := 0\n\tfor {\n\t\tnn := fmt.Sprintf(\"%v-%v-%x\", npart[0], npart[1], seq)\n\t...
[ "0.65832686", "0.6538461", "0.64754593", "0.6443429", "0.6329279", "0.63052166", "0.61619335", "0.60634065", "0.59615046", "0.57940674", "0.5787343", "0.57812905", "0.577772", "0.5728809", "0.57158923", "0.56981456", "0.56562114", "0.5646921", "0.5629366", "0.5581582", "0.557...
0.7503964
0
managePodScaleDown used to manage properly the scale down of a cluster
func (c *Controller) managePodScaleDown(admin submarine.AdminInterface, cluster *rapi.SubmarineCluster, rCluster *submarine.Cluster, nodes submarine.Nodes) (bool, error) { return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Controller) processClusterScaleDown(ecs *ecsv1.KubernetesCluster) error {\n\t// diff work nodes\n\tvar oldSpec ecsv1.KubernetesClusterSpec\n\toldSpecStr := ecs.Annotations[enum.Spec]\n\terr := json.Unmarshal([]byte(oldSpecStr), &oldSpec)\n\tif err != nil {\n\t\tglog.Errorf(\"get old spec failed with:%v\",...
[ "0.7220987", "0.6654861", "0.64811045", "0.64686966", "0.61882216", "0.6067729", "0.6003641", "0.5984935", "0.5909963", "0.5801375", "0.5781897", "0.5721228", "0.56992275", "0.568317", "0.5678845", "0.5672439", "0.564906", "0.56047493", "0.5596159", "0.55896974", "0.557707", ...
0.84669495
0
Lock is a noop used by copylocks checker from `go vet`.
func (*noCopy) Lock() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*NoCopy) Lock() {}", "func (p Pin) Lock() {\n\tp.Port().Lock(Pin0 << p.index())\n}", "func (tl Noop) Lock(_ types.JobID, _ time.Duration, targets []*target.Target) error {\n\tlog.Infof(\"Locked %d targets by doing nothing\", len(targets))\n\treturn nil\n}", "func (p *PreemptiveLocker) Lock(ctx context....
[ "0.80031097", "0.7108842", "0.7057957", "0.7014114", "0.68878496", "0.6848324", "0.684109", "0.68210536", "0.6815423", "0.6760319", "0.6752995", "0.6706289", "0.6677526", "0.6667062", "0.66536474", "0.66485286", "0.6593813", "0.6591521", "0.65862215", "0.65466106", "0.6540568...
0.78249574
1
NewAdapter returns a new Adapter that can be used to orchestrate and obtain information from Amazon Web Services. Before returning there is a discovery process for VPC and EC2 details. It tries to find the Auto Scaling Group and Security Group that should be used for newly created Load Balancers. If any of those critical steps fail an appropriate error is returned.
func NewAdapter() (adapter *Adapter, err error) { p := configProvider() adapter = &Adapter{ ec2: ec2.New(p), ec2metadata: ec2metadata.New(p), autoscaling: autoscaling.New(p), acm: acm.New(p), iam: iam.New(p), cloudformation: cloudformation.New(p), healthCheckPath: DefaultHealthCheckPath, healthCheckPort: DefaultHealthCheckPort, healthCheckInterval: DefaultHealthCheckInterval, creationTimeout: DefaultCreationTimeout, stackTTL: DefaultStackTTL, } adapter.manifest, err = buildManifest(adapter) if err != nil { return nil, err } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewAdapter(g *gce.Cloud) NetworkEndpointGroupCloud {\n\treturn &cloudProviderAdapter{\n\t\tc: g,\n\t\tnetworkURL: g.NetworkURL(),\n\t\tsubnetworkURL: g.SubnetworkURL(),\n\t}\n}", "func NewAdapter() Adapter {\n\treturn createAdapter()\n}", "func NewAdapter() Adapter {\n\treturn createAdapter...
[ "0.62870306", "0.60330063", "0.60330063", "0.60330063", "0.60330063", "0.60330063", "0.5953721", "0.5809309", "0.56710106", "0.5604929", "0.55235195", "0.5386451", "0.53338236", "0.5292613", "0.5190306", "0.51769847", "0.5173544", "0.5151814", "0.51018894", "0.509229", "0.508...
0.71556956
0
WithHealthCheckPath returns the receiver adapter after changing the health check path that will be used by the resources created by the adapter.
func (a *Adapter) WithHealthCheckPath(path string) *Adapter { a.healthCheckPath = path return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithHealthPath(path string) Option {\n\treturn func(o Options) {\n\t\to[optionWithHealthPath] = path\n\t}\n}", "func (a *Adapter) WithHealthCheckInterval(interval time.Duration) *Adapter {\n\ta.healthCheckInterval = interval\n\treturn a\n}", "func (a *Adapter) WithHealthCheckPort(port uint) *Adapter {\n\t...
[ "0.56311184", "0.54221565", "0.53355366", "0.5065387", "0.5011958", "0.5011295", "0.49516243", "0.49430206", "0.47376975", "0.4716614", "0.4532915", "0.4531635", "0.4468667", "0.4417027", "0.4402186", "0.44014338", "0.4387692", "0.43710768", "0.43495873", "0.43489194", "0.431...
0.7927095
0
WithHealthCheckPort returns the receiver adapter after changing the health check port that will be used by the resources created by the adapter
func (a *Adapter) WithHealthCheckPort(port uint) *Adapter { a.healthCheckPort = port return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func HealthPort(port uint) Option {\n\treturn optionFunc(func(r *runtime) {\n\t\tr.hPort = port\n\t})\n}", "func (o SSLHealthCheckResponseOutput) Port() pulumi.IntOutput {\n\treturn o.ApplyT(func(v SSLHealthCheckResponse) int { return v.Port }).(pulumi.IntOutput)\n}", "func (o HTTPHealthCheckResponseOutput) Po...
[ "0.5946382", "0.5838031", "0.57817173", "0.5774734", "0.5774415", "0.574717", "0.5694374", "0.5687079", "0.56020105", "0.55426747", "0.54782814", "0.5443749", "0.54404604", "0.54351515", "0.5432953", "0.54073334", "0.5406503", "0.5379687", "0.5363278", "0.53539973", "0.533657...
0.70723397
0
WithHealthCheckInterval returns the receiver adapter after changing the health check interval that will be used by the resources created by the adapter
func (a *Adapter) WithHealthCheckInterval(interval time.Duration) *Adapter { a.healthCheckInterval = interval return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *monitor) withProbeInterval(probeInterval time.Duration) *monitor {\n\tm.probeInterval = probeInterval\n\treturn m\n}", "func (o ServerGroupHealthCheckOutput) HealthCheckInterval() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v ServerGroupHealthCheck) *int { return v.HealthCheckInterval }).(pulumi.IntPt...
[ "0.53278637", "0.53035617", "0.5293944", "0.52465594", "0.50903225", "0.507159", "0.50312275", "0.5020901", "0.50069153", "0.49919906", "0.49600998", "0.49336693", "0.49049205", "0.4866939", "0.4840432", "0.46657336", "0.46649086", "0.46649086", "0.46628025", "0.46599445", "0...
0.73375005
0
WithCreationTimeout returns the receiver adapter after changing the creation timeout that is used as the max wait time for the creation of all the required AWS resources for a given Ingress
func (a *Adapter) WithCreationTimeout(interval time.Duration) *Adapter { a.creationTimeout = interval return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithTimeout(t time.Duration) apiOption {\n\treturn func(m *Management) {\n\t\tm.timeout = t\n\t}\n}", "func createFromResources(dp *v1alpha1.EdgeDataplane, da *v1alpha1.EdgeTraceabilityAgent) (*APIGatewayConfiguration, error) {\n\n\tcfg := &APIGatewayConfiguration{\n\t\tHost: dp.Spec.ApiGatewayMan...
[ "0.48463553", "0.4834523", "0.47509903", "0.47425815", "0.46419632", "0.45079255", "0.44784862", "0.44415823", "0.44252938", "0.44230074", "0.44079074", "0.44064182", "0.4389599", "0.438555", "0.4380319", "0.43769553", "0.43735534", "0.43591672", "0.43350774", "0.4330374", "0...
0.5352167
0
WithCustomTemplate returns the receiver adapter after changing the CloudFormation template that should be used to create Load Balancer stacks
func (a *Adapter) WithCustomTemplate(template string) *Adapter { a.customTemplate = template return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CustomNamespaceTemplate(templateRef, template string) UaInMurModifier {\n\treturn func(targetCluster string, mur *toolchainv1alpha1.MasterUserRecord) {\n\t\tfor i, ua := range mur.Spec.UserAccounts {\n\t\t\tif ua.TargetCluster == targetCluster {\n\t\t\t\tfor j, ns := range ua.Spec.NSTemplateSet.Namespaces {\n...
[ "0.5200348", "0.5190561", "0.5176106", "0.50507194", "0.49835604", "0.49048224", "0.49023888", "0.48888153", "0.48797894", "0.48579338", "0.47971332", "0.47307512", "0.4713566", "0.466707", "0.46542612", "0.4648205", "0.4648205", "0.4640566", "0.4635521", "0.4635018", "0.4607...
0.6128332
0
ClusterStackName returns the ClusterID tag that all resources from the same Kubernetes cluster share. It's taken from the current ec2 instance.
func (a *Adapter) ClusterID() string { return a.manifest.instance.clusterID() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func lookupStack(clustername string) (string, string, error) {\n\tcfg, err := external.LoadDefaultAWSConfig()\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tsvc := cloudformation.New(cfg)\n\tvar activeStacks = []cloudformation.StackStatus{\"CREATE_COMPLETE\"}\n\tlsreq := svc.ListStacksRequest(&cloudformati...
[ "0.6634175", "0.64011246", "0.63919973", "0.6266783", "0.604183", "0.5951883", "0.5875301", "0.58606607", "0.5757922", "0.5754143", "0.5688333", "0.56320745", "0.5579556", "0.55089194", "0.5506207", "0.5487271", "0.5485594", "0.547948", "0.54571444", "0.5456574", "0.54525596"...
0.0
-1
VpcID returns the VPC ID the current node belongs to.
func (a *Adapter) VpcID() string { return a.manifest.instance.vpcID }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o ZoneVpcOutput) VpcId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ZoneVpc) string { return v.VpcId }).(pulumi.StringOutput)\n}", "func (vpc Vpc) ID() string {\n\treturn vpc.VpcID\n}", "func (o HostedZoneVpcOutput) VpcId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v HostedZoneVpc) string { retu...
[ "0.70958114", "0.7021178", "0.70081663", "0.69484353", "0.69469905", "0.6893211", "0.6839423", "0.68181646", "0.6776505", "0.6775017", "0.6704507", "0.6665544", "0.666223", "0.6541551", "0.6534889", "0.6534633", "0.6505329", "0.64901376", "0.645327", "0.6452794", "0.64369947"...
0.71462744
0
InstanceID returns the instance ID the current node is running on.
func (a *Adapter) InstanceID() string { return a.manifest.instance.id }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func InstanceID() string {\n\treturn instanceID\n}", "func (c *Client) InstanceID() (int, error) {\n\tresp, err := c.get(\"/instance-id\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn strconv.Atoi(resp)\n}", "func (i *instances) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error) {...
[ "0.7966648", "0.7694622", "0.7651121", "0.7553367", "0.75086725", "0.75086725", "0.74904203", "0.74120426", "0.73663956", "0.7230504", "0.7180342", "0.7156372", "0.69985044", "0.69985044", "0.69985044", "0.6971348", "0.6943605", "0.69339204", "0.6921669", "0.6906843", "0.6884...
0.75311035
4
AutoScalingGroupName returns the name of the Auto Scaling Group the current node belongs to
func (a *Adapter) AutoScalingGroupName() string { return a.manifest.autoScalingGroup.name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o NodeGroupDataOutput) AutoScalingGroupName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v NodeGroupData) string { return v.AutoScalingGroupName }).(pulumi.StringOutput)\n}", "func (n namer) AutoScalingGroupName(sku string) string {\n\t// return n.ctx.Name + \"-node-group-\" + sku\n\treturn stringutil.D...
[ "0.8316761", "0.81702137", "0.81702137", "0.7956318", "0.7528973", "0.6624974", "0.6509952", "0.6492119", "0.64409494", "0.6380685", "0.63749176", "0.6328928", "0.6293692", "0.62818784", "0.6260782", "0.6259074", "0.6155628", "0.61387604", "0.6136681", "0.6133578", "0.6118592...
0.8134883
3
SecurityGroupID returns the security group ID that should be used to create Load Balancers.
func (a *Adapter) SecurityGroupID() string { return a.manifest.securityGroup.id }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Canary) GetCanaryLoadBalancerSecurityGroup(region schemas.RegionConfig) (*string, error) {\n\tclient, err := selectClientFromList(c.AWSClients, region.Region)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewLBName := c.GenerateCanaryLBSecurityGroupName(region.Region)\n\n\tgroupID, err := client.EC2Se...
[ "0.62743926", "0.6094887", "0.60606396", "0.5976136", "0.59231603", "0.59077597", "0.58887666", "0.58294344", "0.57898843", "0.5747376", "0.5697769", "0.5626909", "0.5623109", "0.56145775", "0.5611285", "0.5597488", "0.5582124", "0.5576479", "0.55550325", "0.55489683", "0.552...
0.61620134
1
PrivateSubnetIDs returns a slice with the private subnet IDs discovered by the adapter.
func (a *Adapter) PrivateSubnetIDs() []string { return getSubnetIDs(a.manifest.privateSubnets) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func PrivateNets() []*net.IPNet {\n\treturn privateNets\n}", "func (d *Discovery) GetPrivatePorts() []uint16 {\n\treturn d.privatePorts\n}", "func PrivateNetworkInterfaces(logger log.Logger) []string {\n\tints, err := net.Interfaces()\n\tif err != nil {\n\t\tlevel.Warn(logger).Log(\"msg\", \"error getting netw...
[ "0.68231964", "0.64657307", "0.6398693", "0.63024354", "0.6225061", "0.618172", "0.6147592", "0.6138173", "0.6109878", "0.606566", "0.6050834", "0.60140425", "0.59562993", "0.59441864", "0.58901244", "0.5881163", "0.5871929", "0.58298874", "0.5818916", "0.58129025", "0.578703...
0.83112925
0
PublicSubnetIDs returns a slice with the public subnet IDs discovered by the adapter.
func (a *Adapter) PublicSubnetIDs() []string { return getSubnetIDs(a.manifest.publicSubnets) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *Adapter) PrivateSubnetIDs() []string {\n\treturn getSubnetIDs(a.manifest.privateSubnets)\n}", "func (o *FiltersNatService) GetSubnetIds() []string {\n\tif o == nil || o.SubnetIds == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SubnetIds\n}", "func (h *Hub) PublicSubnetMask() (result s...
[ "0.61891586", "0.5924014", "0.57987916", "0.57511437", "0.57172686", "0.57081604", "0.54603547", "0.5409055", "0.54011387", "0.53628165", "0.53247654", "0.521296", "0.5211982", "0.520052", "0.515711", "0.51483375", "0.51237404", "0.51102495", "0.5107029", "0.51025856", "0.509...
0.8309432
0
FindManagedStacks returns all CloudFormation stacks containing the controller management tags that match the current cluster and are ready to be used. The stack status is used to filter.
func (a *Adapter) FindManagedStacks() ([]*Stack, error) { stacks, err := findManagedStacks(a.cloudformation, a.ClusterID()) if err != nil { return nil, err } targetGroupARNs := make([]string, len(stacks)) for i, stack := range stacks { targetGroupARNs[i] = stack.targetGroupARN } // This call is idempotent and safe to execute every time if err := attachTargetGroupsToAutoScalingGroup(a.autoscaling, targetGroupARNs, a.AutoScalingGroupName()); err != nil { log.Printf("FindManagedStacks() failed to attach target groups to ASG: %v", err) } return stacks, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func DescribeStacks(r string) {\n\tsvc := cloudformation.New(getSession(r))\n\n\tstatii := []*string{\n\t\taws.String(\"CREATE_COMPLETE\"),\n\t\taws.String(\"CREATE_IN_PROGRESS\"),\n\t\taws.String(\"UPDATE_COMPLETE\"),\n\t\taws.String(\"UPDATE_IN_PROGRESS\"),\n\t}\n\n\tstackSummaries, err := svc.ListStacks(&cloudf...
[ "0.5754251", "0.54573864", "0.5245028", "0.5053429", "0.49962544", "0.4935037", "0.49084404", "0.4904233", "0.48626906", "0.48518154", "0.48450178", "0.4760185", "0.47336546", "0.4727369", "0.4725655", "0.47225136", "0.45577127", "0.45574242", "0.4549063", "0.4514616", "0.449...
0.7192245
0
CreateStack creates a new Application Load Balancer using CloudFormation. The stack name is derived from the Cluster ID and the certificate ARN (when available). All the required resources (listeners and target group) are created in a transactional fashion. Failure to create the stack causes it to be deleted automatically.
func (a *Adapter) CreateStack(certificateARN string, scheme string) (string, error) { spec := &stackSpec{ name: a.stackName(certificateARN), scheme: scheme, certificateARN: certificateARN, securityGroupID: a.SecurityGroupID(), subnets: a.PublicSubnetIDs(), vpcID: a.VpcID(), clusterID: a.ClusterID(), healthCheck: &healthCheck{ path: a.healthCheckPath, port: a.healthCheckPort, interval: a.healthCheckInterval, }, timeoutInMinutes: uint(a.creationTimeout.Minutes()), } return createStack(a.cloudformation, spec) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Cloudformation) CreateStack() (output *cloudformation.CreateStackOutput, err error) {\n\tsess := s.config.AWSSession\n\tsvc := cloudformation.New(sess)\n\n\tcftemplate := helpers.GetCloudFormationTemplate(s.config, \"s3bucket\", s.S3Bucket.Spec.CloudFormationTemplateName, s.S3Bucket.Spec.CloudFormationTem...
[ "0.71047324", "0.6875082", "0.68076223", "0.6794135", "0.679078", "0.6751174", "0.6712775", "0.66567725", "0.66023535", "0.6595654", "0.6490512", "0.62750256", "0.62704486", "0.60571676", "0.605478", "0.59436655", "0.5935414", "0.5841742", "0.58413035", "0.5837066", "0.576579...
0.7167785
0
GetStack returns the CloudFormation stack details with the name or ID from the argument
func (a *Adapter) GetStack(stackID string) (*Stack, error) { return getStack(a.cloudformation, stackID) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetStack(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *StackState, opts ...pulumi.ResourceOption) (*Stack, error) {\n\tvar resource Stack\n\terr := ctx.ReadResource(\"aws-native:cloudformation:Stack\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn...
[ "0.8298661", "0.72698605", "0.7154262", "0.6917696", "0.66157544", "0.6453903", "0.6377056", "0.6247309", "0.61395586", "0.60342014", "0.59907895", "0.5941389", "0.58851993", "0.584781", "0.5842104", "0.58073467", "0.580492", "0.5800194", "0.57823026", "0.571775", "0.5689168"...
0.7326961
1
MarkToDeleteStack adds a "deleteScheduled" Tag to the CloudFormation stack with the given name
func (a *Adapter) MarkToDeleteStack(stack *Stack) (time.Time, error) { t0 := time.Now().Add(a.stackTTL) return t0, markToDeleteStack(a.cloudformation, a.stackName(stack.CertificateARN()), t0.Format(time.RFC3339)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func deleteStack(name string) error {\n\tfmt.Printf(\"DEBUG:: deleting stack %v\\n\", name)\n\tcfg, err := external.LoadDefaultAWSConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\tsvc := cloudformation.New(cfg)\n\tdsreq := svc.DeleteStackRequest(&cloudformation.DeleteStackInput{StackName: aws.String(name)})\n\t_...
[ "0.6744801", "0.608052", "0.58702874", "0.57997805", "0.5764414", "0.56866527", "0.54130113", "0.5200751", "0.51474035", "0.4966605", "0.49617893", "0.49286732", "0.49198192", "0.4913417", "0.49053788", "0.48483595", "0.48267484", "0.4805724", "0.47534278", "0.473707", "0.473...
0.74567723
0
DeleteStack deletes the CloudFormation stack with the given name
func (a *Adapter) DeleteStack(stack *Stack) error { if err := detachTargetGroupFromAutoScalingGroup(a.autoscaling, stack.TargetGroupARN(), a.AutoScalingGroupName()); err != nil { return fmt.Errorf("DeleteStack failed to detach: %v", err) } return deleteStack(a.cloudformation, stack.Name()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func deleteStack(name string) error {\n\tfmt.Printf(\"DEBUG:: deleting stack %v\\n\", name)\n\tcfg, err := external.LoadDefaultAWSConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\tsvc := cloudformation.New(cfg)\n\tdsreq := svc.DeleteStackRequest(&cloudformation.DeleteStackInput{StackName: aws.String(name)})\n\t_...
[ "0.8518868", "0.7966902", "0.77053547", "0.7586303", "0.7506792", "0.7419008", "0.695851", "0.6467567", "0.64151096", "0.6259764", "0.60829246", "0.60809505", "0.60699147", "0.6050879", "0.6039881", "0.6039098", "0.5982669", "0.5944772", "0.5906172", "0.58737314", "0.58247685...
0.71696025
6
NewFinder constructs an Finder
func NewFinder(getter storage.Getter, feed *feeds.Feed) feeds.Lookup { return &finder{feeds.NewGetter(getter, feed)} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewFinder(conf Config) *Finder {\n\treturn &Finder{config: conf }\n}", "func NewFinder() Finder {\n\treturn &finder{fsWalk: filepath.Walk}\n}", "func NewFinder() *Finder {\n\tfinder := &Finder{\n\t\tFinder: core.NewFinder(),\n\t\tControlPoint: upnp.NewControlPoint(),\n\t}\n\n\tfinder.ControlPoint.Li...
[ "0.8122834", "0.79264635", "0.78552455", "0.7817888", "0.777309", "0.76406205", "0.73853225", "0.68734574", "0.6478233", "0.63309747", "0.62455803", "0.6234578", "0.62128097", "0.6159686", "0.6150639", "0.5968015", "0.5944875", "0.593422", "0.5801198", "0.5801198", "0.5735934...
0.77743185
4
At looks up the version valid at time `at` after is a unix time hint of the latest known update
func (f *finder) At(ctx context.Context, at, after int64) (ch swarm.Chunk, current, next feeds.Index, err error) { for i := uint64(0); ; i++ { u, err := f.getter.Get(ctx, &index{i}) if err != nil { if !errors.Is(err, storage.ErrNotFound) { return nil, nil, nil, err } return ch, &index{i - 1}, &index{i}, nil } ts, err := feeds.UpdatedAt(u) if err != nil { return nil, nil, nil, err } if ts > uint64(at) { return ch, &index{i}, nil, nil } ch = u } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r ApiGetHyperflexServerFirmwareVersionListRequest) At(at string) ApiGetHyperflexServerFirmwareVersionListRequest {\n\tr.at = &at\n\treturn r\n}", "func (r ApiGetHyperflexServerFirmwareVersionEntryListRequest) At(at string) ApiGetHyperflexServerFirmwareVersionEntryListRequest {\n\tr.at = &at\n\treturn r\n}"...
[ "0.6024724", "0.5971322", "0.5965791", "0.5946821", "0.59386605", "0.5537376", "0.5519222", "0.55184233", "0.55153024", "0.5472949", "0.5458037", "0.5456405", "0.5440827", "0.5440527", "0.5412469", "0.54073024", "0.53969324", "0.53810334", "0.5380731", "0.53776205", "0.536922...
0.57098186
5
NewAsyncFinder constructs an AsyncFinder
func NewAsyncFinder(getter storage.Getter, feed *feeds.Feed) feeds.Lookup { return &asyncFinder{feeds.NewGetter(getter, feed)} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func findAsync(findStruct *Find, callback chan *Callback) {\n\trecords, err := find(findStruct)\n\tcb := new(Callback)\n\tcb.Data = records\n\tcb.Error = err\n\tcallback <- cb\n}", "func NewFinder(conf Config) *Finder {\n\treturn &Finder{config: conf }\n}", "func NewFinder(ctx context.Context, zctx *zson.Conte...
[ "0.6278817", "0.60753214", "0.6067157", "0.6022303", "0.60068786", "0.59324783", "0.5866529", "0.56715345", "0.56193966", "0.56193966", "0.5493856", "0.547196", "0.5442003", "0.5435475", "0.53768", "0.5223182", "0.52034193", "0.51921666", "0.5136617", "0.5093945", "0.5092701"...
0.80872023
1
At looks up the version valid at time `at` after is a unix time hint of the latest known update
func (f *asyncFinder) At(ctx context.Context, at, after int64) (ch swarm.Chunk, cur, next feeds.Index, err error) { ch, diff, err := f.get(ctx, at, 0) if err != nil { return nil, nil, nil, err } if ch == nil { return nil, nil, nil, nil } if diff == 0 { return ch, &index{0}, &index{1}, nil } c := make(chan result) p := newPath(0) p.latest.chunk = ch for p.level = 1; diff>>p.level > 0; p.level++ { } quit := make(chan struct{}) defer close(quit) go f.at(ctx, at, p, c, quit) for r := range c { p = r.path if r.chunk == nil { if r.level == 0 { return p.latest.chunk, &index{p.latest.seq}, &index{p.latest.seq + 1}, nil } if p.level < r.level { continue } p.level = r.level - 1 } else { if r.diff == 0 { return r.chunk, &index{r.seq}, &index{r.seq + 1}, nil } if p.latest.level > r.level { continue } p.close() p.latest = r } // below applies even if p.latest==maxLevel if p.latest.level == p.level { if p.level == 0 { return p.latest.chunk, &index{p.latest.seq}, &index{p.latest.seq + 1}, nil } p.close() np := newPath(p.latest.seq) np.level = p.level np.latest.chunk = p.latest.chunk go f.at(ctx, at, np, c, quit) } } return nil, nil, nil, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r ApiGetHyperflexServerFirmwareVersionListRequest) At(at string) ApiGetHyperflexServerFirmwareVersionListRequest {\n\tr.at = &at\n\treturn r\n}", "func (r ApiGetHyperflexServerFirmwareVersionEntryListRequest) At(at string) ApiGetHyperflexServerFirmwareVersionEntryListRequest {\n\tr.at = &at\n\treturn r\n}"...
[ "0.60237", "0.597019", "0.59644204", "0.59450865", "0.59381974", "0.57100904", "0.5538346", "0.5518835", "0.55184263", "0.5513792", "0.547175", "0.5458565", "0.5456444", "0.5441323", "0.5441174", "0.54125583", "0.54082346", "0.53972095", "0.5381042", "0.53801376", "0.5376697"...
0.0
-1
NewUpdater constructs a feed updater
func NewUpdater(putter storage.Putter, signer crypto.Signer, topic []byte) (feeds.Updater, error) { p, err := feeds.NewPutter(putter, signer, topic) if err != nil { return nil, err } return &updater{Putter: p}, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New() *Updater {\n\treturn &Updater{}\n}", "func NewUpdater(cfg *Config, rdb *redis.Client) *Updater {\n\treturn &Updater{\n\t\tConfig: cfg,\n\t\trdb: rdb,\n\t\tdone: make(chan struct{}),\n\t\tabort: make(chan error),\n\t\twork: make(chan WorkTuple),\n\t\tprocessed: make(chan Processe...
[ "0.69606626", "0.67406523", "0.6593128", "0.65879697", "0.6474466", "0.6468645", "0.62675405", "0.6217244", "0.6181586", "0.6118874", "0.60844964", "0.60467017", "0.6034148", "0.6026278", "0.5980703", "0.59795487", "0.59422725", "0.5822659", "0.5807095", "0.5796147", "0.57917...
0.7205077
1
Update pushes an update to the feed through the chunk stores
func (u *updater) Update(ctx context.Context, at int64, payload []byte) error { err := u.Put(ctx, &index{u.next}, at, payload) if err != nil { return err } u.next++ return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *MhistConnector) Update() {\n\tfor {\n\t\tmessage := <-c.brokerChannel\n\t\tmeasurement := proto.MeasurementFromModel(&models.Raw{\n\t\t\tValue: message.Measurement,\n\t\t})\n\t\terr := c.writeStream.Send(&proto.MeasurementMessage{\n\t\t\tName: message.Channel,\n\t\t\tMeasurement: measurement,\n\t\t...
[ "0.7061625", "0.66837144", "0.62871474", "0.6194512", "0.60975534", "0.6057079", "0.6047295", "0.5998641", "0.59809476", "0.59769446", "0.5959136", "0.5950485", "0.59360564", "0.5931388", "0.59304947", "0.5909306", "0.58996606", "0.58698773", "0.5844536", "0.582643", "0.57744...
0.6672352
2
CredentialAssertionToProto converts a CredentialAssertion to its proto counterpart.
func CredentialAssertionToProto(assertion *CredentialAssertion) *wantypes.CredentialAssertion { if assertion == nil { return nil } return &wantypes.CredentialAssertion{ PublicKey: &wantypes.PublicKeyCredentialRequestOptions{ Challenge: assertion.Response.Challenge, TimeoutMs: int64(assertion.Response.Timeout), RpId: assertion.Response.RelyingPartyID, AllowCredentials: credentialDescriptorsToProto(assertion.Response.AllowedCredentials), Extensions: inputExtensionsToProto(assertion.Response.Extensions), UserVerification: string(assertion.Response.UserVerification), }, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CredentialAssertionResponseToProto(car *CredentialAssertionResponse) *wantypes.CredentialAssertionResponse {\n\tif car == nil {\n\t\treturn nil\n\t}\n\treturn &wantypes.CredentialAssertionResponse{\n\t\tType: car.Type,\n\t\tRawId: car.RawID,\n\t\tResponse: &wantypes.AuthenticatorAssertionResponse{\n\t\t\tCli...
[ "0.74571794", "0.7233046", "0.6577429", "0.6498429", "0.63388383", "0.6290534", "0.59917104", "0.5907698", "0.5758109", "0.575023", "0.57271165", "0.56313354", "0.5559705", "0.5557", "0.5521528", "0.5480544", "0.54563236", "0.5406191", "0.5405703", "0.5396835", "0.5376432", ...
0.86607736
0
CredentialAssertionResponseToProto converts a CredentialAssertionResponse to its proto counterpart.
func CredentialAssertionResponseToProto(car *CredentialAssertionResponse) *wantypes.CredentialAssertionResponse { if car == nil { return nil } return &wantypes.CredentialAssertionResponse{ Type: car.Type, RawId: car.RawID, Response: &wantypes.AuthenticatorAssertionResponse{ ClientDataJson: car.AssertionResponse.ClientDataJSON, AuthenticatorData: car.AssertionResponse.AuthenticatorData, Signature: car.AssertionResponse.Signature, UserHandle: car.AssertionResponse.UserHandle, }, Extensions: outputExtensionsToProto(car.Extensions), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CredentialAssertionToProto(assertion *CredentialAssertion) *wantypes.CredentialAssertion {\n\tif assertion == nil {\n\t\treturn nil\n\t}\n\treturn &wantypes.CredentialAssertion{\n\t\tPublicKey: &wantypes.PublicKeyCredentialRequestOptions{\n\t\t\tChallenge: assertion.Response.Challenge,\n\t\t\tTimeoutMs...
[ "0.77999973", "0.75196874", "0.716168", "0.63224673", "0.6134078", "0.5806311", "0.55155236", "0.547025", "0.5325929", "0.5290635", "0.52893364", "0.5166631", "0.51124144", "0.5112016", "0.5104857", "0.4943682", "0.48701605", "0.48501328", "0.48420054", "0.48323202", "0.48153...
0.84686226
0
CredentialCreationToProto converts a CredentialCreation to its proto counterpart.
func CredentialCreationToProto(cc *CredentialCreation) *wantypes.CredentialCreation { if cc == nil { return nil } return &wantypes.CredentialCreation{ PublicKey: &wantypes.PublicKeyCredentialCreationOptions{ Challenge: cc.Response.Challenge, Rp: rpEntityToProto(cc.Response.RelyingParty), User: userEntityToProto(cc.Response.User), CredentialParameters: credentialParametersToProto(cc.Response.Parameters), TimeoutMs: int64(cc.Response.Timeout), ExcludeCredentials: credentialDescriptorsToProto(cc.Response.CredentialExcludeList), Attestation: string(cc.Response.Attestation), Extensions: inputExtensionsToProto(cc.Response.Extensions), AuthenticatorSelection: authenticatorSelectionToProto(cc.Response.AuthenticatorSelection), }, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CredentialCreationResponseToProto(ccr *CredentialCreationResponse) *wantypes.CredentialCreationResponse {\n\tif ccr == nil {\n\t\treturn nil\n\t}\n\treturn &wantypes.CredentialCreationResponse{\n\t\tType: ccr.Type,\n\t\tRawId: ccr.RawID,\n\t\tResponse: &wantypes.AuthenticatorAttestationResponse{\n\t\t\tClien...
[ "0.7853255", "0.7436043", "0.6886519", "0.6403674", "0.6206073", "0.5689377", "0.566673", "0.5385823", "0.5263375", "0.5230518", "0.51713413", "0.5163685", "0.5157063", "0.5118613", "0.5106233", "0.5077851", "0.50734395", "0.5052029", "0.5017867", "0.50151336", "0.5014979", ...
0.86673677
0
CredentialCreationResponseToProto converts a CredentialCreationResponse to its proto counterpart.
func CredentialCreationResponseToProto(ccr *CredentialCreationResponse) *wantypes.CredentialCreationResponse { if ccr == nil { return nil } return &wantypes.CredentialCreationResponse{ Type: ccr.Type, RawId: ccr.RawID, Response: &wantypes.AuthenticatorAttestationResponse{ ClientDataJson: ccr.AttestationResponse.ClientDataJSON, AttestationObject: ccr.AttestationResponse.AttestationObject, }, Extensions: outputExtensionsToProto(ccr.Extensions), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CredentialCreationToProto(cc *CredentialCreation) *wantypes.CredentialCreation {\n\tif cc == nil {\n\t\treturn nil\n\t}\n\treturn &wantypes.CredentialCreation{\n\t\tPublicKey: &wantypes.PublicKeyCredentialCreationOptions{\n\t\t\tChallenge: cc.Response.Challenge,\n\t\t\tRp: rpE...
[ "0.78583616", "0.7849964", "0.7063098", "0.6521318", "0.6473246", "0.62918735", "0.5673684", "0.55803907", "0.556813", "0.549089", "0.54130495", "0.53861296", "0.5301925", "0.52858174", "0.5277383", "0.52336776", "0.5227287", "0.522161", "0.521726", "0.52074724", "0.52071023"...
0.86787826
0
CredentialAssertionFromProto converts a CredentialAssertion proto to its lib counterpart.
func CredentialAssertionFromProto(assertion *wantypes.CredentialAssertion) *CredentialAssertion { if assertion == nil { return nil } return &CredentialAssertion{ Response: publicKeyCredentialRequestOptionsFromProto(assertion.PublicKey), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CredentialAssertionResponseFromProto(car *wantypes.CredentialAssertionResponse) *CredentialAssertionResponse {\n\tif car == nil {\n\t\treturn nil\n\t}\n\treturn &CredentialAssertionResponse{\n\t\tPublicKeyCredential: PublicKeyCredential{\n\t\t\tCredential: Credential{\n\t\t\t\tID: base64.RawURLEncoding.Enco...
[ "0.7431579", "0.7430996", "0.69857", "0.69834393", "0.66492873", "0.65091896", "0.63220865", "0.60344005", "0.57588685", "0.5737976", "0.56534", "0.5622571", "0.5621915", "0.56124455", "0.55954367", "0.554616", "0.5524874", "0.55207145", "0.5483683", "0.54677933", "0.53528214...
0.8768559
0
CredentialAssertionResponseFromProto converts a CredentialAssertionResponse proto to its lib counterpart.
func CredentialAssertionResponseFromProto(car *wantypes.CredentialAssertionResponse) *CredentialAssertionResponse { if car == nil { return nil } return &CredentialAssertionResponse{ PublicKeyCredential: PublicKeyCredential{ Credential: Credential{ ID: base64.RawURLEncoding.EncodeToString(car.RawId), Type: car.Type, }, RawID: car.RawId, Extensions: outputExtensionsFromProto(car.Extensions), }, AssertionResponse: authenticatorAssertionResponseFromProto(car.Response), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CredentialAssertionResponseToProto(car *CredentialAssertionResponse) *wantypes.CredentialAssertionResponse {\n\tif car == nil {\n\t\treturn nil\n\t}\n\treturn &wantypes.CredentialAssertionResponse{\n\t\tType: car.Type,\n\t\tRawId: car.RawID,\n\t\tResponse: &wantypes.AuthenticatorAssertionResponse{\n\t\t\tCli...
[ "0.76067215", "0.75107986", "0.7340281", "0.6968172", "0.6617178", "0.6093907", "0.58568245", "0.5712558", "0.5702413", "0.56552935", "0.5585264", "0.5423334", "0.5421431", "0.5325256", "0.5320269", "0.5177555", "0.5125212", "0.5091248", "0.50174576", "0.5015089", "0.49780425...
0.8518914
0
CredentialCreationFromProto converts a CredentialCreation proto to its lib counterpart.
func CredentialCreationFromProto(cc *wantypes.CredentialCreation) *CredentialCreation { if cc == nil { return nil } return &CredentialCreation{ Response: publicKeyCredentialCreationOptionsFromProto(cc.PublicKey), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CredentialCreationResponseFromProto(ccr *wantypes.CredentialCreationResponse) *CredentialCreationResponse {\n\tif ccr == nil {\n\t\treturn nil\n\t}\n\treturn &CredentialCreationResponse{\n\t\tPublicKeyCredential: PublicKeyCredential{\n\t\t\tCredential: Credential{\n\t\t\t\tID: base64.RawURLEncoding.EncodeTo...
[ "0.77852", "0.7673165", "0.7087914", "0.6934679", "0.68827397", "0.67722136", "0.6361961", "0.602129", "0.591723", "0.58584166", "0.5693408", "0.5690987", "0.5658552", "0.5642539", "0.5617722", "0.5571336", "0.5562646", "0.55291426", "0.5476078", "0.54715914", "0.54699343", ...
0.8701645
0
CredentialCreationResponseFromProto converts a CredentialCreationResponse proto to its lib counterpart.
func CredentialCreationResponseFromProto(ccr *wantypes.CredentialCreationResponse) *CredentialCreationResponse { if ccr == nil { return nil } return &CredentialCreationResponse{ PublicKeyCredential: PublicKeyCredential{ Credential: Credential{ ID: base64.RawURLEncoding.EncodeToString(ccr.RawId), Type: ccr.Type, }, RawID: ccr.RawId, Extensions: outputExtensionsFromProto(ccr.Extensions), }, AttestationResponse: authenticatorAttestationResponseFromProto(ccr.Response), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CredentialCreationResponseToProto(ccr *CredentialCreationResponse) *wantypes.CredentialCreationResponse {\n\tif ccr == nil {\n\t\treturn nil\n\t}\n\treturn &wantypes.CredentialCreationResponse{\n\t\tType: ccr.Type,\n\t\tRawId: ccr.RawID,\n\t\tResponse: &wantypes.AuthenticatorAttestationResponse{\n\t\t\tClien...
[ "0.79458094", "0.76754075", "0.7466945", "0.7264637", "0.66078424", "0.6368274", "0.6345199", "0.633873", "0.6317732", "0.5856386", "0.57786655", "0.5684622", "0.5460006", "0.54394895", "0.5400118", "0.53531575", "0.531271", "0.5247152", "0.524472", "0.5205804", "0.5195482", ...
0.88028467
0
Returns the default Template setter upper
func DefaultTemplateSetup(esClient *elasticsearch.Client, archiveTemplateModifier func(*Template)) TemplateSetup { archiveTemplateModifier(&TasquesArchiveTemplate) return &templateSetupImpl{ esClient: esClient, Templates: []Template{ TasquesQueuesTemplate, TasquesArchiveTemplate, TasquesLocksTemplate, TasquesRecurringTasksTemplate, }, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func templateFunctionGenerateDefault(def, value interface{}) interface{} {\n\tglog.V(log.LevelDebug).Infof(\"default: default '%v', value '%v'\", def, value)\n\n\tif value == nil {\n\t\tvalue = def\n\t}\n\n\tglog.V(log.LevelDebug).Infof(\"default: value '%v'\", value)\n\n\treturn value\n}", "func templateFuncti...
[ "0.523974", "0.51359373", "0.5011097", "0.49829936", "0.49430534", "0.4891433", "0.484189", "0.478802", "0.47771356", "0.47767422", "0.47766063", "0.473133", "0.47030216", "0.4680616", "0.46647787", "0.46492925", "0.46391362", "0.4630544", "0.46262336", "0.46256065", "0.45902...
0.4633425
17
Name implements part of the Plugin interface.
func (p *ProtocGenGrpcNode) Name() string { return "grpc:grpc-node:protoc-gen-grpc-node" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (Plugin) Name() string { return pluginName }", "func (p *Plugin) Name() string {\n\treturn p.PluginObj.Name\n}", "func (p *Plugin) Name() string {\n\treturn \"golang\"\n}", "func (p *GenericPlugin) Name() string {\n\n\tswitch p.state {\n\tcase stateNotLoaded:\n\t\treturn path.Base(p.filename)\n\tdefault...
[ "0.8802937", "0.8218319", "0.8196202", "0.8150867", "0.80918956", "0.7986361", "0.79730093", "0.7800767", "0.77767634", "0.7768216", "0.7708957", "0.76781195", "0.76700634", "0.76645356", "0.762978", "0.76037997", "0.7589927", "0.758337", "0.75551456", "0.75527585", "0.753249...
0.0
-1
Configure implements part of the Plugin interface.
func (p *ProtocGenGrpcNode) Configure(ctx *protoc.PluginContext) *protoc.PluginConfiguration { if !protoc.HasServices(ctx.ProtoLibrary.Files()...) { return nil } return &protoc.PluginConfiguration{ Label: label.New("build_stack_rules_proto", "plugin/grpc/grpc-node", "protoc-gen-grpc-node"), Outputs: protoc.FlatMapFiles( grpcGeneratedFileName(ctx.Rel), protoc.HasService, ctx.ProtoLibrary.Files()..., ), Options: ctx.PluginConfig.GetOptions(), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Client) Configure(configuration map[string]interface{}) plugin.BasicError {\n\tvar response plugin.BasicError\n\terr := c.client.Call(\"Plugin.Configure\", configuration, &response)\n\tif err != nil {\n\t\tresponse = *plugin.NewBasicError(err)\n\t}\n\treturn response\n}", "func (s *Server) Configure(arg...
[ "0.738589", "0.7281108", "0.7218009", "0.72134584", "0.68088496", "0.67336166", "0.6719611", "0.6613242", "0.6582964", "0.657914", "0.6481576", "0.64588183", "0.6443354", "0.63777125", "0.6366098", "0.63492817", "0.6334886", "0.6314976", "0.6293726", "0.6278675", "0.6273871",...
0.59749967
37
grpcGeneratedFileName is a utility function that returns a function that computes the name of a predicted generated file having the given extension(s) relative to the given dir.
func grpcGeneratedFileName(reldir string) func(f *protoc.File) []string { return func(f *protoc.File) []string { name := strings.ReplaceAll(f.Name, "-", "_") if reldir != "" { name = path.Join(reldir, name) } return []string{name + "_grpc_pb.js"} } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GenerateFileName(dir, name, issueNumber, format string) string {\n\treturn fmt.Sprintf(\"%s/%s-%s.%s\", dir, name, issueNumber, format)\n}", "func GenerateFileName(fileName, extension string) (string, error) {\n\tif fileName == \"\" {\n\t\treturn \"\", fmt.Errorf(\"%w missing filename\", errCannotGenerateFi...
[ "0.7159262", "0.7015586", "0.70049655", "0.64598197", "0.6322077", "0.6313036", "0.61655617", "0.60880876", "0.6077366", "0.59720206", "0.59513104", "0.59406734", "0.59303725", "0.58968973", "0.58964074", "0.5814274", "0.5774253", "0.57570577", "0.5718658", "0.5708201", "0.56...
0.80490637
0
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() { if err := rootCmd.Execute(); err != nil { fmt.Println(err) os.Exit(1) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Execute() {\n\tif err := RootCmd.Execute(); err != nil {\n\t\tlog.Fatal(\"[FATAL] unable to add child commands to the root command\")\n\t}\n}", "func Execute() {\n\tif err := initSubCommands(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\tif err := rootCmd.Execute(); err != nil {\n\t\tfmt.Prin...
[ "0.7883761", "0.7761668", "0.76657826", "0.76602453", "0.7636092", "0.75491834", "0.7535363", "0.7501637", "0.7483472", "0.74762964", "0.74595875", "0.7448777", "0.7448777", "0.7443535", "0.74403316", "0.7436203", "0.74361795", "0.74361795", "0.7432754", "0.74320066", "0.7432...
0.0
-1
expectFlag exits with an error if the flag value is empty.
func expectFlag(flag, value string) { if value == "" { exit.WithMessage(fmt.Sprintf("You must specify the %q flag", flag)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestExitOnUnknownFlag(t *testing.T) {\n\terr := joincap([]string{\"joincap\", \"--banana\"})\n\tif err == nil {\n\t\tt.Fatal(\"Shouldn't exited without an error\")\n\t}\n\tif !strings.Contains(err.Error(), \"unknown flag\") ||\n\t\t!strings.Contains(err.Error(), \"banana\") {\n\t\tt.FailNow()\n\t}\n}", "fun...
[ "0.6079569", "0.58692366", "0.57598114", "0.57287717", "0.5551134", "0.5460788", "0.5388357", "0.5382268", "0.53631026", "0.5357898", "0.5328667", "0.5325936", "0.53098136", "0.5273933", "0.5264968", "0.52546215", "0.52443177", "0.523296", "0.52326876", "0.52184695", "0.52027...
0.8324694
0
checkNoArguments checks that there are no arguments.
func checkNoArguments(_ *cobra.Command, args []string) error { if len(args) > 0 { return errors.New("this command doesn't support any arguments") } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func VerifyNoArgument(c *cli.Context) error {\n\ta := c.Args()\n\tif a.Present() {\n\t\treturn fmt.Errorf(`Syntax error, command takes no arguments`)\n\t}\n\n\treturn nil\n}", "func validateArguments(args ...string) error {\n\tif args == nil {\n\t\treturn errors.New(\"No command line args were specified\")\n\t}\...
[ "0.6990896", "0.6740155", "0.6736732", "0.6645205", "0.65820414", "0.64653146", "0.6459614", "0.64470625", "0.64260644", "0.64201087", "0.6372319", "0.63715017", "0.63523114", "0.6348488", "0.6329301", "0.632766", "0.6326579", "0.6272477", "0.61495304", "0.6096113", "0.607904...
0.81754017
0
GetItems returns the items for the given hunt
func GetItems(huntID int) ([]*models.Item, *response.Error) { itemDBs, e := db.GetItemsWithHuntID(huntID) if itemDBs == nil { return nil, e } items := make([]*models.Item, 0, len(itemDBs)) for _, itemDB := range itemDBs { item := models.Item{ItemDB: *itemDB} items = append(items, &item) } return items, e }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetItemsForHunt(huntID int) ([]*models.Item, *response.Error) {\n\titemDBs, e := db.GetItemsWithHuntID(huntID)\n\tif itemDBs == nil {\n\t\treturn nil, e\n\t}\n\n\titems := make([]*models.Item, 0, len(itemDBs))\n\n\tfor _, v := range itemDBs {\n\t\titem := models.Item{ItemDB: *v}\n\t\titems = append(items, &it...
[ "0.7557881", "0.64705104", "0.6452308", "0.64334404", "0.64011496", "0.63178134", "0.6234697", "0.6177612", "0.6156206", "0.61173177", "0.6100953", "0.59985477", "0.5981244", "0.5923877", "0.59163713", "0.58571386", "0.583082", "0.5816483", "0.5781093", "0.5710015", "0.563891...
0.73712164
1
GetItemsForHunt returns all the items for the hunt with the given id
func GetItemsForHunt(huntID int) ([]*models.Item, *response.Error) { itemDBs, e := db.GetItemsWithHuntID(huntID) if itemDBs == nil { return nil, e } items := make([]*models.Item, 0, len(itemDBs)) for _, v := range itemDBs { item := models.Item{ItemDB: *v} items = append(items, &item) } return items, e }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetItems(huntID int) ([]*models.Item, *response.Error) {\n\titemDBs, e := db.GetItemsWithHuntID(huntID)\n\tif itemDBs == nil {\n\t\treturn nil, e\n\t}\n\n\titems := make([]*models.Item, 0, len(itemDBs))\n\tfor _, itemDB := range itemDBs {\n\t\titem := models.Item{ItemDB: *itemDB}\n\t\titems = append(items, &i...
[ "0.70549184", "0.6203212", "0.57432526", "0.561227", "0.55682933", "0.537858", "0.5327069", "0.5295185", "0.5257403", "0.52491146", "0.51914525", "0.51633185", "0.51590073", "0.51384294", "0.5119515", "0.5101776", "0.50942695", "0.50225264", "0.5011956", "0.5010836", "0.49795...
0.7852285
0
InsertItem inserts an Item into the db
func InsertItem(item *models.Item) *response.Error { return item.Insert() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (repo *MySQLRepository) InsertItem(item item.Item) error {\n\ttx, err := repo.db.Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titemQuery := `INSERT INTO item (\n\t\t\tid, \n\t\t\tname, \n\t\t\tdescription, \n\t\t\tcreated_at, \n\t\t\tcreated_by, \n\t\t\tmodified_at, \n\t\t\tmodified_by,\n\t\t\tversion\...
[ "0.79157776", "0.7637643", "0.74021834", "0.7138829", "0.7116001", "0.6995403", "0.69375503", "0.6928879", "0.69254255", "0.6888671", "0.6856061", "0.6696047", "0.6660738", "0.665551", "0.6654495", "0.6652986", "0.66388476", "0.65846837", "0.65480274", "0.65152824", "0.650073...
0.77427083
1
DeleteItem deletes the item with the given itemID AND huntID
func DeleteItem(env *config.Env, huntID, itemID int) *response.Error { return db.DeleteItem(itemID, huntID) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func DeleteItem(c *gin.Context) {\n\tvar item model.Item\n\tid := c.Param(\"id\")\n\tif err := util.DB.Where(\"id = ?\", id).Unscoped().Delete(&item).Error; err != nil {\n\t\tc.JSON(http.StatusNotFound, util.FailResponse(http.StatusNotFound, \"Item not found\"))\n\t} else {\n\t\tc.JSON(http.StatusOK, util.MessageR...
[ "0.70132077", "0.68461764", "0.684266", "0.6773586", "0.66925764", "0.6645942", "0.6609907", "0.66031665", "0.6583193", "0.6573642", "0.65414166", "0.6467582", "0.64610535", "0.6455101", "0.63934666", "0.62482566", "0.62280536", "0.6144563", "0.60750765", "0.60697055", "0.600...
0.78681725
0
UpdateItem executes a partial update of the item with the given id. NOTE: item_id and hunt_id are not eligible to be changed
func UpdateItem(env *config.Env, item *models.Item) *response.Error { return item.Update(env) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func UpdateItem(c *gin.Context) {\n\tvar item model.Item\n\tid := c.Param(\"id\")\n\tif err := util.DB.Where(\"id = ?\", id).First(&item).Error; err != nil {\n\t\tc.JSON(http.StatusNotFound, util.FailResponse(http.StatusNotFound, \"Item not found\"))\n\t} else {\n\t\tc.ShouldBindJSON(&item)\n\t\tutil.DB.Save(&item...
[ "0.7068579", "0.6719442", "0.66551864", "0.6525335", "0.6331886", "0.6250671", "0.62262404", "0.6090824", "0.60514545", "0.59900945", "0.59710205", "0.59433424", "0.59312993", "0.5888979", "0.5857523", "0.58521247", "0.5781352", "0.5777081", "0.5775421", "0.5743207", "0.57149...
0.5960974
11
New returns an initialized FillsGrp instance
func New() *FillsGrp { var m FillsGrp return &m }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New() *AllocGrp {\n\tvar m AllocGrp\n\treturn &m\n}", "func New(dir string) *Group {\n\tg := &Group{\n\t\tdir: dir,\n\t}\n\tg.Clear()\n\treturn g\n}", "func New() *ClrInstGrp {\n\tvar m ClrInstGrp\n\treturn &m\n}", "func New() *LegPreAllocGrp {\n\tvar m LegPreAllocGrp\n\treturn &m\n}", "func New(gid s...
[ "0.6597681", "0.65568674", "0.6489955", "0.61960477", "0.61632395", "0.61583596", "0.6039248", "0.6018359", "0.59911543", "0.59713113", "0.592528", "0.5820535", "0.57798296", "0.57044864", "0.5674156", "0.56696665", "0.56621194", "0.565151", "0.56454813", "0.56247896", "0.560...
0.8539913
0
NewNoFills returns an initialized NoFills instance
func NewNoFills() *NoFills { var m NoFills return &m }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New() *FillsGrp {\n\tvar m FillsGrp\n\treturn &m\n}", "func newEmptyBoard() *FixBoard {\n\tb := &FixBoard{\n\t\tGophers: make([]*pieces.Gopher, 0),\n\t\tGoals: make([]pieces.Goal, 0),\n\t}\n\n\treturn b\n}", "func NewNoAllocs(val int) NoAllocsField {\n\treturn NoAllocsField{quickfix.FIXInt(val)}\n}", ...
[ "0.6507192", "0.6199866", "0.617042", "0.5738209", "0.5639149", "0.5600072", "0.5600072", "0.5494039", "0.53572273", "0.5356669", "0.5356669", "0.5356669", "0.5356669", "0.5356669", "0.5356669", "0.534152", "0.53205913", "0.5306964", "0.5291138", "0.5291138", "0.52845097", ...
0.83670175
0
base64Encode takes in a string and returns a base 64 encoded string
func base64Encode(src string) string { return strings. TrimRight(base64.URLEncoding. EncodeToString([]byte(src)), "=") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Base64Encode(str string) string {\n\treturn base64.StdEncoding.EncodeToString([]byte(str))\n}", "func Base64Encode(src string) string {\n\treturn base64.StdEncoding.EncodeToString([]byte(src))\n}", "func Base64Encode(text string) string {\n\treturn base64.StdEncoding.EncodeToString([]byte(text))\n}", "f...
[ "0.84703225", "0.83077854", "0.83015156", "0.8226953", "0.82128876", "0.81633633", "0.8149859", "0.810932", "0.80856764", "0.8074903", "0.807217", "0.7981776", "0.7970947", "0.79534185", "0.7880615", "0.7826774", "0.77798414", "0.7763966", "0.77257025", "0.7722197", "0.765442...
0.8182063
5
base64Decode takes in a base 64 encoded string and returns the actual string or an error of it fails to decode the string
func base64Decode(src string) (string, error) { if l := len(src) % 4; l > 0 { src += strings.Repeat("=", 4-l) } decoded, err := base64.URLEncoding.DecodeString(src) if err != nil { errMsg := fmt.Errorf("Decoding Error %s", err) return "", errMsg } return string(decoded), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func base64Decode(src string) (string, error) {\n\tif strings.TrimSpace(src) == \"\" {\n\t\treturn \"\", consts.ErrEmptyString\n\t}\n\tif l := len(src) % 4; l > 0 {\n\t\tsrc += strings.Repeat(\"=\", 4-l)\n\t}\n\tdecoded, err := base64.URLEncoding.DecodeString(src)\n\tif err != nil {\n\t\terrMsg := fmt.Errorf(\"dec...
[ "0.8075996", "0.8069602", "0.8045261", "0.7992034", "0.79698575", "0.7959148", "0.7959148", "0.7789961", "0.77893597", "0.778479", "0.77656174", "0.7649702", "0.7619644", "0.76058924", "0.7525648", "0.7510042", "0.7429252", "0.7379714", "0.7274151", "0.7263695", "0.7197686", ...
0.7998288
3
hash generates a Hmac256 hash of a string using a secret
func generateHash(src, secret string) string { key := []byte(secret) h := hmac.New(sha256.New, key) h.Write([]byte(src)) return base64.StdEncoding.EncodeToString(h.Sum(nil)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Hash(src string, secret string) string {\n key := []byte(secret)\n h := hmac.New(sha256.New, key)\n h.Write([]byte(src))\n return base64.StdEncoding.EncodeToString(h.Sum(nil))\n}", "func secretHash(sec *v1.Secret) (string, error) {\n\tencoded, err := encodeSecret(sec)\n\tif err != nil {\n\t\treturn \"\"...
[ "0.76456904", "0.754611", "0.7141423", "0.7066216", "0.7059082", "0.7037359", "0.7004514", "0.6981299", "0.6954003", "0.69420254", "0.6924159", "0.6924104", "0.6924104", "0.6924104", "0.6895148", "0.68863875", "0.68669903", "0.6845643", "0.6827959", "0.68180865", "0.6774375",...
0.72181696
2
getAllIPList get mongo all IPList
func getAllIPList(provider string, model store.ClusterManagerModel) map[string]struct{} { condProd := operator.NewLeafCondition(operator.Eq, operator.M{"provider": provider}) clusterStatus := []string{common.StatusInitialization, common.StatusRunning, common.StatusDeleting} condStatus := operator.NewLeafCondition(operator.In, operator.M{"status": clusterStatus}) cond := operator.NewBranchCondition(operator.And, condProd, condStatus) clusterList, err := model.ListCluster(context.Background(), cond, &storeopt.ListOption{All: true}) if err != nil { blog.Errorf("getAllIPList ListCluster failed: %v", err) return nil } ipList := make(map[string]struct{}) for i := range clusterList { for ip := range clusterList[i].Master { ipList[ip] = struct{}{} } } condIP := make(operator.M) condIP["status"] = common.StatusRunning condP := operator.NewLeafCondition(operator.Eq, condIP) nodes, err := model.ListNode(context.Background(), condP, &storeopt.ListOption{All: true}) if err != nil { blog.Errorf("getAllIPList ListNode failed: %v", err) return nil } for i := range nodes { ipList[nodes[i].InnerIP] = struct{}{} } return ipList }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *IPsService) List(ctx context.Context) ([]IP, *Response, error) {\n\tpath := fmt.Sprintf(\"%v/detail/\", ipsBasePath)\n\n\treq, err := s.client.NewRequest(http.MethodGet, path, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\troot := new(ipsRoot)\n\tresp, err := s.client.Do(ctx, req, root)\n\tif...
[ "0.6849254", "0.6244091", "0.5910938", "0.5899652", "0.57825124", "0.57562876", "0.5694492", "0.5693584", "0.5602305", "0.5589911", "0.55665326", "0.55433226", "0.54862577", "0.54790694", "0.5465517", "0.5461873", "0.5425544", "0.53980386", "0.5375369", "0.5363251", "0.535616...
0.61650884
2
GetUserClusterPermList get user cluster permission
func GetUserClusterPermList(user UserInfo, clusterList []string) (map[string]*proto.Permission, error) { permissions := make(map[string]*proto.Permission) cli := &cluster.BCSClusterPerm{} actionIDs := []string{cluster.ClusterView.String(), cluster.ClusterManage.String(), cluster.ClusterDelete.String()} perms, err := cli.GetMultiClusterMultiActionPermission(user.UserID, user.ProjectID, clusterList, actionIDs) if err != nil { return nil, err } for clusterID, perm := range perms { permissions[clusterID] = &proto.Permission{ Policy: perm, } } return permissions, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetUserPermListByProjectAndCluster(user UserInfo, clusterList []string, filterUse bool) (map[string]*proto.Permission, error) {\n\tpermissions := make(map[string]*proto.Permission)\n\n\t// policyCode resourceType clusterList\n\tfor _, clusterID := range clusterList {\n\t\tdefaultPerm := auth.GetInitPerm(true...
[ "0.7636283", "0.71130735", "0.5741309", "0.5673176", "0.56616306", "0.5642498", "0.5625123", "0.55157167", "0.550617", "0.54891", "0.54313993", "0.54297036", "0.53427935", "0.5333762", "0.531025", "0.5310238", "0.529976", "0.5285257", "0.5264322", "0.52617234", "0.52366245", ...
0.8238796
0
GetUserPermListByProjectAndCluster get user cluster permissions
func GetUserPermListByProjectAndCluster(user UserInfo, clusterList []string, filterUse bool) (map[string]*proto.Permission, error) { permissions := make(map[string]*proto.Permission) // policyCode resourceType clusterList for _, clusterID := range clusterList { defaultPerm := auth.GetInitPerm(true) permissions[clusterID] = &proto.Permission{ Policy: defaultPerm, } } return permissions, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetUserClusterPermList(user UserInfo, clusterList []string) (map[string]*proto.Permission, error) {\n\tpermissions := make(map[string]*proto.Permission)\n\tcli := &cluster.BCSClusterPerm{}\n\n\tactionIDs := []string{cluster.ClusterView.String(), cluster.ClusterManage.String(), cluster.ClusterDelete.String()}\...
[ "0.76727074", "0.7316964", "0.6054277", "0.604634", "0.5853511", "0.57059836", "0.56702274", "0.5662144", "0.5530473", "0.5488563", "0.5409145", "0.53811985", "0.53752625", "0.5248118", "0.5241422", "0.5221002", "0.5150384", "0.5136137", "0.5131411", "0.5123411", "0.5080903",...
0.8364669
0
GetClusterCreatePerm get cluster create permission by user
func GetClusterCreatePerm(user UserInfo) map[string]bool { permissions := make(map[string]bool) // attention: v0 permission only support project permissions["test"] = true permissions["prod"] = true permissions["create"] = true return permissions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetUserPermListByProjectAndCluster(user UserInfo, clusterList []string, filterUse bool) (map[string]*proto.Permission, error) {\n\tpermissions := make(map[string]*proto.Permission)\n\n\t// policyCode resourceType clusterList\n\tfor _, clusterID := range clusterList {\n\t\tdefaultPerm := auth.GetInitPerm(true...
[ "0.63714695", "0.6282406", "0.5705621", "0.56503934", "0.56013805", "0.5566028", "0.55602676", "0.5558598", "0.5530747", "0.552794", "0.54925996", "0.54693615", "0.5449176", "0.5403863", "0.5362785", "0.53541005", "0.53517973", "0.5348801", "0.53400254", "0.53187317", "0.5315...
0.8883577
0
CheckUseNodesPermForUser check user use nodes permission
func CheckUseNodesPermForUser(businessID string, user string, nodes []string) bool { bizID, err := strconv.Atoi(businessID) if err != nil { errMsg := fmt.Errorf("strconv BusinessID to int failed: %v", err) blog.Errorf(errMsg.Error()) return false } return canUseHosts(bizID, user, nodes) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Command) canAccess(r *http.Request, user *userState) accessResult {\n\tif c.AdminOnly && (c.UserOK || c.GuestOK || c.UntrustedOK) {\n\t\tlogger.Panicf(\"internal error: command cannot have AdminOnly together with any *OK flag\")\n\t}\n\n\tif user != nil && !c.AdminOnly {\n\t\t// Authenticated users do any...
[ "0.53122437", "0.5281791", "0.5281775", "0.5256282", "0.5237384", "0.5215866", "0.51346487", "0.5133892", "0.51283", "0.5124426", "0.51170623", "0.510045", "0.5097251", "0.50586534", "0.5048094", "0.5030782", "0.49881282", "0.49571005", "0.49561796", "0.49313322", "0.4897643"...
0.8255833
0
importClusterExtraOperation extra operation (sync cluster to passcc)
func importClusterExtraOperation(cluster *proto.Cluster) { // sync cluster/cluster-snap info to pass-cc err := passcc.GetCCClient().CreatePassCCCluster(cluster) if err != nil { blog.Errorf("ImportClusterExtraOperation[%s] CreatePassCCCluster failed: %v", cluster.ClusterID, err) } err = passcc.GetCCClient().CreatePassCCClusterSnapshoot(cluster) if err != nil { blog.Errorf("ImportClusterExtraOperation CreatePassCCClusterSnapshoot[%s] failed: %v", cluster.ClusterID, err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *Handler) importCluster(config *gkev1.GKEClusterConfig) (*gkev1.GKEClusterConfig, error) {\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tcluster, err := GetCluster(ctx, h.secretsCache, &config.Spec)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\tif err := h.createCAS...
[ "0.6103863", "0.57436365", "0.5697269", "0.54563576", "0.54550797", "0.53302664", "0.53095317", "0.5288244", "0.5267604", "0.5254226", "0.5233511", "0.52175516", "0.5189461", "0.5116505", "0.5082574", "0.5072907", "0.5043684", "0.5035357", "0.50312465", "0.5026622", "0.501762...
0.8505771
0
GetSession returns a MongoDB Session
func GetSession() *mgo.Session { if session == nil { var err error session, err = mgo.DialWithInfo(&mgo.DialInfo{ Addrs: []string{AppConfig.MongoDBHost}, Username: AppConfig.DBUser, Password: AppConfig.DBPwd, Timeout: 60 * time.Second, }) if err != nil { log.Fatalf("[GetSession]: %s\n", err) } } return session }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetSession() *mgo.Session {\n\n\tsession, err := mgo.Dial(\"mongodb://localhost\")\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\treturn session\n}", "func getSession() *mgo.Session {\n\n\t// We need this object to establish a session to our MongoDB.\n\t// using the .env to load the database information\n...
[ "0.7763258", "0.7729244", "0.77174616", "0.7714797", "0.7622922", "0.7610538", "0.7607445", "0.7607404", "0.7607404", "0.75904083", "0.74248", "0.7197448", "0.70316523", "0.70088005", "0.69970316", "0.6957453", "0.69071007", "0.68869203", "0.68112403", "0.66923857", "0.656717...
0.76879805
4
Add indexes into MongoDB
func addIndexes() { var err error userIndex := mgo.Index{ Key: []string{"email"}, Unique: true, Background: true, Sparse: true, } // Add indexes into MongoDB session := GetSession().Copy() defer session.Close() userCol := session.DB(AppConfig.Database).C("users") err = userCol.EnsureIndex(userIndex) if err != nil { log.Fatalf("[addIndexes]: %s\n", err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func addIndexes() {\n\tvar err error\n\tuserIndex := mgo.Index{\n\t\tKey: []string{\"email\"},\n\t\tUnique: true,\n\t\tBackground: true,\n\t\tSparse: true,\n\t}\n\n\tauthIndex := mgo.Index{\n\t\tKey: []string{\"sender_id\"},\n\t\tUnique: true,\n\t\tBackground: true,\n\t\tSparse: true,...
[ "0.8049515", "0.7906946", "0.71204585", "0.71009797", "0.7069479", "0.6932295", "0.6842536", "0.6802358", "0.679094", "0.6670864", "0.6619791", "0.6590732", "0.65583503", "0.6502643", "0.64861286", "0.6485306", "0.64831126", "0.6381865", "0.63740486", "0.6362152", "0.6322755"...
0.7849583
2
unmarshalPrio parses the Prioencoded data and stores the result in the value pointed to by info.
func unmarshalPrio(data []byte, info *Prio) error { return unmarshalStruct(data, info) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func marshalPrio(info *Prio) ([]byte, error) {\n\tif info == nil {\n\t\treturn []byte{}, fmt.Errorf(\"Prio: %w\", ErrNoArg)\n\t}\n\treturn marshalStruct(info)\n}", "func (pi *ProtoInfo) unmarshal(ad *netlink.AttributeDecoder) error {\n\n\t// Make sure we don't unmarshal into the same ProtoInfo twice.\n\tif pi.fi...
[ "0.6577112", "0.5219782", "0.51016974", "0.5092685", "0.5073904", "0.5039395", "0.49995887", "0.49094743", "0.4806477", "0.4751718", "0.472503", "0.47232008", "0.4706695", "0.46945775", "0.46726182", "0.46441156", "0.45968992", "0.45847493", "0.45667946", "0.45524022", "0.453...
0.8034607
0
marshalPrio returns the binary encoding of MqPrio
func marshalPrio(info *Prio) ([]byte, error) { if info == nil { return []byte{}, fmt.Errorf("Prio: %w", ErrNoArg) } return marshalStruct(info) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *Parameters) MarshalBinary() ([]byte, error) {\n\tif p.N == 0 { // if N is 0, then p is the zero value\n\t\treturn []byte{}, nil\n\t}\n\tb := utils.NewBuffer(make([]byte, 0, 3+((2+len(p.Qi)+len(p.Pi))<<3)))\n\tb.WriteUint8(uint8(bits.Len64(p.N) - 1))\n\tb.WriteUint8(uint8(len(p.Qi)))\n\tb.WriteUint8(uint8(...
[ "0.58822757", "0.58489716", "0.54703814", "0.5352939", "0.5244442", "0.52092755", "0.5113366", "0.5069259", "0.5049839", "0.49863398", "0.4983973", "0.4955698", "0.49072796", "0.48997742", "0.489945", "0.48868656", "0.4884658", "0.4880819", "0.48767295", "0.48668808", "0.4858...
0.7522036
0
Returns a copy of the array that as been solved with a simple sudoku style solver
func deduceWhatWeCan(restrictions [][]int) [][]int { updatedArray, changeMade := attemptToReduce(restrictions) for changeMade { updatedArray, changeMade = attemptToReduce(updatedArray) } return updatedArray }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func solveSudoku(board [][]byte) {\n\n}", "func solve(board [][]byte) {\n \n}", "func solveSudoku(board [][]byte) {\n\tsolve(board, 0, 0)\n}", "func (a Ant) BorraSolucion(){\n (*a.solution) = make([]int, 0)\n}", "func (this *Solution) Reset() []int {\nreturn this.arr\n}", "func (s *Sudoku) SudokuI...
[ "0.67193305", "0.64270633", "0.62536854", "0.61941683", "0.6049497", "0.6033678", "0.58965313", "0.589649", "0.58708674", "0.5849783", "0.579723", "0.5719005", "0.56586736", "0.56038004", "0.55810887", "0.55595493", "0.5537374", "0.54805875", "0.5387022", "0.53836954", "0.534...
0.0
-1
Index of first array matches the column number, then the second array contains all indexs of restrictions that match
func buildColumnToPossibleRestrictions(tickets []Ticket, restrictions []FieldDef) [][]int { numberOfColumns := len(restrictions) rowToRestrictions := make([][]int, numberOfColumns) for i := 0; i < numberOfColumns; i++ { rowToRestrictions[i] = buildPossibleRestrictionsForColumn(getColumn(tickets, i), restrictions) } return rowToRestrictions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func IndexFindAllIndex(x *suffixarray.Index, r *regexp.Regexp, n int) [][]int", "func indexDiff(a, b []string) []int {\n\tm := make(map[string]bool)\n\tdiff := []int{}\n\n\tfor _, item := range b {\n\t\t m[item] = true\n\t}\n\n\tfor i, item := range a {\n\t\tif _, ok := m[item]; !ok {\n\t\t\tdiff = append(diff,...
[ "0.5408901", "0.5372722", "0.51973224", "0.5108608", "0.5081069", "0.5075441", "0.5071634", "0.49702466", "0.4949031", "0.49230248", "0.48864025", "0.48742807", "0.4862145", "0.48436132", "0.4823846", "0.47946924", "0.47935823", "0.47839373", "0.4770979", "0.4752496", "0.4733...
0.5508602
0
Serialize implement Serializable interface serialize a variable bytes array into format below: variable length + bytes[]
func (vb *VarBytes) Serialize(w io.Writer) error { var varlen = VarUint{UintType: GetUintTypeByValue(vb.Len), Value: vb.Len} if err := varlen.Serialize(w); err != nil { return err } return binary.Write(w, binary.LittleEndian, vb.Bytes) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *RecBytes) Serialize() []byte {\n\tres := make([]byte, 0, len(r.Path)+len(r.Time)+len(r.Val)+3)\n\tres = append(res, r.Path...)\n\tres = append(res, ' ')\n\tres = append(res, r.Val...)\n\tres = append(res, ' ')\n\tres = append(res, r.Time...)\n\tres = append(res, '\\n')\n\n\treturn res\n}", "func (n Byte...
[ "0.60886234", "0.6066471", "0.5919572", "0.573001", "0.55983853", "0.5585901", "0.55529904", "0.5549069", "0.553861", "0.5525328", "0.5523632", "0.5516", "0.54950243", "0.54753387", "0.5423635", "0.541514", "0.54085726", "0.53678983", "0.53493255", "0.53365976", "0.5331272", ...
0.63819116
0
Deserialize implement Deserialiazable interface deserialize a variable bytes arrary from buffer see Serialize above as reference
func (vb *VarBytes) Deserialize(r io.Reader) error { var varlen VarUint if err := varlen.Deserialize(r); err != nil { return err } vb.Len = uint64(varlen.Value) vb.Bytes = make([]byte, vb.Len) return binary.Read(r, binary.LittleEndian, vb.Bytes) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func deserialize(src []byte, dst interface{}) error {\n\tdec := gob.NewDecoder(bytes.NewBuffer(src))\n\tif err := dec.Decode(dst); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func Deserialize(buffer []byte) *block {\n\tvar b block\n\tdecoder := gob.NewDecoder(bytes.NewReader(buffer)) // convert []byte ...
[ "0.6612194", "0.6521848", "0.6435393", "0.63997245", "0.6359135", "0.633301", "0.62487584", "0.61810875", "0.6155041", "0.60449594", "0.6040225", "0.60215473", "0.5947103", "0.59352154", "0.59306705", "0.5907481", "0.5892002", "0.5888056", "0.5870201", "0.5865612", "0.5861259...
0.611553
9
Exec_Withdraw exec asset withdraw
func (z *zksync) Exec_Withdraw(payload *types.AssetsWithdraw, tx *types.Transaction, index int) (*types.Receipt, error) { action := NewAction(z, tx, index) return action.AssetWithdraw(payload, tx, index) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (_IWETH *IWETHTransactor) Withdraw(opts *bind.TransactOpts, arg0 *big.Int) (*types.Transaction, error) {\r\n\treturn _IWETH.contract.Transact(opts, \"withdraw\", arg0)\r\n}", "func (_PBridge *PBridgeTransactor) ExecuteWithdrawTx(opts *bind.TransactOpts, txKey string, to common.Address, amount *big.Int, isER...
[ "0.7312641", "0.72754675", "0.71570385", "0.7136819", "0.7123336", "0.7105116", "0.71018606", "0.7083507", "0.7048111", "0.7032736", "0.70042676", "0.6964425", "0.6914816", "0.68968433", "0.68824387", "0.68595165", "0.68546516", "0.6827496", "0.6759343", "0.67280483", "0.6726...
0.80167997
0
Evaluate returns the input traits unmodified.
func (NullEvaluator) Evaluate(ctx context.Context, input *EvaluationInput) (*EvaluationOutput, error) { return &EvaluationOutput{ Traits: input.Traits, }, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Strategy) Evaluate(pods []v1.Pod) []v1.Pod {\n\tlog.Printf(\"Evaluate called with %d pods\", len(pods))\n\tpods = s.eval(pods)\n\tlog.Printf(\"Evaluate exiting with %d pods\", len(pods))\n\treturn pods\n}", "func Evaluate(item interface{}, passedContext interface{}) map[string]float64 {\n\t//fmt.Fprintf...
[ "0.6244661", "0.612793", "0.6052038", "0.5920062", "0.5904791", "0.57955474", "0.5789945", "0.57720846", "0.5768817", "0.57387304", "0.57387304", "0.5710845", "0.56974244", "0.56859833", "0.5674682", "0.5674682", "0.56727636", "0.5640962", "0.56262887", "0.56128746", "0.55172...
0.6993517
0
NewConfigMapReplicator creates a new config map replicator
func NewConfigMapReplicator(client kubernetes.Interface, resyncPeriod time.Duration, allowAll bool) Replicator { repl := objectReplicator{ replicatorProps: replicatorProps{ Name: "config map", allowAll: allowAll, client: client, targetsFrom: make(map[string][]string), targetsTo: make(map[string][]string), watchedTargets: make(map[string][]string), watchedPatterns: make(map[string][]targetPattern), }, replicatorActions: ConfigMapActions, } namespaceStore, namespaceController := cache.NewInformer( &cache.ListWatch{ ListFunc: func(lo metav1.ListOptions) (runtime.Object, error) { list, err := client.CoreV1().Namespaces().List(lo) if err != nil { return list, err } // populate the store already, to avoid believing some items are deleted copy := make([]interface{}, len(list.Items)) for index := range list.Items { copy[index] = &list.Items[index] } repl.namespaceStore.Replace(copy, "init") return list, err }, WatchFunc: func(lo metav1.ListOptions) (watch.Interface, error) { return client.CoreV1().Namespaces().Watch(lo) }, }, &v1.Namespace{}, resyncPeriod, cache.ResourceEventHandlerFuncs{ AddFunc: repl.NamespaceAdded, UpdateFunc: func(old interface{}, new interface{}) {}, DeleteFunc: func(obj interface{}) {}, }, ) repl.namespaceStore = namespaceStore repl.namespaceController = namespaceController objectStore, objectController := cache.NewInformer( &cache.ListWatch{ ListFunc: func(lo metav1.ListOptions) (runtime.Object, error) { list, err := client.CoreV1().ConfigMaps("").List(lo) if err != nil { return list, err } // populate the store already, to avoid believing some items are deleted copy := make([]interface{}, len(list.Items)) for index := range list.Items { copy[index] = &list.Items[index] } repl.objectStore.Replace(copy, "init") return list, err }, WatchFunc: func(lo metav1.ListOptions) (watch.Interface, error) { return client.CoreV1().ConfigMaps("").Watch(lo) }, }, &v1.ConfigMap{}, resyncPeriod, cache.ResourceEventHandlerFuncs{ AddFunc: repl.ObjectAdded, UpdateFunc: func(old interface{}, new interface{}) { repl.ObjectAdded(new) }, DeleteFunc: repl.ObjectDeleted, }, ) repl.objectStore = objectStore repl.objectController = objectController return &repl }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newConfigMap(configMapName, namespace string, labels map[string]string,\n\tkibanaIndexMode, esUnicastHost, rootLogger, nodeQuorum, recoverExpectedShards, primaryShardsCount, replicaShardsCount string) *v1.ConfigMap {\n\n\terr, data := renderData(kibanaIndexMode, esUnicastHost, nodeQuorum, recoverExpectedShard...
[ "0.71497184", "0.6927563", "0.65653753", "0.6345264", "0.6338276", "0.63350874", "0.6253385", "0.61591893", "0.6085698", "0.60481936", "0.60005623", "0.598205", "0.5976869", "0.5919875", "0.59195656", "0.59191275", "0.59029496", "0.588134", "0.5876783", "0.58281237", "0.57945...
0.8266834
0
RequestIDFromContext is get the request id from context
func RequestIDFromContext(ctx context.Context) string { return ctx.Value(requestIDKey).(string) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func RequestIDFromContext(ctx context.Context) string {\n\tif ctx == nil {\n\t\treturn \"\"\n\t}\n\tif gCtx, ok := ctx.(*gin.Context); ok {\n\t\tctx = gCtx.Request.Context()\n\t}\n\tif requestId, ok := ctx.Value(requestIdKey).(string); ok {\n\t\treturn requestId\n\t}\n\treturn \"\"\n}", "func ContextRequestId(ct...
[ "0.8282987", "0.77042204", "0.769616", "0.76211", "0.76147074", "0.7583506", "0.75634944", "0.7542204", "0.75279135", "0.7511003", "0.749952", "0.7479339", "0.7449342", "0.7335127", "0.7257361", "0.7229935", "0.7225493", "0.7152414", "0.71456414", "0.7142945", "0.7142945", ...
0.79195726
1