text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (mt RankdbElementFullCollection) Validate() (err error) {
for _, e := range mt {
if e != nil {
if err2 := e.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
}
return
} | [
-0.4273683726787567,
-0.19877053797245026,
0.6407417058944702,
0.7328283190727234,
0.33833664655685425,
0.3224802315235138,
0.8117009401321411,
-0.5436242818832397,
-0.9566652178764343,
0.5370693802833557,
0.2211262285709381,
-0.866998016834259,
-0.9228650331497192,
1.7339590787887573,
0... |
func (mt RankdbElementFullUpdateCollection) Validate() (err error) {
for _, e := range mt {
if e != nil {
if err2 := e.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
}
return
} | [
-0.6914053559303284,
-0.1963968276977539,
0.6940679550170898,
0.5102771520614624,
0.17112992703914642,
0.5175408720970154,
0.4439006745815277,
-0.24228818714618683,
-0.8377428650856018,
0.32804685831069946,
0.6041651964187622,
-0.6969149708747864,
-1.0493274927139282,
1.4139329195022583,
... |
func (mt RankdbElementTinyCollection) Validate() (err error) {
for _, e := range mt {
if e != nil {
if err2 := e.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
}
return
} | [
-0.6862573027610779,
-0.30211347341537476,
0.758034348487854,
0.19203060865402222,
1.1357954740524292,
0.00630593067035079,
0.8213359117507935,
-1.0330911874771118,
-0.8214118480682373,
0.14496344327926636,
0.13845756649971008,
-0.48591408133506775,
-1.2633885145187378,
1.4548083543777466,... |
func (mt *RankdbListopresult) Validate() (err error) {
if mt.List != nil {
if err2 := mt.List.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
return
} | [
-0.3495933711528778,
0.47492167353630066,
0.4318356513977051,
0.4251169264316559,
0.06009387969970703,
-0.16851279139518738,
0.07421448826789856,
-0.1858406662940979,
-0.26878368854522705,
0.3098657429218292,
-0.030065733939409256,
-0.9955798387527466,
-1.1699442863464355,
1.20949220657348... |
func (mt *RankdbListsresult) Validate() (err error) {
if mt.Lists == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "lists"))
}
if err2 := mt.Lists.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
return
} | [
0.29336807131767273,
0.7013712525367737,
0.2158677875995636,
0.20419897139072418,
0.10314393043518066,
-0.03371649608016014,
0.2031444013118744,
-0.43394097685813904,
-0.1745922714471817,
0.07365765422582626,
-0.21975743770599365,
-0.7275726199150085,
-1.358786940574646,
1.1628367900848389... |
func (mt *RankdbMultielement) Validate() (err error) {
if mt.Found == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "found"))
}
if err2 := mt.Found.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
return
} | [
-0.05668829008936882,
0.1018439456820488,
0.572306215763092,
0.4921573996543884,
0.4270275831222534,
0.29491978883743286,
0.5496672987937927,
-0.755334734916687,
-0.2989928722381592,
-0.019299589097499847,
0.10649663209915161,
0.13282057642936707,
-0.7304179668426514,
1.765900731086731,
... |
func (mt *RankdbOperationSuccess) Validate() (err error) {
if err2 := mt.Results.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
return
} | [
-0.08816729485988617,
0.8854998350143433,
0.3683234751224518,
0.9364434480667114,
0.050082892179489136,
0.08692657202482224,
0.7949299216270447,
0.10327830165624619,
-0.938020646572113,
0.5032566785812378,
0.6806963682174683,
-0.5814332962036133,
-0.6366909146308899,
0.7704762816429138,
... |
func (mt *RankdbRanklist) Validate() (err error) {
if mt.ID == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "id"))
}
if mt.Set == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "set"))
}
if mt.Metadata == nil {
err = goa.MergeErrors(err, goa.MissingAttributeErr... | [
-0.3365509510040283,
-0.445821613073349,
0.7470960021018982,
-0.2348739206790924,
0.2627885639667511,
-0.16269132494926453,
-0.0925951674580574,
-0.5759705901145935,
-0.5217908620834351,
0.11123820394277573,
-0.14191767573356628,
-0.1592005491256714,
-0.4452780485153198,
0.5810779333114624... |
func (mt *RankdbRanklistFull) Validate() (err error) {
if mt.ID == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "id"))
}
if mt.Set == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "set"))
}
if mt.Metadata == nil {
err = goa.MergeErrors(err, goa.MissingAttribut... | [
-0.029616059735417366,
-0.6436497569084167,
0.8443018794059753,
-0.2257416546344757,
0.10961907356977463,
-0.12942378222942352,
-0.05239985138177872,
-0.4301879405975342,
-0.22551192343235016,
0.11312372982501984,
-0.339196115732193,
-0.05308254808187485,
-0.3515290915966034,
0.61036980152... |
func (mt *RankdbRanklistTiny) Validate() (err error) {
if mt.ID == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "id"))
}
if ok := goa.ValidatePattern(`^[a-zA-Z0-9-_.]+$`, mt.ID); !ok {
err = goa.MergeErrors(err, goa.InvalidPatternError(`response.id`, mt.ID, `^[a-zA-Z0-9-_.]+$`))
}
if u... | [
-0.35617154836654663,
-0.8121077418327332,
0.6824532151222229,
-0.7994904518127441,
0.39940398931503296,
-0.47837793827056885,
-0.3224930763244629,
-0.9532036781311035,
-0.27164751291275024,
0.29378050565719604,
-0.28475648164749146,
-0.2784753143787384,
-0.5790620446205139,
0.213613048195... |
func (mt RankdbRanklistCollection) Validate() (err error) {
for _, e := range mt {
if e != nil {
if err2 := e.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
}
return
} | [
-0.6674870848655701,
-0.21370382606983185,
0.5903443694114685,
0.7150658965110779,
1.0853174924850464,
0.23898445069789886,
0.4034750163555145,
-0.4312938153743744,
-1.062698245048523,
0.5211345553398132,
0.42269498109817505,
-0.395243376493454,
-0.766242265701294,
1.835081934928894,
-0.... |
func (mt RankdbRanklistTinyCollection) Validate() (err error) {
for _, e := range mt {
if e != nil {
if err2 := e.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
}
return
} | [
-0.5482564568519592,
-0.40513744950294495,
0.7143739461898804,
0.01571442186832428,
1.2138465642929077,
-0.3445034921169281,
0.6098839044570923,
-0.954095184803009,
-0.754406213760376,
0.25971952080726624,
-0.02769860252737999,
-0.5787741541862488,
-1.1202431917190552,
1.3849684000015259,
... |
func (mt *RankdbRestoreresult) Validate() (err error) {
if mt.Errors == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "errors"))
}
return
} | [
0.7360341548919678,
0.4314987361431122,
0.4752490520477295,
0.2342766523361206,
0.4549718201160431,
-0.3344636559486389,
0.5717259645462036,
-0.5387334227561951,
-0.01614498719573021,
-0.6157121062278748,
0.39912769198417664,
-0.42545342445373535,
-1.520085096359253,
-0.37187281250953674,
... |
func (mt *RankdbResultlist) Validate() (err error) {
for _, e := range mt.Success {
if e != nil {
if err2 := e.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
}
return
} | [
-0.3971015512943268,
0.490000456571579,
0.5257253646850586,
1.0783530473709106,
0.7263551950454712,
0.20888778567314148,
0.28975239396095276,
-0.19663549959659576,
-1.086151123046875,
0.370599627494812,
0.09249787777662277,
-0.5713704824447632,
-1.0154019594192505,
1.5197948217391968,
-0... |
func WriteFull(w io.Writer, d []byte) (err error) {
var n int
for n < len(d) {
var o int
o, err = w.Write(d[n:])
if err == nil {
n += o
} else {
break
}
}
return
} | [
-0.44033655524253845,
0.7143779397010803,
0.7136672735214233,
0.2282773107290268,
0.30182787775993347,
0.1950175017118454,
0.5340478420257568,
0.12153153866529465,
0.12250988930463791,
0.2934698164463043,
-0.6709213256835938,
-0.027369508519768715,
0.2627429664134979,
0.5213217735290527,
... |
func httpAddress(s ServerConfig) string {
return s.Hostname + ":" + fmt.Sprintf("%d", s.HTTPPort)
} | [
-0.4040813148021698,
-1.5227878093719482,
0.6579242944717407,
-0.6012699604034424,
0.02126443386077881,
0.7294583916664124,
0.11949166655540466,
0.6731841564178467,
0.1145753562450409,
0.17994841933250427,
-0.21280960738658905,
1.3155207633972168,
-0.19516952335834503,
0.05014001950621605,... |
func (src *gcloudTokenSource) Token() (*oauth2.Token, error) {
cfg, err := GcloudConfig()
if err != nil {
return nil, err
}
return cfg.oauthToken(), nil
} | [
-0.5128287672996521,
0.14452408254146576,
0.2444724589586258,
0.4869369566440582,
0.15249046683311462,
-0.1242222711443901,
0.8248833417892456,
0.2918916940689087,
-0.3479597866535187,
-0.8223357796669006,
-0.5145776271820068,
1.0593316555023193,
0.771901547908783,
-0.13213789463043213,
... |
func NewTwitterService() TwitterService {
return TwitterService{
URL: os.Getenv("TWITTER_API_URL"),
TokenBearer: os.Getenv("TWITTER_TOKEN_BEARER"),
MaxResults: maxResultsPerPage,
}
} | [
-0.18826113641262054,
-0.32456037402153015,
0.0036071084905415773,
-0.36565279960632324,
0.44648346304893494,
-0.17724277079105377,
-0.6762979030609131,
-0.279990553855896,
-0.33858731389045715,
-0.6081500053405762,
-0.38192862272262573,
1.2476730346679688,
-0.5573607087135315,
1.866700053... |
func (svc TwitterService) GetTweets(author, fromDate, toDate, nextPage string) (*TweetResponse, error) {
var authorParam = fmt.Sprintf("from:%s lang:pt", author)
var output TweetResponse
payload := TweetPayload{
Query: authorParam,
MaxResults: svc.MaxResults,
FromDate: fromDate,
ToDate: toDate,
... | [
-0.5528773665428162,
0.5090996623039246,
0.935177206993103,
-0.46636566519737244,
0.05023576691746712,
-0.8759375810623169,
-0.5050222277641296,
-0.8656328320503235,
0.00970255583524704,
0.08215756714344025,
0.026554973796010017,
0.7139500975608826,
-0.8126764297485352,
0.4745063781738281,... |
func newNdJSONPacketDumper(args DumperArguments) dumper {
return &jsonPacketDumper{args: args, newline: true}
} | [
-0.9185575842857361,
-0.34610095620155334,
0.30980435013771057,
-0.7396434545516968,
-0.5934110879898071,
-0.2102629840373993,
-0.8568462133407593,
-0.4774843156337738,
-0.6208265423774719,
-0.2517518699169159,
-0.22462031245231628,
-0.3252743184566498,
-0.2530654966831207,
1.0683293342590... |
func (*Notification) Descriptor() ([]byte, []int) {
return file_notification_proto_rawDescGZIP(), []int{0}
} | [
-0.5269219875335693,
0.7743497490882874,
0.42081230878829956,
0.40771520137786865,
0.5798805356025696,
-0.1821482926607132,
0.7205142378807068,
0.39213451743125916,
-0.43431568145751953,
-0.0620262585580349,
-0.9095759391784668,
-0.24422268569469452,
0.8647671937942505,
0.7187494039535522,... |
func (f *Func) Register(vendor string, functionName string, contentType StoreContentType, handler FuncHandler) error {
if _, ok := f.registeredFuncHandler[functionName]; ok {
//we have already registered this function
return errors.New("Unable to register function, already exists ")
}
//register function
meta... | [
0.11168371886014938,
1.0067311525344849,
0.6279659271240234,
-0.06663987785577774,
0.7751998901367188,
-1.1176398992538452,
0.1847512423992157,
0.17118960618972778,
-0.5729819536209106,
-0.5762718319892883,
-0.5464197397232056,
0.891562819480896,
0.6403328776359558,
0.4356321096420288,
1... |
func (f Func) Call(functionName string, payload []byte, contentType StoreContentType) (<-chan FuncResponse, error) {
responseChan := make(chan FuncResponse)
go f.parseRawFuncResponse(functionName, payload, contentType, responseChan)
return responseChan, nil
} | [
-0.4055156111717224,
0.04378873109817505,
0.5764819383621216,
-0.6513044238090515,
-0.4658149778842926,
-0.1521124392747879,
-0.5998275279998779,
-0.9814931750297546,
0.12138519436120987,
-0.5931347608566284,
0.7470462918281555,
0.7377211451530457,
-0.12422079592943192,
-0.3570366501808166... |
func NumResponded(err error) int {
for err != nil {
if e, ok := err.(consistencyResultError); ok {
return e.numResponded()
}
err = xerrors.InnerError(err)
}
return 0
} | [
0.3176869750022888,
-0.20226985216140747,
0.6571367979049683,
-0.11718516051769257,
0.3906492292881012,
-1.0660524368286133,
0.7841750383377075,
1.3574892282485962,
1.4959030151367188,
-0.9131503701210022,
-0.927518367767334,
-1.0917813777923584,
-0.17946560680866241,
0.2364359050989151,
... |
func NumSuccess(err error) int {
for err != nil {
if e, ok := err.(consistencyResultError); ok {
return e.numSuccess()
}
err = xerrors.InnerError(err)
}
return 0
} | [
-0.462636262178421,
0.5653433799743652,
0.43649113178253174,
0.29084739089012146,
-0.0385744608938694,
-0.6298224925994873,
0.24532312154769897,
1.3372347354888916,
0.5677585601806641,
-0.05973932519555092,
-0.8422677516937256,
-0.7399135231971741,
0.19759926199913025,
0.727462887763977,
... |
func sendNote(s *byte) bool {
if !sig.inuse {
return false
}
// Add signal to outgoing queue.
if !sig.q.push(s) {
return false
}
lock(&sig.lock)
if sig.sleeping {
sig.sleeping = false
notewakeup(&sig.note)
}
unlock(&sig.lock)
return true
} | [
-0.6177535653114319,
1.0027726888656616,
0.6206986308097839,
0.22768445312976837,
-0.8357056975364685,
0.36303311586380005,
0.3050268292427063,
-0.7323318719863892,
0.23879241943359375,
0.7155789136886597,
-0.5586424469947815,
-0.6030319333076477,
-1.1518809795379639,
0.3722846210002899,
... |
func signal_recv() string {
for {
note := sig.q.pop()
if note != nil {
return gostring(note)
}
lock(&sig.lock)
sig.sleeping = true
noteclear(&sig.note)
unlock(&sig.lock)
notetsleepg(&sig.note, -1)
}
} | [
0.2161208689212799,
-0.5474053025245667,
0.6010733246803284,
-0.2919364869594574,
-0.5271077752113342,
0.017816053703427315,
-0.1628744900226593,
-1.09279203414917,
-0.2700290381908417,
1.116569995880127,
-0.7111862301826477,
0.24727031588554382,
-0.036463554948568344,
-0.6970567107200623,... |
func signal_enable(s uint32) {
if !sig.inuse {
// The first call to signal_enable is for us
// to use for initialization. It does not pass
// signal information in m.
sig.inuse = true // enable reception of signals; cannot disable
noteclear(&sig.note)
return
}
} | [
0.5570266842842102,
-0.24232615530490875,
0.5439159870147705,
0.3885352909564972,
-0.15472951531410217,
0.3501729667186737,
0.5730658769607544,
0.3610064685344696,
0.2944810688495636,
0.072762630879879,
-1.0180391073226929,
-0.0035672408994287252,
-0.8721891641616821,
0.5481472015380859,
... |
func signal_disable(s uint32) {
} | [
0.41275957226753235,
-0.5430099964141846,
0.3148115277290344,
0.5472632646560669,
-1.078286051750183,
0.035759057849645615,
1.0784879922866821,
0.7211270928382874,
0.5582178831100464,
0.13352620601654053,
-1.790571928024292,
-0.23319759964942932,
-0.5191580653190613,
-0.08656882494688034,
... |
func signal_ignore(s uint32) {
} | [
0.0801103413105011,
-0.11303438991308212,
0.30826473236083984,
0.1735633760690689,
-0.4917754530906677,
0.2910245358943939,
0.929246187210083,
-0.5025069713592529,
0.8039246201515198,
0.09403833746910095,
-2.1104490756988525,
-0.8038883805274963,
-0.37298524379730225,
-0.5059829950332642,
... |
func (p *RealmPurgatory) GetPhantomNode(id insolar.ShortNodeID) *NodePhantom {
p.rw.RLock()
defer p.rw.RUnlock()
return p.phantomByID[id]
} | [
-0.3875824809074402,
-0.4803241789340973,
0.3764016032218933,
0.3073163330554962,
-0.1631583422422409,
-0.15903960168361664,
-0.17216499149799347,
-0.06423526257276535,
0.45618775486946106,
-0.22750745713710785,
0.4517785310745239,
0.8828220963478088,
-0.25905171036720276,
-0.3079765737056... |
func (p *RealmPurgatory) AddJoinerAndEnsureAscendancy(
ctx context.Context, announcement profiles.JoinerAnnouncement, announcedByID insolar.ShortNodeID) error {
jp := announcement.JoinerProfile
joinerID := jp.GetStaticNodeID()
if announcedByID == joinerID {
panic("illegal value - cant add itself")
}
err := p... | [
0.016341224312782288,
-0.33243849873542786,
0.904977560043335,
1.1179636716842651,
-0.25805166363716125,
0.7908648252487183,
0.007201900240033865,
0.03241993486881256,
0.044775787740945816,
-0.07818540930747986,
0.29373839497566223,
0.1849101334810257,
-0.7741492986679077,
0.53721910715103... |
func (in *NodeLabels) DeepCopyInto(out *NodeLabels) {
*out = *in
if in.Required != nil {
in, out := &in.Required, &out.Required
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Preferred != nil {
in, out := &in.Preferred, &out.Preferred
*out = make(map[... | [
-0.8713444471359253,
0.09873378276824951,
0.5541112422943115,
-1.0018854141235352,
-1.0404719114303589,
0.3539096713066101,
-0.4702318012714386,
0.4258274435997009,
-1.5492080450057983,
0.36451855301856995,
-0.05879576504230499,
0.48997050523757935,
-0.13944387435913086,
-0.147056251764297... |
func (in *NodeLabels) DeepCopy() *NodeLabels {
if in == nil {
return nil
}
out := new(NodeLabels)
in.DeepCopyInto(out)
return out
} | [
-1.430275321006775,
0.7810810208320618,
0.09672564268112183,
0.2141726315021515,
-0.7991243600845337,
0.4013652205467224,
0.25889208912849426,
-0.9304870367050171,
-0.3288341462612152,
0.6711149215698242,
-0.009651551023125648,
-0.12352615594863892,
-1.300230860710144,
-0.2236461043357849,... |
func (in *NodeProfile) DeepCopyInto(out *NodeProfile) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
} | [
0.6134743690490723,
0.21944020688533783,
0.4219832718372345,
-0.2211557924747467,
-0.4730016887187958,
0.3049401342868805,
0.07833640277385712,
-0.14226828515529633,
-1.628304362297058,
-0.08713418245315552,
-0.9081246256828308,
0.8080008625984192,
-0.2760961055755615,
-0.25393006205558777... |
func (in *NodeProfile) DeepCopy() *NodeProfile {
if in == nil {
return nil
}
out := new(NodeProfile)
in.DeepCopyInto(out)
return out
} | [
-0.1973099261522293,
1.0963462591171265,
0.027627995237708092,
0.494800329208374,
-0.4953228235244751,
0.03710317611694336,
0.2281970977783203,
-1.0793465375900269,
-0.6116610765457153,
0.2704685926437378,
-0.8034946322441101,
-0.48372963070869446,
-1.135142207145691,
-0.34429463744163513,... |
func (in *NodeProfile) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.052933599799871445,
0.40435874462127686,
0.503307044506073,
0.2942214012145996,
-0.5659283995628357,
0.4042169153690338,
1.0140489339828491,
-0.5013854503631592,
-1.0736488103866577,
-0.5045714378356934,
-0.6644571423530579,
-0.0820508673787117,
-0.38749441504478455,
-0.4891563951969147... |
func (in *NodeProfileList) DeepCopyInto(out *NodeProfileList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]NodeProfile, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
} | [
-0.11591572314500809,
0.6027881503105164,
0.46880871057510376,
0.4044184982776642,
-0.2834550738334656,
0.30639299750328064,
-0.09966139495372772,
0.11406082659959793,
-1.1178345680236816,
0.5965238809585571,
-1.029093623161316,
0.325374573469162,
-0.22505131363868713,
-0.14179886877536774... |
func (in *NodeProfileList) DeepCopy() *NodeProfileList {
if in == nil {
return nil
}
out := new(NodeProfileList)
in.DeepCopyInto(out)
return out
} | [
-1.0721427202224731,
0.9686275124549866,
-0.22098854184150696,
1.085447907447815,
0.00024006233434192836,
0.21036142110824585,
-0.17338138818740845,
-0.5365646481513977,
-0.33124616742134094,
0.52251136302948,
-1.1960715055465698,
-0.3925018906593323,
-0.4473080039024353,
0.014361212961375... |
func (in *NodeProfileList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.5844392776489258,
0.4468696713447571,
0.4429238438606262,
0.5281882286071777,
-0.3151358366012573,
0.5319257974624634,
0.7490940093994141,
-0.2809240221977234,
-0.7578899264335632,
0.016043435782194138,
-1.1469600200653076,
-0.1889531910419464,
-0.24124616384506226,
0.027803674340248108... |
func (in *NodeProfileSpec) DeepCopyInto(out *NodeProfileSpec) {
*out = *in
in.Labels.DeepCopyInto(&out.Labels)
} | [
0.5155035257339478,
0.3521080017089844,
0.2571258842945099,
-0.5195889472961426,
-0.5093053579330444,
0.5682756900787354,
-0.04971176013350487,
-0.1980343610048294,
-1.6516510248184204,
0.11655599623918533,
-0.16398684680461884,
0.8952695727348328,
0.20395539700984955,
-0.43758460879325867... |
func (in *NodeProfileSpec) DeepCopy() *NodeProfileSpec {
if in == nil {
return nil
}
out := new(NodeProfileSpec)
in.DeepCopyInto(out)
return out
} | [
0.0071861171163618565,
0.636938214302063,
-0.18043914437294006,
0.35719960927963257,
-0.5472858548164368,
0.5367282629013062,
0.2828736901283264,
-0.7408847212791443,
-0.7709577679634094,
0.5355902314186096,
-0.4618098735809326,
0.07726021856069565,
0.08394540846347809,
-0.2056445330381393... |
func (in *NodeProfileStatus) DeepCopyInto(out *NodeProfileStatus) {
*out = *in
if in.Nodes != nil {
in, out := &in.Nodes, &out.Nodes
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
} | [
0.4317786693572998,
0.3551507890224457,
0.23099230229854584,
-0.6522200107574463,
-0.8105751872062683,
0.4226909577846527,
-0.36079278588294983,
0.3154773414134979,
-1.395607352256775,
-0.026317698881030083,
-0.8190988898277283,
0.5976067781448364,
0.09630776196718216,
-0.5477901697158813,... |
func (in *NodeProfileStatus) DeepCopy() *NodeProfileStatus {
if in == nil {
return nil
}
out := new(NodeProfileStatus)
in.DeepCopyInto(out)
return out
} | [
-0.10584989935159683,
0.48483848571777344,
-0.6143742203712463,
-0.1196967214345932,
-0.5313843488693237,
0.13391560316085815,
-0.5551708936691284,
-0.6497361063957214,
-0.4382575452327728,
-0.2300107181072235,
-1.134730577468872,
-0.3328205943107605,
-0.26111069321632385,
-0.0099129043519... |
func ConvertRecord(binMap as.BinMap) map[string]interface{} {
bins := make(map[string]interface{})
for key, value := range binMap {
switch value := value.(type) {
case map[string]interface{}:
log.Println("converting stringMap ", key)
val := ConvertStringMap(value)
bins[key] = val
case map[interface{}]i... | [
-0.5481316447257996,
-0.16165278851985931,
0.6130502820014954,
0.2570349872112274,
0.025046929717063904,
0.3341119885444641,
0.3117060363292694,
-0.18978343904018402,
-0.5228366255760193,
0.29660964012145996,
0.08324307948350906,
0.06259340047836304,
-0.9637473225593567,
1.218780755996704,... |
func ConvertInterfaceMap(interfaceMap map[interface{}]interface{}) map[string]interface{} {
stringMap := make(map[string]interface{})
for key, value := range interfaceMap {
switch key := key.(type) {
case string:
switch value := value.(type) {
case map[string]interface{}:
val := ConvertStringMap(value)
... | [
-0.8618865013122559,
-0.6455456614494324,
0.833710253238678,
-0.21545760333538055,
-0.05196014791727066,
-0.2878023386001587,
0.413271963596344,
-0.5575436949729919,
0.09712368994951248,
0.9623286128044128,
-0.11416498571634293,
-0.19292648136615753,
-1.138221025466919,
0.649044394493103,
... |
func ConvertStringMap(sMap map[string]interface{}) map[string]interface{} {
stringMap := make(map[string]interface{})
for key, value := range sMap {
switch value := value.(type) {
case map[string]interface{}:
val := ConvertStringMap(value)
stringMap[key] = val
case map[interface{}]interface{}:
val := C... | [
-0.9101978540420532,
-0.6059473752975464,
0.702133297920227,
0.10646313428878784,
-0.010585151612758636,
-0.44076329469680786,
0.15358322858810425,
-0.5922923684120178,
0.31161215901374817,
0.7096387147903442,
-0.06162288039922714,
0.024854961782693863,
-0.7559537291526794,
0.6867682337760... |
func ConvertInterfaceArray(array []interface{}) []interface{} {
newArray := make([]interface{}, len(array))
for i, val := range array {
switch concreteVal := val.(type) {
case map[string]interface{}:
stringMap := ConvertStringMap(concreteVal)
newArray[i] = stringMap
case map[interface{}]interface{}:
in... | [
-1.1387388706207275,
-1.04252028465271,
0.7660683989524841,
0.4054728150367737,
0.5506711006164551,
0.6129521131515503,
0.5899838209152222,
-0.48643773794174194,
0.4286321699619293,
0.8549190759658813,
0.2919594645500183,
-0.21895240247249603,
-0.893500030040741,
1.579169750213623,
0.764... |
func ToI64(i interface{}) int64 {
switch i.(type) {
case int:
return int64(i.(int))
case int64:
return i.(int64)
case float64:
return int64(i.(float64))
default:
panic(fmt.Sprintf("Cannot convert %s to int64", i))
}
} | [
-1.0165026187896729,
0.28978535532951355,
0.43949079513549805,
0.9717468619346619,
0.10122465342283249,
-0.0629008486866951,
0.5356257557868958,
-0.3882431983947754,
-0.17549791932106018,
0.9441179633140564,
-0.4147658348083496,
-0.4603988826274872,
-1.0336427688598633,
-0.5303128361701965... |
func ToInt(i interface{}) int {
switch i.(type) {
case int:
return i.(int)
case int64:
return int(i.(int64))
case float64:
return int(i.(float64))
default:
panic(fmt.Sprintf("Cannot convert %s to int64", i))
}
} | [
-0.12341109663248062,
0.6662026643753052,
0.41407305002212524,
0.6470690369606018,
-0.1736096292734146,
0.5032476782798767,
0.13098318874835968,
-0.8418589234352112,
-0.14327852427959442,
0.8423590064048767,
-0.0567583292722702,
-0.04218928515911102,
-0.5963483452796936,
-0.656969010829925... |
func MaxInt64(nums ...int64) int64 {
if len(nums) == 0 {
return 0
}
max := nums[0]
for _, num := range nums {
if num > max {
max = num
}
}
return max
} | [
-0.583516001701355,
-0.06121058762073517,
0.41004514694213867,
1.8316994905471802,
0.4305019974708557,
-0.07531967759132385,
-0.5164626240730286,
0.046193137764930725,
-0.05074881762266159,
-0.0048881773836910725,
0.35518479347229004,
-0.3191220164299011,
-0.4604378938674927,
0.98009073734... |
func MaxInt(nums ...int) int {
if len(nums) == 0 {
return 0
}
max := nums[0]
for _, num := range nums {
if num > max {
max = num
}
}
return max
} | [
0.05764421448111534,
-0.19427490234375,
0.3940720856189728,
0.6436852216720581,
0.6893951892852783,
0.5785056948661804,
-0.3853384852409363,
-0.07756537199020386,
-0.15361817181110382,
-0.3682383894920349,
-0.10731445997953415,
0.21611201763153076,
-0.3333331346511841,
0.3845587968826294,
... |
func MinInt64(nums ...int64) int64 {
if len(nums) == 0 {
return 0
}
min := nums[0]
for _, num := range nums {
if num < min {
min = num
}
}
return min
} | [
-0.6096148490905762,
-0.8944156169891357,
0.383980929851532,
1.1301199197769165,
0.05119691044092178,
-0.047547757625579834,
-0.32782283425331116,
-0.664414644241333,
-0.24366819858551025,
-0.5150324702262878,
0.26955437660217285,
-0.239791601896286,
-1.1066861152648926,
0.9480537176132202... |
func MinInt(nums ...int) int {
if len(nums) == 0 {
return 0
}
min := nums[0]
for _, num := range nums {
if num < min {
min = num
}
}
return min
} | [
0.11209066957235336,
-1.0689116716384888,
0.44066810607910156,
-0.07184618711471558,
0.5892173647880554,
0.4060848653316498,
-0.30430057644844055,
-0.8412203192710876,
-0.16760466992855072,
-0.6211019158363342,
-0.01527427975088358,
0.41322317719459534,
-0.7054188847541809,
0.5189360976219... |
func (p *Postgres) GetByID(id int) (*e.User, error) {
db := p.DB
user := e.User{}
err := db.Model(&user).Where("id = ?", id).Select()
if err != nil {
return nil, err
}
return &user, nil
} | [
0.5241122245788574,
0.45329803228378296,
0.6911506056785583,
0.5851269364356995,
0.15341541171073914,
0.30258190631866455,
0.17788371443748474,
-0.4650496244430542,
0.1512356698513031,
0.15591490268707275,
-0.3057178258895874,
0.9530433416366577,
-0.3732779920101166,
-0.1199667677283287,
... |
func (p *Postgres) Store(u *e.User) (*e.User, error) {
db := p.DB
err := db.Insert(&u)
if err != nil {
return u, err
}
return u, nil
} | [
-0.264946311712265,
0.9103386998176575,
0.33641648292541504,
0.4270007014274597,
-0.5321533679962158,
1.3563261032104492,
0.7840785980224609,
0.18687258660793304,
0.6296700239181519,
-0.7575587034225464,
-0.44561710953712463,
0.32695576548576355,
-1.096606731414795,
-0.008301708847284317,
... |
func GetEnvWithDefault(variable string, defaultValue string) string {
value := os.Getenv(variable)
if len(value) == 0 {
value = defaultValue
}
return value
} | [
0.2607695460319519,
-0.26214760541915894,
0.3098474144935608,
0.36464348435401917,
0.7922757863998413,
-0.31024980545043945,
-0.5954152345657349,
0.0984625294804573,
0.00984205026179552,
0.5534386038780212,
-0.028408654034137726,
0.13305850327014923,
-0.31211063265800476,
0.725023627281189... |
func MustGetEnv(variable string) string {
value := os.Getenv(variable)
if len(value) == 0 {
panic(fmt.Errorf("%s env not found", variable))
}
return value
} | [
-0.455771803855896,
-0.1305208057165146,
0.2207186371088028,
0.6274824142456055,
0.07154123485088348,
0.8815600872039795,
-0.776805579662323,
-0.8368618488311768,
-0.09793649613857269,
0.45734572410583496,
0.16841886937618256,
0.7252621054649353,
0.007230906747281551,
0.6048227548599243,
... |
func (pg *ProcessGroup) Run(name string, action processAction) {
// With every public method calling setup, we avoid the need for a constructor function and it becomes safe
// to allow end users to be able to acess the process group itself (ProcessGroup instead of processGroup)
pg.setup()
// Build a process f... | [
-0.1518303006887436,
-0.4932519793510437,
0.8711110949516296,
-0.8354355096817017,
-0.04830428957939148,
-0.33921971917152405,
-0.5215710997581482,
-0.4136403501033783,
-0.6501598358154297,
0.3448646068572998,
-0.3987163007259369,
0.622688353061676,
-0.905900776386261,
0.139581561088562,
... |
func (pg *ProcessGroup) Wait() {
// With every public method calling setup, we avoid the need for a constructor function and it becomes safe
// to allow end users to be able to acess the process group itself (ProcessGroup instead of processGroup)
pg.setup()
// Use the wait function of our wait group
pg.grou... | [
-0.17611382901668549,
-0.07239986956119537,
0.46749722957611084,
-0.3900899887084961,
0.518569827079773,
-0.11929156631231308,
0.09446880966424942,
-0.09142662584781647,
-1.3727737665176392,
-0.4689112603664398,
0.6458591222763062,
0.833141028881073,
-0.4632287621498108,
0.3234207928180694... |
func (pg *ProcessGroup) SendMessage(to string, message interface{}) {
// With every public method calling setup, we avoid the need for a constructor function and it becomes safe
// to allow end users to be able to acess the process group itself (ProcessGroup instead of processGroup)
pg.setup()
// Locate the r... | [
-0.6712460517883301,
0.17573875188827515,
0.5905907154083252,
-0.24343553185462952,
0.5581915378570557,
-0.46688130497932434,
-0.40875062346458435,
-0.34829339385032654,
-0.5684003233909607,
0.6085389852523804,
0.9470376372337341,
1.0340516567230225,
-0.6344796419143677,
0.6675589680671692... |
func (pg *ProcessGroup) SendSubscriberMesssage(subject string, message interface{}) bool {
// Avoid needing a constructor by putting this at the top of all public methods
pg.setup()
pg.lock.RLock()
channel, exists := pg.workChannels[subject]
pg.lock.RUnlock()
if(!exists) {
return false
}
// Send... | [
-0.8631079792976379,
0.0597807839512825,
0.6741042733192444,
0.010463910177350044,
-0.22161471843719482,
-0.12126506865024567,
-0.6034088730812073,
-1.5319461822509766,
-0.9535931348800659,
0.09251236915588379,
0.07883292436599731,
0.12075553834438324,
-1.4390138387680054,
0.65531271696090... |
func (pg *ProcessGroup) End() {
// With every public method calling setup, we avoid the need for a constructor function and it becomes safe
// to allow end users to be able to acess the process group itself (ProcessGroup instead of processGroup)
pg.setup()
// Kill our group context - all process contexts are ... | [
-0.05877546966075897,
-0.6113513708114624,
0.5409736037254333,
-0.3591921031475067,
-0.06637156009674072,
-0.114414282143116,
-0.3292999565601349,
-0.27045321464538574,
-1.0646190643310547,
0.7879037261009216,
0.5427746772766113,
0.5773466229438782,
-0.8524230122566223,
0.5215888023376465,... |
func (p *Process) Alive() bool {
select {
case <- p.context.Done():
return false
default:
return true
}
} | [
0.09615299105644226,
-1.0323954820632935,
0.7702907919883728,
-0.0514545738697052,
0.45758774876594543,
0.7082401514053345,
-0.8371246457099915,
-0.36752834916114807,
-0.5130219459533691,
0.6899229884147644,
-0.6132856011390686,
-0.9679060578346252,
-1.0952816009521484,
-1.1271286010742188... |
func (p *Process) CheckForMessage() interface{} {
select {
case msg := <- p.channel:
return msg
case <- p.context.Done():
return nil
default:
return nil
}
} | [
0.046537697315216064,
-0.3075577914714813,
0.6710320115089417,
0.038810111582279205,
0.5209336280822754,
-0.46782925724983215,
-0.8629037141799927,
-1.1436666250228882,
-0.29552942514419556,
0.18717840313911438,
0.7681721448898315,
0.12837651371955872,
-1.5361136198043823,
0.89455443620681... |
func (p *Process) WaitForMessage() interface{} {
// OK secretly, don't actually wait for ever - the context is king so if we are done(), then stop
select {
case <- p.context.Done():
return nil
case msg := <- p.channel:
return msg
}
} | [
0.4043872058391571,
-0.16674037277698517,
0.4500688314437866,
-0.9323395490646362,
0.4653618633747101,
-0.5574508309364319,
-0.7643949389457703,
-1.1176904439926147,
0.07782083749771118,
-0.7194320559501648,
0.8170151710510254,
-0.25324398279190063,
-0.7208530902862549,
0.768559992313385,
... |
func (p *Process) WaitForSubscribedMessage() interface{} {
var cases []reflect.SelectCase
for _, ch := range p.subscribed_channels {
cases = append(cases, reflect.SelectCase{
Dir: reflect.SelectRecv,
Chan: reflect.ValueOf(ch),
Send: reflect.Value{},
})
}
// Add in our instruction to die so ... | [
0.936877429485321,
-0.256700336933136,
0.4708297550678253,
-0.8033410310745239,
-0.10417742282152176,
-0.8054749965667725,
-0.10002986341714859,
-1.2568161487579346,
-0.41952192783355713,
-0.9288796186447144,
0.4047040045261383,
0.5586066246032715,
-0.3710471987724304,
0.6424806714057922,
... |
func (p *Process) SendMessage(to string, message interface{}) {
// If you're sending a message to yourself that's probably a coding mistake or whatever but it makes no sense. Kindly just edit that out for the end user
if(p.Name == to) {
return
}
// Send this back to control for the post person to intercep... | [
-0.47097811102867126,
0.25201934576034546,
0.5837242603302002,
0.31423938274383545,
0.5097436308860779,
0.05202096700668335,
0.25070488452911377,
-0.02130865305662155,
-0.7795068621635437,
-0.2588931918144226,
0.39275607466697693,
0.32725024223327637,
-0.7235864996910095,
0.484579265117645... |
func (p *Process) Broadcast(message interface{}) {
// Send a message to control, asking for a broadcast
msg := groupMessage{ Sender: p.Name, Broadcast: true, Message: message }
// Make all send operations non blocking, so we're ready for whatever the end coder comes up with
select {
case p.group_channel <... | [
-0.10527937114238739,
0.23038002848625183,
0.5908998847007751,
0.43163561820983887,
0.5720102787017822,
-0.1617187112569809,
1.0066622495651245,
-0.5589337944984436,
-0.09857435524463654,
-0.3095707893371582,
0.4547935724258423,
0.7523695826530457,
-1.4384253025054932,
0.6988773941993713,
... |
func (p *Process) Subscribe(subject string) {
// Pass this back to the parent
p.subscribed_channels = append(p.subscribed_channels, p.parent.subscribe(subject))
} | [
1.3993700742721558,
-0.2750169038772583,
0.4283481240272522,
-0.5891895294189453,
-0.08169347792863846,
0.507204532623291,
-1.1315336227416992,
-0.645498514175415,
-0.221004918217659,
-1.1841003894805908,
-0.5304040312767029,
1.0590014457702637,
-0.10847758501768112,
0.6871030330657959,
... |
func (p *Process) Log(event string) {
msg := groupMessage{ Sender: p.Name, Log: true, Message: event }
// Keep everything here non blocking, so things are very thread safe
select {
case p.group_channel <- msg:
default:
}
} | [
0.32009389996528625,
0.5406581163406372,
0.39681103825569153,
-0.25854358077049255,
-0.002384960651397705,
-0.20532912015914917,
0.35979366302490234,
-0.28027454018592834,
-0.3374789357185364,
-0.2586824893951416,
-0.5166646838188171,
0.3186202645301819,
-0.6052164435386658,
0.316312730312... |
func (p *Process) SendSubsriberMessage(subject string, message interface{}) {
// Send a message to control, asking for a subscriber message to be distributed
msg := groupMessage{ Sender: p.Name, Subscriber: true, Subject: subject, Message: message }
// Make all send operations non blocking, so we're ready for w... | [
0.494191437959671,
0.33101892471313477,
0.47620368003845215,
0.002747426275163889,
0.12008315324783325,
0.06078923121094704,
-0.39135614037513733,
-0.8720744252204895,
-0.5954797863960266,
-0.03393463417887688,
-0.15059982240200043,
0.9625144600868225,
-1.4590342044830322,
0.85359674692153... |
func (r *HasOneRelation) Get(m mgm.Model) error {
return mgm.Coll(r.related).First(r.filterByRelation(nil), m)
} | [
0.4737043082714081,
0.6369737386703491,
0.3250519335269928,
-0.49430111050605774,
0.7938117384910583,
0.015385909005999565,
-0.007231652736663818,
-0.5681196451187134,
-0.4005346894264221,
-0.5629094243049622,
0.20326688885688782,
-0.34594547748565674,
-1.3389286994934082,
-0.1104766428470... |
func (r *HasOneRelation) Sync(model mgm.Model) error {
if gutil.IsNil(model) {
_, err := r.delete(nil)
return err
}
if err := callToBeforeSyncHooks(model); err != nil {
return err
}
_, err := r.delete(model.GetID())
upsert := true
_, err = mgm.Coll(r.related).UpdateOne(mgm.Ctx(), bson.M{f.ID: model.GetID(... | [
0.13192051649093628,
0.43911993503570557,
0.9937852621078491,
0.12280221283435822,
0.2653747498989105,
-0.139400452375412,
0.760737419128418,
-0.6412526965141296,
0.044677235186100006,
0.6824567317962646,
-0.5392747521400452,
-0.3635072112083435,
-0.5200228095054626,
0.5292848348617554,
... |
func HasOne(model mgm.Model, related mgm.Model) *HasOneRelation {
return HasOneByOptions(model, related, foreignKeyName(model))
} | [
0.9573759436607361,
0.7865768074989319,
0.4182492196559906,
0.40087538957595825,
0.4413580596446991,
0.25827404856681824,
0.100265733897686,
-0.13947060704231262,
0.11566076427698135,
-0.4956851005554199,
-0.08891057968139648,
-1.1762211322784424,
-0.9925379157066345,
-0.3076983392238617,
... |
func HasOneByOptions(model mgm.Model, related mgm.Model, foreignKey string) *HasOneRelation {
return &HasOneRelation{
m: model,
related: related,
foreignKey: foreignKey,
}
} | [
1.0045831203460693,
0.5600016713142395,
0.4143172800540924,
0.20019976794719696,
0.6869641542434692,
-0.2791611850261688,
0.6464314460754395,
-0.6023512482643127,
0.2893310487270355,
-0.18151924014091492,
-0.40517547726631165,
-1.2369375228881836,
-1.3058850765228271,
-0.3211590349674225,
... |
func (hana HanaClusterDiscover) ShouldDiscover(client consul.Client) bool {
return len(hana.SAPid) > 0
} | [
1.2939164638519287,
0.920556366443634,
0.4799885153770447,
0.7326297760009766,
-0.26130130887031555,
0.5214560031890869,
0.05920712277293205,
0.5290558934211731,
0.5330196022987366,
-0.5955107808113098,
-0.45892196893692017,
-0.3524738550186157,
-0.21316742897033691,
0.5952059030532837,
... |
func (hana HanaClusterDiscover) storeDiscovery(cStorePath, cStoreValue string) error {
return hana.cluster.storeDiscovery(cStorePath, cStoreValue)
} | [
0.3801776170730591,
0.6926344037055969,
0.13717709481716156,
1.203234076499939,
-0.35565924644470215,
0.12676690518856049,
1.0120902061462402,
0.45517462491989136,
0.8309414982795715,
-0.6507723927497864,
-0.830000102519989,
-0.7195864319801331,
0.01609453745186329,
-0.24576997756958008,
... |
func (hana HanaClusterDiscover) Discover() error {
err := hana.cluster.Discover()
if err != nil {
return err
}
for _, master := range hana.cluster.cibConfig.Configuration.Resources.Masters {
for _, attr := range master.Primitive.InstanceAttributes {
if master.Primitive.Class == "ocf" &&
master.Primitive.... | [
0.011555716395378113,
0.3707064986228943,
0.4988725483417511,
-0.04388922452926636,
-0.23191094398498535,
-0.5835163593292236,
0.09892953187227249,
0.6268919110298157,
0.10449150949716568,
-0.12992945313453674,
-0.6682265400886536,
-0.5141622424125671,
-0.29802536964416504,
1.2787463665008... |
func NewHanaClusterDiscover(client consul.Client) HanaClusterDiscover {
r := HanaClusterDiscover{}
r.cluster = NewClusterDiscover(client)
return r
} | [
1.3017321825027466,
-0.2991510033607483,
0.2965267300605774,
0.29217329621315,
-0.7842394113540649,
0.030749831348657608,
0.08051304519176483,
1.1523669958114624,
0.2652297914028168,
-0.5191736221313477,
-0.8004360795021057,
0.3408309817314148,
-0.2727399468421936,
-0.3595029413700104,
1... |
func GetHttpbinConfig(name, version string) DockerComposeConfig {
services := make(map[string]Service)
if version == "" {
version = HttpbinDockerImageVersion
}
services[name] = Service{
Image: fmt.Sprintf("%s:%s", HttpbinDockerImage, version),
Restart: HttpbinRestartPolicy,
Ports: []string{HttpbinPort... | [
-0.18147192895412445,
-0.24655024707317352,
0.8503108024597168,
-0.10299497097730637,
-0.5267595648765564,
0.7256810069084167,
-0.49333709478378296,
-0.041543103754520416,
-0.5169509053230286,
0.6587957739830017,
-0.987204372882843,
1.22947096824646,
-0.5605051517486572,
0.7989474534988403... |
func NewContext() *Context {
cx := &Context{}
cx.id = uid()
cx.ready = make(chan error, 1)
cx.in = make(chan *cxfn)
cx.objs = make(map[int]*Object)
cx.funcs = make(map[int]*function)
var err error
jsapi.do(func() {
if C.JSAPI_NewContext(C.int(cx.id)) != C.JSAPI_OK {
err = fmt.Errorf("failed to spawn new co... | [
-0.2551816999912262,
-0.7743779420852661,
0.5397859215736389,
0.24828101694583893,
-0.7384457588195801,
-0.441194623708725,
-0.08356785774230957,
-0.8841056227684021,
1.5452897548675537,
-0.3061339557170868,
-0.25624188780784607,
0.20388691127300262,
0.1321215182542801,
0.03449220955371857... |
func (cx *Context) setError(filename string, line uint, message string) {
cx.err = &ErrorReport{
Filename: filename,
Line: line,
Message: message,
}
} | [
0.7288119196891785,
-0.1556057333946228,
0.23863950371742249,
0.2434576153755188,
0.4933217465877533,
0.3328584134578705,
-0.29445675015449524,
0.7822622060775757,
-0.6478512287139893,
-0.8079738020896912,
-0.2372216284275055,
0.2679807245731354,
-0.331310510635376,
0.1476759910583496,
0... |
func (cx *Context) getError(filename string) (err error) {
err = cx.err
cx.err = nil
return err
} | [
0.17347854375839233,
-0.08723162859678268,
0.5085957646369934,
0.21667475998401642,
0.2631858289241791,
0.13383443653583527,
0.5366912484169006,
0.6533944606781006,
0.19255581498146057,
-0.04190324619412422,
-0.03635416179895401,
0.6383600831031799,
-0.40595683455467224,
0.0378279462456703... |
func (cx *Context) Destroy() {
if cx.Valid {
close(cx.in)
cx.Valid = false
}
} | [
0.050712279975414276,
-0.202144056558609,
0.13114993274211884,
-0.0008636388229206204,
-0.37568730115890503,
1.14864981174469,
-0.14333057403564453,
0.4810855984687805,
0.33284929394721985,
-0.19683754444122314,
0.6427673697471619,
-0.5276740193367004,
-1.5806593894958496,
-0.1440164148807... |
func (cx *Context) Exec(source string) (err error) {
return cx.exec(source, "exec")
} | [
0.28235095739364624,
0.9069541096687317,
0.18041791021823883,
0.6847037672996521,
-0.888190507888794,
0.0767441987991333,
-0.3752998411655426,
0.528667688369751,
0.029252516105771065,
0.1981072574853897,
-0.5480204820632935,
-0.03533744066953659,
0.7450689673423767,
-0.48666152358055115,
... |
func (cx *Context) Eval(source string, result interface{}) (err error) {
cx.do(func(ptr *C.JSAPIContext) {
// alloc C-string
csource := C.CString(source)
defer C.free(unsafe.Pointer(csource))
var jsonData *C.char
var jsonLen C.int
filename := "eval"
cfilename := C.CString(filename)
defer C.free(unsafe.... | [
-0.5053032636642456,
-0.020101694390177727,
0.7064928412437439,
-1.0517388582229614,
-0.7438663244247437,
0.031817253679037094,
-0.10528726130723953,
0.03973564878106117,
0.3761293292045593,
0.9042659401893616,
-0.7417821884155273,
0.41494426131248474,
0.2867119610309601,
-0.68179857730865... |
func (cx *Context) ExecFrom(r io.Reader) (err error) {
return cx.execFrom(r, "ExecFrom")
} | [
0.08981852978467941,
-0.5050777196884155,
0.5003771185874939,
0.3120136260986328,
-0.42621564865112305,
0.107810378074646,
0.471863329410553,
-0.04573754221200943,
0.7112557888031006,
-0.32318493723869324,
0.34898823499679565,
-0.3702022433280945,
0.9311956167221069,
0.0693325474858284,
... |
func (cx *Context) ExecFile(filename string) (err error) {
f, err := os.Open(filename)
if err != nil {
return err
}
defer f.Close()
return cx.execFrom(f, filename)
} | [
0.15777930617332458,
0.05397401750087738,
0.6801131963729858,
0.30996784567832947,
0.17245176434516907,
0.9738249778747559,
0.5885388255119324,
0.5953851938247681,
-0.8455986380577087,
-0.0004841055197175592,
0.7568156719207764,
-0.6102790832519531,
-0.06385645270347595,
-0.124423235654830... |
func (cx *Context) DefineObject(name string, proxy interface{}) (Definer, error) {
return cx.defineObject(name, proxy, 0)
} | [
0.09803862869739532,
-0.5836858153343201,
0.4952397346496582,
-0.2843033969402313,
-0.271803617477417,
-0.08563265204429626,
-0.3293386399745941,
-0.30533719062805176,
-0.14165379106998444,
-0.20639033615589142,
-0.8259784579277039,
-0.8722344636917114,
0.3510606288909912,
-0.0605656430125... |
func (cx *Context) do(callback func(*C.JSAPIContext)) {
if !cx.Valid {
panic("attempt to use a destroyed context")
}
if cx.ptr != nil && C.JSAPI_ThreadCanAccessContext(cx.ptr) == C.JSAPI_OK {
callback(cx.ptr)
return
}
fn := &cxfn{
call: callback,
done: make(chan bool, 1),
}
cx.in <- fn
<-fn.done
} | [
-0.0725451186299324,
0.18788300454616547,
0.6413346529006958,
-0.15064598619937897,
-0.09359700232744217,
-0.09454640746116638,
0.17802715301513672,
-0.9771482944488525,
0.8718203902244568,
0.3931213617324829,
-0.14248590171337128,
-0.0027315926272422075,
-0.13287296891212463,
0.1437104940... |
func cast(v reflect.Value, t reflect.Type) (reflect.Value, error) {
if v.Type().Kind() == reflect.Ptr && t.Kind() != reflect.Ptr {
v = v.Elem()
}
if !v.Type().AssignableTo(t) {
if !v.Type().ConvertibleTo(t) {
// A common failure here is that we want to
// cast a map[string]interface{} -> struct.
// This... | [
-0.5701097249984741,
-0.8977988362312317,
0.7939329147338867,
-0.9214394092559814,
-0.3645215630531311,
-0.3076043725013733,
-0.19869540631771088,
-0.7916305065155029,
0.39187923073768616,
0.7775155305862427,
0.4631962478160858,
1.5654371976852417,
-0.013501282781362534,
0.2225922793149948... |
func (p *prop) get() (string, error) {
b, err := json.Marshal(p.v.Interface())
return string(b), err
} | [
-0.842615008354187,
-0.4330865740776062,
0.6189243793487549,
-0.42173126339912415,
0.21604807674884796,
-0.06838540732860565,
-0.7967959642410278,
-0.5423591732978821,
-0.4476061761379242,
0.7409064769744873,
0.5057058930397034,
0.9275296330451965,
-0.6936629414558411,
-1.4183752536773682,... |
func (p *prop) set(injson string) (string, error) {
var x interface{}
err := json.Unmarshal([]byte(injson), &x)
if err != nil {
return "", err
}
xv := reflect.ValueOf(x)
xv, err = cast(xv, p.t)
if !p.v.CanSet() {
return "", fmt.Errorf("property %s is not settable", p.name)
}
p.v.Set(xv)
return p.get()
} | [
-0.9745569825172424,
-0.407609224319458,
0.6637227535247803,
-0.5564391613006592,
-0.9397352933883667,
0.04744366556406021,
-0.4278424382209778,
-0.4038252830505371,
-0.6055099368095398,
0.9908339381217957,
0.04201393947005272,
0.36437103152275085,
-0.3894070088863373,
-0.9586657285690308,... |
func NewRuleMatch() *RuleMatch {
this := RuleMatch{}
return &this
} | [
0.3952088952064514,
-0.4917698800563812,
0.13172632455825806,
1.1921566724777222,
0.5165613293647766,
0.5323439240455627,
-0.33832624554634094,
0.5362125635147095,
0.15559370815753937,
-0.6900080442428589,
-0.3077544569969177,
0.29027095437049866,
-1.1346555948257446,
0.027840420603752136,... |
func NewRuleMatchWithDefaults() *RuleMatch {
this := RuleMatch{}
return &this
} | [
0.4387783706188202,
-0.06803088635206223,
0.03358720988035202,
1.1842701435089111,
1.2008246183395386,
0.05838635563850403,
-0.6194734573364258,
0.300510436296463,
0.02712501958012581,
-0.455297589302063,
-0.6984768509864807,
-0.901024341583252,
-1.021186113357544,
0.3974928855895996,
-0... |
func (o *RuleMatch) GetMethods() []string {
if o == nil || o.Methods == nil {
var ret []string
return ret
}
return o.Methods
} | [
0.7072618007659912,
0.40141814947128296,
0.1206088438630104,
0.720754861831665,
0.9621923565864563,
-0.38902711868286133,
0.32719889283180237,
-0.7390167117118835,
1.3108261823654175,
-0.3925245702266693,
0.9018940329551697,
-0.6720026731491089,
-0.6129950881004333,
0.6235790848731995,
0... |
func (o *RuleMatch) GetMethodsOk() ([]string, bool) {
if o == nil || o.Methods == nil {
return nil, false
}
return o.Methods, true
} | [
0.3259214460849762,
0.5229853391647339,
0.3187466263771057,
0.7868648767471313,
-0.1647467166185379,
-0.3844442069530487,
0.6197185516357422,
-0.5518394708633423,
0.5627254843711853,
0.6268547773361206,
-0.3341798186302185,
-1.5253487825393677,
0.09869697690010071,
0.90228271484375,
-0.2... |
func (o *RuleMatch) HasMethods() bool {
if o != nil && o.Methods != nil {
return true
}
return false
} | [
0.7656489610671997,
0.8653926253318787,
0.17892281711101532,
0.12953710556030273,
0.7302579283714294,
-0.44045495986938477,
0.16021190583705902,
0.23725023865699768,
0.6206868290901184,
-0.7412983775138855,
0.281111478805542,
-1.4712070226669312,
-0.5001869201660156,
0.5672376751899719,
... |
func (o *RuleMatch) SetMethods(v []string) {
o.Methods = v
} | [
-0.10755568742752075,
0.41052308678627014,
-0.008076807484030724,
0.33244559168815613,
0.28879669308662415,
0.04374407231807709,
0.24695418775081635,
-0.3694370985031128,
0.3421452045440674,
0.22438935935497284,
0.12072496116161346,
-0.3727509677410126,
-0.945922315120697,
0.41899123787879... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.