text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (f *BodyField) UnmarshalYAML(unmarshal func(interface{}) error) error {
var value string
if err := unmarshal(&value); err != nil {
return fmt.Errorf("the field is not a string: %s", err)
}
*f = fromJSONDot(value)
return nil
} | [
-0.09566023200750351,
0.7640533447265625,
0.6955703496932983,
-1.3374592065811157,
-0.7284897565841675,
-0.39608606696128845,
0.37899458408355713,
0.11008971184492111,
0.1110876053571701,
0.16842857003211975,
-0.5079953074455261,
0.40593400597572327,
0.2692244052886963,
-0.526559054851532,... |
func (f BodyField) MarshalYAML() (interface{}, error) {
return toJSONDot(f), nil
} | [
0.17263537645339966,
0.6259869337081909,
0.49090543389320374,
-0.1237478107213974,
-0.386726051568985,
0.8169083595275879,
0.37003785371780396,
0.301197350025177,
0.11723815649747849,
-0.11635363847017288,
-1.2210745811462402,
0.3601955771446228,
0.3395671546459198,
-0.09815569221973419,
... |
func fromJSONDot(value string) BodyField {
keys := strings.Split(value, ".")
if keys[0] == "$" || keys[0] == BodyPrefix {
keys = keys[1:]
}
return BodyField{keys}
} | [
-0.7970237731933594,
-0.430020272731781,
0.6876192688941956,
-1.3390440940856934,
-0.946281909942627,
0.10282238572835922,
-0.9438394904136658,
-1.532066822052002,
0.2777123749256134,
0.2635238766670227,
-0.802199125289917,
0.09434399008750916,
0.8944164514541626,
-0.5681709051132202,
0.... |
func toJSONDot(field BodyField) string {
if field.isRoot() {
return BodyPrefix
}
containsDots := false
for _, key := range field.Keys {
if strings.Contains(key, ".") {
containsDots = true
}
}
var b strings.Builder
if containsDots {
b.WriteString(BodyPrefix)
for _, key := range field.Keys {
b.Wr... | [
-0.70708829164505,
-0.4352772831916809,
0.9997398257255554,
-1.3990049362182617,
-0.36636438965797424,
-0.18935009837150574,
-0.4830516278743744,
-1.1770293712615967,
-0.15360797941684723,
0.34485524892807007,
-0.46206071972846985,
0.9665234088897705,
0.6402729153633118,
0.1892917007207870... |
func NewBodyField(keys ...string) Field {
if keys == nil {
keys = []string{}
}
return Field{BodyField{
Keys: keys,
}}
} | [
-0.35254037380218506,
-0.001852777786552906,
0.2553543746471405,
-0.6154553294181824,
-0.11450756341218948,
0.8043609261512756,
-1.545750617980957,
-0.5161893367767334,
-0.24519897997379303,
0.3087088465690613,
-1.3711390495300293,
-0.13745279610157013,
-1.0300371646881104,
0.1207647472620... |
func (_m *Client) Broadcast(ctx context.Context, msgs ...types.Msg) error {
_va := make([]interface{}, len(msgs))
for _i := range msgs {
_va[_i] = msgs[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 error
if rf, ok := ret.Get(0).(func(context.Con... | [
-0.3780727684497833,
0.02210068516433239,
0.758224606513977,
0.11235877871513367,
0.4558124244213104,
-0.5130524635314941,
1.2055752277374268,
-0.23922176659107208,
0.19988064467906952,
-0.36223334074020386,
0.46764978766441345,
0.5362680554389954,
-0.6028290390968323,
0.3931594491004944,
... |
func (dt DefaultTrigger) IsTriggered(times interface{}, user interface{}) bool {
return true
} | [
-0.4456418752670288,
0.8749702572822571,
0.5496073961257935,
0.9041590094566345,
0.9651763439178467,
-0.2583511471748352,
0.2934618890285492,
0.4140399992465973,
0.20105203986167908,
-0.42439356446266174,
-1.2491523027420044,
-0.43312859535217285,
-0.8961752653121948,
0.34443190693855286,
... |
func (i *Invoice) FillFrom(from interface {
GetTest() (value bool)
GetNameRequested() (value bool)
GetPhoneRequested() (value bool)
GetEmailRequested() (value bool)
GetShippingAddressRequested() (value bool)
GetFlexible() (value bool)
GetPhoneToProvider() (value bool)
GetEmailToProvider() (value bool)
GetRecur... | [
0.20094241201877594,
-0.33099499344825745,
0.7571011185646057,
-0.2633447051048279,
-0.0839400663971901,
0.15803812444210052,
-0.026700446382164955,
-0.45008811354637146,
0.19485147297382355,
-0.7479616403579712,
-0.02624663896858692,
0.3235386312007904,
0.18321187794208527,
0.039936885237... |
func (*Invoice) TypeID() uint32 {
return InvoiceTypeID
} | [
0.5385350584983826,
-0.9645092487335205,
0.5254223346710205,
0.3267103433609009,
0.2949400842189789,
0.7337303161621094,
0.20650888979434967,
-0.27601709961891174,
0.4861772060394287,
-0.1525808423757553,
-0.16163086891174316,
0.6023591160774231,
-1.6914304494857788,
0.27639898657798767,
... |
func (*Invoice) TypeName() string {
return "invoice"
} | [
0.06557536125183105,
-0.8441091179847717,
0.7239651679992676,
0.17493285238742828,
-0.007608819752931595,
0.10168484598398209,
-0.4074098467826843,
0.14198845624923706,
0.028309833258390427,
-0.24450597167015076,
-0.046908535063266754,
-0.12106599658727646,
-0.9837701320648193,
-0.54381299... |
func (i *Invoice) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "invoice",
ID: InvoiceTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Test",
SchemaName: "test",
Null: !i.Flags.Has(0),
},
{
Name: "NameRequested",
SchemaName: "na... | [
0.12602373957633972,
-0.2230319231748581,
0.6606335043907166,
-0.6673988699913025,
0.4489385783672333,
-0.5541076064109802,
0.22234438359737396,
-0.8966153860092163,
-0.17546409368515015,
-0.07833051681518555,
-0.7325573563575745,
-0.6659701466560364,
-0.39489802718162537,
-0.4672108590602... |
func (i *Invoice) SetFlags() {
if !(i.Test == false) {
i.Flags.Set(0)
}
if !(i.NameRequested == false) {
i.Flags.Set(1)
}
if !(i.PhoneRequested == false) {
i.Flags.Set(2)
}
if !(i.EmailRequested == false) {
i.Flags.Set(3)
}
if !(i.ShippingAddressRequested == false) {
i.Flags.Set(4)
}
if !(i.Flexibl... | [
-0.2696288526058197,
0.3454234302043915,
0.3885240852832794,
-0.024264104664325714,
0.692095160484314,
0.5078124403953552,
0.060216303914785385,
-0.10333073139190674,
-0.593851625919342,
-0.4117746353149414,
-0.3652069568634033,
0.44553184509277344,
-1.3939446210861206,
0.5348444581031799,... |
func (i *Invoice) SetTest(value bool) {
if value {
i.Flags.Set(0)
i.Test = true
} else {
i.Flags.Unset(0)
i.Test = false
}
} | [
0.4867093563079834,
0.4198358356952667,
0.47171708941459656,
0.0340425930917263,
0.49623528122901917,
0.6126233339309692,
0.4014376699924469,
-0.17734389007091522,
-0.24802044034004211,
-0.3730369806289673,
-0.08929001539945602,
-0.47519823908805847,
-1.199191689491272,
-0.0705182552337646... |
func (i *Invoice) GetTest() (value bool) {
if i == nil {
return
}
return i.Flags.Has(0)
} | [
0.6712214946746826,
0.95904940366745,
0.47778818011283875,
0.4192480742931366,
1.3696739673614502,
0.006823248229920864,
-0.028437243774533272,
-0.2730673849582672,
0.02053520642220974,
-0.5719573497772217,
0.029746847227215767,
-0.6351255774497986,
-1.4322612285614014,
-0.4363908171653747... |
func (i *Invoice) SetNameRequested(value bool) {
if value {
i.Flags.Set(1)
i.NameRequested = true
} else {
i.Flags.Unset(1)
i.NameRequested = false
}
} | [
-0.8350340127944946,
-0.09894292056560516,
0.7908973097801208,
-0.27526459097862244,
-0.2870135009288788,
0.4609513580799103,
-0.6801488399505615,
-0.5266573429107666,
-0.676823079586029,
-0.35269466042518616,
-0.6541546583175659,
-0.28569430112838745,
-0.6135208010673523,
0.36413940787315... |
func (i *Invoice) GetNameRequested() (value bool) {
if i == nil {
return
}
return i.Flags.Has(1)
} | [
-0.661296546459198,
0.33841922879219055,
0.7952456474304199,
0.4741489887237549,
0.6209264397621155,
0.11428962647914886,
-0.5099841356277466,
-0.42573949694633484,
-0.6796621680259705,
-0.5337539911270142,
-0.3710330128669739,
-0.3667553663253784,
-0.7390226125717163,
0.07227783650159836,... |
func (i *Invoice) SetPhoneRequested(value bool) {
if value {
i.Flags.Set(2)
i.PhoneRequested = true
} else {
i.Flags.Unset(2)
i.PhoneRequested = false
}
} | [
-0.6293628811836243,
-0.03772785887122154,
0.592663586139679,
0.8092664480209351,
0.02061707340180874,
0.904977023601532,
-0.8115352392196655,
-0.11398519575595856,
-0.06537781655788422,
-1.0965625047683716,
0.4027123749256134,
-0.3745182752609253,
-0.5025250315666199,
0.2683565020561218,
... |
func (i *Invoice) GetPhoneRequested() (value bool) {
if i == nil {
return
}
return i.Flags.Has(2)
} | [
-0.20803506672382355,
0.3606393039226532,
0.7441353797912598,
1.3613723516464233,
0.7907052040100098,
0.3457220792770386,
-0.6039150357246399,
-0.04910096526145935,
-0.06901700049638748,
-1.2542147636413574,
0.4237353503704071,
-0.3998437523841858,
-0.2742582857608795,
0.008970522321760654... |
func (i *Invoice) SetEmailRequested(value bool) {
if value {
i.Flags.Set(3)
i.EmailRequested = true
} else {
i.Flags.Unset(3)
i.EmailRequested = false
}
} | [
-0.47831612825393677,
0.1155770942568779,
0.7486525177955627,
-0.42986106872558594,
0.041433185338974,
0.896926999092102,
-0.43012940883636475,
0.16774605214595795,
-0.6574033498764038,
-0.3912176787853241,
-0.043942827731370926,
-0.05762932822108269,
-0.45046043395996094,
-0.3815729618072... |
func (i *Invoice) GetEmailRequested() (value bool) {
if i == nil {
return
}
return i.Flags.Has(3)
} | [
0.04654410853981972,
0.562308132648468,
0.8436799049377441,
0.08485140651464462,
0.6973865628242493,
0.6704399585723877,
-0.4993881285190582,
0.3540802299976349,
-0.32254520058631897,
-0.5865657925605774,
0.026142515242099762,
-0.1460539549589157,
-0.2138054072856903,
-0.8852664828300476,
... |
func (i *Invoice) SetShippingAddressRequested(value bool) {
if value {
i.Flags.Set(4)
i.ShippingAddressRequested = true
} else {
i.Flags.Unset(4)
i.ShippingAddressRequested = false
}
} | [
-1.015145182609558,
-0.14182975888252258,
0.5786712169647217,
-0.3130091428756714,
-0.08834443986415863,
0.6421540975570679,
-0.2057502120733261,
0.18595297634601593,
0.5562328100204468,
-0.3310094475746155,
-0.1318940371274948,
0.2151990830898285,
-0.012095601297914982,
-0.272485852241516... |
func (i *Invoice) GetShippingAddressRequested() (value bool) {
if i == nil {
return
}
return i.Flags.Has(4)
} | [
-0.8095670342445374,
0.40484559535980225,
0.7905542254447937,
0.28749045729637146,
0.44748976826667786,
0.318178653717041,
-0.10366732627153397,
0.03576786071062088,
0.4042459726333618,
-0.7398440837860107,
-0.14313872158527374,
0.1721259355545044,
-0.2360415905714035,
-0.5267801880836487,... |
func (i *Invoice) SetFlexible(value bool) {
if value {
i.Flags.Set(5)
i.Flexible = true
} else {
i.Flags.Unset(5)
i.Flexible = false
}
} | [
0.603884220123291,
-0.0024961454328149557,
0.7395736575126648,
0.46078458428382874,
-0.24448049068450928,
0.4033689796924591,
0.256050169467926,
0.28288742899894714,
-1.0728634595870972,
-0.6561883091926575,
-0.5962347984313965,
-0.4006160497665405,
-0.9009591341018677,
0.42515772581100464... |
func (i *Invoice) GetFlexible() (value bool) {
if i == nil {
return
}
return i.Flags.Has(5)
} | [
0.8935098648071289,
0.29543015360832214,
0.4377208352088928,
0.7660703659057617,
0.34375542402267456,
-0.2889309823513031,
-0.06904412806034088,
-0.11572464555501938,
-0.9535094499588013,
-0.6101048588752747,
-0.5981923341751099,
-0.36869120597839355,
-1.2253680229187012,
0.043710730969905... |
func (i *Invoice) SetPhoneToProvider(value bool) {
if value {
i.Flags.Set(6)
i.PhoneToProvider = true
} else {
i.Flags.Unset(6)
i.PhoneToProvider = false
}
} | [
-0.7411283254623413,
0.21116408705711365,
0.4404662251472473,
0.049570370465517044,
-0.32591819763183594,
0.7712160348892212,
-0.1681380271911621,
0.06938280910253525,
0.4126951992511749,
0.3387860059738159,
0.21988323330879211,
-1.4474276304244995,
-0.5752087831497192,
0.04599850252270698... |
func (i *Invoice) GetPhoneToProvider() (value bool) {
if i == nil {
return
}
return i.Flags.Has(6)
} | [
-0.28308743238449097,
0.8962910771369934,
0.3728567957878113,
0.37197011709213257,
0.37447670102119446,
0.3148861825466156,
-0.34654563665390015,
0.10402539372444153,
0.47651544213294983,
-0.0834866389632225,
0.14457795023918152,
-1.6611707210540771,
-0.9092321395874023,
-0.502588391304016... |
func (i *Invoice) SetEmailToProvider(value bool) {
if value {
i.Flags.Set(7)
i.EmailToProvider = true
} else {
i.Flags.Unset(7)
i.EmailToProvider = false
}
} | [
-0.8562281727790833,
0.5591989755630493,
0.41222548484802246,
-0.6957111954689026,
-0.6037911772727966,
0.518112063407898,
0.4877570867538452,
0.3697672188282013,
0.054729484021663666,
0.9881383776664734,
0.4281133711338043,
-0.3705105781555176,
-0.35968852043151855,
-0.4219191074371338,
... |
func (i *Invoice) GetEmailToProvider() (value bool) {
if i == nil {
return
}
return i.Flags.Has(7)
} | [
-0.26203835010528564,
1.3453160524368286,
0.4581111669540405,
-0.3096998929977417,
0.010461089201271534,
0.13472849130630493,
0.20967678725719452,
0.29570895433425903,
0.37346693873405457,
0.3120277225971222,
0.5796645879745483,
-0.6554534435272217,
-0.5033937096595764,
-0.85638028383255,
... |
func (i *Invoice) SetRecurring(value bool) {
if value {
i.Flags.Set(9)
i.Recurring = true
} else {
i.Flags.Unset(9)
i.Recurring = false
}
} | [
0.3282415568828583,
0.7956821918487549,
0.5907486081123352,
-0.3250803053379059,
0.20390518009662628,
0.6263857483863831,
0.33531251549720764,
0.3378232419490814,
-0.5288193821907043,
-0.4646022319793701,
0.1017288938164711,
0.1989261358976364,
-0.6327109336853027,
-0.1019761860370636,
-... |
func (i *Invoice) GetRecurring() (value bool) {
if i == nil {
return
}
return i.Flags.Has(9)
} | [
0.5496644377708435,
1.6993855237960815,
0.5456639528274536,
-0.07138223946094513,
0.9848325848579407,
-0.004886016249656677,
0.13560067117214203,
0.19246141612529755,
-0.34181925654411316,
-0.695393979549408,
0.1991940140724182,
0.30857691168785095,
-0.7106486558914185,
-0.8464410901069641... |
func (i *Invoice) GetCurrency() (value string) {
if i == nil {
return
}
return i.Currency
} | [
0.44983747601509094,
-0.3249531686306,
0.2292996197938919,
0.9522063136100769,
0.439844012260437,
-0.36288970708847046,
0.5087624788284302,
0.18162809312343597,
0.4720818102359772,
0.0006823785370215774,
0.8005844950675964,
-0.7719300985336304,
-0.8474588990211487,
-0.45559123158454895,
... |
func (i *Invoice) GetPrices() (value []LabeledPrice) {
if i == nil {
return
}
return i.Prices
} | [
-0.1468895971775055,
0.27281299233436584,
0.515927791595459,
0.2962503433227539,
0.9419395327568054,
0.14189891517162323,
-0.8040197491645813,
-0.5812434554100037,
0.5623499751091003,
0.18275980651378632,
0.2191527932882309,
-0.43791714310646057,
-1.0581589937210083,
0.27977174520492554,
... |
func (i *Invoice) SetMaxTipAmount(value int64) {
i.Flags.Set(8)
i.MaxTipAmount = value
} | [
-0.4733095169067383,
-0.6082616448402405,
0.47095489501953125,
0.6000533103942871,
-1.3947250843048096,
0.6647747159004211,
0.3488633930683136,
0.18743060529232025,
0.445075124502182,
0.6833276748657227,
-0.4444601237773895,
-1.1520441770553589,
0.321145236492157,
-0.4384375512599945,
-0... |
func (i *Invoice) GetMaxTipAmount() (value int64, ok bool) {
if i == nil {
return
}
if !i.Flags.Has(8) {
return value, false
}
return i.MaxTipAmount, true
} | [
-0.6707544326782227,
0.2460436075925827,
0.6422396302223206,
0.9684390425682068,
-0.9042130708694458,
0.23548781871795654,
-0.22258371114730835,
0.3431698977947235,
0.5092952251434326,
0.5485919117927551,
-0.5805559754371643,
-1.0617775917053223,
-0.42687278985977173,
-0.71407151222229,
... |
func (i *Invoice) SetSuggestedTipAmounts(value []int64) {
i.Flags.Set(8)
i.SuggestedTipAmounts = value
} | [
-0.9740896821022034,
-0.5551273226737976,
0.39753612875938416,
-0.3465406596660614,
-0.47447142004966736,
0.42513832449913025,
0.8835232853889465,
-0.5625838041305542,
0.06842367351055145,
-0.09417107701301575,
-0.569306492805481,
-0.18861664831638336,
0.06586004048585892,
0.16087980568408... |
func (i *Invoice) GetSuggestedTipAmounts() (value []int64, ok bool) {
if i == nil {
return
}
if !i.Flags.Has(8) {
return value, false
}
return i.SuggestedTipAmounts, true
} | [
-1.1040406227111816,
0.23899200558662415,
0.6905755996704102,
0.15443873405456543,
-0.3291124403476715,
0.07405830174684525,
0.11922681331634521,
-0.4023459851741791,
0.10465220361948013,
0.21359337866306305,
-0.7688391804695129,
-0.2946966290473938,
-0.5258675217628479,
-0.052084796130657... |
func (i *Invoice) SetRecurringTermsURL(value string) {
i.Flags.Set(9)
i.RecurringTermsURL = value
} | [
0.7002649307250977,
-0.11621186882257462,
0.12098129838705063,
-0.45955440402030945,
0.31276726722717285,
0.1558610051870346,
0.19579212367534637,
-0.1989973485469818,
-0.5579950213432312,
-0.3589763343334198,
-0.3304620683193207,
-0.0236763097345829,
-0.6808750033378601,
-0.43671044707298... |
func (i *Invoice) GetRecurringTermsURL() (value string, ok bool) {
if i == nil {
return
}
if !i.Flags.Has(9) {
return value, false
}
return i.RecurringTermsURL, true
} | [
0.26046764850616455,
0.7492809891700745,
0.3325410485267639,
0.09670305252075195,
0.5852806568145752,
-0.0336071215569973,
-0.0524568185210228,
0.09314627945423126,
-0.4000813364982605,
0.0005303267389535904,
-0.1620667278766632,
-0.15504342317581177,
-1.057460904121399,
-0.634462118148803... |
func DirSize2(path string) (int64, error) {
var size int64
adjSize := func(_ string, info os.FileInfo, err error) error {
if !info.IsDir() {
size += info.Size()
}
return err
}
err := filepath.Walk(path, adjSize)
return size, err
} | [
-0.4635680913925171,
-0.05384582281112671,
0.502782940864563,
0.10121675580739975,
-1.2276043891906738,
-0.35534706711769104,
0.9816138744354248,
-0.6154472231864929,
0.14712205529212952,
-0.363534152507782,
-0.3244403600692749,
-0.07722199708223343,
-0.2695828676223755,
1.6036862134933472... |
func NewLearner(id int, nrOfNodes int, valueOut chan<- Value) *Learner {
//TODO(student): Task 2 and 3 - algorithm and distributed implementation
return &Learner{}
} | [
-0.10565400868654251,
-1.0797815322875977,
0.3642180860042572,
0.6016491651535034,
-1.2842986583709717,
0.05873878300189972,
-0.24061055481433868,
-0.7936526536941528,
0.0973091647028923,
-0.35887882113456726,
-0.5302579998970032,
0.38843420147895813,
-0.06491565704345703,
0.90299338102340... |
func (l *Learner) Start() {
go func() {
for {
//TODO(student): Task 3 - distributed implementation
}
}()
} | [
0.16925247013568878,
-0.1608140617609024,
0.38961946964263916,
0.7495297789573669,
0.5060269236564636,
0.7416221499443054,
0.7085368633270264,
0.6791138052940369,
-0.5100834965705872,
0.17101097106933594,
-1.2522839307785034,
0.9009195566177368,
0.7485060691833496,
1.0153779983520508,
-0... |
func (l *Learner) Stop() {
//TODO(student): Task 3 - distributed implementation
} | [
-1.1819895505905151,
-0.6719654202461243,
0.3441266119480133,
0.2547052502632141,
0.08888790011405945,
1.4502065181732178,
0.9146906137466431,
0.6855485439300537,
-0.5529298186302185,
0.18831318616867065,
-0.9423169493675232,
0.5007994771003723,
0.16279122233390808,
0.6884076595306396,
-... |
func (l *Learner) DeliverLearn(lrn Learn) {
//TODO(student): Task 3 - distributed implementation
} | [
-0.20977728068828583,
-0.8801442980766296,
0.43472108244895935,
0.20341995358467102,
-0.7966675162315369,
1.3901389837265015,
-0.19515898823738098,
-0.1468328982591629,
0.8772903680801392,
0.05318218842148781,
-1.2752550840377808,
-0.06895415484905243,
0.41510507464408875,
1.17071938514709... |
func (l *Learner) handleLearn(learn Learn) (val Value, output bool) {
//TODO(student): Task 2 - algorithm implementation
return "FooBar", true
} | [
-0.24352818727493286,
-0.1447828710079193,
0.6863800287246704,
0.8615373373031616,
-0.8945314288139343,
0.047884196043014526,
0.15735383331775665,
-0.23224346339702606,
0.38009774684906006,
-0.4887184798717499,
-1.216766595840454,
-1.118298888206482,
0.19824331998825073,
1.0156198740005493... |
func layout(g *gocui.Gui) error {
// Get size of the terminal
maxX, maxY := g.Size()
// Creates view "messages"
if messages, err := g.SetView("messages", 0, 0, maxX-1, maxY-3); err != nil {
if err != gocui.ErrUnknownView {
return err
}
messages.Autoscroll = true
messages.Wrap = true
messages.Write([... | [
0.35686570405960083,
0.14195440709590912,
0.6906222105026245,
-0.7141638994216919,
-0.2855485677719116,
0.6525470614433289,
1.4396657943725586,
-0.12231060862541199,
-0.14519353210926056,
-0.6057004332542419,
0.5347453951835632,
-0.3187430202960968,
-0.5576949119567871,
0.258280485868454,
... |
func send(g *gocui.Gui, v *gocui.View) error {
msg := chatmessage.Chatmessage{
Text: v.Buffer(),
From: nickname,
}
// Get the top window view and write the buffer of the bottom window view to it
if m, err := g.View("messages"); err != nil {
log.Fatal(err)
} else {
if len(msg.Text) != 0 {
m.Write([]byte... | [
-0.09156160056591034,
0.18068628013134003,
0.5541629195213318,
-0.016822269186377525,
0.2486308068037033,
-0.25949087738990784,
0.2462548166513443,
-0.8035793304443359,
-0.8023808598518372,
0.008970796130597591,
-0.04284653440117836,
1.5772744417190552,
-1.1825456619262695,
0.4507347047328... |
func (s *Store) AddEvent(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
defer closeBody(ctx, r.Body)
vars := mux.Vars(r)
instanceID := vars["instance_id"]
eTag := getIfMatch(r)
data := log.Data{"instance_id": instanceID, "action": AddInstanceEventAction}
event, err := unmarshalEvent(r.Body)
if e... | [
-0.9450815916061401,
0.23220638930797577,
0.9260249733924866,
-0.39397838711738586,
0.23617935180664062,
0.18298335373401642,
0.43951913714408875,
0.49221283197402954,
0.5357570648193359,
0.506057620048523,
-0.1318635493516922,
0.14933981001377106,
-0.07271888107061386,
0.09044293314218521... |
func TestInvalidInput(t *testing.T) {
tests := []struct {
input string
}{
//too short
{"12"},
{"12/14"},
//bad month
{"13/14/1989"},
//bad day
{"12/32/1989"},
}
for _, test := range tests {
//Create and assign test input
obj := DOB{}
obj.DOB = test.input
//Create buffer to catch validateInp... | [
-0.5169817805290222,
-0.3477139472961426,
0.6252050995826721,
0.4198192358016968,
0.054035384207963943,
1.5577799081802368,
0.777397632598877,
-0.5543032288551331,
0.16801948845386505,
-1.4569140672683716,
-0.17712071537971497,
0.13202686607837677,
-0.8930632472038269,
0.48744556307792664,... |
func TestShortInput(t *testing.T) {
tests := []struct {
input string
}{
//Single digit month
{"6/14/89"},
//Single digit day
{"06/6/89"},
//Year is 2 digits instead of 4
{"12/14/89"},
}
for _, test := range tests {
//Create and assign test input
obj := DOB{}
obj.DOB = test.input
var b bytes.Bu... | [
0.10673962533473969,
-0.5859279036521912,
0.733517587184906,
0.5659146308898926,
0.11598081141710281,
1.762954831123352,
1.3456544876098633,
-0.7016249895095825,
0.6385101675987244,
-1.0470348596572876,
-0.4368768036365509,
0.47126898169517517,
-0.2744947373867035,
0.47749266028404236,
-... |
func TestDir() (string, func()) {
dir, err := ioutil.TempDir("", "elvishtest.")
if err != nil {
panic(err)
}
dir, err = filepath.EvalSymlinks(dir)
if err != nil {
panic(err)
}
return dir, func() {
err := os.RemoveAll(dir)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to remove temp dir %s: %v\n", dir... | [
0.04443712905049324,
-0.5360938310623169,
0.630379855632782,
-0.3242775499820709,
-0.0924781858921051,
-0.665431797504425,
0.9970215559005737,
0.09548968076705933,
0.8749794363975525,
-0.5622179508209229,
0.23571862280368805,
-0.09387577325105667,
0.39872798323631287,
0.6052078008651733,
... |
func InTestDir() (string, func()) {
oldWd, err := os.Getwd()
if err != nil {
panic(err)
}
dir, cleanup := TestDir()
mustChdir(dir)
return dir, func() {
mustChdir(oldWd)
cleanup()
}
} | [
-0.21181119978427887,
-0.21196997165679932,
0.6526731848716736,
-0.3606804609298706,
-0.5468064546585083,
-0.06675409525632858,
1.084342360496521,
-0.41888487339019775,
0.4763863682746887,
-0.07015864551067352,
0.4644903242588043,
0.3938004970550537,
-0.27457454800605774,
0.735281229019165... |
func InTestDirWithSetup(dir Dir) func() {
_, cleanup := InTestDir()
ApplyDir(dir)
return cleanup
} | [
-1.1836824417114258,
-0.08800166845321655,
0.7888481020927429,
-0.18396125733852386,
-0.8862793445587158,
-0.7838212847709656,
1.5530036687850952,
-0.5820168852806091,
1.5115509033203125,
0.1472935974597931,
0.4806482493877411,
-0.0056188348680734634,
-0.3247407078742981,
0.017714336514472... |
func ApplyDir(dir Dir) {
applyDir(dir, "")
} | [
0.06756088882684708,
0.5300186276435852,
0.40440937876701355,
0.10470707714557648,
-1.0046789646148682,
0.11235227435827255,
0.33065274357795715,
0.6950832605361938,
1.4572550058364868,
-1.7724884748458862,
0.057313837110996246,
0.02681843750178814,
-0.08082573115825653,
2.2926254272460938... |
func TestMTLSMeshWideEnabledDRWithoutTrafficPolicy(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Mesh-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
data.Creat... | [
0.39624083042144775,
0.4636799991130829,
0.6976333260536194,
-0.41843271255493164,
0.07103799283504486,
1.4938281774520874,
0.0600779764354229,
0.09706444293260574,
-0.09838048368692398,
-0.23063655197620392,
0.3441336154937744,
-0.025128154084086418,
-0.9322861433029175,
0.335877537727355... |
func TestMTLSMeshWideEnabledDRWithoutmTLSOptions(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Mesh-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
data.CreateE... | [
0.5714839100837708,
0.6599611043930054,
0.7982509136199951,
-0.5032345652580261,
-0.1281323879957199,
1.4409852027893066,
-0.07959743589162827,
0.16956330835819244,
0.19902761280536652,
-0.2503495216369629,
0.30195215344429016,
-0.1642662137746811,
-0.6042176485061646,
0.42793864011764526,... |
func TestMTLSMeshWideEnabledDRWithoutPortLevelmTLSOptions(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Mesh-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
dat... | [
0.5373082756996155,
0.4808524549007416,
0.829718828201294,
-0.44984808564186096,
-0.05490228533744812,
1.6841259002685547,
0.04142467677593231,
0.0862027257680893,
0.009904857724905014,
-0.29658961296081543,
0.41993269324302673,
-0.02240179292857647,
-0.8275017142295837,
0.3719885051250458... |
func TestMTLSMeshWideEnabledDRWithTrafficPolicy(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Mesh-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
data.CreateEm... | [
0.6910216808319092,
0.7827883362770081,
0.8062077760696411,
-0.39789721369743347,
0.03241977468132973,
1.6607394218444824,
-0.03169531375169754,
0.057645417749881744,
-0.013195287436246872,
0.17370446026325226,
0.233601912856102,
-0.13837529718875885,
-0.710053026676178,
0.0046641062945127... |
func TestMTLSMeshWideEnabledDRWithPortLevelTLSTrafficPolicy(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Mesh-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
d... | [
0.8981660008430481,
0.6477704644203186,
0.8814931511878967,
-0.5339775085449219,
0.19877499341964722,
1.8338966369628906,
-0.04131131246685982,
0.02938772737979889,
-0.11516539752483368,
-0.06272365152835846,
0.16169136762619019,
0.08456895500421524,
-0.7226086258888245,
-0.028442276641726... |
func TestNamespacemTLSEnabledDRWithoutTrafficPolicy(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Namespace-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
data... | [
0.2981019914150238,
0.29613521695137024,
0.5638086795806885,
-0.6452375054359436,
-0.3597768545150757,
1.4492948055267334,
-0.36709412932395935,
-0.16365253925323486,
0.25651684403419495,
-0.14780166745185852,
0.2947089970111847,
-0.2807396948337555,
-0.8396505117416382,
0.3147820234298706... |
func TestNamespacemTLSEnabledDRWithoutmTLSOptions(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Namespace-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
data.C... | [
0.3989872336387634,
0.36893248558044434,
0.6942282915115356,
-0.7599829435348511,
-0.3015899360179901,
1.317253828048706,
-0.35532867908477783,
-0.20938090980052948,
0.5067510008811951,
-0.21494659781455994,
0.36867108941078186,
-0.30706265568733215,
-0.4692893326282501,
0.4692559242248535... |
func TestNamespacemTLSEnabledDRWithTrafficPolicy(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Namespace-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
data.Cr... | [
0.4809725284576416,
0.40832847356796265,
0.7309719324111938,
-0.7091118693351746,
-0.2287558913230896,
1.5919548273086548,
-0.4222365617752075,
-0.3020416498184204,
0.3568030297756195,
0.18085911870002747,
0.25689712166786194,
-0.3411248028278351,
-0.5701816082000732,
0.14754149317741394,
... |
func TestCrossNamespaceProtection(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Namespace-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
data.CreateEmptyDestin... | [
0.7790207862854004,
0.8276820778846741,
0.6797106862068176,
-0.15061038732528687,
0.2668721079826355,
1.4490505456924438,
-0.057493727654218674,
-0.2501703202724457,
0.3411441445350647,
0.28475144505500793,
0.06430649757385254,
-0.61128830909729,
-0.7656408548355103,
0.19140328466892242,
... |
func TestCrossNamespaceServiceEntryProtection(t *testing.T) {
mTLSDetails := kubernetes.MTLSDetails{
DestinationRules: []*networking_v1beta1.DestinationRule{
// Namespace-wide DR enabling mTLS communication
data.AddTrafficPolicyToDestinationRule(data.CreateMTLSTrafficPolicyForDestinationRules(),
data.Creat... | [
0.850089967250824,
0.7503727674484253,
0.632632851600647,
-0.11047033965587616,
0.021668316796422005,
1.2517457008361816,
0.16360832750797272,
-0.3548407256603241,
0.4799022078514099,
0.314450204372406,
0.2868575155735016,
-0.10747961699962616,
-0.6409104466438293,
0.33612707257270813,
-... |
func half(i int) bool {
if i%2 == 0 {
return true
}
return false
} | [
-1.2719841003417969,
0.18550941348075867,
0.43899092078208923,
0.07497210800647736,
-0.4946868419647217,
0.9575042724609375,
0.10700887441635132,
0.4691455364227295,
-0.5322412848472595,
-0.8175790309906006,
-0.9233397245407104,
-0.7517547607421875,
-0.6344831585884094,
0.4711638391017914,... |
func greatest(i ...int) int {
biggest := i[0]
for j := range i {
if i[j] > biggest {
biggest = i[j]
}
}
return biggest
} | [
-0.975375235080719,
0.6936292052268982,
0.6615162491798401,
0.5872920155525208,
1.310797095298767,
0.20452527701854706,
-0.636544942855835,
0.059252895414829254,
-1.743752121925354,
-0.11579231172800064,
-1.0153878927230835,
0.09084691852331161,
-0.17378093302249908,
0.14461828768253326,
... |
func makeOddGenerator() func() int {
i := 1
return func() (ret int) {
ret = i
i += 2
return
}
} | [
-1.2103958129882812,
0.7254547476768494,
0.35726243257522583,
-0.7540228962898254,
-0.5756431221961975,
0.1720699816942215,
1.0482573509216309,
0.2129843831062317,
-0.881562352180481,
-1.0731701850891113,
-0.838273823261261,
-0.4188356101512909,
0.17402362823486328,
-0.45874306559562683,
... |
func fib(n int) int {
if n == 0 || n == 1 {
return n
}
return fib(n-1) + fib(n-2)
} | [
-0.0003831159556284547,
0.9162536263465881,
0.41493460536003113,
1.6086806058883667,
0.6253785490989685,
0.38962188363075256,
0.39203527569770813,
-0.03484481945633888,
0.4699169099330902,
-0.5690011382102966,
0.21351346373558044,
0.13033244013786316,
-0.3561100661754608,
1.327569723129272... |
func getOperators () []string {
var keys = make([]string, len(operatorPrecedence) + len(assignmentOperators))
var i = 0
for k := range operatorPrecedence {
keys[i] = k
i++
}
for j, op := range assignmentOperators {
keys[j + len(operatorPrecedence)] = op
}
return keys
} | [
-1.8291845321655273,
0.7296324968338013,
0.7461050152778625,
-0.15229235589504242,
-0.23871326446533203,
-0.7412572503089905,
0.3054009974002838,
0.2348564863204956,
0.1781306117773056,
0.8931798934936523,
-0.036609381437301636,
0.10718974471092224,
-0.6608548760414124,
0.5649909973144531,... |
func (cluster *Cluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(cluster).
Complete()
} | [
0.32714638113975525,
-0.26419249176979065,
0.4422140121459961,
0.546926736831665,
0.24413448572158813,
-0.1712418794631958,
0.525472104549408,
-0.007257048971951008,
-0.21340411901474,
-0.09497903287410736,
0.1161770150065422,
-0.009953832253813744,
0.11911290138959885,
2.2620842456817627,... |
func (cluster *Cluster) Default() {
klog.Info("default", "name", cluster.Name)
cluster.addFinalizer()
cluster.defaultKubernetesVersion()
cluster.defaultControlPlaneReplicas()
cluster.defaultVPN()
cluster.defaultUninitializedCertificatesLabel()
cluster.defaultNetworking()
} | [
0.10520071536302567,
0.05281451717019081,
0.06761623173952103,
0.7365363836288452,
1.9995570182800293,
0.1361716389656067,
-0.5129098892211914,
0.2965170443058014,
0.3701950013637543,
-0.2975550591945648,
-0.7833049893379211,
0.30607518553733826,
-0.1311766654253006,
0.7036454677581787,
... |
func (cluster *Cluster) ValidateCreate() error {
klog.Info("validate create", "name", cluster.Name)
return nil
} | [
0.5064623951911926,
-0.1680600792169571,
0.17618335783481598,
0.6438524127006531,
0.6571018695831299,
0.6556508541107178,
0.22483624517917633,
-0.918293833732605,
-0.867641270160675,
0.09044574201107025,
0.03680083900690079,
-0.0443965382874012,
-0.323319673538208,
0.5484708547592163,
0.... |
func (cluster *Cluster) ValidateUpdate(old runtime.Object) error {
klog.Info("validate update", "name", cluster.Name)
return nil
} | [
-0.21459685266017914,
-1.4524846076965332,
0.4647967219352722,
0.9672619104385376,
-0.4042796492576599,
0.5079008340835571,
0.07361049205064774,
-0.7013611793518066,
0.6580263376235962,
0.3459664285182953,
-0.023220522329211235,
0.016330184414982796,
-0.4345196485519409,
0.1588026285171508... |
func (cluster *Cluster) ValidateDelete() error {
klog.Info("validate delete", "name", cluster.Name)
return nil
} | [
0.9614956378936768,
-0.19248363375663757,
0.25325632095336914,
0.9264402389526367,
0.855261504650116,
0.08642733842134476,
0.32821694016456604,
-0.2692504823207855,
0.4785662591457367,
-0.005026201251894236,
0.18161584436893463,
0.34295228123664856,
-0.6542425155639648,
0.2713838219642639,... |
func GenerateKeyRing() (SecretKeyRing, error) {
identity, err := GenerateIdentity()
if err != nil {
return SecretKeyRing{}, nil
}
address, err := GenerateAddress()
if err != nil {
return SecretKeyRing{}, nil
}
return SecretKeyRing{
Identity: identity,
Addresses: []SecretAddress{address},
Trusted: ma... | [
-0.15346331894397736,
0.6177133917808533,
0.5603091716766357,
-0.12167729437351227,
-0.22753039002418518,
0.7092201113700867,
-0.8663944602012634,
0.09353815019130707,
0.042752232402563095,
0.5165900588035583,
-1.6053459644317627,
0.6071327328681946,
0.07048953324556351,
0.3112614750862121... |
func UUID() string {
uuID := make([]byte, 16)
n, err := io.ReadFull(rand.Reader, uuID)
if n != len(uuID) || err != nil {
panic(err)
}
// variant bits; see section 4.1.1
uuID[8] = uuID[8]&^0xc0 | 0x80
// version 4 (pseudo-random); see section 4.1.3
uuID[6] = uuID[6]&^0xf0 | 0x40
return fmt.Sprintf("%x-%x-%x-%... | [
0.4009013772010803,
-0.7607972621917725,
0.7281614542007446,
-0.44572827219963074,
-0.8522809743881226,
0.7502163052558899,
0.047325778752565384,
0.14327192306518555,
0.3991657495498657,
0.4390307366847992,
0.5707387328147888,
0.3482168912887573,
-0.16163136065006256,
-1.323081612586975,
... |
func (r RuleRegistry) Register(aip int, rules ...ProtoRule) error {
rulePrefix := getRuleGroup(aip, aipGroups) + nameSeparator + fmt.Sprintf("%04d", aip)
for _, rl := range rules {
if !rl.GetName().IsValid() {
return errInvalidRuleName
}
if !rl.GetName().HasPrefix(rulePrefix) {
return errInvalidRuleGroup... | [
-1.2421339750289917,
0.5459028482437134,
0.3863845765590668,
-0.5091959834098816,
1.0628777742385864,
0.36214709281921387,
0.3601227104663849,
0.21672199666500092,
-0.7816113829612732,
0.6471776366233826,
0.10370907932519913,
-0.19338618218898773,
-0.5332452058792114,
0.2800256013870239,
... |
func NewRuleRegistry() RuleRegistry {
return make(RuleRegistry)
} | [
-0.14128808677196503,
-0.14941665530204773,
-0.07101120799779892,
-0.0881812572479248,
0.14057794213294983,
-0.28850430250167847,
0.230564683675766,
-0.25053465366363525,
-0.16867920756340027,
-0.5914595127105713,
-0.559334397315979,
1.012039303779602,
-0.7115610837936401,
0.19880466163158... |
func ExampleDscpConfigurationClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
... | [
-0.7201360464096069,
-0.0028039035387337208,
0.5486236214637756,
-1.0296648740768433,
-0.26299625635147095,
-0.2714848220348358,
0.19684971868991852,
-0.09116408973932266,
0.016334721818566322,
0.20755638182163239,
-0.546222448348999,
0.19558343291282654,
0.30576208233833313,
-0.3135914802... |
func ExampleDscpConfigurationClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fa... | [
-0.002078754361718893,
0.5046559572219849,
0.690151572227478,
-0.4661795496940613,
-0.3738655149936676,
-0.4384726285934448,
0.36406129598617554,
-0.12726914882659912,
-0.07268596440553665,
0.17054173350334167,
-0.06522028148174286,
1.0838730335235596,
-0.10520199686288834,
-0.126302644610... |
func ExampleDscpConfigurationClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("fa... | [
-0.2804839313030243,
0.1694491058588028,
0.5458384156227112,
-0.7724486589431763,
-0.247282937169075,
-1.15345299243927,
-0.45380306243896484,
0.038935158401727676,
-0.32193806767463684,
-0.13317909836769104,
-0.881310224533081,
0.7149630188941956,
0.2706119120121002,
-0.6673098206520081,
... |
func ExampleDscpConfigurationClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.F... | [
-0.38133853673934937,
0.1949356198310852,
0.4031001627445221,
-0.48873960971832275,
-0.0939389169216156,
-0.9133110046386719,
-0.2652975916862488,
0.05653112754225731,
0.14563623070716858,
0.31412190198898315,
-0.8341207504272461,
-0.2625355124473572,
0.36406272649765015,
0.476004540920257... |
func ExampleDscpConfigurationClient_NewListAllPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
lo... | [
-0.16511674225330353,
0.08484592288732529,
0.45430323481559753,
-0.533864438533783,
-0.1409529447555542,
-0.9271962642669678,
-0.4024201035499573,
0.0024042653385549784,
0.2828006148338318,
0.2336220145225525,
-0.7412872314453125,
-0.1660756766796112,
0.48281681537628174,
0.604180216789245... |
func (m *Mpesa) B2CRequest(b2c B2CRequestBody) (*MpesaResult, error) {
if b2c.CommandID == "" {
b2c.CommandID = BusinessPayment
}
return m.sendAndProcessMpesaRequest("https://api.safaricom.co.ke/mpesa/b2c/v1/paymentrequest", b2c, nil)
} | [
-0.9413182139396667,
-0.7185131311416626,
0.6504679322242737,
0.8099714517593384,
-0.5881779193878174,
-0.7931119203567505,
0.04408412426710129,
0.11061223596334457,
0.4268426299095154,
0.04056958109140396,
0.44782179594039917,
1.641692876815796,
-0.10168526321649551,
0.6161744594573975,
... |
func (m *Mpesa) B2BRequest(b2b B2BRequestBody) (*MpesaResult, error) {
return m.sendAndProcessMpesaRequest(m.getB2BUrl(), b2b, nil)
} | [
-1.215369462966919,
-0.34359386563301086,
0.6531053185462952,
1.049241304397583,
0.2224695086479187,
-0.6344796419143677,
0.03579147905111313,
-0.5455377697944641,
0.528751790523529,
-0.2862497568130493,
-0.494660884141922,
1.7290163040161133,
-0.6041340827941895,
0.448471337556839,
1.05... |
func (m *Mpesa) GetAccessToken() (*AccessTokenResponse, error) {
req, err := http.NewRequest(http.MethodGet, m.getAccessTokenUrl(), nil)
if err != nil {
return nil, err
}
log.Println(req.URL.String())
req.SetBasicAuth(m.ConsumerKey, m.ConsumerSecret)
req.Header.Add("Accept", "application/json")
req.Header.Se... | [
-0.037853874266147614,
-0.7854624390602112,
1.1317797899246216,
-0.36529335379600525,
-0.31842494010925293,
-0.9070470333099365,
0.10073534399271011,
0.13227592408657074,
0.512093722820282,
0.1753188818693161,
0.3668012022972107,
1.671409010887146,
-0.2957122325897217,
-0.15613171458244324... |
func parseEpd(epd string) (chess2.Game, error) {
flags := chess2.VariantChess2
usedEpd := epd
if *classic {
flags = chess2.VariantClassic
usedEpd += " cc 33"
}
game, err := chess2.ParseEpdFlags(usedEpd, flags)
return game, err
} | [
-0.5298121571540833,
0.264843612909317,
0.56819087266922,
-0.604516863822937,
-1.001942753791809,
1.236841082572937,
-0.35633325576782227,
-0.20442074537277222,
0.5065557956695557,
-0.10815083980560303,
0.9996551871299744,
0.05064711347222328,
0.3028043806552887,
0.253525048494339,
0.671... |
func dividePerft(epd string) (string, error) {
game, err := parseEpd(epd)
if err != nil {
return "", err
}
var sb strings.Builder
sb.WriteString(strings.TrimSpace(epd))
sb.WriteRune('\n')
if *maxDepth < 1 {
return sb.String(), nil
}
var moves []chess2.Move
if *bruteforce {
chess2.BruteforceMoveList(fun... | [
-0.19167248904705048,
0.1595573127269745,
0.6789167523384094,
-0.38831695914268494,
-0.8279380798339844,
-0.014331191778182983,
0.48095840215682983,
0.2461490035057068,
0.24295789003372192,
-0.17345339059829712,
0.48900264501571655,
-0.8610053062438965,
-0.16109926998615265,
0.772936463356... |
func runPerft(input string) (string, error) {
parts := strings.SplitN(input, ";", 2)
epd := parts[0]
var checkValues []uint64
if len(parts) > 1 {
perftValues := strings.Split(strings.TrimSpace(parts[1]), "/")
checkValues = make([]uint64, len(perftValues))
for i, str := range perftValues {
val, err := strco... | [
-0.09723645448684692,
0.07108473777770996,
0.7888480424880981,
-0.5315512418746948,
-0.7534006237983704,
-0.07811231911182404,
0.6415068507194519,
0.5458072423934937,
0.38428229093551636,
-0.388239324092865,
0.585411548614502,
-0.05876478552818298,
-0.7801001667976379,
0.5131772756576538,
... |
func (obj *BrainkeyHardenedPoint) Ctx() uintptr {
return uintptr(unsafe.Pointer(obj.cCtx))
} | [
0.3764704763889313,
-0.04380542039871216,
0.307436466217041,
-0.004370671696960926,
0.01593744195997715,
0.8835013508796692,
0.17974083125591278,
-0.5545000433921814,
0.8083613514900208,
0.5587620139122009,
0.09579425305128098,
0.7001667022705078,
-0.3724397122859955,
-0.884475827217102,
... |
func NewBrainkeyHardenedPointWithCtx(pointer unsafe.Pointer) *BrainkeyHardenedPoint {
ctx := (*C.vssb_brainkey_hardened_point_t /*ct2*/)(pointer)
obj := &BrainkeyHardenedPoint{
cCtx: ctx,
}
runtime.SetFinalizer(obj, (*BrainkeyHardenedPoint).Delete)
return obj
} | [
0.5518921613693237,
-0.6032231450080872,
0.38625991344451904,
0.4290009140968323,
-0.1519608497619629,
1.001936435699463,
-0.42346593737602234,
-0.45517194271087646,
-0.42394256591796875,
0.4658661484718323,
-0.4298097789287567,
0.06324103474617004,
-0.7922974824905396,
-0.1219171881675720... |
func NewBrainkeyHardenedPointCopy(pointer unsafe.Pointer) *BrainkeyHardenedPoint {
ctx := (*C.vssb_brainkey_hardened_point_t /*ct2*/)(pointer)
obj := &BrainkeyHardenedPoint{
cCtx: C.vssb_brainkey_hardened_point_shallow_copy(ctx),
}
runtime.SetFinalizer(obj, (*BrainkeyHardenedPoint).Delete)
return obj
} | [
0.4397328197956085,
-0.603499710559845,
0.29249003529548645,
0.5315691232681274,
-0.695854127407074,
0.8854811787605286,
-0.00411418778821826,
-0.7872169613838196,
-0.426039457321167,
0.8892655372619629,
-0.604033887386322,
0.44081467390060425,
-1.3238164186477661,
-0.034655094146728516,
... |
func (obj *BrainkeyHardenedPoint) Delete() {
if obj == nil {
return
}
runtime.SetFinalizer(obj, nil)
obj.delete()
} | [
1.116571307182312,
0.6400611400604248,
0.28351685404777527,
1.0652821063995361,
0.7442742586135864,
0.4878878593444824,
0.4876258075237274,
-0.19017565250396729,
0.06221620365977287,
0.6291530728340149,
-0.18442672491073608,
-0.14870764315128326,
-1.6118338108062744,
0.3456060290336609,
... |
func (obj *BrainkeyHardenedPoint) delete() {
C.vssb_brainkey_hardened_point_delete(obj.cCtx)
} | [
1.4739580154418945,
0.71418696641922,
0.2911708354949951,
1.2733122110366821,
0.7429825067520142,
1.394105315208435,
0.47290918231010437,
-0.07233019918203354,
0.1519419550895691,
1.1609798669815063,
-0.32845836877822876,
0.44104814529418945,
-1.7030222415924072,
-0.1577921360731125,
0.5... |
func (obj *BrainkeyHardenedPoint) Value() []byte {
proxyResult := /*pr4*/ C.vssb_brainkey_hardened_point_value(obj.cCtx)
runtime.KeepAlive(obj)
return helperExtractData(proxyResult) /* r1 */
} | [
-0.10381750762462616,
0.5052362084388733,
0.2738564908504486,
1.109952688217163,
0.6046544909477234,
1.1443712711334229,
0.1374216079711914,
-1.0806233882904053,
-0.18661142885684967,
1.07240891456604,
-0.044081106781959534,
0.8632927536964417,
-1.5730724334716797,
0.03419376164674759,
0... |
func RunPod(ctx context.Context, pod corev1.Pod,
ts oauth2.TokenSource, watcherImage, project, zone, machineType string) error {
svc, err := compute.NewService(ctx, option.WithTokenSource(ts))
if err != nil {
return err
}
b, err := yaml.Marshal(pod)
if err != nil {
return err
}
podstr := string(b)
log.Pr... | [
-0.6744329929351807,
0.112732894718647,
0.7609917521476746,
-0.8835805058479309,
-0.1650412529706955,
0.4304113984107971,
0.5016564130783081,
0.1406698077917099,
-0.29434072971343994,
0.15830084681510925,
-0.04028034210205078,
0.4742267429828644,
0.27767273783683777,
0.38046976923942566,
... |
func (nt *NullTime) Scan(value interface{}) error {
nt.Time, nt.Valid = value.(time.Time)
if !nt.Valid && value != nil {
return fmt.Errorf("invalid type %T for NullTime: %v", value, value)
}
return nil
} | [
-0.28602883219718933,
0.7004582285881042,
0.5304301381111145,
0.19404448568820953,
-0.8847594857215881,
-0.03214644640684128,
-0.6490954160690308,
-0.7529129981994629,
0.683685302734375,
-0.17202900350093842,
-0.40416476130485535,
0.3459632098674774,
0.10481195896863937,
1.5191168785095215... |
func (nt NullTime) Value() (driver.Value, error) {
if !nt.Valid {
return nil, nil
}
return nt.Time, nil
} | [
-0.28743788599967957,
0.0430590994656086,
0.36119475960731506,
0.39270490407943726,
0.46143782138824463,
-0.12073743343353271,
-0.42403626441955566,
-0.8448001146316528,
1.0573488473892212,
0.783689558506012,
0.3471713662147522,
-0.03427713364362717,
-0.4435959458351135,
0.9492265582084656... |
func ToNullTime(v time.Time) NullTime {
return NullTime{Time: v, Valid: true}
} | [
0.2682742774486542,
-0.1326315999031067,
0.4533793032169342,
-0.06449204683303833,
-1.0994195938110352,
-0.4645237922668457,
-1.4601011276245117,
0.044960808008909225,
1.298570990562439,
1.3911076784133911,
-1.0825802087783813,
-0.24598371982574463,
0.16684910655021667,
0.3564136028289795,... |
func (nt NullTime) MarshalJSON() ([]byte, error) {
if nt.Valid {
return nt.Time.MarshalJSON()
}
return []byte("null"), nil
} | [
0.15912961959838867,
-0.15241116285324097,
0.2511855363845825,
-0.166534885764122,
-0.7887670993804932,
-0.8504666686058044,
-1.3928701877593994,
-0.19569125771522522,
1.4204368591308594,
0.6387824416160583,
-1.0109953880310059,
0.24418456852436066,
-0.4363158643245697,
1.7150228023529053,... |
func (nt *NullTime) UnmarshalJSON(b []byte) (err error) {
// scan for null
if bytes.Equal(b, []byte("null")) {
return nt.Scan(nil)
}
var t time.Time
var err2 error
if err := json.Unmarshal(b, &t); err != nil {
// Try for JS new Date().toJSON()
if t, err2 = time.Parse("2006-01-02T15:04:05.000Z", string(b)); ... | [
-0.4475982189178467,
0.1776486039161682,
0.8688749074935913,
-0.6993130445480347,
-1.2109862565994263,
-1.084245204925537,
-0.35526061058044434,
-0.5621400475502014,
0.7895948886871338,
0.9744828343391418,
-0.7232948541641235,
-0.1701061725616455,
-0.10564877837896347,
1.2315293550491333,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.