text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (v *ProductExtended) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonD2b7633eDecodeBackendInternalModels5(&r, v)
return r.Error()
} | [
-0.25048714876174927,
0.5193731188774109,
0.5075091123580933,
-0.5922641754150391,
-1.0041998624801636,
0.2577754259109497,
-0.022433064877986908,
0.09202783554792404,
0.1256241351366043,
0.6146445274353027,
-1.4378825426101685,
1.1581190824508667,
-0.4674516022205353,
-0.18162216246128082... |
func (v *ProductExtended) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonD2b7633eDecodeBackendInternalModels5(l, v)
} | [
-0.05947849899530411,
0.4718382954597473,
0.4792713522911072,
-0.43999695777893066,
-0.6205065846443176,
-0.5544486045837402,
0.24324345588684082,
0.10474586486816406,
0.14104779064655304,
0.5719494819641113,
-1.8581771850585938,
0.8172363638877869,
-0.33153384923934937,
0.0942151173949241... |
func (v Msg) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonD2b7633eEncodeBackendInternalModels6(&w, v)
return w.Buffer.BuildBytes(), w.Error
} | [
-0.18118317425251007,
0.39248955249786377,
0.27395498752593994,
-0.2882455587387085,
0.04617803171277046,
-0.9693777561187744,
1.1147181987762451,
0.054525747895240784,
-0.05032065883278847,
0.14531999826431274,
-0.700029194355011,
0.4996747076511383,
-0.9079169034957886,
0.905697166919708... |
func (v Msg) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonD2b7633eEncodeBackendInternalModels6(w, v)
} | [
-0.02967146411538124,
0.2540647089481354,
0.38089877367019653,
-0.9603764414787292,
0.270514577627182,
-1.3017356395721436,
0.7997556328773499,
-0.7468379735946655,
0.09456313401460648,
0.11212403327226639,
-1.0215750932693481,
0.37728872895240784,
-0.36576181650161743,
1.358716607093811,
... |
func (v *Msg) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonD2b7633eDecodeBackendInternalModels6(&r, v)
return r.Error()
} | [
0.008366497233510017,
0.7286612391471863,
0.4447966516017914,
-1.0728275775909424,
-0.4347687363624573,
-0.6475702524185181,
0.531195878982544,
0.10899566859006882,
-0.2583380937576294,
0.13433685898780823,
-0.16693057119846344,
0.27803125977516174,
-0.9568968415260315,
1.092842698097229,
... |
func (v *Msg) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonD2b7633eDecodeBackendInternalModels6(l, v)
} | [
0.32922664284706116,
0.3672196567058563,
0.49348247051239014,
-0.9958001375198364,
0.17002743482589722,
-1.5721583366394043,
0.6045477986335754,
0.12426331639289856,
-0.09829568862915039,
0.06826319545507431,
-0.8216961026191711,
0.032437920570373535,
-0.5521883964538574,
1.252013564109802... |
func (v IngredientArr) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonD2b7633eEncodeBackendInternalModels7(&w, v)
return w.Buffer.BuildBytes(), w.Error
} | [
-0.8306003212928772,
-0.8451153635978699,
0.23312275111675262,
0.30429065227508545,
-0.5593177676200867,
-0.6074305772781372,
0.7247712016105652,
0.03378875553607941,
0.3539316952228546,
0.914577066898346,
0.31181472539901733,
0.0861772894859314,
-0.576770007610321,
0.9296513199806213,
-... |
func (v IngredientArr) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonD2b7633eEncodeBackendInternalModels7(w, v)
} | [
-0.7141751646995544,
-0.6716800928115845,
0.31501516699790955,
-0.25069406628608704,
-0.4149117171764374,
-1.1655709743499756,
0.4033430516719818,
-0.6945458054542542,
0.5196369290351868,
0.5735020637512207,
-0.06464806944131851,
-0.07642395049333572,
-0.21168963611125946,
1.36818897724151... |
func (v *IngredientArr) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonD2b7633eDecodeBackendInternalModels7(&r, v)
return r.Error()
} | [
-0.42004600167274475,
-0.6401175856590271,
0.3471565246582031,
-0.8142349123954773,
-1.1152092218399048,
-0.5493313670158386,
0.3356623947620392,
0.23951345682144165,
0.12388455867767334,
1.1187899112701416,
0.5054515600204468,
0.2159402072429657,
-0.595545768737793,
0.9200471043586731,
... |
func (v *IngredientArr) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonD2b7633eDecodeBackendInternalModels7(l, v)
} | [
-0.1312204748392105,
-0.5314043760299683,
0.4306177496910095,
-0.564644992351532,
-0.594088077545166,
-1.436787486076355,
0.3822474181652069,
0.21728965640068054,
0.2447887361049652,
0.8333362936973572,
0.021019667387008667,
-0.05524739250540733,
-0.3410921096801758,
1.0941591262817383,
... |
func (v Ingredient) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonD2b7633eEncodeBackendInternalModels8(&w, v)
return w.Buffer.BuildBytes(), w.Error
} | [
-0.6619859337806702,
-0.5604720711708069,
0.12731926143169403,
-0.10906276851892471,
-0.08085592836141586,
-0.9044600129127502,
0.677078127861023,
0.2108219414949417,
0.2913631498813629,
1.1311047077178955,
-0.3128049671649933,
0.46372461318969727,
-0.5054607391357422,
0.12681324779987335,... |
func (v Ingredient) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonD2b7633eEncodeBackendInternalModels8(w, v)
} | [
-0.424196720123291,
-0.4078122675418854,
0.28277337551116943,
-0.5378041863441467,
-0.0922863781452179,
-1.3236124515533447,
0.41680192947387695,
-0.6178014874458313,
0.49682721495628357,
0.7048317790031433,
-0.6268308758735657,
0.3383163809776306,
-0.16515235602855682,
0.6340082883834839,... |
func (v *Ingredient) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonD2b7633eDecodeBackendInternalModels8(&r, v)
return r.Error()
} | [
-0.4231566786766052,
-0.3400576710700989,
0.21026089787483215,
-1.1118003129959106,
-0.8213671445846558,
-0.7126672267913818,
0.24620717763900757,
0.43593740463256836,
0.08340127021074295,
1.3363713026046753,
0.13687951862812042,
0.2743849456310272,
-0.6318241357803345,
0.10489653050899506... |
func (v *Ingredient) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonD2b7633eDecodeBackendInternalModels8(l, v)
} | [
-0.0849570780992508,
-0.3647180497646332,
0.33126360177993774,
-0.7789989113807678,
-0.43246325850486755,
-1.5679324865341187,
0.30044636130332947,
0.5032976865768433,
0.3296755254268646,
1.0734927654266357,
-0.4131068289279938,
0.1856992393732071,
-0.43604835867881775,
0.4723964333534241,... |
func (v GroupArr) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonD2b7633eEncodeBackendInternalModels9(&w, v)
return w.Buffer.BuildBytes(), w.Error
} | [
-0.9049878716468811,
-0.3080300986766815,
0.3320543169975281,
0.421720027923584,
-0.4224444329738617,
-0.40670543909072876,
1.367436170578003,
-0.4400692284107208,
-0.11946512013673782,
0.2183394432067871,
0.11080345511436462,
0.35275861620903015,
-0.786304235458374,
0.8560357689857483,
... |
func (v GroupArr) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonD2b7633eEncodeBackendInternalModels9(w, v)
} | [
-0.7546721696853638,
-0.24829988181591034,
0.3433789610862732,
-0.2681364119052887,
-0.2382887303829193,
-0.9417459964752197,
0.9461125731468201,
-1.1742022037506104,
0.09152284264564514,
0.14357392489910126,
-0.16224059462547302,
0.20049948990345,
-0.3985055983066559,
1.329136848449707,
... |
func (v *GroupArr) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonD2b7633eDecodeBackendInternalModels9(&r, v)
return r.Error()
} | [
-0.6378686428070068,
-0.08744674921035767,
0.4157816469669342,
-0.6727453470230103,
-0.7321318984031677,
-0.2814781069755554,
1.045935034751892,
-0.332832008600235,
-0.43607306480407715,
0.3108363449573517,
0.3911658227443695,
0.2625527083873749,
-0.8215383291244507,
0.7980172634124756,
... |
func (v *GroupArr) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonD2b7633eDecodeBackendInternalModels9(l, v)
} | [
-0.2802371680736542,
-0.253086656332016,
0.4386606514453888,
-0.655941367149353,
-0.2921826243400574,
-1.2318177223205566,
1.0139014720916748,
-0.2901506721973419,
-0.2035435438156128,
0.22843176126480103,
-0.004849539604038,
-0.10599664598703384,
-0.5743719339370728,
0.867991030216217,
... |
func (v Group) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonD2b7633eEncodeBackendInternalModels10(&w, v)
return w.Buffer.BuildBytes(), w.Error
} | [
-1.0120668411254883,
0.3662560284137726,
0.2560286521911621,
-0.3778495788574219,
0.14039450883865356,
-0.993011474609375,
1.1728965044021606,
-0.2785488963127136,
-0.3241129517555237,
0.4184005558490753,
-0.3375438153743744,
0.23267416656017303,
-0.8211761713027954,
0.5005679726600647,
... |
func (v Group) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonD2b7633eEncodeBackendInternalModels10(w, v)
} | [
-0.8001320362091064,
0.1821856051683426,
0.2903028428554535,
-1.0096673965454102,
0.20787674188613892,
-1.409749984741211,
0.7176798582077026,
-1.0324829816818237,
-0.05517800152301788,
0.29817894101142883,
-0.6251018047332764,
0.21743588149547577,
-0.33328840136528015,
1.076054573059082,
... |
func (v *Group) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonD2b7633eDecodeBackendInternalModels10(&r, v)
return r.Error()
} | [
-0.7577664852142334,
0.5829082131385803,
0.25819602608680725,
-1.250691294670105,
-0.6216197609901428,
-0.6941144466400146,
0.6366850137710571,
-0.1533489227294922,
-0.6287721991539001,
0.29930928349494934,
0.09143979102373123,
0.16039633750915527,
-0.736273467540741,
0.5309098362922668,
... |
func (v *Group) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonD2b7633eDecodeBackendInternalModels10(l, v)
} | [
-0.3828151226043701,
0.3035276234149933,
0.30522656440734863,
-1.2237929105758667,
-0.11971819400787354,
-1.5752882957458496,
0.6498197913169861,
-0.058672524988651276,
-0.3237631618976593,
0.32873043417930603,
-0.4521980583667755,
-0.05414612218737602,
-0.4334312379360199,
0.7947788834571... |
func (v Fruit) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonD2b7633eEncodeBackendInternalModels11(&w, v)
return w.Buffer.BuildBytes(), w.Error
} | [
-0.5805468559265137,
0.11717484146356583,
0.3507796823978424,
0.2099180817604065,
-0.18041914701461792,
-0.7226192355155945,
0.6781876087188721,
0.23645347356796265,
0.09744460135698318,
0.07027191668748856,
-0.8033942580223083,
0.0757618248462677,
-0.42674121260643005,
-0.3225586712360382... |
func (v Fruit) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonD2b7633eEncodeBackendInternalModels11(w, v)
} | [
-0.4756579101085663,
-0.0005307250539772213,
0.3964114487171173,
-0.36831530928611755,
-0.09134221076965332,
-1.0974434614181519,
0.47649750113487244,
-0.6059865355491638,
0.22261276841163635,
-0.04426282271742821,
-1.135268211364746,
0.11719761043787003,
-0.018480099737644196,
0.179895356... |
func (v *Fruit) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonD2b7633eDecodeBackendInternalModels11(&r, v)
return r.Error()
} | [
-0.2809808850288391,
0.39679276943206787,
0.4413190186023712,
-0.44776198267936707,
-0.9623873233795166,
-0.44919776916503906,
0.4382317364215851,
0.3657260835170746,
-0.05098443850874901,
0.06110798567533493,
-0.4845413267612457,
0.1919960379600525,
-0.3478478491306305,
-0.154968336224555... |
func (v *Fruit) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonD2b7633eDecodeBackendInternalModels11(l, v)
} | [
0.05161834508180618,
0.09613911062479019,
0.5409248471260071,
-0.404426246881485,
-0.3746689558029175,
-1.3146978616714478,
0.5113433599472046,
0.43052801489830017,
0.15464657545089722,
0.08720950037240982,
-1.0449503660202026,
-0.06494076550006866,
-0.16718490421772003,
0.0917533263564109... |
func (v DetectedFruit) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonD2b7633eEncodeBackendInternalModels12(&w, v)
return w.Buffer.BuildBytes(), w.Error
} | [
-0.24222275614738464,
-0.14005348086357117,
0.2861683964729309,
0.6381765007972717,
0.21123991906642914,
-1.063132643699646,
0.942125678062439,
0.12219361215829849,
0.30534979701042175,
-0.26458728313446045,
-0.8431568741798401,
0.9028764367103577,
-0.574126124382019,
0.35368314385414124,
... |
func (v DetectedFruit) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonD2b7633eEncodeBackendInternalModels12(w, v)
} | [
-0.08394124358892441,
-0.20243440568447113,
0.31479400396347046,
0.012024620547890663,
0.36412882804870605,
-1.4158717393875122,
0.6892464756965637,
-0.7299452424049377,
0.36364713311195374,
-0.3944077789783478,
-1.2174012660980225,
0.7441842555999756,
-0.14818847179412842,
0.7549272775650... |
func (v *DetectedFruit) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonD2b7633eDecodeBackendInternalModels12(&r, v)
return r.Error()
} | [
0.09905823320150375,
0.08591189980506897,
0.3677804470062256,
0.08531655371189117,
-0.23845350742340088,
-0.5695323944091797,
0.7166876792907715,
0.18335068225860596,
0.10016205161809921,
-0.5065901279449463,
-0.7379237413406372,
0.7613081932067871,
-0.4469699561595917,
0.5045554041862488,... |
func (v *DetectedFruit) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonD2b7633eDecodeBackendInternalModels12(l, v)
} | [
0.3838098645210266,
-0.11892687529325485,
0.44494715332984924,
0.03173209726810455,
0.31049609184265137,
-1.3655723333358765,
0.7051805853843689,
0.2945139706134796,
0.09101289510726929,
-0.4515366554260254,
-1.3017189502716064,
0.6177552342414856,
-0.3006097078323364,
0.6888538599014282,
... |
func (o *HTTPFrontendOptions) CopyFrom(src *HTTPFrontendOptions) {
patternToRgx := func(pattern string) *regexp.Regexp {
reg := regexp.QuoteMeta(strings.ToLower(pattern))
reg = strings.Replace(reg, "\\*", ".*", -1)
reg = strings.Replace(reg, "\\?", ".", -1)
reg = "^" + reg + "$"
return regexp.MustCompile(reg... | [
0.08696022629737854,
-0.08539701998233795,
0.7643701434135437,
-0.15564732253551483,
-0.608113169670105,
0.15631558001041412,
0.5512733459472656,
0.16725431382656097,
0.10149486362934113,
0.22751818597316742,
0.3841477334499359,
0.799488365650177,
0.7537434697151184,
0.26235339045524597,
... |
func NewHTTPFrontend(opts HTTPFrontendOptions) (f *HTTPFrontend, err error) {
f, err = f.Fork(opts)
return
} | [
0.5737988352775574,
0.14701341092586517,
0.23484644293785095,
0.757536768913269,
-0.6747201681137085,
-0.529666543006897,
-0.7533869743347168,
-0.4370090961456299,
-0.23038744926452637,
-0.7050119042396545,
-0.6671295166015625,
1.3313062191009521,
-0.2701866030693054,
0.6528410315513611,
... |
func (f *HTTPFrontend) Fork(opts HTTPFrontendOptions) (fn *HTTPFrontend, err error) {
fn = &HTTPFrontend{}
fn.opts.CopyFrom(&opts)
fn.workerTkr = time.NewTicker(100 * time.Millisecond)
fn.ctx, fn.ctxCancel = context.WithCancel(context.Background())
promLabels := prometheus.Labels{
"frontend": fn.opts.Name,
}
... | [
0.6215261816978455,
0.21322780847549438,
0.719897449016571,
-0.008911026641726494,
-0.24785473942756653,
0.3635643422603607,
0.3259897232055664,
-0.4959103465080261,
0.06405093520879745,
-0.5448958873748779,
0.3696156144142151,
1.2125434875488281,
-0.10911480337381363,
0.8742169141769409,
... |
func (f *HTTPFrontend) Close() {
f.ctxCancel()
f.workerTkr.Stop()
f.workerWg.Wait()
} | [
0.46754828095436096,
-0.18806783854961395,
0.5208705067634583,
-0.2153439223766327,
-0.11984174698591232,
0.7938331365585327,
-0.25491875410079956,
-0.43592217564582825,
-1.5713943243026733,
-0.557289719581604,
0.39806023240089417,
-0.28392037749290466,
-0.37018534541130066,
1.104644536972... |
func (f *HTTPFrontend) GetOpts() (opts HTTPFrontendOptions) {
opts.CopyFrom(&f.opts)
return
} | [
0.451107919216156,
0.2742933928966522,
0.228396937251091,
-0.15879660844802856,
0.4967764914035797,
-0.24761874973773956,
-0.4984142780303955,
-0.9460969567298889,
0.5805813670158386,
-0.6154478788375854,
0.6952167749404907,
0.7784625291824341,
-0.056274186819791794,
0.042401112616062164,
... |
func (f *HTTPFrontend) Serve(ctx context.Context, l *Listener, conn net.Conn) {
if tcpConn, ok := conn.(*net.TCPConn); ok {
tcpConn.SetKeepAlive(true)
tcpConn.SetKeepAlivePeriod(5 * time.Second)
}
feConn := newBufConn(conn)
defer feConn.Flush()
xlog.V(200).Debugf("connected client %q to listener %q on frontend... | [
-0.40057840943336487,
-0.11572879552841187,
0.8284733295440674,
-0.3120373487472534,
0.48976874351501465,
-0.031184814870357513,
-0.34116727113723755,
0.03345199301838875,
-1.5321146249771118,
0.22938083112239838,
0.12698312103748322,
0.37790343165397644,
0.1300526112318039,
0.551949918270... |
func GetVersion() string {
return fmt.Sprintf("%s (git+sha %s)", Release, GitSHA)
} | [
0.3770117461681366,
-0.9741880297660828,
0.374055415391922,
-0.508922815322876,
0.2510901987552643,
0.6404768824577332,
-0.5094558596611023,
0.2525072693824768,
0.1130070760846138,
1.0065391063690186,
0.07441621273756027,
0.7252005338668823,
0.37513530254364014,
0.6264877319335938,
0.867... |
func GetBuildTime() time.Time {
tm, err := strconv.ParseInt(BuildTime, 10, 64)
if err != nil {
panic("unable to parse the build time")
}
return time.Unix(tm, 0)
} | [
0.5035786628723145,
0.12332385033369064,
0.6097468137741089,
0.09565315395593643,
0.7766609191894531,
0.28700923919677734,
-0.5166556239128113,
0.533440351486206,
-0.24816931784152985,
-0.10911216586828232,
-0.41446253657341003,
-0.054775211960077286,
-0.7433190941810608,
0.437149375677108... |
func removeNodeSession(id int64) error {
kv, err := etcdkv.NewEtcdKV(Params.EtcdEndpoints, Params.MetaRootPath)
if err != nil {
return err
}
err = kv.Remove(fmt.Sprintf("session/"+typeutil.QueryNodeRole+"-%d", id))
if err != nil {
return err
}
return nil
} | [
-1.111691951751709,
-0.08623310923576355,
0.1862369179725647,
-0.9065601229667664,
-0.8976609110832214,
-0.3819735646247864,
0.18088026344776154,
-0.7184056639671326,
0.27510517835617065,
0.7585482001304626,
0.05463574081659317,
-0.31924235820770264,
-0.2082682102918625,
0.0118951313197612... |
func Total(amount int, currency string) (totalSum int) {
bonus := PercentFor(currency)
totalSum = amount + (amount * bonus / 1000)
return totalSum
} | [
0.6665617823600769,
0.14237259328365326,
0.32373252511024475,
-0.16100601851940155,
-0.37380844354629517,
-0.38858911395072937,
0.7939003109931946,
0.0599646233022213,
0.2503189742565155,
0.9179188013076782,
-0.7313753962516785,
0.34030959010124207,
-0.7231931686401367,
-1.1706082820892334... |
func PercentFor(currency string) int {
if currency == "UZS" {
return 7
}
if currency == "USD" {
return 10
}
return 0
} | [
-0.4662053883075714,
0.5811942219734192,
0.5091918706893921,
-0.14389722049236298,
-0.19275400042533875,
0.05025370791554451,
0.24073709547519684,
0.5121213793754578,
0.6306800246238708,
-0.17688804864883423,
0.020711364224553108,
-1.31856107711792,
0.41433683037757874,
0.04135591164231300... |
func init() {
bSalt, err := ioutil.ReadFile("./.salt")
if err != nil {
initErr = err
return
}
salt = strings.TrimSpace(string(bSalt))
} | [
0.7439055442810059,
-0.5167125463485718,
0.6527701616287231,
-0.7054728269577026,
-0.019619794562458992,
0.9692936539649963,
-0.11223600059747696,
0.15782874822616577,
-0.37363845109939575,
0.4320867955684662,
0.27856025099754333,
1.4535201787948608,
0.46213048696517944,
0.2012033462524414... |
func StartProgram() {
airports := []Airport{
Airport{
Place: Place{
Name: "SeaTac",
Coordinate: Coordinate{Lat: 47.438164914, Long: -122.28916551},
},
Aircrafts: []Aircraft{
Aircraft{
ID: 9,
Model: "OEING",
Speed: 300,
},
},
},
Airport{
Place: Place{
Nam... | [
-0.3424798846244812,
-0.43643730878829956,
0.9818649291992188,
-0.24647322297096252,
-0.4912794530391693,
1.0480443239212036,
0.05077479034662247,
-0.0775623470544815,
-0.6104695200920105,
0.1948319375514984,
-0.5351455211639404,
-0.18624648451805115,
-0.05027569457888603,
-0.3523685932159... |
func NewHotSpotCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "hot",
Short: "show the hotspot status of the cluster",
}
cmd.AddCommand(NewHotWriteRegionCommand())
cmd.AddCommand(NewHotReadRegionCommand())
cmd.AddCommand(NewHotStoreCommand())
return cmd
} | [
-0.19734922051429749,
-0.8183565735816956,
0.6046823263168335,
-0.0497557669878006,
0.3599841296672821,
-0.4387128949165344,
0.15474441647529602,
0.5971099734306335,
0.6736363768577576,
-0.44080138206481934,
-0.48824137449264526,
0.20517991483211517,
0.5911945104598999,
1.1144447326660156,... |
func NewHotWriteRegionCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "write [<store id> ...]",
Short: "show the hot write regions",
Run: showHotWriteRegionsCommandFunc,
}
return cmd
} | [
-0.6581279635429382,
-1.0030696392059326,
0.25390344858169556,
-0.020311545580625534,
0.19947762787342072,
-0.7056357860565186,
1.1121481657028198,
0.16617009043693542,
0.1364668756723404,
-0.2950645089149475,
-0.05300423502922058,
0.721971869468689,
0.5077876448631287,
0.8825369477272034,... |
func NewHotReadRegionCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "read [<store id> ...]",
Short: "show the hot read regions",
Run: showHotReadRegionsCommandFunc,
}
return cmd
} | [
0.1712609827518463,
-1.1844124794006348,
0.42906272411346436,
-0.4643929600715637,
-0.017027275636792183,
-0.18653765320777893,
0.15063756704330444,
0.5775296092033386,
0.43559348583221436,
-0.8242482542991638,
0.3474081754684448,
1.1233389377593994,
0.9619899392127991,
0.33722251653671265... |
func NewHotStoreCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "store",
Short: "show the hot stores",
Run: showHotStoresCommandFunc,
}
return cmd
} | [
0.18868938088417053,
-0.3435584008693695,
0.30511027574539185,
0.30229467153549194,
-0.07007186859846115,
-0.37662678956985474,
0.32020682096481323,
0.922842264175415,
0.6462135314941406,
-0.8609896302223206,
-0.196868434548378,
0.860924482345581,
0.48537328839302063,
0.9449353218078613,
... |
func NewStoppedCh() StoppedCh {
return make(StoppedCh)
} | [
-0.334841787815094,
-0.7183572053909302,
-0.04257725179195404,
0.3301810920238495,
-1.1043806076049805,
0.6515429019927979,
0.4460602402687073,
-0.4957237243652344,
-0.9372156858444214,
-1.0305936336517334,
-0.4268287718296051,
-0.3311068117618561,
-0.1328168511390686,
0.2953435182571411,
... |
func (pa Attr) pack() []byte {
var space bool
out := new(bytes.Buffer)
for k, v := range pa {
if space {
out.WriteRune(' ')
}
fmt.Fprintf(out, "%s=%s", k, quote(v))
space = true
}
return out.Bytes()
} | [
-0.4100373685359955,
0.5645747780799866,
0.5663756728172302,
-0.24097506701946259,
-0.5745600461959839,
0.29367467761039734,
-0.10940641909837723,
-0.23996737599372864,
0.23726612329483032,
0.4313015639781952,
0.15054890513420105,
-0.38042283058166504,
-0.011368063278496265,
0.823831260204... |
func (pm Msg) pack() []byte {
out := new(bytes.Buffer)
fmt.Fprintf(out, "%s\n%s\n%s\n%s\n%s\n", pm.Src, pm.Dst, pm.Wdir, pm.Type, pm.Attr.pack())
ln := len(pm.Data)
fmt.Fprintf(out, "%d\n%s", ln, pm.Data[:ln])
return out.Bytes()
} | [
-0.06043855845928192,
0.2762492001056671,
0.5328734517097473,
-0.967773973941803,
-0.6547255516052246,
0.03193046152591705,
0.2114725261926651,
-0.2827838361263275,
-0.40815088152885437,
-0.8116591572761536,
0.23501327633857727,
0.28689295053482056,
-0.834101140499115,
1.3412195444107056,
... |
func Open(name string, mode uint8) (*Port, error) {
once.Do(mountPlumb)
if fsysErr != nil {
return nil, fsysErr
}
if err := fsys.Access("send", plan9.AWRITE); err != nil {
return nil, err
}
if fid, err := fsys.Open(name, mode); err != nil {
return nil, fmt.Errorf("open %s: %s", name, err)
} else {
retu... | [
0.3426239788532257,
0.06818794459104538,
0.5099532604217529,
-0.2700352966785431,
-0.9501010775566101,
-0.07954847067594528,
1.0869060754776,
-0.13499902188777924,
0.3532247245311737,
-0.10920128971338272,
-0.08547080308198929,
0.13087432086467743,
-0.5255985856056213,
-0.5775622725486755,... |
func (p *Port) Recv() (*Msg, error) {
msg := &Msg{}
indata := make([]byte, 8192)
fid := (*client.Fid)(p)
n, err := fid.Read(indata)
if n <= 0 {
return nil, err
}
buf := bytes.NewBuffer(indata)
rd := bufio.NewReader(buf)
msg.Src, _ = rd.ReadString('\n')
msg.Src = strings.TrimSpace(msg.Src)
msg.Dst, _ = ... | [
0.6972565650939941,
-0.3722037374973297,
0.8615167737007141,
-1.2986805438995361,
-0.5919873118400574,
-0.08401079475879669,
-0.0845220685005188,
-0.6285108923912048,
-0.9182711839675903,
-0.2935084104537964,
0.14368101954460144,
1.112684965133667,
-0.2699204683303833,
-0.2701423466205597,... |
func (p *Port) Send(m *Msg) error {
msg := m.pack()
fid := (*client.Fid)(p)
if _, err := fid.Write(msg); err != nil {
return err
}
return nil
} | [
0.5161845684051514,
0.5162456631660461,
0.18887020647525787,
-0.3185997009277344,
0.4651595652103424,
0.1952592134475708,
0.07370608299970627,
-0.5201597809791565,
-1.096276879310608,
0.0020298531744629145,
-0.3142414093017578,
0.1894996613264084,
-1.5788830518722534,
0.23619374632835388,
... |
func AliasFromReader(r io.Reader) (*BookmarkData, error) {
d, err := newBookmarkDecoder(r)
if err != nil {
return nil, fmt.Errorf("failed to read source - %s", err)
}
if err := d.aliasHeader(); err != nil {
return nil, err
}
d.read(&d.tocOffset)
// jump to toc
d.seek(int64(d.tocOffset)-4, io.SeekCurrent)
i... | [
-0.2505120635032654,
-0.9753966927528381,
0.70905601978302,
0.06951924413442612,
-0.6792575716972351,
0.06552658975124359,
0.235064297914505,
0.37501266598701477,
-0.3671756982803345,
0.24756568670272827,
-0.2833537459373474,
-0.049235258251428604,
0.2957705557346344,
0.36058109998703003,
... |
func GetRegistryAddressFromInterface(intf net.Interface, localhost bool, ch chan *net.TCPAddr) {
request := LookupInfoRequest{OPERATION_ADDRESS, "registry"}
response := LookupAddressResponse{}
buffer := make([]byte, PACKET_SIZE)
var connection *net.UDPConn
var err error
if localhost {
connection, err = net.Li... | [
-0.9313613772392273,
0.3553289473056793,
0.9496044516563416,
-0.5588334202766418,
0.482634037733078,
-1.0851916074752808,
0.7660677433013916,
0.06014953926205635,
0.4124649465084076,
0.4848509132862091,
-0.4282120168209076,
0.5646936297416687,
-0.055818378925323486,
0.3663806915283203,
1... |
func GetRegistryAddress() (*net.TCPAddr, error) {
if registryAddress != nil {
return registryAddress, nil
}
ch := make(chan *net.TCPAddr, 1)
intf, err := net.Interfaces()
if err != nil {
return nil, err
}
go GetRegistryAddressFromInterface(net.Interface{}, true, ch)
for _, i := range intf {
go GetRegis... | [
-0.2272055298089981,
0.8653213977813721,
0.7523898482322693,
0.7468141317367554,
0.7887275218963623,
-0.8537676334381104,
1.5218009948730469,
0.08972480893135071,
0.6058563590049744,
0.32553544640541077,
-0.17539465427398682,
0.5721284747123718,
-1.2453829050064087,
0.7400938868522644,
0... |
func GetServiceData(operation, name string) ([]byte, error) {
request := LookupInfoRequest{operation, name}
buffer := make([]byte, PACKET_SIZE)
address, err := GetRegistryAddress()
if err != nil {
return nil, err
}
connection, err := net.DialTCP(TCP_PROTOCOL, nil, address)
if err != nil {
registryAddress =... | [
-0.32042187452316284,
0.6227454543113708,
1.1790529489517212,
-0.854182243347168,
-0.34903639554977417,
-0.22275185585021973,
-0.26730793714523315,
-0.33459538221359253,
-0.1802770346403122,
0.4391546845436096,
-0.49866122007369995,
0.7336426973342896,
-1.0791901350021362,
0.10439173132181... |
func GetServiceAddress(name string) (*net.TCPAddr, error) {
response := LookupAddressResponse{}
buffer, err := GetServiceData(OPERATION_ADDRESS, name)
if err != nil {
return nil, err
}
err = json.Unmarshal(buffer, &response)
if err != nil {
return nil, err
}
return &response.Address, nil
} | [
-0.6248889565467834,
-0.14374957978725433,
1.017267107963562,
-0.6355738639831543,
-0.8186612129211426,
-0.6467486619949341,
0.745618999004364,
-0.5230801701545715,
0.5289862155914307,
0.6322457790374756,
-0.3164743185043335,
0.6959630250930786,
-0.800483763217926,
-0.3089325726032257,
0... |
func GetServiceInfo(name string) (*ServiceInfoAddress, error) {
response := ServiceInfoAddress{}
buffer, err := GetServiceData(OPERATION_INFO, name)
if err != nil {
return nil, err
}
err = json.Unmarshal(buffer, &response)
if err != nil {
return nil, err
}
return &response, nil
} | [
-0.4865542948246002,
-0.19545863568782806,
0.7346320748329163,
-0.32626965641975403,
-0.8571891188621521,
-0.7975339889526367,
0.36791345477104187,
-0.6356159448623657,
-0.15516972541809082,
0.3745776414871216,
-0.9534933567047119,
0.3197467625141144,
-0.8418411612510681,
-0.23785924911499... |
func GetServiceList() (*map[string]ServiceInfoAddress, error) {
response := make(map[string]ServiceInfoAddress)
buffer, err := GetServiceData(OPERATION_LIST, "")
if err != nil {
return nil, err
}
err = json.Unmarshal(buffer, &response)
if err != nil {
return nil, err
}
return &response, nil
} | [
-0.9244908094406128,
0.32406142354011536,
0.7499584555625916,
-0.421703040599823,
-0.28805312514305115,
-0.6796112060546875,
0.21623000502586365,
0.06815767288208008,
-0.06209537014365196,
0.11598590016365051,
-0.2699838876724243,
-0.23267823457717896,
-0.37292346358299255,
0.4588702023029... |
func handleServiceConnection(connection *net.TCPConn, handler ServiceHandler) error {
servicecall := ServiceCall{}
buffer := make([]byte, PACKET_SIZE)
defer connection.Close()
length, err := connection.Read(buffer)
if err != nil {
return err
}
err = json.Unmarshal(buffer[:length], &servicecall)
if err != ni... | [
0.15381667017936707,
0.319019079208374,
0.8568153977394104,
-0.5115362405776978,
-0.48079004883766174,
-0.4210059344768524,
0.10117896646261215,
-0.4101729393005371,
-0.7711014151573181,
0.3286490738391876,
-0.505297064781189,
-0.6145618557929993,
-0.06377072632312775,
0.6052038073539734,
... |
func RunService(serviceinfo *ServiceInfo, handler ServiceHandler) error {
address, err := GetRegistryAddress()
if err != nil {
return err
}
connection, err := net.DialTCP(TCP_PROTOCOL, nil, address)
if err != nil {
return err
}
defer connection.Close()
listener, err := net.ListenTCP(TCP_PROTOCOL, TCP_ANY_... | [
-0.21725887060165405,
-0.16727767884731293,
0.8372774720191956,
-0.6316092610359192,
0.09613624960184097,
0.20151236653327942,
0.26074209809303284,
0.2033867985010147,
-1.1119531393051147,
-0.04500580579042435,
-0.25709351897239685,
0.39787757396698,
-0.4495561420917511,
0.8513215184211731... |
func registryLookupServiceOnInterface(address *net.TCPAddr, intf net.Interface, ch chan int) {
response := LookupAddressResponse{*address}
buffer := make([]byte, PACKET_SIZE)
connection, err := net.ListenMulticastUDP(UDP_PROTOCOL, &intf, MULTICAT_ADDR)
if err != nil {
return
}
defer connection.Close()
bytes,... | [
-0.9590979218482971,
0.06483577936887741,
0.7830036282539368,
-1.589141845703125,
-0.2539418935775757,
-0.5074160099029541,
0.5171161890029907,
-0.060883816331624985,
0.5251389741897583,
0.8081609606742859,
-0.727634847164154,
0.03606591001152992,
-0.17192552983760834,
0.010651792399585247... |
func registryLookupService(address *net.TCPAddr) error {
ch := make(chan int)
intf, err := net.Interfaces()
if err != nil {
return err
}
for _, i := range intf {
go registryLookupServiceOnInterface(address, i, ch)
}
for _, _ = range intf {
<- ch
}
return nil
} | [
-1.1072829961776733,
0.8909599781036377,
0.5738064646720886,
-0.6507439613342285,
0.39411062002182007,
0.3246656060218811,
1.4554975032806396,
-0.5482363104820251,
0.9318329095840454,
0.327435165643692,
-0.3069644868373871,
0.06152568757534027,
-0.7275086045265198,
0.676776647567749,
0.3... |
func handleRegistryConnection(connection *net.TCPConn) error {
serviceinfoaddress := ServiceInfoAddress{}
lookuprequest := LookupInfoRequest{}
buffer := make([]byte, PACKET_SIZE)
defer connection.Close()
length, err := connection.Read(buffer)
if err != nil {
return err
}
err = json.Unmarshal(buffer[:length]... | [
-0.47974202036857605,
0.04057951271533966,
1.1734904050827026,
-0.7882657051086426,
0.24899335205554962,
-0.699834406375885,
0.3447939157485962,
-0.13138800859451294,
-0.3232889771461487,
-0.3325614035129547,
-0.5372128486633301,
0.041543520987033844,
-0.18141040205955505,
0.50736516714096... |
func RunRegistryServer() error {
listener, err := net.ListenTCP(TCP_PROTOCOL, TCP_ANY_ADDR)
if err != nil {
return err
}
address, err := net.ResolveTCPAddr(TCP_PROTOCOL, listener.Addr().String())
if err != nil {
return err
}
defer listener.Close()
go registryLookupService(address)
for {
connection, er... | [
-0.9129754304885864,
0.19174878299236298,
0.7889192700386047,
-0.39579877257347107,
0.9567686915397644,
-0.4280758500099182,
1.2218321561813354,
0.49186602234840393,
-0.2571803033351898,
0.1300908774137497,
-0.2295766919851303,
0.009376180358231068,
-0.3583631217479706,
0.6133139133453369,... |
func CallService(name string, args ...string) (string, error) {
servicecall := ServiceCall{name, args}
serviceresult := ServiceResult{}
buffer := make([]byte, PACKET_SIZE)
address, err := GetServiceAddress(name)
if err != nil {
return "", err
}
connection, err := net.DialTCP(TCP_PROTOCOL, nil, address)
if er... | [
-0.30833911895751953,
0.5370640754699707,
1.1348026990890503,
-0.9408957958221436,
-0.8661054968833923,
-0.4182143211364746,
-1.1690945625305176,
-1.3685060739517212,
-0.5909388065338135,
0.7514994144439697,
-0.25614258646965027,
0.3265385627746582,
-0.7006727457046509,
0.40892666578292847... |
func (m Modifiers) Has(v int) bool {
return uint(m)&uint(v) > 0
} | [
-0.8979467153549194,
-0.17466142773628235,
0.322801411151886,
-0.8220576643943787,
0.07201926410198212,
-0.3180907070636749,
-0.46666136384010315,
0.40850698947906494,
0.15063969790935516,
-0.5660118460655212,
-0.7423191666603088,
0.032165125012397766,
-0.5755849480628967,
1.10460650920867... |
func (m Modifiers) Is(v int) bool {
// ignore locks state
m = m.clearLock()
m = m.clearMod2()
return uint(m) == uint(v)
} | [
-1.6683088541030884,
-0.5422261953353882,
0.26375412940979004,
-0.20592918992042542,
-0.2178362011909485,
-0.3956943452358246,
-0.24486945569515228,
-1.0681397914886475,
1.4201358556747437,
0.27678099274635315,
-0.20120982825756073,
0.9866147041320801,
-0.6682582497596741,
0.06584393978118... |
func (t TimeFormat) Get(s string) interface{} { return t } | [
-0.5798757672309875,
-0.8331571817398071,
0.24113166332244873,
-0.8180896639823914,
-0.6643865704536438,
-0.8415420651435852,
-0.5202165842056274,
-0.9395125508308411,
0.2592446208000183,
-0.31429818272590637,
-0.488016813993454,
-0.04715868458151817,
-0.19915823638439178,
0.17247198522090... |
func (t *TimeFormat) Set(s string) error {
switch s {
case "unix-epoch", "0":
*t = FormatUnixEpoch
case "rfc3339", "1":
*t = FormatRFC3339
default:
return errors.New(`invalid TimeFormat: "` + s + `"`)
}
return nil
} | [
-0.2076605260372162,
-0.30464616417884827,
0.2049580067396164,
-0.6632144451141357,
-0.5533562302589417,
0.03115147165954113,
-0.6407595872879028,
-0.5101909637451172,
-0.20421001315116882,
-0.07025107741355896,
-0.46234631538391113,
0.020595893263816833,
0.13553030788898468,
0.59810495376... |
func AddVolumeForUserAuthentication(i *infinispanv1.Infinispan, spec *corev1.PodSpec) bool {
if _, index := findSecretInVolume(spec, IdentitiesVolumeName); !i.IsAuthenticationEnabled() || index >= 0 {
return false
}
v := &spec.Volumes
*v = append(*v, corev1.Volume{
Name: IdentitiesVolumeName,
VolumeSource: c... | [
-0.6511069536209106,
0.01764601841568947,
0.7107875943183899,
0.2612207531929016,
0.4918419122695923,
-0.007058663759380579,
-0.3941608965396881,
-0.08525604009628296,
0.3422211706638336,
0.03182413429021835,
-0.4821218252182007,
0.3539409041404724,
-0.3970488905906677,
-0.2801030576229095... |
func AddVolumeChmodInitContainer(containerName, volumeName, mountPath string, spec *corev1.PodSpec) {
if chmod, ok := os.LookupEnv("MAKE_DATADIR_WRITABLE"); ok && chmod == "true" {
c := &spec.InitContainers
*c = append(*c, chmodInitContainer(containerName, volumeName, mountPath))
}
} | [
0.3336358666419983,
-0.5930745601654053,
0.674194872379303,
0.13794127106666565,
0.6275196075439453,
-0.26796138286590576,
-0.11784113198518753,
-0.04354573041200638,
-0.20577435195446014,
-0.09507358074188232,
0.5230622887611389,
0.41877830028533936,
-0.052509330213069916,
0.3854721188545... |
func AddSecretVolume(secretName, volumeName, mountPath string, spec *corev1.PodSpec) {
v := &spec.Volumes
if _, index := findSecretInVolume(spec, volumeName); index < 0 {
*v = append(*v, corev1.Volume{Name: volumeName,
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: s... | [
-0.21236924827098846,
-0.4877011775970459,
0.8498290777206421,
0.18934254348278046,
0.91732257604599,
-0.4124959111213684,
-0.88455730676651,
-0.010926935821771622,
-0.0639798492193222,
0.06465128809213638,
-0.5101937055587769,
0.5008289217948914,
-0.27016547322273254,
0.11119385063648224,... |
func (sp *SerialPort) closeIdle() {
if sp.IdleTimeout <= 0 {
return
}
idle := time.Now().Sub(sp.lastActivity)
if idle >= sp.IdleTimeout {
sp.Logger.Errorf("serial: closing connection due to idle timeout: %v", idle)
sp.close()
}
} | [
0.13475348055362701,
-0.4406964182853699,
0.6786953806877136,
-0.6946350932121277,
0.20829984545707703,
0.28725239634513855,
-0.11642846465110779,
-0.8038562536239624,
0.8420113921165466,
-0.7462390661239624,
1.0643489360809326,
0.38584354519844055,
-1.2998822927474976,
0.07737021893262863... |
func (sp *SerialPort) calculateDelay(chars int) time.Duration {
var characterDelay, frameDelay int // us
if sp.BaudRate <= 0 || sp.BaudRate > 19200 {
characterDelay = 750
frameDelay = 1750
} else {
characterDelay = 15000000 / sp.BaudRate
frameDelay = 35000000 / sp.BaudRate
}
return time.Duration(character... | [
0.35296425223350525,
0.2988693416118622,
0.8190311789512634,
-1.10784113407135,
-0.9690392017364502,
-0.709301233291626,
0.2774111032485962,
-0.09378284215927124,
0.28534477949142456,
-0.9148812890052795,
-0.8256179094314575,
0.04519755393266678,
0.05095963552594185,
-0.11927758157253265,
... |
func GetUriFilteringSourcePortRange(engine *xorm.Engine, teleTopTalkerId int64) (portRangeList []UriFilteringSourcePortRange, err error) {
portRangeList = []UriFilteringSourcePortRange{}
err = engine.Where("tele_top_talker_id = ?", teleTopTalkerId).OrderBy("id ASC").Find(&portRangeList)
return
} | [
-1.0585018396377563,
0.4894104301929474,
0.2982197105884552,
-0.29305315017700195,
-0.3237929940223694,
-0.10689334571361542,
-0.10830440372228622,
0.12946946918964386,
0.11117478460073471,
0.29467126727104187,
-0.2468709796667099,
0.24661311507225037,
-0.26754215359687805,
-0.170413866639... |
func DeleteUriFilteringSourcePortRange(session *xorm.Session, teleTopTalkerId int64) (err error) {
_, err = session.Delete(&UriFilteringSourcePortRange{TeleTopTalkerId: teleTopTalkerId})
return
} | [
-0.7202459573745728,
0.01400146447122097,
0.061265356838703156,
-0.5942324995994568,
-0.25181517004966736,
0.3049984574317932,
0.17545387148857117,
0.20034150779247284,
-0.06227904185652733,
0.07554097473621368,
-0.06844642013311386,
0.05537240579724312,
-0.3024578392505646,
-0.22689463198... |
func (svc *Athena) GetQueryExecution(ctx context.Context, r GetQueryExecutionRequest) (*GetQueryExecutionResult, error) {
out, err := svc.RawGetQueryExecution(ctx, r.ToInput())
if err != nil {
err = svc.errWrap(errors.ErrorData{
Err: err,
AWSOperation: "GetQueryExecution",
})
svc.Errorf(err.Error... | [
-0.17797218263149261,
0.6704283356666565,
0.4057713449001312,
0.32940152287483215,
0.5709640383720398,
-0.299969345331192,
0.7237818241119385,
-0.9741782546043396,
0.5237863063812256,
-0.40159958600997925,
-0.5380387306213379,
0.7700327634811401,
0.030406897887587547,
-0.25420883297920227,... |
func NewStreamMonitor(manager *IndexManager, timer *Timer) *StreamMonitor {
return &StreamMonitor{
manager: manager,
timer: timer,
activeMap: make(map[common.StreamId]map[string][]bool),
startTimestamps: make(map[common.StreamId]map[string]*common.TsVbuuid),
killch: make(chan... | [
-0.5719722509384155,
-0.5838324427604675,
0.3711842894554138,
0.09531879425048828,
-0.8784221410751343,
-0.3495655953884125,
-0.5831483006477356,
-0.707878053188324,
0.09062967449426651,
0.4024133086204529,
-0.7961145043373108,
0.7526559829711914,
-0.6544939875602722,
0.7210733294487,
-0... |
func (m *StreamMonitor) monitor() {
logging.Debugf("StreamMonitor::Monitor(): start")
ticker := time.NewTicker(MONITOR_INTERVAL)
defer ticker.Stop()
for {
select {
case <-m.killch:
return
case <-ticker.C:
m.repair()
}
}
} | [
-0.06786208599805832,
-0.37603968381881714,
0.22749529778957367,
0.06358194351196289,
0.549087405204773,
-0.31112098693847656,
0.5771889090538025,
-0.3788745105266571,
-0.36662983894348145,
-0.32970428466796875,
0.3215040862560272,
-0.0019334611715748906,
-0.8398811221122742,
0.14995566010... |
func advantage(c *client.Client, b game.Board) int {
black, white := b.Score()
diff := black - white
if c.Color() == game.White {
diff = -diff
}
return diff
} | [
-0.03926858305931091,
0.7085593938827515,
0.7030622363090515,
-0.05312574282288551,
0.5217361450195312,
0.14451445639133453,
0.5478435754776001,
-0.36136990785598755,
0.5733407139778137,
1.0557639598846436,
0.136679545044899,
0.4205685555934906,
-0.7523188591003418,
0.8636458516120911,
1... |
func (act *action) competitive() {
choices := map[int][]game.Position{}
b := act.State()
nothing := advantage(act.Client, b)
for x, rows := range b {
for y, cols := range rows {
if cols != game.None {
continue
}
c := b.Copy()
pos := game.Position{x, y}
taken, err := c.Apply(game.Move{act.Color(... | [
-0.23112235963344574,
-0.7554389238357544,
0.6772478222846985,
0.0896337553858757,
0.3764737546443939,
-0.25382107496261597,
0.20155537128448486,
-0.4754318296909332,
0.12209951132535934,
0.8722900152206421,
0.22433924674987793,
0.5565224289894104,
0.7546126246452332,
-0.2537459433078766,
... |
func TestEncode(t *testing.T) {
raw, err := ioutil.ReadFile("xpacket.input")
if err == nil {
ofile, err := os.OpenFile("xpacket.output", os.O_RDWR|os.O_CREATE, 0644)
if err == nil {
xassert.IsNil(t, Encode(ofile, raw))
}
}
} | [
0.6374584436416626,
0.21934805810451508,
0.5366944670677185,
0.2596989572048187,
0.3807518780231476,
0.4559575617313385,
0.42242032289505005,
-0.7077174186706543,
0.05144374072551727,
-0.7954902052879333,
-0.3837744891643524,
-0.43258535861968994,
-0.6716362833976746,
-0.13289423286914825,... |
func TestDecode(t *testing.T) {
raw, err := ioutil.ReadFile("xpacket.input")
if err == nil {
ofile, err := os.Open("xpacket.output")
if err == nil {
out, err := Decode(ofile)
xassert.IsNil(t, err)
xassert.Equal(t, bytes.Compare(out, raw), 0)
}
}
} | [
0.7339847087860107,
-0.2673485279083252,
0.7243014574050903,
-0.24058052897453308,
0.37752145528793335,
0.606931209564209,
0.00491503207013011,
0.007611915934830904,
0.10929641872644424,
-1.49252188205719,
-0.5701495409011841,
-0.3819940388202667,
-0.7734227180480957,
-0.405510276556015,
... |
func Valid(s string) bool {
// Invalidate if the string contains invalid characters.
if invalidChars.MatchString(s) {
return false
}
s = numericOnly.ReplaceAllString(s, "")
length := len(s)
// Invalidate if the string has less than 2 characters.
if length <= 1 {
return false
}
sum := 0
for i := 0; i < ... | [
0.10337680578231812,
0.5049178004264832,
0.713485836982727,
-0.3447882831096649,
-0.7990965843200684,
0.22733421623706818,
0.5507806539535522,
0.6143859624862671,
-0.12254413962364197,
-0.41837233304977417,
-0.41173914074897766,
-0.023819908499717712,
-0.18174056708812714,
-0.6542124152183... |
func NewRR(s string) (dns.RR, error) {
if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline
return ReadRR(strings.NewReader(s + "\n"))
}
return ReadRR(strings.NewReader(s))
} | [
-0.4458247423171997,
-0.02293042093515396,
0.3911675810813904,
0.41915619373321533,
-1.3257465362548828,
-0.6070557236671448,
-1.2905848026275635,
-0.7002949714660645,
0.42401552200317383,
-0.5304656028747559,
1.2027491331100464,
0.31801530718803406,
-0.2761858105659485,
0.6284427642822266... |
func ReadRR(r io.Reader) (dns.RR, error) {
zp := dns.NewZoneParser(r, ".", "")
zp.SetDefaultTTL(172800)
zp.SetIncludeAllowed(true)
rr, _ := zp.Next()
return rr, zp.Err()
} | [
-0.7558826804161072,
-0.009220837615430355,
0.5534824132919312,
0.45547497272491455,
-1.3666332960128784,
0.11537407338619232,
-0.09041940420866013,
-0.2585798501968384,
0.5814186334609985,
-0.096636101603508,
0.043903473764657974,
0.2446357011795044,
-0.6934974789619446,
0.042443018406629... |
func (src *DataSrc) Init(conf *viper.Viper) error {
//initial DataSrc.DB from the confing passed to it
errDB := src.InitDB(conf)
if errDB != nil {
return errDB
}
//initial DataSrc.Cache from the confing passed to it
errCache := src.InitCache(conf)
if errCache != nil {
return errCache
}
//initial DataSrc.S... | [
-0.5999733805656433,
0.2971664369106293,
0.19891457259655,
-0.8631938099861145,
0.6968933939933777,
-0.42684051394462585,
-0.2553943395614624,
0.9175034165382385,
-0.49832141399383545,
-0.135050430893898,
-0.9926904439926147,
0.7390057444572449,
0.33993473649024963,
1.3230236768722534,
0... |
func (src *DataSrc) InitDB(conf *viper.Viper) error {
dbEngine := conf.GetString("db.engine")
dbHost := conf.GetString("db.host")
dbPort := conf.GetString("db.port")
dbAddr := dbHost + ":" + dbPort
dbName := conf.GetString("db.name")
dbUser := conf.GetString("db.user")
dbPassword := conf.GetString("db.password")... | [
-0.4396054744720459,
0.38601624965667725,
0.9146323204040527,
0.17025181651115417,
0.4003896117210388,
0.18099303543567657,
-0.1245441883802414,
0.6517001390457153,
-0.10025637596845627,
-0.14134414494037628,
0.16841286420822144,
0.4215274155139923,
-0.38494396209716797,
0.8644612431526184... |
func Add(mgr manager.Manager) error {
return add(mgr, newReconciler(mgr))
} | [
-0.24057555198669434,
0.12229465693235397,
0.46777674555778503,
-0.6655282378196716,
0.4479011595249176,
-0.17455056309700012,
-0.48020607233047485,
0.6828829646110535,
0.19666412472724915,
-0.7739230394363403,
0.224630668759346,
0.617239773273468,
-1.010264277458191,
1.3228338956832886,
... |
func newReconciler(mgr manager.Manager) reconcile.Reconciler {
r := &Reconciler{
Client: mgr.GetClient(),
scheme: mgr.GetScheme(),
kubeclient: kubernetes.NewForConfigOrDie(mgr.GetConfig()),
recorder: mgr.GetRecorder(controllerName),
}
r.provision = r._provision
r.bind = r._bind
r.delete = r._dele... | [
0.3146877586841583,
-1.1237000226974487,
0.48398929834365845,
-0.5678488612174988,
-0.8435230255126953,
-0.214766725897789,
-0.236299067735672,
0.548279881477356,
0.32133758068084717,
0.042892936617136,
0.41103675961494446,
0.10070978105068207,
-0.5423353910446167,
0.9831079244613647,
1.... |
func add(mgr manager.Manager, r reconcile.Reconciler) error {
// Create a new controller
c, err := controller.New(controllerName, mgr, controller.Options{Reconciler: r})
if err != nil {
return err
}
// Watch for changes to Instance
err = c.Watch(&source.Kind{Type: &bucketv1alpha1.Bucket{}}, &handler.EnqueueReq... | [
-0.07972298562526703,
-0.09978137165307999,
0.7388184070587158,
-0.9356161952018738,
0.5952353477478027,
0.28491291403770447,
-0.3616963028907776,
0.2566883862018585,
-0.010767423547804356,
-0.42962145805358887,
-0.20095086097717285,
0.3071833550930023,
-0.2870229482650757,
0.7879983186721... |
func (r *Reconciler) fail(instance *bucketv1alpha1.Bucket, reason, msg string) (reconcile.Result, error) {
instance.Status.SetCondition(corev1alpha1.NewCondition(corev1alpha1.Failed, reason, msg))
return resultRequeue, r.Update(ctx, instance)
} | [
-0.7458502650260925,
-0.22169680893421173,
0.26089194416999817,
-0.7063561081886292,
0.11136128008365631,
-0.2036442756652832,
-0.43759390711784363,
-0.10297127813100815,
-0.5461552739143372,
0.001190233277156949,
-0.4428577721118927,
-0.08623868227005005,
-0.8778558969497681,
0.4710414707... |
func (r *Reconciler) _provision(instance *bucketv1alpha1.Bucket) (reconcile.Result, error) {
instance.Status.SetUnbound()
classRef := instance.Spec.ClassRef
if classRef == nil {
return r.fail(instance, errorResourceClassNotDefined, "")
}
// retrieve classRef for this instance
class := &corev1alpha1.ResourceCl... | [
-0.7741166949272156,
-0.8589161038398743,
0.6761691570281982,
-1.1107760667800903,
-0.16305819153785706,
0.3641429841518402,
0.1662391722202301,
0.019436707720160484,
0.019634317606687546,
1.1433358192443848,
-0.143474280834198,
-0.693306028842926,
-0.13039126992225647,
0.8232808709144592,... |
func (r *Reconciler) _bind(instance *bucketv1alpha1.Bucket) (reconcile.Result, error) {
// retrieve finding function for this resource
resourceHandler, ok := handlers[instance.Status.Provisioner]
if !ok {
// finder function is not found, this condition should never happened
// provisioner and finder should be ad... | [
-0.5339048504829407,
-0.8950325846672058,
0.8495113849639893,
-0.3790183365345001,
0.1456027776002884,
-0.03295872360467911,
-0.09080174565315247,
-0.14639317989349365,
-0.14623311161994934,
0.4428114593029022,
0.2012203186750412,
0.14522677659988403,
-0.33886781334877014,
0.68324804306030... |
func namespaceNameFromObjectRef(or *v1.ObjectReference) types.NamespacedName {
return types.NamespacedName{
Namespace: or.Namespace,
Name: or.Name,
}
} | [
0.9410642385482788,
-1.0152987241744995,
0.25860705971717834,
-0.20410753786563873,
-1.1251792907714844,
-0.4649815261363983,
-0.7998955249786377,
-0.48639771342277527,
1.3225713968276978,
0.6867722272872925,
0.2261834740638733,
-0.007002327591180801,
0.4458727240562439,
0.6015508770942688... |
func (r *Reconciler) Reconcile(request reconcile.Request) (reconcile.Result, error) {
log.Printf("reconciling %s: %v", bucketv1alpha1.BucketKindApiVersion, request)
// fetch the CRD instance
bucket := &bucketv1alpha1.Bucket{}
err := r.Get(ctx, request.NamespacedName, bucket)
if err != nil {
if errors.IsNotFoun... | [
-0.24084366858005524,
-0.5376021862030029,
0.9663413763046265,
-0.055405545979738235,
0.07621824741363525,
-0.304242879152298,
-0.5851088166236877,
-0.0983339175581932,
-0.22868481278419495,
0.10506775975227356,
0.5617730617523193,
-0.05163559317588806,
-0.8557208180427551,
0.6106074452400... |
func (this *ChannelExternalState) Close(balanceProof *transfer.BalanceProofState) error {
this.lock.Lock()
defer this.lock.Unlock()
var Nonce int64 = 0
TransferAmount := utils.BigInt0
var LocksRoot common.Hash = utils.EmptyHash
//var ChannelAddress common.Address = utils.EmptyAddress
var MessageHash common.Hash ... | [
0.3374541103839874,
0.5228474140167236,
1.0057179927825928,
-0.8780378699302673,
0.0692998617887497,
0.8865480422973633,
-0.2172251045703888,
-0.10617748647928238,
0.40163058042526245,
0.015924835577607155,
0.14644283056259155,
0.05858534574508667,
-1.6583517789840698,
0.5231831073760986,
... |
func (chain *DataTypeChain) Lookup(lookup map[string]DataType) *DataTypeChain {
if chain.strval != nil {
key := *chain.strval
var val *DataType
if v, ok := lookup[key]; ok {
val = &v
} else if v, ok := lookup[strings.ToLower(key)]; ok {
val = &v
}
if val != nil {
chain.value = val
chain.afterSe... | [
-0.5210635662078857,
0.03705243393778801,
0.24112090468406677,
-0.9256317615509033,
-0.322433203458786,
-0.602814793586731,
-0.4709959328174591,
0.2454284131526947,
0.3910631537437439,
0.24971386790275574,
0.03234226256608963,
1.2026572227478027,
-0.34859755635261536,
0.17350134253501892,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.