text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (in *RedisInsight) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.6269516348838806,
0.2950439453125,
0.6868825554847717,
0.7014667987823486,
-0.8661172986030579,
0.2946358919143677,
0.16376328468322754,
0.14292125403881073,
0.06786786764860153,
-0.34510716795921326,
-0.3466792702674866,
-0.00883413851261139,
-0.015757707878947258,
-0.06416421383619308... |
func (in *RedisInsightList) DeepCopyInto(out *RedisInsightList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]RedisInsight, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
-0.4278976619243622,
0.4349581301212311,
0.7929214239120483,
0.38258665800094604,
-0.8008212447166443,
-0.06036396324634552,
-0.5886873602867126,
0.6429598331451416,
-0.269194632768631,
0.5162327289581299,
-1.0924054384231567,
0.8900977373123169,
-0.028328806161880493,
0.24576468765735626,... |
func (in *RedisInsightList) DeepCopy() *RedisInsightList {
if in == nil {
return nil
}
out := new(RedisInsightList)
in.DeepCopyInto(out)
return out
} | [
-0.692358136177063,
0.47650715708732605,
0.4368082284927368,
0.8470458388328552,
-0.8368579745292664,
0.034645285457372665,
-0.6462867856025696,
-0.20004050433635712,
0.298017293214798,
0.6391242146492004,
-1.4013574123382568,
0.20599542558193207,
-0.7307359576225281,
0.5328599214553833,
... |
func (in *RedisInsightList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.8068479299545288,
0.29628095030784607,
0.6592931151390076,
0.688476026058197,
-0.8395501375198364,
0.35407036542892456,
0.14488007128238678,
0.34517812728881836,
0.28557994961738586,
-0.017930934205651283,
-0.8817700147628784,
0.06405474245548248,
-0.11899863183498383,
0.355520188808441... |
func (in *RedisInsightSpec) DeepCopyInto(out *RedisInsightSpec) {
*out = *in
if in.MaxClients != nil {
in, out := &in.MaxClients, &out.MaxClients
*out = new(int64)
**out = **in
}
if in.ConnectedClients != nil {
in, out := &in.ConnectedClients, &out.ConnectedClients
*out = new(int64)
**out = **in
}
if ... | [
0.42922091484069824,
-0.11059320718050003,
0.8699358105659485,
-0.6089066863059998,
-0.7491284608840942,
-0.7198612093925476,
-0.15807394683361053,
-0.3474212884902954,
-0.9018130302429199,
0.03065270557999611,
-0.9708118438720703,
0.9755470752716064,
-0.1257055103778839,
0.435713738203048... |
func (in *RedisInsightSpec) DeepCopy() *RedisInsightSpec {
if in == nil {
return nil
}
out := new(RedisInsightSpec)
in.DeepCopyInto(out)
return out
} | [
-0.06663616746664047,
0.6652446985244751,
0.3133212924003601,
0.00359637220390141,
-0.6147184371948242,
0.059272848069667816,
-0.4447559118270874,
-0.4425830841064453,
-0.28223717212677,
0.8092740774154663,
-1.0181509256362915,
0.27954307198524475,
0.20114578306674957,
0.19244028627872467,... |
func (in *RedisQueries) DeepCopyInto(out *RedisQueries) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
} | [
0.166000097990036,
-0.10521631687879562,
0.49915027618408203,
0.0011281967163085938,
-0.6614793539047241,
0.5013425350189209,
0.18413884937763214,
0.0014320580521598458,
-0.6808926463127136,
0.14397123456001282,
-0.09949683398008347,
1.059154748916626,
0.25978395342826843,
0.11891929805278... |
func (in *RedisQueries) DeepCopy() *RedisQueries {
if in == nil {
return nil
}
out := new(RedisQueries)
in.DeepCopyInto(out)
return out
} | [
-0.10638944059610367,
0.6723380088806152,
-0.020217344164848328,
0.8674548268318176,
-0.11131294816732407,
0.16666053235530853,
0.15931671857833862,
-0.7613193392753601,
0.5020440816879272,
0.07922811061143875,
0.1816919595003128,
-0.0031107598915696144,
-0.7065091133117676,
0.281654328107... |
func (in *RedisQueries) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.15704408288002014,
0.13209553062915802,
0.5750965476036072,
0.31175148487091064,
-0.8276257514953613,
0.729812741279602,
0.7884158492088318,
-0.2947559654712677,
-0.0494721382856369,
-0.49906837940216064,
-0.10031164437532425,
-0.18327435851097107,
-0.030815524980425835,
-0.017365928739... |
func (in *RedisQueriesList) DeepCopyInto(out *RedisQueriesList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]RedisQueries, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
0.1825943887233734,
0.4337981939315796,
0.5450569987297058,
0.18568526208400726,
-0.7173786163330078,
0.44101274013519287,
-0.178287073969841,
0.0719427615404129,
-0.21413777768611908,
0.4559158384799957,
-0.7147241830825806,
0.34948697686195374,
-0.14660881459712982,
-0.001122472109273076... |
func (in *RedisQueriesList) DeepCopy() *RedisQueriesList {
if in == nil {
return nil
}
out := new(RedisQueriesList)
in.DeepCopyInto(out)
return out
} | [
-0.3218643367290497,
0.12042861431837082,
-0.047440603375434875,
0.6650989055633545,
-0.33830487728118896,
0.3975774943828583,
0.1452094167470932,
-0.8179752230644226,
0.5462642312049866,
0.3868887424468994,
-0.7375082969665527,
-0.6504504084587097,
-0.07198698818683624,
0.2180654257535934... |
func (in *RedisQueriesList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.3804869055747986,
0.13446061313152313,
0.5345017910003662,
0.2860950231552124,
-0.682806670665741,
0.8160737752914429,
0.7327793836593628,
-0.23315684497356415,
0.1631336510181427,
-0.3106987476348877,
-0.6737847328186035,
-0.3240777552127838,
-0.15030762553215027,
0.19590036571025848,
... |
func (in *RedisQueriesSpec) DeepCopyInto(out *RedisQueriesSpec) {
*out = *in
if in.Queries != nil {
in, out := &in.Queries, &out.Queries
*out = make([]RedisQuerySpec, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
0.6247884035110474,
0.4538312256336212,
0.43192753195762634,
-0.3289774954319,
-0.44400736689567566,
0.33832404017448425,
-0.26622679829597473,
0.15258118510246277,
-0.6424326300621033,
0.5636641979217529,
-0.49621888995170593,
0.5801763534545898,
0.255568265914917,
-0.026978058740496635,
... |
func (in *RedisQueriesSpec) DeepCopy() *RedisQueriesSpec {
if in == nil {
return nil
}
out := new(RedisQueriesSpec)
in.DeepCopyInto(out)
return out
} | [
0.46480226516723633,
0.3398851156234741,
-0.1396128535270691,
-0.1195785254240036,
-0.3773060739040375,
0.5855339765548706,
0.07937993854284286,
-0.5302309989929199,
0.14450494945049286,
0.8156127333641052,
-0.38922786712646484,
-0.3231041133403778,
0.547781229019165,
-0.387026846408844,
... |
func (in *RedisQuerySpec) DeepCopyInto(out *RedisQuerySpec) {
*out = *in
if in.QueryTimestamp != nil {
in, out := &in.QueryTimestamp, &out.QueryTimestamp
*out = (*in).DeepCopy()
}
if in.ExecTimeMicroSeconds != nil {
in, out := &in.ExecTimeMicroSeconds, &out.ExecTimeMicroSeconds
*out = new(int64)
**out = *... | [
0.16968952119350433,
0.323193222284317,
0.61474609375,
-0.3785877823829651,
-0.42498043179512024,
-0.014528770931065083,
-0.08686836808919907,
0.14073722064495087,
-0.7362887263298035,
0.45330026745796204,
-0.19612464308738708,
0.8170015811920166,
0.17338155210018158,
-0.09274890273809433,... |
func (in *RedisQuerySpec) DeepCopy() *RedisQuerySpec {
if in == nil {
return nil
}
out := new(RedisQuerySpec)
in.DeepCopyInto(out)
return out
} | [
-0.28913864493370056,
0.7729161381721497,
-0.05956963822245598,
-0.20820185542106628,
-0.7544584274291992,
0.2815985083580017,
0.16327928006649017,
-0.20589764416217804,
0.08584164083003998,
0.4594205319881439,
0.03901364654302597,
0.3109573423862457,
0.5410506725311279,
-0.480534374713897... |
func (in *RedisSchemaOverview) DeepCopyInto(out *RedisSchemaOverview) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
} | [
-0.2594870328903198,
0.2962782084941864,
0.7037614583969116,
-0.40940409898757935,
-0.5531907677650452,
-0.102918840944767,
-0.2104923278093338,
0.6256228089332581,
-0.6670941710472107,
-0.5833388566970825,
-0.19423213601112366,
0.9365553259849548,
0.6536288857460022,
-0.013186044991016388... |
func (in *RedisSchemaOverview) DeepCopy() *RedisSchemaOverview {
if in == nil {
return nil
}
out := new(RedisSchemaOverview)
in.DeepCopyInto(out)
return out
} | [
-1.0295857191085815,
0.5337746739387512,
0.3231114149093628,
-0.189828023314476,
-0.8928863406181335,
-0.42168381810188293,
-0.28609803318977356,
0.5414178967475891,
0.03618476912379265,
-0.4174904525279999,
0.00016818182484712452,
-0.3832617402076721,
-0.09013209491968155,
-0.047672573477... |
func (in *RedisSchemaOverview) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.7924383878707886,
0.47301405668258667,
0.6826293468475342,
0.15554608404636383,
-0.7087414860725403,
0.1317378729581833,
0.6099810004234314,
0.7623958587646484,
0.0020182107109576464,
-0.887491762638092,
0.08479341864585876,
-0.052725616842508316,
0.4085465967655182,
-0.082784503698349,... |
func (in *RedisSchemaOverviewList) DeepCopyInto(out *RedisSchemaOverviewList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]RedisSchemaOverview, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)... | [
-0.6819863319396973,
1.0979254245758057,
0.7182357907295227,
-0.07451822608709335,
-0.7203550338745117,
-0.0907696932554245,
-0.39561203122138977,
1.0728821754455566,
-0.3437325954437256,
0.16708698868751526,
-0.6308913826942444,
0.15205883979797363,
0.24205784499645233,
0.1753063648939132... |
func (in *RedisSchemaOverviewList) DeepCopy() *RedisSchemaOverviewList {
if in == nil {
return nil
}
out := new(RedisSchemaOverviewList)
in.DeepCopyInto(out)
return out
} | [
-0.9939720630645752,
1.220693588256836,
0.3317956328392029,
-0.03683243691921234,
-0.9215264320373535,
0.12166032195091248,
-0.26858195662498474,
0.652095377445221,
0.19558730721473694,
0.4447099566459656,
-0.8127145767211914,
-0.5960310697555542,
0.3180926442146301,
0.7010766863822937,
... |
func (in *RedisSchemaOverviewList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-1.0735647678375244,
0.796697735786438,
0.6216523051261902,
0.18291603028774261,
-0.7857696413993835,
0.2235942929983139,
0.4262351095676422,
0.9404414892196655,
0.129824697971344,
-0.548268735408783,
-0.4532526433467865,
-0.3773307204246521,
0.4472418427467346,
0.43440061807632446,
-0.9... |
func (in *RedisSchemaOverviewSpec) DeepCopyInto(out *RedisSchemaOverviewSpec) {
*out = *in
if in.Databases != nil {
in, out := &in.Databases, &out.Databases
*out = make([]RedisDatabaseSpec, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
0.10328199714422226,
1.5206003189086914,
0.6610634922981262,
-0.3151242434978485,
-0.5454772114753723,
0.2132716327905655,
-0.20537129044532776,
0.9876129031181335,
-0.697497546672821,
0.3694967031478882,
-0.41312724351882935,
0.9239674210548401,
0.12452349066734314,
0.14568772912025452,
... |
func (in *RedisSchemaOverviewSpec) DeepCopy() *RedisSchemaOverviewSpec {
if in == nil {
return nil
}
out := new(RedisSchemaOverviewSpec)
in.DeepCopyInto(out)
return out
} | [
-0.2306431382894516,
0.7737864255905151,
0.3128669559955597,
-0.6506819725036621,
-0.8580819368362427,
0.38047853112220764,
-0.08849771320819855,
0.37914955615997314,
0.11762907356023788,
0.3876306116580963,
-0.20477764308452606,
-0.12004188448190689,
0.7686136960983276,
0.0853016525506973... |
func (in *RuleExecution) DeepCopyInto(out *RuleExecution) {
*out = *in
if in.RuleId != nil {
in, out := &in.RuleId, &out.RuleId
*out = new(int64)
**out = **in
}
if in.Hits != nil {
in, out := &in.Hits, &out.Hits
*out = new(int64)
**out = **in
}
return
} | [
0.6359559297561646,
0.054988645017147064,
0.417326956987381,
0.07534389942884445,
0.26157060265541077,
-0.041463401168584824,
0.1482212245464325,
0.9253285527229309,
-1.277116298675537,
-0.05347491428256035,
-0.46534600853919983,
1.3860719203948975,
0.1257776916027069,
0.059135809540748596... |
func (in *RuleExecution) DeepCopy() *RuleExecution {
if in == nil {
return nil
}
out := new(RuleExecution)
in.DeepCopyInto(out)
return out
} | [
0.5329786539077759,
0.3788236379623413,
0.061004914343357086,
1.4310178756713867,
0.4550594091415405,
-0.07051698118448257,
0.6431627869606018,
0.1942337304353714,
-0.44102227687835693,
0.028752155601978302,
-0.5440699458122253,
0.35882773995399475,
-0.17457327246665955,
0.0559242479503154... |
func NSData_WithBytes(b []byte, length uint64) NSData {
buf := C.CBytes(b)
defer C.free(buf)
return NSData_dataWithBytes_length_(buf, NSUInteger(length))
} | [
0.7789793610572815,
0.6642688512802124,
0.280059278011322,
-0.6719260215759277,
-1.1315499544143677,
0.16689060628414154,
-1.5151299238204956,
-1.2243260145187378,
0.7389581203460693,
-0.4854043126106262,
-0.8830245733261108,
0.4766576588153839,
0.27551040053367615,
0.6416606307029724,
-... |
func (d NSData) Length() uint64 {
return uint64(d.gen_NSData.Length())
} | [
-0.1878773421049118,
0.8999075889587402,
-0.07776376605033875,
0.005502292886376381,
-0.02884582430124283,
1.0294331312179565,
0.0672835260629654,
0.32566291093826294,
0.19251109659671783,
-0.7493716478347778,
-0.26979395747184753,
0.6916335225105286,
1.1130260229110718,
0.9545174837112427... |
func (d NSData) Bytes() []byte {
length := d.Length()
if length == 0 {
return nil
}
ptr := d.gen_NSData.Bytes()
return C.GoBytes(ptr, C.int(length))
} | [
-0.43441450595855713,
1.2665839195251465,
0.23292361199855804,
-0.6011706590652466,
0.1282985955476761,
0.2822124660015106,
-1.386460781097412,
-1.155143141746521,
0.23373889923095703,
-1.271918535232544,
-0.555608332157135,
1.334519386291504,
0.1550997644662857,
0.5462955236434937,
-0.1... |
func rotateAndNormalizeVec332(quat *T, v *vec3.T) {
qv := T{v[0], v[1], v[2], 0}
inv := quat.Inverted()
q := Mul3(quat, &qv, &inv)
v[0] = q[0]
v[1] = q[1]
v[2] = q[2]
} | [
-0.3511260747909546,
-0.36073407530784607,
0.3793606460094452,
-1.10380220413208,
0.12295310199260712,
0.021802503615617752,
-1.1266090869903564,
-0.7193618416786194,
0.6103201508522034,
0.20711663365364075,
-0.4071579873561859,
0.7192096710205078,
-0.21962997317314148,
-0.7301967144012451... |
func rotateAndNormalizeVec364(quat *quaternion64.T, v *vec364.T) {
qv := quaternion64.T{v[0], v[1], v[2], 0}
inv := quat.Inverted()
q := quaternion64.Mul3(quat, &qv, &inv)
v[0] = q[0]
v[1] = q[1]
v[2] = q[2]
} | [
-0.1961258500814438,
-0.7957649230957031,
0.4909546375274658,
-0.2675040364265442,
0.5381059646606445,
-0.4990732669830322,
-1.2699546813964844,
-0.6675751805305481,
0.32642829418182373,
-0.2990403175354004,
-0.35522976517677307,
0.11311798542737961,
-0.650273859500885,
-1.0779081583023071... |
func ActionableErr(cfg interface{}, phase constants.Phase, err error) *proto.ActionableErr {
errCode, suggestions := getErrorCodeFromError(cfg, phase, err)
return &proto.ActionableErr{
ErrCode: errCode,
Message: err.Error(),
Suggestions: suggestions,
}
} | [
0.1338752657175064,
-1.0555553436279297,
0.3019249439239502,
0.7479382157325745,
-0.8227204084396362,
-0.5326063632965088,
0.046523865312337875,
0.5840398669242859,
0.28693610429763794,
0.5626970529556274,
0.6136552691459656,
0.3114050626754761,
-0.32498306035995483,
0.23379354178905487,
... |
func ActionableErrV2(cfg interface{}, phase constants.Phase, err error) *protoV2.ActionableErr {
errCode, suggestions := getErrorCodeFromError(cfg, phase, err)
suggestionsV2 := make([]*protoV2.Suggestion, len(suggestions))
for i, suggestion := range suggestions {
var suggestions2 protoV2.Suggestion
suggestions2.... | [
-0.8040764331817627,
-1.4727818965911865,
0.4748055040836334,
-0.05308837816119194,
-0.6740539073944092,
-0.5681959390640259,
-0.31521594524383545,
0.24182385206222534,
-0.2692316770553589,
0.6273329257965088,
0.1157919317483902,
1.0648653507232666,
-0.3068300783634186,
0.4471636712551117,... |
func (usr *UserAuth) createUserTable(cfg *config.CfgService) (err error) {
userSchema := []string{
"username TEXT",
"password TEXT",
"isAdmin INTEGER",
"loggedIn INTEGER",
"ccNumber INTEGER",
"ccExpiryMonth INTEGER",
"ccExpiryYear INTEGER",
"cvv INTEGER",
"cardName TEXT"}
userDefaultAdmin := map[st... | [
0.35557833313941956,
0.07922717183828354,
0.9327273368835449,
0.6415866017341614,
0.06641515344381332,
0.17625118792057037,
0.40710097551345825,
-0.09730469435453415,
-0.2768590450286865,
0.199323832988739,
-1.2049758434295654,
-0.10744769871234894,
-0.4595240652561188,
0.9171964526176453,... |
func (sc *ShardCtrler) Kill() {
sc.rf.Kill()
// Your code here, if desired.
sc.killCh <- struct{}{}
} | [
0.817777693271637,
-0.9554976224899292,
0.32085487246513367,
1.321938157081604,
1.0958455801010132,
0.3486967086791992,
-0.19196836650371552,
0.27390027046203613,
0.10035672783851624,
-0.6279597878456116,
-0.23230449855327606,
0.060392286628484726,
0.20784132182598114,
0.06564608961343765,... |
func (sc *ShardCtrler) Raft() *raft.Raft {
return sc.rf
} | [
0.8696796894073486,
0.41493868827819824,
0.16801044344902039,
0.040374089032411575,
0.4403476119041443,
0.11566229909658432,
0.43514537811279297,
-0.42734408378601074,
0.21019598841667175,
-1.03131103515625,
-0.039155811071395874,
0.8056012988090515,
0.08076159656047821,
-0.123155459761619... |
func StartServer(servers []*labrpc.ClientEnd, me int, persister *raft.Persister) *ShardCtrler {
sc := new(ShardCtrler)
sc.me = me
sc.configs = make([]Config, 1)
sc.configs[0].Groups = map[int][]string{}
labgob.Register(Op{})
labgob.Register(Op{})
labgob.Register(JoinArgs{})
labgob.Register(LeaveArgs{})
labgob... | [
0.525173008441925,
-0.4164569675922394,
0.6956678032875061,
0.6065974235534668,
0.4759722650051117,
0.051470134407281876,
0.4383491277694702,
0.2228713482618332,
0.1781330704689026,
-1.1129388809204102,
-0.33467957377433777,
0.4308125972747803,
-0.842081606388092,
0.5383022427558899,
0.6... |
func (b *Block) Segments() []*bar.Segment {
s := outputs.Pango(
pango.Icon("mdi-"+b.Icon).Large().Rise(-2800),
pango.Text(" ").Small(),
b.Text,
)
switch b.Color {
case "red":
s = s.Color(colors.Hex(red))
case "amber":
s = s.Color(colors.Hex(amber))
case "green":
s = s.Color(colors.Hex(green))
}
if... | [
-0.5700268149375916,
-0.08988238126039505,
0.43887048959732056,
-0.36608439683914185,
0.254672110080719,
0.08421909064054489,
-0.08367080241441727,
-1.0182936191558838,
0.4636618196964264,
-0.22749827802181244,
-0.0030865187291055918,
0.018069040030241013,
-0.23405884206295013,
0.595104575... |
func (e *EventService) Save(event *Event) error {
return e.Repository.save(event)
} | [
-0.5752212405204773,
0.07801245152950287,
0.15303252637386322,
-0.024448202922940254,
0.6903975605964661,
0.31326133012771606,
-0.13352088630199432,
0.21539165079593658,
0.276644766330719,
0.6628215312957764,
-1.4224046468734741,
0.2039753794670105,
-0.2089466005563736,
0.8010930418968201,... |
func New(cfg Config, k8ssvc k8s.Service, logger log.Logger) operator.Operator {
logger = logger.With("operator", operatorName)
handler := NewHandler(logger)
crd := NewMultiRoleBindingCRD(k8ssvc)
ctrl := controller.NewSequential(cfg.ResyncDuration, handler, crd, nil, logger)
return operator.NewOperator(crd, ctrl, ... | [
0.3006482720375061,
0.04009268432855606,
0.4603642523288727,
0.48677191138267517,
-1.1356743574142456,
-0.9175675511360168,
-0.157692551612854,
0.40563642978668213,
0.07200170308351517,
0.3325704038143158,
-0.21621212363243103,
-0.38579750061035156,
0.7871333956718445,
0.669482946395874,
... |
func TestNumInList(t *testing.T) {
t.Run("[1,2,3,4,5]", testNumInListFunc([]int{1, 2, 3, 4, 5}, 5, true))
t.Run("[1,2,3,4,5]", testNumInListFunc([]int{1, 2, 3, 4, 5}, -5, false))
t.Run("[1,2,3,4,5]", testNumInListFunc([]int{1, 2, 3, 4, 5}, 0, false))
t.Run("[]", testNumInListFunc([]int{}, 1, false))
t.Run("nil", t... | [
0.2321760356426239,
-0.4932316243648529,
0.6784759163856506,
0.45811113715171814,
-0.39350393414497375,
-0.4399167001247406,
0.8675973415374756,
1.15586256980896,
0.35453280806541443,
-0.16031774878501892,
-2.0139923095703125,
0.35796883702278137,
-0.6090176105499268,
0.7541189789772034,
... |
func (b *bucketInt64) deleteFunc(matches func(key int64, item *ItemInt64) bool, deletables chan *ItemInt64) int {
lookup := b.lookup
items := make([]*ItemInt64, 0)
b.RLock()
for key, item := range lookup {
if matches(key, item) {
deletables <- item
items = append(items, item)
}
}
b.RUnlock()
if len(i... | [
-0.1698349118232727,
0.3616742193698883,
0.51139235496521,
-0.06293565779924393,
0.05660197511315346,
-1.3532284498214722,
0.8474786281585693,
0.6042965650558472,
-0.3167736530303955,
-0.07350313663482666,
-0.09721416980028152,
-0.03334542363882065,
-0.028541438281536102,
-0.37764275074005... |
func PrepareIndex(creators map[string]Creator, cfg Config, games []GameSource) error {
indexPath := cfg.Filepath
indexFile, err := os.Stat(indexPath)
if !os.IsNotExist(err) && err != nil {
return err
}
if indexFile != nil {
err = os.RemoveAll(indexPath)
if err != nil {
return err
}
}
if creator, ok ... | [
-0.4440641403198242,
0.12244102358818054,
0.5515011548995972,
0.10968285799026489,
0.585929811000824,
0.33998650312423706,
0.5351245403289795,
0.4072958827018738,
0.07851257175207138,
0.4791383743286133,
-0.19042684137821198,
-0.2820812463760376,
0.5570684671401978,
-0.03718291223049164,
... |
func ParseFilterStr(filterStr string) (EntityFilter, error) {
filterParts := strings.Split(filterStr, ",")
filter := NewEntityFilter()
for _, filterStr := range filterParts {
if strings.TrimSpace(filterStr) == "" {
continue
}
newEntry, err := buildFilterEntry(filterStr)
if err != nil {
return filter,... | [
0.14123526215553284,
-0.7580164670944214,
0.13686774671077728,
0.19550909101963043,
-0.18118426203727722,
-0.9071112275123596,
0.05358767881989479,
-0.6576666831970215,
-0.07772953063249588,
0.17510421574115753,
0.03522660955786705,
0.667195200920105,
-0.34428533911705017,
0.52740347385406... |
func MsChapV2GetMasterKey(psswdHashHash, ntResponse []byte) []byte {
hsha1 := sha1.New()
hsha1.Write(psswdHashHash)
hsha1.Write(ntResponse)
hsha1.Write(keyMagic1[:])
digest := hsha1.Sum(nil)
return digest[:16]
} | [
0.655183732509613,
-1.2016810178756714,
0.6552887558937073,
0.07648704200983047,
-0.33441612124443054,
-0.2188112586736679,
-1.1240477561950684,
-0.0637471154332161,
0.18922126293182373,
-0.019562700763344765,
-0.47078737616539,
0.6967113614082336,
-0.20466434955596924,
0.10449495166540146... |
func MsChapV2GetAsymetricStartKey(masterKey []byte, keyLength uint, isSend, isServer bool) []byte {
var s []byte
if isSend == isServer {
s = keyMagic3[:]
} else {
s = keyMagic2[:]
}
hsha1 := sha1.New()
hsha1.Write(masterKey)
hsha1.Write(shsPad1[:])
hsha1.Write(s)
hsha1.Write(shsPad2[:])
digest := hsh... | [
0.14502789080142975,
-0.6210067868232727,
0.6863042712211609,
0.20891635119915009,
-0.5638521909713745,
-0.30078548192977905,
-0.5153510570526123,
-0.13844753801822662,
0.38470542430877686,
0.788515031337738,
0.008105273358523846,
1.519345998764038,
0.29916080832481384,
-0.0314348116517066... |
func handleComponentConditions(req *common.HcoRequest, component string, componentConds []metav1.Condition) bool {
if len(componentConds) == 0 {
getConditionsForNewCr(req, component)
return false
}
return setConditionsByOperandConditions(req, component, componentConds)
} | [
-0.5366557836532593,
-0.2689298689365387,
0.39756330847740173,
-0.22953590750694275,
0.10337276011705399,
0.08462166041135788,
0.5343504548072815,
0.1765931248664856,
0.06149016320705414,
-0.046719010919332504,
-0.019506704062223434,
-1.4672099351882935,
-1.0171265602111816,
0.454546809196... |
func (s DeleteConfigurationSetEventDestinationInput) String() string {
return awsutil.Prettify(s)
} | [
0.11874338239431381,
0.2312726229429245,
0.18655231595039368,
-0.29671427607536316,
-0.13448624312877655,
0.3965163826942444,
0.5361199975013733,
-0.5205448269844055,
0.4549010097980499,
0.25571611523628235,
0.5691325068473816,
0.11355463415384293,
1.3385206460952759,
-0.5635963082313538,
... |
func (s *DeleteConfigurationSetEventDestinationInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DeleteConfigurationSetEventDestinationInput"}
if s.ConfigurationSetName == nil {
invalidParams.Add(aws.NewErrParamRequired("ConfigurationSetName"))
}
if s.EventDestinationName == nil {
inva... | [
-0.5322890877723694,
0.22729021310806274,
0.4873431324958801,
0.09518133848905563,
0.1121828630566597,
-0.0604381188750267,
0.06796421855688095,
0.04007386788725853,
-0.003400235902518034,
0.177777498960495,
0.8423756957054138,
-0.28332310914993286,
0.4313448965549469,
0.5857388377189636,
... |
func (s DeleteConfigurationSetEventDestinationOutput) String() string {
return awsutil.Prettify(s)
} | [
0.544532299041748,
-0.13928884267807007,
0.2518581748008728,
-0.22643038630485535,
-0.48594221472740173,
-0.24557630717754364,
0.5753081440925598,
-0.43943485617637634,
0.09059566259384155,
0.19766414165496826,
0.7491476535797119,
0.037849511951208115,
1.4757448434829712,
-0.75320392847061... |
func (r DeleteConfigurationSetEventDestinationRequest) Send(ctx context.Context) (*DeleteConfigurationSetEventDestinationResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &DeleteConfigurationSetEventDestinationResponse{
DeleteConfigurationSetEventDe... | [
-0.9941242337226868,
0.34286534786224365,
0.30730026960372925,
0.23042765259742737,
0.16618269681930542,
-0.6421276330947876,
0.202082559466362,
-0.2924054265022278,
0.39010223746299744,
0.44152718782424927,
-0.1012100949883461,
0.226854607462883,
0.8768193125724792,
-0.3069044351577759,
... |
func (r *DeleteConfigurationSetEventDestinationResponse) SDKResponseMetdata() *aws.Response {
return r.response
} | [
-0.24606291949748993,
0.023801224306225777,
0.3478546142578125,
-0.08560694754123688,
-0.015605511143803596,
-0.03337283805012703,
-0.3955320417881012,
0.07140684127807617,
1.0370110273361206,
0.1791994869709015,
0.024943668395280838,
-0.6733938455581665,
1.2937138080596924,
-1.05682635307... |
func leastInterval(tasks []byte, n int) int {
cnt := map[byte]int{}
maxCount := 0
for _, b := range tasks {
cnt[b]++
if cnt[b] > maxCount {
maxCount = cnt[b]
}
}
minCost := (maxCount - 1) * (n + 1)
for _, v := range cnt {
if v == maxCount {
minCost++
}
}
if minCost < len(tasks) {
return len(ta... | [
0.42170098423957825,
-0.42196178436279297,
0.6395260095596313,
-0.5157912969589233,
-0.8774031400680542,
-0.015072274021804333,
0.18707366287708282,
0.27382203936576843,
0.16978587210178375,
-0.6517803072929382,
-0.816794216632843,
-0.5649258494377136,
-1.0179563760757446,
0.50218605995178... |
func init() {
jobSubcmds[0].Subcommands = append(jobSubcmds[0].Subcommands, bucketSpecificCmds...)
jobSubcmds[0].Subcommands = append(jobSubcmds[0].Subcommands, xactionCmds()...)
} | [
0.6911712884902954,
-0.015979060903191566,
0.6252998113632202,
0.25565892457962036,
0.716765820980072,
0.4031311571598053,
-0.30462712049484253,
0.17181605100631714,
-0.34415990114212036,
-1.064622402191162,
-0.892601728439331,
1.3350740671157837,
1.166577696800232,
0.1629243791103363,
-... |
func (p *Parser) ParseUpdateOperation(request []byte, anchor bool) (*model.Operation, error) {
schema, err := p.parseUpdateRequest(request)
if err != nil {
return nil, err
}
_, err = p.ParseSignedDataForUpdate(schema.SignedData)
if err != nil {
return nil, err
}
if !anchor {
err = p.ValidateDelta(schema.... | [
-0.7666305303573608,
-0.16908223927021027,
0.7968869805335999,
0.09306872636079788,
-1.165972352027893,
0.11166847497224808,
0.9420662522315979,
0.018210265785455704,
0.7665612697601318,
0.15663591027259827,
-0.3694409132003784,
-0.9760018587112427,
-0.3681502640247345,
-0.7323117852210999... |
func (p *Parser) ParseSignedDataForUpdate(compactJWS string) (*model.UpdateSignedDataModel, error) {
jws, err := p.parseSignedData(compactJWS)
if err != nil {
return nil, fmt.Errorf("update: %s", err.Error())
}
schema := &model.UpdateSignedDataModel{}
err = json.Unmarshal(jws.Payload, schema)
if err != nil {
... | [
-0.14385539293289185,
-1.2907055616378784,
0.3001309335231781,
-0.4092658758163452,
-1.2885801792144775,
0.43854379653930664,
-0.0761752799153328,
0.16460059583187103,
0.09496702253818512,
-0.4628233313560486,
-0.15458905696868896,
-0.3345088064670563,
-0.3735837936401367,
0.21497945487499... |
func GetEarthquakes() []Earthquake {
earthquakeDetails := earthquakeData()
earthquakes := []Earthquake{}
for _, locFeature := range earthquakeDetails.Features {
earthquake := featureToEarthquakeFormat(locFeature)
earthquakes = append(earthquakes, *earthquake)
}
return earthquakes
} | [
-0.17809239029884338,
-0.7805082201957703,
0.6005405783653259,
-0.44197407364845276,
0.5965544581413269,
0.26221928000450134,
-0.6014251708984375,
-0.013455087319016457,
0.3543979823589325,
0.4456442892551422,
-0.3736231327056885,
0.5161578059196472,
0.19443030655384064,
0.7458947896957397... |
func GetEarthquake(id string) *Earthquake {
earthquakeDetails := earthquakeData()
for _, locFeature := range earthquakeDetails.Features {
if locFeature.ID == id {
return featureToEarthquakeFormat(locFeature)
}
}
return nil
} | [
0.011417652480304241,
-0.7935598492622375,
0.6578704118728638,
-0.6750659346580505,
0.07666309922933578,
-0.7247529029846191,
-0.6333398818969727,
-0.4624810814857483,
0.08928605914115906,
0.23698726296424866,
-0.14104005694389343,
0.6385712027549744,
0.03919537737965584,
0.234797313809394... |
func featureToEarthquakeFormat(l locationFeature) *Earthquake {
return &Earthquake{
ID: l.ID,
Place: l.Properties.Place,
Time: time.Unix(0, l.Properties.Time*int64(time.Millisecond)),
Magnitude: l.Properties.Mag,
Significance: l.Properties.Sig,
MoreInfoURL: l.Properties.URL,
... | [
0.0347914882004261,
-1.1621273756027222,
0.4707563519477844,
-1.0444645881652832,
-0.06639133393764496,
-0.38648685812950134,
-0.8464239835739136,
-0.06856890767812729,
0.369235098361969,
0.36711931228637695,
-0.32209470868110657,
0.355964720249176,
0.6167396903038025,
-0.02204805240035057... |
func TranslateToGreenSchema(path string, fs *FileSet) (*green.Schema, error) {
structs := make(map[string]*green.Struct)
for _, ele := range fs.Identities {
switch x := ele.(type) {
case *gen.Struct:
tr := green.Struct{
StructName: x.TypeName(),
}
for _, f := range x.Fields {
zc, zp := getCatP... | [
-0.5601171255111694,
-0.2984178066253662,
0.8416434526443481,
0.09190627187490463,
-0.20186693966388702,
0.34994450211524963,
0.30402544140815735,
-0.5750486254692078,
0.17886489629745483,
-0.5270692706108093,
-0.8255568742752075,
0.007165602408349514,
0.191118985414505,
-0.098071686923503... |
func Listen(cfg *ListenerConfig, onConn func(net.Conn) net.Conn) (net.Listener, error) {
cfg.applyDefaults()
l, err := kcp.ListenWithOptions(cfg.Listen, cfg.block, cfg.DataShard, cfg.ParityShard)
if err != nil {
return nil, err
}
if err := l.SetDSCP(cfg.DSCP); err != nil {
log.Errorf("Error setting DSCP: %v",... | [
1.1675997972488403,
-0.6151465177536011,
0.8482740521430969,
-0.2553955316543579,
-0.7594168782234192,
0.1401391625404358,
-0.805296778678894,
0.6444388031959534,
0.03599356859922409,
0.056344494223594666,
0.23741434514522552,
0.40038323402404785,
-0.6285893321037292,
0.5536866188049316,
... |
func ThreeSum(nums []int) [][]int {
var res = [][]int{}
if nums[0] == 0 && nums[1] == 0 && nums[2] == 0 {
res = append(res, []int{0, 0, 0})
return res
}
neg := make(map[int]bool)
pos := make(map[int]bool)
// sort the array in negative and positive
for i := 0; i < len(nums); i++ {
if nums[i] < 0 {
if... | [
-0.6204387545585632,
-0.7771304249763489,
1.0781517028808594,
0.29458221793174744,
0.23990899324417114,
0.4137037396430969,
-0.4584014117717743,
-0.29387155175209045,
0.2398877590894699,
0.5939174890518188,
-0.31346216797828674,
-0.00865156389772892,
-0.42092451453208923,
-0.52106100320816... |
func WithDebugLevel(enable bool) Option {
return func(opt *option) {
if !enable {
return
}
opt.level = zapcore.DebugLevel
}
} | [
0.40120813250541687,
0.34343281388282776,
0.482852578163147,
0.4905027449131012,
-0.6222410798072815,
0.15229621529579163,
0.08404197543859482,
-0.6404772400856018,
0.49433380365371704,
0.2582660913467407,
-0.8579610586166382,
-0.9124946594238281,
-0.7441964149475098,
0.04348668456077576,
... |
func WithInfoLevel() Option {
return func(opt *option) {
opt.level = zapcore.InfoLevel
}
} | [
-0.0616275891661644,
-0.2891159653663635,
0.30230027437210083,
-0.28249359130859375,
-0.13342620432376862,
0.10305694490671158,
0.5589168667793274,
-0.696247935295105,
-0.6603344678878784,
-0.3540235757827759,
-0.6089516878128052,
0.18063433468341827,
-0.8920820951461792,
-0.51793432235717... |
func WithWarnLevel() Option {
return func(opt *option) {
opt.level = zapcore.WarnLevel
}
} | [
0.4645889699459076,
-0.27959293127059937,
0.4109562039375305,
0.28527629375457764,
-0.6476708650588989,
0.17981912195682526,
-0.12109088897705078,
-0.9104227423667908,
0.35196417570114136,
0.7546263933181763,
-0.7790855765342712,
0.1582486778497696,
0.29384085536003113,
-0.5216360688209534... |
func WithField(key, value string) Option {
return func(opt *option) {
opt.fields[key] = value
}
} | [
-0.16199609637260437,
0.3978736102581024,
0.2582131624221802,
-1.1892534494400024,
-0.1880856454372406,
0.6866272687911987,
-0.5302506685256958,
-0.6438113451004028,
-0.0028055731672793627,
0.4725292921066284,
-0.12265520542860031,
-0.6043691039085388,
0.4231727123260498,
-0.61094027757644... |
func WithFileP(file string) Option {
dir := filepath.Dir(file)
if err := os.MkdirAll(dir, 0766); err != nil {
panic(err)
}
f, err := os.OpenFile(file, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0766)
if err != nil {
panic(err)
}
return func(opt *option) {
opt.file = zapcore.Lock(f)
}
} | [
1.0638000965118408,
-0.5110554099082947,
0.838374137878418,
-0.1639704406261444,
-0.215910866856575,
0.6168717741966248,
1.0603032112121582,
-0.048584945499897,
0.6579420566558838,
0.5606784224510193,
0.12295198440551758,
-1.4792245626449585,
0.21110540628433228,
-0.5522173643112183,
-0.... |
func WithFileRotationP(file string) Option {
dir := filepath.Dir(file)
if err := os.MkdirAll(dir, 0766); err != nil {
panic(err)
}
return func(opt *option) {
opt.file = &lumberjack.Logger{ // concurrent-safed
Filename: file, // 文件路径
MaxSize: 128, // 单个文件最大尺寸,默认单位 M
MaxBackups: 300, // 最多保留 300 ... | [
1.30927312374115,
0.29573220014572144,
0.9964245557785034,
-0.4012152850627899,
-0.7403413653373718,
0.20180834829807281,
0.8651623129844666,
0.13976648449897766,
0.49527132511138916,
0.5858963131904602,
0.009472406469285488,
-0.9010894298553467,
-0.28997981548309326,
-0.2546388506889343,
... |
func WithTimeLayout(timeLayout string) Option {
return func(opt *option) {
opt.timeLayout = timeLayout
}
} | [
1.5798176527023315,
-0.06938209384679794,
0.6211932301521301,
-0.2632295489311218,
-0.7974861264228821,
-0.3112613558769226,
-0.04748142510652542,
-0.29174309968948364,
0.7497751712799072,
0.6071519255638123,
-0.8410935401916504,
-0.9472260475158691,
0.05855989456176758,
0.2285994440317154... |
func WithDisableConsole(enable bool) Option {
return func(opt *option) {
if !enable {
return
}
opt.disableConsole = true
}
} | [
0.8089476227760315,
-0.1458572894334793,
0.6133268475532532,
0.3803652226924896,
-0.2699712812900543,
0.3640536069869995,
0.6457777619361877,
0.3927733898162842,
-0.03959732502698898,
-0.11448359489440918,
-0.1522625833749771,
-1.011118769645691,
-1.258870005607605,
0.3862476348876953,
1... |
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
}
return nil, fmt.Errorf("Asset %s not foun... | [
-0.7961483001708984,
-1.2313168048858643,
0.633165180683136,
-0.6093899011611938,
-1.546921730041504,
-0.11101024597883224,
0.12971386313438416,
-1.3390334844589233,
-1.1358720064163208,
0.4855233430862427,
0.3090141713619232,
0.32495471835136414,
-0.6009681224822998,
-0.44264674186706543,... |
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
} | [
-0.012778956443071365,
0.11985661834478378,
0.4091298282146454,
-0.5268413424491882,
-0.8276715278625488,
0.4719155430793762,
-0.8186293840408325,
-1.5736604928970337,
0.16388541460037231,
0.6357062458992004,
-0.5354578495025635,
0.35693347454071045,
0.0057142809964716434,
-0.0248885955661... |
func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("Asset... | [
0.371969997882843,
-1.1052993535995483,
0.5630446076393127,
-0.922572672367096,
-1.356387734413147,
0.0033556853886693716,
0.6777529716491699,
-0.8006685972213745,
-1.2748286724090576,
0.3115358352661133,
0.2636086046695709,
0.26388120651245117,
0.0635773167014122,
-0.3988074064254761,
0... |
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
} | [
-0.7293784618377686,
-0.8460342288017273,
0.7321816682815552,
-0.39323121309280396,
-0.48951536417007446,
0.7661203145980835,
-0.5028699636459351,
-0.8655748963356018,
-0.4145073890686035,
0.8099913597106934,
0.16903363168239594,
1.163049578666687,
-0.028152840211987495,
0.0342608317732811... |
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), d... | [
0.3437124192714691,
-0.3622540235519409,
0.6770355701446533,
-1.2592030763626099,
-0.006139514967799187,
-0.04453148692846298,
-0.0072639440186321735,
-0.43950510025024414,
-0.20619122684001923,
-0.2510169744491577,
0.1784360408782959,
0.13568510115146637,
-0.23627112805843353,
-0.56985116... |
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
} | [
0.42261892557144165,
0.30020031332969666,
0.5813396573066711,
-0.20641657710075378,
-0.23828908801078796,
-0.24414615333080292,
0.5739709138870239,
-0.029911456629633904,
0.06188219040632248,
-0.43923482298851013,
0.5113736987113953,
0.3275970220565796,
-0.6125145554542542,
0.0351656526327... |
func (s *ProgramMap) Get(key string) (*Program, bool) {
//s.lock.RLock()
//defer s.lock.RUnlock()
value, ok := s.m[key]
return value, ok
} | [
-1.206790566444397,
-0.31675466895103455,
0.5086793899536133,
-0.30959904193878174,
-1.059796690940857,
0.2270200550556183,
0.3063424527645111,
-0.269558310508728,
0.3321695625782013,
0.6524197459220886,
-0.14099684357643127,
0.4777029752731323,
-0.8366490006446838,
-0.2988450527191162,
... |
func New(config LoadAgentClusterConfig, ltConfig loadtest.Config, log *mlog.Logger) (*LoadAgentCluster, error) {
if log == nil {
return nil, errors.New("logger should not be nil")
}
if err := defaults.Validate(config); err != nil {
return nil, fmt.Errorf("could not validate configuration: %w", err)
}
agents :=... | [
0.45369669795036316,
-1.105722188949585,
0.3166610598564148,
-0.7945737242698669,
0.13267771899700165,
-0.24578939378261566,
-0.1841450035572052,
-0.396156907081604,
-0.021943314000964165,
0.30600273609161377,
0.24767085909843445,
0.1685318946838379,
-0.12296894192695618,
0.214928478002548... |
func (c *LoadAgentCluster) Run() error {
for _, agent := range c.agents {
if _, err := agent.Run(); err != nil {
return fmt.Errorf("cluster: failed to start agent: %w", err)
}
}
return nil
} | [
0.23733054101467133,
-0.9169468283653259,
0.11972935497760773,
-0.049544405192136765,
0.47805464267730713,
-0.15352965891361237,
0.16010889410972595,
0.2524408996105194,
-0.2913759648799896,
0.2570466995239258,
-0.0726652517914772,
0.16541069746017456,
-0.4684637486934662,
0.49056887626647... |
func (c *LoadAgentCluster) Stop() error {
for _, agent := range c.agents {
if _, err := agent.Stop(); err != nil {
return fmt.Errorf("cluster: failed to stop agent: %w", err)
}
}
return nil
} | [
-0.14826886355876923,
-0.6924130320549011,
0.23417924344539642,
-0.3396508991718292,
0.6076454520225525,
-0.19456203281879425,
-0.3941202759742737,
0.09630054235458374,
-0.6251201629638672,
0.6210447549819946,
0.19470764696598053,
0.17244815826416016,
-0.2025621235370636,
0.236068755388259... |
func (c *LoadAgentCluster) Shutdown() {
var wg sync.WaitGroup
wg.Add(len(c.agents))
for _, ag := range c.agents {
go func(ag *client.Agent) {
defer wg.Done()
if _, err := ag.Destroy(); err != nil {
c.log.Error("cluster: failed to stop agent", mlog.Err(err))
}
}(ag)
}
wg.Wait()
} | [
0.3321678936481476,
-0.7606917023658752,
0.4934958219528198,
-0.6469613313674927,
0.33807557821273804,
0.2270069569349289,
-0.4353833794593811,
0.30415090918540955,
-0.054495472460985184,
0.589454174041748,
0.5854405760765076,
0.4157710373401642,
-0.5234551429748535,
0.27604353427886963,
... |
func (c *LoadAgentCluster) IncrementUsers(n int) error {
if len(c.agents) == 0 {
return nil
}
amounts, err := getUsersAmounts(c.agents)
if err != nil {
return err
}
dist, err := additionDistribution(amounts, n)
if err != nil {
return fmt.Errorf("cluster: cannot add users to any agent: %w", err)
}
for i,... | [
-0.07699830830097198,
0.09577083587646484,
0.33983445167541504,
0.13733285665512085,
-0.0057031940668821335,
0.02295817993581295,
0.419603556394577,
-0.43926870822906494,
0.6246297359466553,
-0.24281947314739227,
0.33459553122520447,
0.5037961602210999,
-0.01725216582417488,
0.408310085535... |
func (c *LoadAgentCluster) DecrementUsers(n int) error {
if len(c.agents) == 0 {
return nil
}
amounts, err := getUsersAmounts(c.agents)
if err != nil {
return err
}
dist, err := deletionDistribution(amounts, n)
if err != nil {
return fmt.Errorf("cluster: cannot add users to any agent: %w", err)
}
for i,... | [
0.3073092997074127,
-0.06457465887069702,
0.4506072700023651,
-0.014825566671788692,
0.16372700035572052,
-0.3671655058860779,
0.3865419924259186,
0.07380690425634384,
0.536275327205658,
-0.1133178174495697,
0.44115743041038513,
0.10370969772338867,
-0.6276371479034424,
0.6307629346847534,... |
func (c *LoadAgentCluster) Status() (Status, error) {
var status Status
for _, agent := range c.agents {
st, err := agent.Status()
// Agent probably crashed. We create it again.
if errors.Is(err, client.ErrAgentNotFound) {
if err := createAgent(agent, c.ltConfig); err != nil {
c.log.Error("agent create f... | [
0.007289423141628504,
-1.0096908807754517,
0.5179330110549927,
-0.22920121252536774,
0.3052835464477539,
-0.733588457107544,
0.355313777923584,
-0.04641503840684891,
0.4185014069080353,
0.0531407929956913,
-0.002683980856090784,
0.17741934955120087,
-0.27726325392723083,
-0.029140667989850... |
func (c *LoadAgentCluster) InjectAction(actionID string) error {
merr := merror.New()
for _, agent := range c.agents {
if _, err := agent.InjectAction(actionID); err != nil {
merr.Append(fmt.Errorf("cluster: failed to inject action %s for agent %s: %w", actionID, agent.Id(), err))
}
}
return merr.ErrorOrNil(... | [
-0.38007235527038574,
-0.5395998954772949,
0.32116395235061646,
-0.5284717082977295,
0.07396672666072845,
0.15859104692935944,
0.18206623196601868,
-0.7232831120491028,
0.6086849570274353,
1.0157209634780884,
0.008577116765081882,
0.4357569217681885,
-0.5975167751312256,
0.7858957648277283... |
func getSumUniformSubstrings(s string) (m map[int]bool) {
m = make(map[int]bool)
sum := 0
cur := int(s[0] - 'a' + 1)
for x := 0; x < len(s); x++ {
n := int(s[x] - 'a' + 1)
if n == cur {
sum += n
} else {
cur = n
sum = n
}
m[sum] = true
}
return m
} | [
-0.6103050112724304,
0.16971199214458466,
0.6399305462837219,
-0.37606650590896606,
-0.4501087963581085,
-0.11966534703969955,
1.7827987670898438,
0.19528792798519135,
0.7443801164627075,
-0.3739934265613556,
-1.1958630084991455,
0.5532206296920776,
0.06231449544429779,
-0.7672359943389893... |
func LoadKeywordMappingList(fn string) (*KeywordMappingList, error) {
fi, err := os.Open(fn)
if err != nil {
return nil, err
}
defer fi.Close()
fd, err := ioutil.ReadAll(fi)
if err != nil {
return nil, err
}
lst := &KeywordMappingList{}
err = yaml.Unmarshal(fd, lst)
if err != nil {
return nil, err
}... | [
-0.048239678144454956,
-0.4768848717212677,
0.7227858304977417,
-0.34704238176345825,
-1.381685495376587,
-0.05387331545352936,
-0.4018592834472656,
1.5914671421051025,
0.29321548342704773,
0.4752458930015564,
-0.927014172077179,
-0.8063859343528748,
-0.42895203828811646,
0.897403419017791... |
func (lc mockNotifyLogger) SetLogLevel(loglevel string) error {
return nil
} | [
-0.6252189874649048,
0.37678229808807373,
0.4024185836315155,
0.017117207869887352,
0.41903364658355713,
0.1557694971561432,
0.6207297444343567,
0.4801883101463318,
0.17054302990436554,
-0.46731024980545044,
-1.88196861743927,
-0.1460154801607132,
-0.4554111063480377,
1.078561544418335,
... |
func (lc mockNotifyLogger) Info(msg string, args ...interface{}) {
} | [
0.15167579054832458,
-0.530702531337738,
0.7384786009788513,
0.2931502163410187,
0.27958944439888,
-0.017558583989739418,
0.5877085328102112,
0.28156134486198425,
-0.7954155206680298,
0.18883754312992096,
-0.9227933883666992,
0.2366115152835846,
0.05549141392111778,
1.3828651905059814,
-... |
func (lc mockNotifyLogger) Debug(msg string, args ...interface{}) {
} | [
0.23554962873458862,
0.08838044106960297,
0.7837180495262146,
0.005737822502851486,
0.6446457505226135,
0.2602713108062744,
0.3878123164176941,
0.7709212899208069,
-0.014376483857631683,
-0.14747963845729828,
-0.39647892117500305,
0.13021107017993927,
-0.23149125277996063,
1.52051329612731... |
func (lc mockNotifyLogger) Trace(msg string, args ...interface{}) {
} | [
0.6966578364372253,
-0.06483906507492065,
0.6528577208518982,
0.14714109897613525,
0.5089035034179688,
0.09666166454553604,
0.765365719795227,
-0.2742459774017334,
0.4662696123123169,
0.08803313225507736,
-0.5637004971504211,
0.26934805512428284,
-0.8349270820617676,
1.069197177886963,
-... |
func (lc mockNotifyLogger) Warn(msg string, args ...interface{}) {
} | [
-0.2037094235420227,
0.07406573742628098,
0.7404341101646423,
-0.03378916531801224,
-0.13602545857429504,
-0.1951882392168045,
0.2782720923423767,
0.23217226564884186,
-0.29180529713630676,
-0.05207716301083565,
-0.5690016746520996,
0.7921579480171204,
-0.033435966819524765,
0.914376854896... |
func NewRedis(client RedisClientInterface, options *Options) *RedisStore {
if options == nil {
options = &Options{}
}
return &RedisStore{
client: client,
options: options,
}
} | [
-0.15951983630657196,
0.31353285908699036,
0.07144772261381149,
-0.29245397448539734,
-1.2833524942398071,
-0.15911832451820374,
-0.7539893984794617,
-0.5481489896774292,
1.3076322078704834,
-0.6085967421531677,
0.46380266547203064,
0.19892284274101257,
-0.8411140441894531,
-0.036232236772... |
func (s *RedisStore) Get(key interface{}) (interface{}, error) {
return s.client.Get(key.(string)).Result()
} | [
-1.376261830329895,
0.9177670478820801,
0.1644783467054367,
0.0884845107793808,
-0.21308717131614685,
-0.585397481918335,
-1.421694278717041,
-0.47571420669555664,
0.2935560345649719,
0.18076692521572113,
-0.19689874351024628,
0.2910712957382202,
-0.7004597187042236,
-0.06422602385282516,
... |
func (s *RedisStore) Set(key interface{}, value interface{}, options *Options) error {
if options == nil {
options = s.options
}
return s.client.Set(key.(string), value, options.ExpirationValue()).Err()
} | [
-0.455640971660614,
0.5792399644851685,
0.04853400960564613,
-0.25643935799598694,
-0.2076587677001953,
0.23504990339279175,
-0.9510100483894348,
-0.44927433133125305,
0.7446072101593018,
0.7105417251586914,
-0.03134370595216751,
0.18576249480247498,
-0.5816418528556824,
-0.167595535516738... |
func (s *RedisStore) Delete(key interface{}) error {
_, err := s.client.Del(key.(string)).Result()
return err
} | [
-0.6582648754119873,
1.3082976341247559,
0.15420347452163696,
0.5620035529136658,
-0.27818694710731506,
0.4760684370994568,
-0.8606265783309937,
-0.0024236070457845926,
1.1896324157714844,
0.7275128960609436,
-0.13055165112018585,
-0.21894879639148712,
-1.3419361114501953,
0.39451798796653... |
func (s *RedisStore) GetType() string {
return RedisType
} | [
-0.5254993438720703,
1.032576560974121,
0.2010851949453354,
0.16270707547664642,
0.7610636949539185,
0.11021342128515244,
-0.6670765280723572,
0.06801732629537582,
1.9879438877105713,
0.23557841777801514,
-0.18984928727149963,
0.2920502722263336,
-0.6522526144981384,
0.285999596118927,
0... |
func InputFunctionTimeout(t *testing.T) {
err := WaitFor(twoMillisecond, oneMillisecond, func() (bool, error) {
time.Sleep(fiveMillisecond)
return true, nil
})
assert.NotEqual(t, err, nil)
assert.Equal(t, 0, strings.Compare(err.Error(), timeoutErrMsg))
} | [
0.6964036822319031,
0.4305148124694824,
0.28393641114234924,
-0.3808610439300537,
0.12940670549869537,
0.8696249723434448,
0.07906904816627502,
0.11418396979570389,
-0.8000258207321167,
0.25377461314201355,
-0.4708584249019623,
-0.25428536534309387,
-0.3789231777191162,
-0.0629641637206077... |
func InputFunctionReturnsFalseAndNil(t *testing.T) {
err := WaitFor(fiveMillisecond, oneMillisecond, func() (bool, error) {
time.Sleep(twoMillisecond)
return false, nil
})
assert.Equal(t, err, nil)
} | [
0.2637414038181305,
-0.04953337460756302,
0.36915111541748047,
0.19259805977344513,
-0.44880637526512146,
0.4273986518383026,
-0.21655018627643585,
-0.18107332289218903,
-0.26922664046287537,
-0.38853946328163147,
-0.2681475281715393,
-0.5150078535079956,
-0.5199294686317444,
0.20747962594... |
func InputFunctionReturnsTrueAndNil(t *testing.T) {
err := WaitFor(fiveMillisecond, oneMillisecond, func() (bool, error) {
time.Sleep(twoMillisecond)
return true, nil
})
assert.NotEqual(t, err, nil)
assert.Equal(t, 0, strings.Compare(err.Error(), timeoutErrMsg))
} | [
0.6310184597969055,
-0.19686606526374817,
0.38675230741500854,
-0.11191163957118988,
-0.31173622608184814,
0.6784902811050415,
-0.29613053798675537,
0.3446402847766876,
-0.1716831773519516,
-0.037398673593997955,
-0.2818545401096344,
-0.4317184090614319,
-0.3262426555156708,
-0.21448090672... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.