text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (p *googleCloudProvider) StreamInvoke(_ *rpc.InvokeRequest, _ rpc.ResourceProvider_StreamInvokeServer) error {
return status.Error(codes.Unimplemented, "StreamInvoke is not yet implemented")
} | [
-0.458717405796051,
0.5630430579185486,
0.882400393486023,
0.3697417676448822,
-0.011428178288042545,
0.7761258482933044,
0.21975791454315186,
-0.4838712215423584,
-0.1747627705335617,
0.04281463101506233,
-0.3233398497104645,
2.1253886222839355,
-1.0416816473007202,
0.6569799780845642,
... |
func (p *googleCloudProvider) Check(_ context.Context, req *rpc.CheckRequest) (*rpc.CheckResponse, error) {
urn := resource.URN(req.GetUrn())
label := fmt.Sprintf("%s.Check(%s)", p.name, urn)
logging.V(9).Infof("%s executing", label)
// Deserialize RPC inputs.
olds, err := plugin.UnmarshalProperties(req.GetOlds()... | [
-0.5802111029624939,
0.5591409206390381,
0.5758056044578552,
0.04349129647016525,
0.9967330098152161,
-0.0980663001537323,
-0.30134254693984985,
-0.46835166215896606,
-0.5383628606796265,
0.5659182667732239,
0.21935288608074188,
-0.44521236419677734,
-0.3797946572303772,
1.3380244970321655... |
func (p *googleCloudProvider) getDefaultValue(key resource.PropertyKey, configName string, olds resource.PropertyMap) (*resource.PropertyValue, bool) {
// 1. Check if old inputs define the value.
if v, ok := olds[key]; ok {
return &v, true
}
// 2. Check if the config has a corresponding value.
if cv, ok := p.co... | [
0.1824006885290146,
0.45545753836631775,
0.658365786075592,
0.5267035365104675,
0.09773636609315872,
-0.33114197850227356,
-0.5744466781616211,
0.0787021741271019,
-0.3955024182796478,
0.23119810223579407,
0.24309077858924866,
-0.021919045597314835,
-0.3214050531387329,
0.6540676355361938,... |
func (p *googleCloudProvider) CheckConfig(_ context.Context, req *rpc.CheckRequest) (*rpc.CheckResponse, error) {
return &rpc.CheckResponse{Inputs: req.GetNews()}, nil
} | [
-0.8812515139579773,
0.6366848349571228,
0.3050101399421692,
0.37063151597976685,
0.4858265519142151,
0.39629217982292175,
-0.656951904296875,
-0.29782137274742126,
-0.6355268955230713,
0.969113826751709,
-0.2679382264614105,
0.11898250877857208,
-0.5824969410896301,
1.6350712776184082,
... |
func (p *googleCloudProvider) DiffConfig(context.Context, *rpc.DiffRequest) (*rpc.DiffResponse, error) {
return &rpc.DiffResponse{
Changes: 0,
Replaces: []string{},
Stables: []string{},
DeleteBeforeReplace: false,
}, nil
} | [
-1.1396788358688354,
0.3341690003871918,
0.3089889883995056,
-0.5326269865036011,
0.3387824296951294,
0.610055685043335,
0.10144016146659851,
-0.25840428471565247,
0.27391281723976135,
0.8692488074302673,
-0.8783601522445679,
0.27454501390457153,
-0.6989576816558838,
1.6936750411987305,
... |
func (p *googleCloudProvider) Diff(_ context.Context, req *rpc.DiffRequest) (*rpc.DiffResponse, error) {
urn := resource.URN(req.GetUrn())
label := fmt.Sprintf("%s.Diff(%s)", p.name, urn)
logging.V(9).Infof("%s executing", label)
resourceKey := string(urn.Type())
res, ok := p.resourceMap.Resources[resourceKey]
i... | [
-1.011814832687378,
0.044662315398454666,
0.8730713129043579,
0.1035723090171814,
0.43459901213645935,
-0.04389050975441933,
0.2250545173883438,
-0.39852374792099,
0.5799329280853271,
0.1637629270553589,
0.214264914393425,
-0.331603080034256,
-0.061875972896814346,
0.6394978761672974,
0.... |
func (p *googleCloudProvider) Create(ctx context.Context, req *rpc.CreateRequest) (*rpc.CreateResponse, error) {
urn := resource.URN(req.GetUrn())
label := fmt.Sprintf("%s.Create(%s)", p.name, urn)
logging.V(9).Infof("%s executing", label)
// Deserialize RPC inputs
inputs, err := plugin.UnmarshalProperties(req.Ge... | [
-1.054680347442627,
0.06368377804756165,
0.9004308581352234,
0.03842318803071976,
0.6158933043479919,
0.016150524839758873,
-0.28432267904281616,
-0.970649778842926,
-0.24023789167404175,
0.8756628036499023,
-0.0493086613714695,
0.00983885396271944,
-0.6751124262809753,
0.29020386934280396... |
func (p *googleCloudProvider) waitForResourceOpCompletion(baseUrl string, resp map[string]interface{}) (map[string]interface{}, error) {
retryPolicy := backoff.Backoff{
Min: 1 * time.Second,
Max: 15 * time.Second,
Factor: 1.5,
Jitter: true,
}
for {
logging.V(9).Infof("waiting for completion: %+v", re... | [
0.15609531104564667,
-0.6347373127937317,
0.6063777804374695,
-0.45291373133659363,
-0.008227042853832245,
-0.9318633079528809,
0.24973194301128387,
-0.19336889684200287,
0.22190521657466888,
0.32170572876930237,
0.47006478905677795,
-1.0049786567687988,
0.39719611406326294,
-0.62767755985... |
func (p *googleCloudProvider) Read(_ context.Context, req *rpc.ReadRequest) (*rpc.ReadResponse, error) {
urn := resource.URN(req.GetUrn())
label := fmt.Sprintf("%s.Read(%s)", p.name, urn)
resourceKey := string(urn.Type())
res, ok := p.resourceMap.Resources[resourceKey]
if !ok {
return nil, errors.Errorf("resourc... | [
-0.32666054368019104,
-0.7079979777336121,
0.7364876866340637,
-0.144719660282135,
0.19553175568580627,
-0.041053656488657,
0.01890595816075802,
-0.29015684127807617,
0.347002774477005,
0.7768142223358154,
0.5548925399780273,
0.5116205811500549,
-0.32117611169815063,
-0.44541358947753906,
... |
func (p *googleCloudProvider) Update(_ context.Context, req *rpc.UpdateRequest) (*rpc.UpdateResponse, error) {
urn := resource.URN(req.GetUrn())
label := fmt.Sprintf("%s.Update(%s)", p.name, urn)
logging.V(9).Infof("%s executing", label)
// Deserialize RPC inputs
inputs, err := plugin.UnmarshalProperties(req.GetN... | [
-0.7696893811225891,
-0.45035895705223083,
0.6736628413200378,
-0.2794362008571625,
0.15343864262104034,
-0.11028007417917252,
-0.6095041632652283,
-0.6945242285728455,
0.4506770670413971,
0.8792909383773804,
0.23882614076137543,
0.321044385433197,
-0.7131014466285706,
-0.19391736388206482... |
func (p *googleCloudProvider) Delete(_ context.Context, req *rpc.DeleteRequest) (*empty.Empty, error) {
urn := resource.URN(req.GetUrn())
resourceKey := string(urn.Type())
res, ok := p.resourceMap.Resources[resourceKey]
if !ok {
return nil, errors.Errorf("resource %q not found", resourceKey)
}
uri := res.Resou... | [
-0.31935936212539673,
0.6735292077064514,
0.6885766983032227,
-0.08595234900712967,
0.7104069590568542,
0.23694762587547302,
-0.1895729899406433,
-0.48895999789237976,
0.27978694438934326,
1.0933367013931274,
0.4278888404369354,
-0.06309174001216888,
-0.6108008623123169,
0.0196509249508380... |
func (p *googleCloudProvider) Construct(_ context.Context, _ *rpc.ConstructRequest) (*rpc.ConstructResponse, error) {
return nil, status.Error(codes.Unimplemented, "Construct is not yet implemented")
} | [
-1.0446372032165527,
-0.1276821345090866,
0.5892243385314941,
0.07177166640758514,
-0.016502778977155685,
0.7188926935195923,
0.19322673976421356,
-0.5418611168861389,
0.033143550157547,
0.3539048731327057,
-0.32052475214004517,
0.6178231239318848,
-0.4220513701438904,
0.6670740246772766,
... |
func (p *googleCloudProvider) Call(_ context.Context, _ *rpc.CallRequest) (*rpc.CallResponse, error) {
return nil, status.Error(codes.Unimplemented, "Call is not yet implemented")
} | [
-1.0664876699447632,
0.5238719582557678,
0.6766319870948792,
0.37090152502059937,
-0.25575271248817444,
1.449973702430725,
-0.7181152701377869,
-1.2836138010025024,
0.4208458662033081,
1.1779823303222656,
0.13073164224624634,
0.5722643733024597,
-0.9131681323051453,
0.5228266716003418,
0... |
func (p *googleCloudProvider) GetPluginInfo(context.Context, *empty.Empty) (*rpc.PluginInfo, error) {
return &rpc.PluginInfo{
Version: p.version,
}, nil
} | [
-0.20351170003414154,
-0.5300682783126831,
0.21835622191429138,
0.26612982153892517,
0.1011599525809288,
0.13942646980285645,
-0.28119179606437683,
-0.614315927028656,
-0.14051079750061035,
0.30203866958618164,
-1.7286272048950195,
1.0989819765090942,
-0.7775254845619202,
-0.32820674777030... |
func (p *googleCloudProvider) Cancel(context.Context, *empty.Empty) (*empty.Empty, error) {
return &empty.Empty{}, nil
} | [
0.7037714719772339,
0.11724700778722763,
0.35258644819259644,
0.6473621129989624,
-0.1702725887298584,
0.4291279911994934,
-0.17457570135593414,
-0.4082905650138855,
0.42054620385169983,
0.33911943435668945,
-0.5151463747024536,
0.9347016215324402,
-0.41443386673927307,
0.09185566008090973... |
func checkpointObject(inputs resource.PropertyMap, outputs map[string]interface{}) resource.PropertyMap {
object := resource.NewPropertyMapFromMap(outputs)
object["__inputs"] = resource.MakeSecret(resource.NewObjectProperty(inputs))
return object
} | [
-0.07235465943813324,
-1.1647363901138306,
0.5818347930908203,
0.3277309834957123,
-0.18935512006282806,
0.34917372465133667,
0.3539031445980072,
-0.6880932450294495,
-0.4163154661655426,
-0.3288247883319855,
-0.15478767454624176,
-0.9332203269004822,
0.23896782100200653,
-1.33114469051361... |
func parseCheckpointObject(obj resource.PropertyMap) resource.PropertyMap {
if inputs, ok := obj["__inputs"]; ok {
return inputs.SecretValue().Element.ObjectValue()
}
return nil
} | [
0.31519216299057007,
-1.235418438911438,
0.43317076563835144,
0.8687940835952759,
-0.04612424969673157,
0.6208614110946655,
-0.10550156235694885,
-0.6363109946250916,
0.36470451951026917,
0.054660964757204056,
-0.1473352611064911,
-0.39085447788238525,
-0.4580829441547394,
-0.5691335201263... |
func randomRange(min, max int) int {
return rand.Intn(max-min) + min
} | [
-0.8890025615692139,
-0.13233625888824463,
0.23140038549900055,
-0.0036109411157667637,
0.05871547758579254,
0.35197198390960693,
-1.4184807538986206,
0.18613089621067047,
-0.6356307864189148,
-0.8294081091880798,
-0.3997665047645569,
0.2225198894739151,
-0.5283163189888,
0.029683018103241... |
func MustParseInstallerType(typeStr string) InstallerType {
switch t := strings.ToLower(typeStr); t {
case cliInstallerKey:
return CLIInstallerType
case crInstallerKey:
return CRInstallerType
default:
panic(fmt.Errorf("Unknown installer type %s", typeStr))
}
} | [
-0.145839661359787,
-0.3865851163864136,
0.23477451503276825,
0.10595933347940445,
0.025316359475255013,
0.32028019428253174,
-0.6018107533454895,
0.025102954357862473,
0.02023935876786709,
0.6125780344009399,
0.32707780599594116,
0.053970176726579666,
-1.3450102806091309,
0.76166611909866... |
func (lp *LoadPoint) GetStatus() api.ChargeStatus {
lp.Lock()
defer lp.Unlock()
return lp.status
} | [
0.8242631554603577,
-0.9658468961715698,
0.323162317276001,
0.5352219939231873,
0.6244331002235413,
-0.07840975373983383,
-0.9946869015693665,
-0.06428705155849457,
0.09274811297655106,
-0.022603843361139297,
-0.42729708552360535,
0.5932651162147522,
-1.127128005027771,
0.4713379144668579,... |
func (lp *LoadPoint) GetMode() api.ChargeMode {
lp.Lock()
defer lp.Unlock()
return lp.Mode
} | [
0.5514827370643616,
-0.4322025775909424,
0.5039294958114624,
0.8775032162666321,
1.0557817220687866,
0.16313204169273376,
-0.9598005414009094,
-0.45554119348526,
-0.08077405393123627,
-0.23593418300151825,
0.3921503722667694,
0.1343313455581665,
-1.521086573600769,
0.4612153470516205,
0.... |
func (lp *LoadPoint) SetMode(mode api.ChargeMode) {
lp.Lock()
defer lp.Unlock()
lp.log.INFO.Printf("set charge mode: %s", string(mode))
// apply immediately
if lp.Mode != mode {
lp.Mode = mode
lp.publish("mode", mode)
// immediately allow pv mode activity
lp.elapsePVTimer()
lp.requestUpdate()
}
} | [
0.04292939975857735,
-0.6363940834999084,
0.5853729248046875,
0.9153054356575012,
0.34304845333099365,
0.9658154249191284,
-0.6072587370872498,
0.035570502281188965,
-0.06969085335731506,
0.026532765477895737,
0.340851753950119,
-0.06874101608991623,
-1.293818473815918,
0.8017104864120483,... |
func (lp *LoadPoint) GetTargetSoC() int {
lp.Lock()
defer lp.Unlock()
return lp.SoC.Target
} | [
0.949340283870697,
-0.2701352536678314,
0.5839669704437256,
-0.039445746690034866,
0.7285326719284058,
-0.8327183127403259,
1.0271488428115845,
-0.6122116446495056,
-0.34533634781837463,
-0.5847293138504028,
0.6130425333976746,
0.5334147214889526,
-0.1021057516336441,
-0.7342082262039185,
... |
func (lp *LoadPoint) SetTargetSoC(soc int) error {
if lp.vehicle == nil {
return api.ErrNotAvailable
}
lp.Lock()
defer lp.Unlock()
lp.log.INFO.Println("set target soc:", soc)
// apply immediately
if lp.SoC.Target != soc {
lp.SoC.Target = soc
lp.publish("targetSoC", soc)
lp.requestUpdate()
}
return ... | [
0.10035979002714157,
-1.0503400564193726,
0.40832406282424927,
-0.2313547432422638,
0.6077303290367126,
-0.3876151442527771,
0.23284845054149628,
-0.7884017825126648,
0.21422821283340454,
-0.2942471206188202,
0.5740963220596313,
0.3299850523471832,
0.26829230785369873,
-0.40017959475517273... |
func (lp *LoadPoint) GetMinSoC() int {
lp.Lock()
defer lp.Unlock()
return lp.SoC.Min
} | [
0.8879929780960083,
-0.4131906032562256,
0.20870643854141235,
0.4956742525100708,
-0.5592110753059387,
-0.20909425616264343,
0.18854135274887085,
-1.1907188892364502,
-0.0719527080655098,
-0.776049792766571,
0.32614073157310486,
0.007147382479161024,
-1.2593002319335938,
0.1894533783197403... |
func (lp *LoadPoint) SetMinSoC(soc int) error {
if lp.vehicle == nil {
return api.ErrNotAvailable
}
lp.Lock()
defer lp.Unlock()
lp.log.INFO.Println("set min soc:", soc)
// apply immediately
if lp.SoC.Min != soc {
lp.SoC.Min = soc
lp.publish("minSoC", soc)
lp.requestUpdate()
}
return nil
} | [
0.031318698078393936,
-1.1419037580490112,
0.32456713914871216,
0.11281807720661163,
-0.5855019092559814,
0.11996427923440933,
-0.3296654522418976,
-1.3016529083251953,
0.7611284852027893,
-0.2750815451145172,
-0.025560667738318443,
0.024653473868966103,
-0.5863516330718994,
0.354544699192... |
func (lp *LoadPoint) GetPhases() int {
lp.Lock()
defer lp.Unlock()
return int(lp.Phases)
} | [
0.6494529247283936,
-0.335769921541214,
0.3988039195537567,
-0.33777764439582825,
0.5273922681808472,
0.014935916289687157,
-0.2978486120700836,
-0.8244531750679016,
0.276801735162735,
-0.13789448142051697,
0.07225209474563599,
-0.5642219185829163,
-2.0715646743774414,
0.33425915241241455,... |
func (lp *LoadPoint) SetPhases(phases int) error {
return lp.scalePhases(phases)
} | [
0.038736578077077866,
-0.4576835036277771,
0.23763160407543182,
-0.6938120722770691,
-0.03700164332985878,
0.6049906611442566,
-0.9822698831558228,
-0.7952715754508972,
0.5829474925994873,
0.4534918963909149,
-0.45532354712486267,
-0.833990752696991,
-1.442609190940857,
0.8376740217208862,... |
func (lp *LoadPoint) SetTargetCharge(finishAt time.Time, targetSoC int) {
lp.Lock()
defer lp.Unlock()
lp.log.INFO.Printf("set target charge: %d @ %v", targetSoC, finishAt)
// apply immediately
// TODO check reset of targetSoC
lp.publish("targetTime", finishAt)
lp.publish("targetSoC", targetSoC)
lp.socTimer.T... | [
-0.27753379940986633,
-1.083485722541809,
0.4155178964138031,
-0.09082086384296417,
0.5033086538314819,
-0.07754183560609818,
-0.7849115133285522,
-0.7048738598823547,
-0.41310107707977295,
0.454449862241745,
0.19361744821071625,
0.5966135859489441,
-0.43930646777153015,
0.3395930230617523... |
func (lp *LoadPoint) RemoteControl(source string, demand loadpoint.RemoteDemand) {
lp.Lock()
defer lp.Unlock()
lp.log.INFO.Println("remote demand:", demand)
// apply immediately
if lp.remoteDemand != demand {
lp.remoteDemand = demand
lp.publish("remoteDisabled", demand)
lp.publish("remoteDisabledSource", ... | [
0.5676243901252747,
-0.9490348100662231,
0.37145617604255676,
-0.9147146344184875,
-0.4117160737514496,
1.818422794342041,
-0.7886602878570557,
0.1305510252714157,
0.6333374977111816,
0.05227760225534439,
-0.8293653726577759,
0.5360733270645142,
-0.7177350521087646,
-0.05947621911764145,
... |
func (lp *LoadPoint) HasChargeMeter() bool {
_, isWrapped := lp.chargeMeter.(*wrapper.ChargeMeter)
return lp.chargeMeter != nil && !isWrapped
} | [
0.05327698960900307,
-0.8701046705245972,
0.508333146572113,
-0.08685514330863953,
-0.07785661518573761,
-0.4042211174964905,
-0.6081594228744507,
-0.22942474484443665,
0.07723477482795715,
0.017332518473267555,
-0.4036739766597748,
-0.06629283726215363,
-0.24581964313983917,
1.98703444004... |
func (lp *LoadPoint) GetChargePower() float64 {
lp.Lock()
defer lp.Unlock()
return lp.chargePower
} | [
0.4490717947483063,
-0.5364060997962952,
0.3165462911128998,
0.8764253258705139,
0.3234279751777649,
-0.055195268243551254,
-0.8954832553863525,
-0.4113772213459015,
-0.17924554646015167,
-0.2521629333496094,
-0.12044145166873932,
-0.0317617692053318,
-2.0194990634918213,
0.751737952232360... |
func (lp *LoadPoint) GetMinCurrent() float64 {
lp.Lock()
defer lp.Unlock()
return lp.MinCurrent
} | [
0.48714587092399597,
-1.6412177085876465,
0.1839306801557541,
0.12858393788337708,
-0.6596081256866455,
0.24874760210514069,
-0.08918990939855576,
-0.9678109884262085,
-1.080544114112854,
-0.5436804890632629,
0.4989475905895233,
0.6701172590255737,
-1.4576200246810913,
-0.09586956351995468... |
func (lp *LoadPoint) SetMinCurrent(current float64) {
lp.Lock()
defer lp.Unlock()
if current != lp.MinCurrent {
lp.MinCurrent = current
lp.publish("minCurrent", lp.MinCurrent)
}
} | [
0.3051629364490509,
-1.9622902870178223,
0.32067692279815674,
-0.049877166748046875,
-0.8737002015113831,
0.671378493309021,
-0.07682330161333084,
-0.9859347939491272,
-0.5797411799430847,
-0.16413258016109467,
-0.009581462480127811,
0.6671857237815857,
-1.0323002338409424,
0.2883648872375... |
func (lp *LoadPoint) GetMaxCurrent() float64 {
lp.Lock()
defer lp.Unlock()
return lp.MaxCurrent
} | [
0.6563858389854431,
-1.1844761371612549,
0.36624425649642944,
0.6571632027626038,
-0.5242100954055786,
0.48551905155181885,
-0.4033083915710449,
-0.12519434094429016,
-1.065321683883667,
-0.19209818542003632,
0.10987364500761032,
0.5531463623046875,
-0.968432605266571,
-0.11235242336988449... |
func (lp *LoadPoint) SetMaxCurrent(current float64) {
lp.Lock()
defer lp.Unlock()
if current != lp.MaxCurrent {
lp.MaxCurrent = current
lp.publish("maxCurrent", lp.MaxCurrent)
}
} | [
0.14671845734119415,
-1.5233644247055054,
0.43379104137420654,
0.46605420112609863,
-0.7783243060112,
0.6766164302825928,
-0.25371649861335754,
-0.017857616767287254,
-0.720536470413208,
0.287565678358078,
-0.4357646405696869,
0.4239400327205658,
-0.6601875424385071,
0.18661163747310638,
... |
func (lp *LoadPoint) GetMinPower() float64 {
return Voltage * lp.GetMinCurrent()
} | [
0.5177406668663025,
-1.4884685277938843,
0.2844911217689514,
0.6374948620796204,
-0.402313768863678,
-0.25807109475135803,
-1.3792935609817505,
-0.7612605094909668,
0.05792535841464996,
-0.5746138095855713,
0.5031021237373352,
0.04155783727765083,
-1.9848806858062744,
0.6930685639381409,
... |
func (lp *LoadPoint) GetMaxPower() float64 {
return Voltage * lp.GetMaxCurrent() * float64(lp.GetPhases())
} | [
0.9485542178153992,
-0.8203197121620178,
0.46330389380455017,
0.7039576768875122,
-0.3222454786300659,
-0.5081726312637329,
-1.6220283508300781,
0.21312221884727478,
0.21273058652877808,
0.08263441920280457,
0.3196292519569397,
-0.19118720293045044,
-0.9860536456108093,
0.8152785301208496,... |
func (lp *LoadPoint) setRemainingDuration(chargeRemainingDuration time.Duration) {
lp.Lock()
defer lp.Unlock()
if lp.chargeRemainingDuration != chargeRemainingDuration {
lp.chargeRemainingDuration = chargeRemainingDuration
lp.publish("chargeRemainingDuration", chargeRemainingDuration)
}
} | [
0.3977201581001282,
-1.434931755065918,
0.24675504863262177,
0.10626300424337387,
-0.08251888304948807,
1.2060497999191284,
-0.9036819338798523,
-0.5782774090766907,
-0.03533751145005226,
0.08005795627832413,
-0.5504679679870605,
-0.03481064364314079,
-0.9612619280815125,
0.750582933425903... |
func (lp *LoadPoint) GetRemainingDuration() time.Duration {
lp.Lock()
defer lp.Unlock()
return lp.chargeRemainingDuration
} | [
0.5900288820266724,
-0.788788378238678,
0.2831851541996002,
0.35629960894584656,
-0.2162686139345169,
0.5173863768577576,
-0.7423669695854187,
-0.4234709143638611,
-0.02166348323225975,
-0.08536743372678757,
-0.544408917427063,
-0.005777834448963404,
-1.2603343725204468,
0.6583733558654785... |
func (lp *LoadPoint) setRemainingEnergy(chargeRemainingEnergy float64) {
lp.Lock()
defer lp.Unlock()
if lp.chargeRemainingEnergy != chargeRemainingEnergy {
lp.chargeRemainingEnergy = chargeRemainingEnergy
lp.publish("chargeRemainingEnergy", chargeRemainingEnergy)
}
} | [
0.6346693634986877,
-1.0442301034927368,
0.314573734998703,
0.012993398122489452,
0.09728100150823593,
0.9160656929016113,
-0.9483128786087036,
-0.290974885225296,
-0.4634953439235687,
-0.037957582622766495,
-0.6321930885314941,
-0.5945896506309509,
-1.7115962505340576,
0.8956414461135864,... |
func (lp *LoadPoint) GetRemainingEnergy() float64 {
lp.Lock()
defer lp.Unlock()
return lp.chargeRemainingEnergy
} | [
0.7947871685028076,
-0.4348968267440796,
0.21844737231731415,
0.41098761558532715,
0.0032608662731945515,
0.27375638484954834,
-0.9778515100479126,
-0.33277198672294617,
-0.5615195035934448,
-0.21637314558029175,
-0.26472872495651245,
-0.6144310832023621,
-2.2452268600463867,
0.84142076969... |
func wordPattern(pattern string, str string) bool {
ss := strings.Split(str, " ")
pb := []rune(pattern)
if len(ss) != len(pb) {
return false
}
p2s := make(map[rune]string, len(pattern)/2)
s2p := make(map[string]rune, len(ss)/2)
for i, sss := range ss {
pr := pb[i]
if prr, ok := s2p[sss]; ok {
if pr != ... | [
-0.143562451004982,
-0.28613850474357605,
0.9257364273071289,
-0.094864621758461,
-0.9314963817596436,
0.8293910026550293,
0.04496413469314575,
0.672663688659668,
0.1744479537010193,
1.079664707183838,
-0.8491054773330688,
0.5588824152946472,
-0.5772255063056946,
0.07713604718446732,
-0.... |
func Connect(url, dbName string) *mongo.Database {
client, err := mongo.NewClient(options.Client().ApplyURI(url))
if err != nil {
log.Fatalf("could not fetch client from url [ %s ]: %v", url, err)
}
if err := client.Connect(context.Background()); err != nil {
log.Fatalf("could not initialize client: %v", err)... | [
-0.10962707549333572,
0.2608020305633545,
0.5473709106445312,
0.18232621252536774,
-0.562084972858429,
0.1858251839876175,
-0.7049016356468201,
-0.813162088394165,
-0.5439845323562622,
0.6219367980957031,
0.39301222562789917,
0.4984188675880432,
-1.0709707736968994,
-0.03897185996174812,
... |
func (p *planner) ShowIndex(ctx context.Context, n *tree.ShowIndex) (planNode, error) {
const getIndexes = `
SELECT
table_name AS "Table",
index_name AS "Name",
NOT non_unique::BOOL AS "Unique",
seq_in_index AS "Seq",
column_name AS "Column",
direction AS "Direction",
storing::BO... | [
-0.2981557250022888,
0.7295989394187927,
0.4546986520290375,
-0.0009943584445863962,
-0.6730647683143616,
-0.18705548346042633,
0.9140891432762146,
0.54189133644104,
0.31696802377700806,
0.34061872959136963,
-0.17998264729976654,
0.6863887310028076,
0.6747434139251709,
-0.12856221199035645... |
func (*TextSegment) Descriptor() ([]byte, []int) {
return file_google_cloud_automl_v1_text_segment_proto_rawDescGZIP(), []int{0}
} | [
-0.7056459784507751,
0.29405874013900757,
0.06390507519245148,
-0.9884940981864929,
-0.051544297486543655,
-0.47697708010673523,
0.048706430941820145,
0.17037440836429596,
-1.0955530405044556,
0.2869630753993988,
-0.7282225489616394,
-0.23082669079303741,
-0.2319231480360031,
0.77070367336... |
func GetAllApps(c echo.Context) error {
// returning static apps array
sqlStatment := "SELECT id, appname, disabled, globaldisablemessage FROM apps order by id"
rows, err := d.Query(sqlStatment)
if err != nil {
fmt.Println(err)
}
defer rows.Close()
// creates a new object from return from postgres
var result... | [
-0.19743479788303375,
-0.5100123286247253,
0.8595138192176819,
1.688094973564148,
-0.7175227999687195,
0.7101459503173828,
-0.45525288581848145,
-0.36788409948349,
-0.1340014785528183,
0.5144742727279663,
-0.28086793422698975,
-0.03855584189295769,
-0.4660848379135132,
0.6677348017692566,
... |
func GetApp(c echo.Context) error {
id := c.Param("id")
fmt.Println("id passed in : ", id)
var app models.App
sqlStatment := `SELECT id, appname, disabled, globaldisablemessage FROM apps WHERE id=$1;`
row := d.QueryRow(sqlStatment, id)
err := row.Scan(&app.ID, &app.Appname, &app.Disabled, &app.GlobalDisableMessag... | [
0.024528000503778458,
0.07700860500335693,
0.6549065709114075,
1.263547420501709,
-0.5809897184371948,
0.660317599773407,
-0.4708784222602844,
0.013379599899053574,
0.23481309413909912,
0.8822945356369019,
0.04288174957036972,
0.27618956565856934,
-0.15531611442565918,
0.3540843427181244,
... |
func DeleteApp(c echo.Context) error {
id := c.Param("id")
sqlStatment := "DELETE FROM apps WHERE id = $1"
res, err := d.Query(sqlStatment, id)
if err != nil{
fmt.Println(err)
} else {
fmt.Println(res)
return c.JSON(http.StatusOK, "Deleted")
}
return c.JSON(http.StatusOK, "Deleted")
} | [
0.04522842913866043,
-0.24741801619529724,
0.7907472848892212,
0.8603118062019348,
-0.4193721413612366,
1.125521183013916,
-0.20256324112415314,
-0.4367640018463135,
0.6306988000869751,
0.5188234448432922,
0.3899668753147125,
0.06606972217559814,
0.16124241054058075,
0.6705732941627502,
... |
func Greet() {
fmt.Println("Hello, World!")
} | [
1.2221271991729736,
-0.16477368772029877,
0.5712192058563232,
0.5006508827209473,
0.35715413093566895,
1.4934290647506714,
0.22000861167907715,
0.3490879535675049,
-0.3235969841480255,
-0.43348708748817444,
-0.2913344204425812,
1.5655916929244995,
-0.16043750941753387,
0.8089279532432556,
... |
func (r *LogRequest) Validate() error {
if err := requireProject(r.GetProject()); err != nil {
return err
}
if err := requireCommittish("committish", r.GetCommittish()); err != nil {
return err
}
switch {
case strings.Contains(r.Committish, ".."):
return errors.New("committish cannot contain \"..\"; use Anc... | [
0.26080265641212463,
0.2571035921573639,
0.7299872040748596,
-0.3017742931842804,
0.024233834818005562,
0.1016746535897255,
-0.8318340182304382,
-0.9903485774993896,
-0.47047045826911926,
-0.2218739539384842,
1.4510451555252075,
0.5628791451454163,
-0.6201735734939575,
0.5951536893844604,
... |
func (r *RefsRequest) Validate() error {
if err := requireProject(r.GetProject()); err != nil {
return err
}
switch {
case r.RefsPath != "refs" && !strings.HasPrefix(r.RefsPath, "refs/"):
return errors.Reason(`refsPath must be "refs" or start with "refs/": %q`, r.RefsPath).Err()
default:
return nil
}
} | [
0.061167508363723755,
0.0744841992855072,
0.6405490636825562,
-0.22014681994915009,
0.23248827457427979,
0.3455946445465088,
0.2562105059623718,
-1.544743537902832,
0.6210954785346985,
-0.2261928766965866,
1.867203950881958,
0.11473798751831055,
-0.808121919631958,
1.1804933547973633,
0.... |
func (r *ArchiveRequest) Validate() error {
if err := requireProject(r.GetProject()); err != nil {
return err
}
switch {
case r.Format == ArchiveRequest_Invalid:
return errors.New("format must be valid")
case r.Ref == "":
return errors.New("ref is required")
default:
return nil
}
} | [
-0.40387213230133057,
0.33402007818222046,
0.638046145439148,
-0.19469070434570312,
0.3432729244232178,
0.23135724663734436,
-0.6216052174568176,
-0.4739914536476135,
-0.23469829559326172,
0.10023336857557297,
1.5497006177902222,
0.8177323937416077,
-0.5807503461837769,
0.6043200492858887,... |
func (r *DownloadFileRequest) Validate() error {
if err := requireProject(r.GetProject()); err != nil {
return err
}
if err := requireCommittish("committish", r.GetCommittish()); err != nil {
return err
}
if strings.HasPrefix(r.Path, "/") {
return errors.New("path must not start with /")
}
return nil
} | [
0.5749555826187134,
0.155889630317688,
0.6141183972358704,
-0.24870288372039795,
0.2878257930278778,
0.5879296660423279,
0.18312488496303558,
-0.6074662208557129,
-0.9115983247756958,
-0.390207976102829,
1.1575708389282227,
-0.06059393286705017,
-0.5811129212379456,
1.1313166618347168,
-... |
func (r *DownloadDiffRequest) Validate() error {
if err := requireProject(r.GetProject()); err != nil {
return err
}
if err := requireCommittish("committish", r.GetCommittish()); err != nil {
return err
}
if base := r.GetBase(); base != "" {
if err := requireCommittish("base", base); err != nil {
return e... | [
0.158184215426445,
-0.22481098771095276,
0.7300431728363037,
-0.2365891933441162,
0.2818603515625,
0.5480448603630066,
0.33879852294921875,
-1.4146435260772705,
-0.4883240759372711,
-0.4900890290737152,
0.952975332736969,
0.26180359721183777,
-0.540130078792572,
1.4475353956222534,
0.078... |
func (r *ListFilesRequest) Validate() error {
if err := requireProject(r.GetProject()); err != nil {
return err
}
if err := requireCommittish("committish", r.GetCommittish()); err != nil {
return err
}
if strings.HasSuffix(r.GetCommittish(), "/") {
return errors.New("committish must not end with /")
}
if s... | [
0.19762572646141052,
0.1692838817834854,
0.5481062531471252,
-0.2577499747276306,
0.12313300371170044,
0.18232430517673492,
-0.2306276559829712,
-0.781272292137146,
-0.23656326532363892,
-0.28695914149284363,
0.9915677905082703,
0.23875515162944794,
-0.7105352282524109,
0.9857738614082336,... |
func (metricsServer PrometheusMetricServer) NewServer(address string, pattern string) {
http.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
})
log.Printf("Starting metrics server at %v", address)
http.Handle(pattern, promhttp.HandlerFor(r... | [
-0.37601572275161743,
-0.42788222432136536,
0.6450414657592773,
-0.27280399203300476,
0.7717081308364868,
0.6538498401641846,
0.5886543989181519,
0.4239867925643921,
-0.13882023096084595,
-0.023338712751865387,
-0.15952374041080475,
1.1409353017807007,
-0.314790278673172,
0.582966387271881... |
func (metricsServer PrometheusMetricServer) RecordHPAScalerMetric(namespace string, scaledObject string, scaler string, scalerIndex int, metric string, value int64) {
scalerMetricsValue.With(getLabels(namespace, scaledObject, scaler, scalerIndex, metric)).Set(float64(value))
} | [
-0.08459748327732086,
-0.23992615938186646,
0.3736459016799927,
-0.3530797064304352,
-0.6044145226478577,
0.5443133115768433,
-0.8482580184936523,
-0.851159930229187,
-1.0162888765335083,
0.4135468006134033,
-0.0446506142616272,
0.19710566103458405,
-0.576708197593689,
1.0771652460098267,
... |
func defaultConfig() Config {
return Config{
HandlerPattern: "/ws",
Address: ":8000",
}
} | [
0.579241931438446,
0.6044256091117859,
0.3215539753437042,
0.07192956656217575,
-0.17275328934192657,
0.6872217059135437,
0.15135464072227478,
1.3851704597473145,
0.6967096924781799,
-0.5760672688484192,
-0.6780927777290344,
0.45393481850624084,
0.3236946761608124,
1.1650593280792236,
-0... |
func RunServer(ctx context.Context, srv3 serverv3.Server, port uint) {
log := logger.New("runServer")
defer log.LogDone()
var grpcOptions []grpc.ServerOption
grpcOptions = append(grpcOptions, grpc.MaxConcurrentStreams(grpcMaxConcurrentStreams))
grpcServer := grpc.NewServer(grpcOptions...)
lis, err := net.Listen(... | [
-0.962949275970459,
0.11287190765142441,
0.7520041465759277,
-0.28461575508117676,
1.328148603439331,
0.4483451247215271,
0.22015926241874695,
0.4605514109134674,
0.051567383110523224,
-0.19657103717327118,
-0.01491161622107029,
1.1937589645385742,
-1.3449913263320923,
0.5537080764770508,
... |
func NewGovernancePolicy()(*GovernancePolicy) {
m := &GovernancePolicy{
}
m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();
m.SetAdditionalData(make(map[string]any))
return m
} | [
0.009304694831371307,
0.3803727328777313,
-0.21065570414066315,
-0.41309964656829834,
0.7507719397544861,
0.6249176263809204,
0.047179292887449265,
-0.3011567294597626,
-0.8334770798683167,
0.2527797818183899,
-0.2005346566438675,
0.5972398519515991,
-0.5892809629440308,
0.81098872423172,
... |
func CreateGovernancePolicyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewGovernancePolicy(), nil
} | [
0.7330543398857117,
0.2409783899784088,
0.24016165733337402,
-0.24378696084022522,
-0.20138517022132874,
1.1338317394256592,
-0.02049718052148819,
-0.2062927931547165,
0.06263282895088196,
-0.15172401070594788,
0.38062548637390137,
0.29771310091018677,
0.2922135889530182,
0.932440757751464... |
func (m *GovernancePolicy) GetAdditionalData()(map[string]any) {
val , err := m.backingStore.Get("additionalData")
if err != nil {
panic(err)
}
if val == nil {
var value = make(map[string]any);
m.SetAdditionalData(value);
}
return val.(map[string]any)
} | [
0.2553142011165619,
0.015391373075544834,
-0.00341515289619565,
-0.39746832847595215,
-0.5797820687294006,
1.117628812789917,
-0.8829165697097778,
-0.6014679670333862,
0.8047033548355103,
-0.3222781717777252,
0.01939288340508938,
0.7983282804489136,
-0.24897781014442444,
0.4398777186870575... |
func (m *GovernancePolicy) GetBackingStore()(ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) {
return m.backingStore
} | [
0.4409846067428589,
-0.30511659383773804,
0.18178929388523102,
-0.5592132210731506,
0.45949670672416687,
1.0855103731155396,
0.40621688961982727,
-0.48923107981681824,
0.4464469850063324,
-0.3354661166667938,
0.8015053868293762,
0.11362390220165253,
-1.9476956129074097,
-0.7866010069847107... |
func (m *GovernancePolicy) GetDecisionMakerCriteria()([]GovernanceCriteriaable) {
val, err := m.GetBackingStore().Get("decisionMakerCriteria")
if err != nil {
panic(err)
}
if val != nil {
return val.([]GovernanceCriteriaable)
}
return nil
} | [
0.04281033203005791,
0.9187973141670227,
0.021839147433638573,
0.8535123467445374,
0.9224003553390503,
0.9048269987106323,
0.011503529734909534,
0.4227548837661743,
-0.5161395072937012,
-0.004395451862365007,
0.597448468208313,
0.6880499720573425,
0.2741082012653351,
0.3599236309528351,
... |
func (m *GovernancePolicy) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["decisionMakerCriteria"] = func (n i878a8... | [
-0.03922410309314728,
0.6071534752845764,
0.5442788600921631,
-0.8412193059921265,
0.6587710380554199,
0.2754197120666504,
0.32270681858062744,
-0.22712603211402893,
-0.8717371821403503,
-0.0498124398291111,
-0.5259366035461426,
0.6447567343711853,
-0.7679725289344788,
0.728334903717041,
... |
func (m *GovernancePolicy) GetNotificationPolicy()(GovernanceNotificationPolicyable) {
val, err := m.GetBackingStore().Get("notificationPolicy")
if err != nil {
panic(err)
}
if val != nil {
return val.(GovernanceNotificationPolicyable)
}
return nil
} | [
0.7874161005020142,
0.7861506342887878,
0.13580381870269775,
1.2320585250854492,
1.5421193838119507,
1.146195888519287,
0.8701654672622681,
-0.585825502872467,
-0.4935856759548187,
0.30850592255592346,
-0.013815888203680515,
0.3607780933380127,
0.15068408846855164,
-0.23041528463363647,
... |
func (m *GovernancePolicy) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
if m.GetDecisionMakerCriteria() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetDecisionMakerCriteria()))
... | [
-0.1673911064863205,
0.3738996982574463,
0.36571764945983887,
-0.6188505291938782,
1.1005489826202393,
0.8591152429580688,
0.6601396203041077,
-0.18601912260055542,
-0.5324836373329163,
0.5744287371635437,
-0.08185210824012756,
0.8777371644973755,
-0.27749282121658325,
0.7180487513542175,
... |
func (m *GovernancePolicy) SetAdditionalData(value map[string]any)() {
err := m.GetBackingStore().Set("additionalData", value)
if err != nil {
panic(err)
}
} | [
0.43979090452194214,
0.5344491004943848,
-0.24026070535182953,
-0.3307971954345703,
-0.24659159779548645,
2.025615930557251,
-0.3420477509498596,
-0.7465102672576904,
0.3287270665168762,
-0.18106195330619812,
-0.05868879333138466,
0.6299574375152588,
-0.22233451902866364,
0.661800563335418... |
func (m *GovernancePolicy) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {
m.backingStore = value
} | [
0.16894501447677612,
0.39810726046562195,
0.019740326330065727,
-0.4792705178260803,
0.2341858148574829,
1.1984848976135254,
0.4925230145454407,
-0.510931670665741,
-0.4792185127735138,
0.07046960294246674,
0.06174401938915253,
-0.5720406174659729,
-0.9943625330924988,
0.23133139312267303,... |
func (m *GovernancePolicy) SetDecisionMakerCriteria(value []GovernanceCriteriaable)() {
err := m.GetBackingStore().Set("decisionMakerCriteria", value)
if err != nil {
panic(err)
}
} | [
-0.5379283428192139,
0.9329919219017029,
0.04722238704562187,
0.49036702513694763,
0.4168558716773987,
0.9598338603973389,
0.3405075669288635,
0.6186735033988953,
-0.9720657467842102,
0.34600046277046204,
0.1677253544330597,
-0.14938122034072876,
0.5650254487991333,
0.6053528785705566,
-... |
func (m *GovernancePolicy) SetNotificationPolicy(value GovernanceNotificationPolicyable)() {
err := m.GetBackingStore().Set("notificationPolicy", value)
if err != nil {
panic(err)
}
} | [
0.7130404114723206,
0.7667636871337891,
-0.046004582196474075,
1.017142415046692,
1.1878201961517334,
1.619500994682312,
1.0005700588226318,
-0.4661143124103546,
-0.8748769760131836,
0.6778258085250854,
-0.6802828907966614,
-0.4813201129436493,
0.35147005319595337,
0.23965495824813843,
0... |
func (s *engine) waitForShutdown() {
s.cond.L.Lock()
s.cond.Wait()
s.cond.L.Unlock()
} | [
0.5931220054626465,
0.11213567107915878,
0.17696332931518555,
-0.31162789463996887,
0.35101181268692017,
0.08325054496526718,
-0.11365664005279541,
0.5581812858581543,
-0.7355679869651794,
-0.8136718273162842,
0.3845784664154053,
-0.7786908149719238,
0.5195228457450867,
0.6367799043655396,... |
func (s *engine) signalShutdown() {
s.cond.L.Lock()
s.cond.Signal()
s.cond.L.Unlock()
} | [
0.0819375216960907,
-0.48374974727630615,
0.24307100474834442,
0.002589932642877102,
0.24813242256641388,
0.298537939786911,
0.2574084997177124,
0.9265461564064026,
-0.036970045417547226,
0.5902047157287598,
-0.6377156376838684,
-0.3329680263996124,
0.22364802658557892,
0.6485313773155212,... |
func New() App {
return App{}
} | [
0.2633255422115326,
-1.423413634300232,
-0.23659437894821167,
0.815790057182312,
-1.05378258228302,
0.7107259035110474,
-0.042230766266584396,
-0.3345482349395752,
-0.11267300695180893,
-0.325562059879303,
-0.5777100324630737,
0.2059062421321869,
0.976768970489502,
0.4833146929740906,
0.... |
func (a Address) toHeaderFormat() string {
msg := gomail.NewMessage()
return msg.FormatAddress(a.Address, a.Name)
} | [
0.07643798738718033,
-0.9027700424194336,
0.6717942357063293,
-1.5932856798171997,
-0.7001155614852905,
-0.31286993622779846,
-0.5077067613601685,
-0.1760561615228653,
1.1407159566879272,
0.43525585532188416,
0.07153622806072235,
1.075120449066162,
-0.3298768401145935,
-0.10502900183200836... |
func buildUnconfiguredIgnitionAssetDefaultDependencies(t *testing.T) []asset.Asset {
t.Helper()
infraEnv := getTestInfraEnv()
agentPullSecret := getTestAgentPullSecret(t)
clusterImageSet := getTestClusterImageSet()
return []asset.Asset{
&infraEnv,
&agentPullSecret,
&clusterImageSet,
&manifests.NMStateCon... | [
-0.3792904019355774,
-0.42939263582229614,
0.20096419751644135,
-0.025807220488786697,
0.8731975555419922,
0.09455089271068573,
0.691999077796936,
0.36314743757247925,
0.6975400447845459,
-0.18634064495563507,
-0.7685520052909851,
-0.6291403770446777,
0.14360809326171875,
0.732244193553924... |
func (a *app) GetReadinessProbe() *v1.Probe {
if !a.composeService.DockerComposeService.HealthcheckDisabled {
if a.composeService.DockerComposeService.Healthcheck != nil {
return createReadinessProbeFromDockerHealthcheck(a.composeService.DockerComposeService.Healthcheck)
} else if a.imageInfo.imageHealthcheck !... | [
0.7706266045570374,
0.03440967947244644,
0.7851085662841797,
0.25613951683044434,
0.14771300554275513,
0.29122617840766907,
-0.45850494503974915,
-0.03246943652629852,
0.6022037863731384,
0.21034486591815948,
1.5119731426239014,
0.27576392889022827,
-0.6810975074768066,
0.5743264555931091,... |
func Run(cfg *config.Config, opts *Options) error {
// TODO https://github.com/kube-compose/kube-compose/issues/2 accept context as a parameter
u := &upRunner{
cfg: cfg,
opts: opts,
}
u.hostAliases.once = &sync.Once{}
u.localImagesCache.once = &sync.Once{}
return u.run()
} | [
-0.9226188659667969,
-0.054494936019182205,
0.6802500486373901,
0.6961511373519897,
-0.12124159932136536,
-0.07631772011518478,
1.10221266746521,
0.262114554643631,
0.21781904995441437,
0.33584362268447876,
-0.6063998937606812,
0.36367008090019226,
-0.22352638840675354,
0.6380828022956848,... |
func NewDriver(version string, ctx *cli.Context) (*Driver, error) {
docker, err := client.NewEnvClient()
if err != nil {
return nil, fmt.Errorf("could not connect to docker: %s", err)
}
d := &Driver{
networks: networkTable{},
dClient: docker,
}
return d, nil
} | [
0.22479885816574097,
-0.4142339527606964,
0.3131999373435974,
0.6555006504058838,
-0.24435636401176453,
0.6057605743408203,
-0.003892660140991211,
-0.4368443191051483,
-0.3654094636440277,
0.04646780714392662,
0.37265369296073914,
0.20526625216007233,
0.1134408488869667,
0.860893189907074,... |
func (d *Driver) GetCapabilities() (*sdk.CapabilitiesResponse, error) {
scope := &sdk.CapabilitiesResponse{Scope: sdk.LocalScope}
return scope, nil
} | [
-0.1942923665046692,
-0.7770101428031921,
0.26325762271881104,
-0.07250315696001053,
0.8435623049736023,
-1.6427876949310303,
0.6566815972328186,
-0.5083211064338684,
1.07827627658844,
-0.07484690845012665,
-0.07065461575984955,
-0.06267606467008591,
-0.8020761013031006,
0.4996502101421356... |
func (d *Driver) CreateNetwork(r *sdk.CreateNetworkRequest) error {
var netCidr *net.IPNet
var netGw string
var err error
log.Debugf("Network Create Called: [ %+v ]", r)
for _, v4 := range r.IPv4Data {
netGw = v4.Gateway
_, netCidr, err = net.ParseCIDR(v4.Pool)
if err != nil {
return err
}
}
// Parse... | [
-0.37595701217651367,
0.7668236494064331,
0.55348140001297,
0.15079380571842194,
1.4371434450149536,
0.5247070789337158,
-0.006356816738843918,
-0.31749171018600464,
0.5526623129844666,
-0.25626081228256226,
0.07791583985090256,
-1.7137689590454102,
-0.6350610256195068,
0.34217867255210876... |
func (d *Driver) DeleteNetwork(r *sdk.DeleteNetworkRequest) error {
log.Debugf("Delete network request: %+v", &r)
n := d.network(r.NetworkID)
if n == nil {
return nil
}
log.Debugf("Delete network name: %v", n.name)
if err := d.nlh.LinkDel(n.bridge.Link); err != nil {
log.Warnf("Failed to remove bridge inter... | [
-0.694021999835968,
0.4981481730937958,
0.36214229464530945,
0.3509657382965088,
1.0974935293197632,
-0.22750958800315857,
0.17411795258522034,
-0.20847991108894348,
0.928804874420166,
-1.0588958263397217,
-0.13250020146369934,
-0.6615899801254272,
-0.4544256627559662,
0.8837148547172546,
... |
func (d *Driver) CreateEndpoint(r *sdk.CreateEndpointRequest) (*sdk.CreateEndpointResponse, error) {
endID := r.EndpointID
netID := r.NetworkID
eInfo := r.Interface
log.Debugf("CreateEndpoint called :%v", r)
// Get the network handler and make sure it exists
d.Lock()
network, ok := d.networks[r.NetworkID]
d.Unl... | [
0.29474955797195435,
0.6427263021469116,
0.7514403462409973,
0.25086191296577454,
1.4207710027694702,
0.4258895814418793,
0.0936458557844162,
0.324422687292099,
0.22085705399513245,
-0.01086615864187479,
0.5354219675064087,
-1.4983904361724854,
-1.2334353923797607,
0.6739572882652283,
0.... |
func (d *Driver) DeleteEndpoint(r *sdk.DeleteEndpointRequest) error {
log.Debugf("Delete endpoint request: %+v", &r)
//TODO: null check cidr in case driver restarted and doesn't know the network to avoid panic
log.Debugf("Delete endpoint %s", r.EndpointID)
nid := r.NetworkID
eid := r.EndpointID
// Get the netwo... | [
-0.011554337106645107,
-0.24267540872097015,
0.5085703134536743,
0.3933973014354706,
0.9635476469993591,
-0.6567355394363403,
0.15146347880363464,
0.4271738529205322,
0.7167386412620544,
-0.17343780398368835,
0.7122763991355896,
-0.466009259223938,
-0.6348291039466858,
0.5829470753669739,
... |
func (d *Driver) EndpointInfo(r *sdk.InfoRequest) (*sdk.InfoResponse, error) {
log.Debugf("Endpoint info request: %+v", &r)
res := &sdk.InfoResponse{
Value: make(map[string]string),
}
return res, nil
} | [
-1.1181174516677856,
-0.739145815372467,
0.5057881474494934,
-0.17436756193637848,
-0.013770146295428276,
-0.439927339553833,
-0.38625654578208923,
0.020231861621141434,
-0.5226436853408813,
0.7434048056602478,
-0.02950623631477356,
-0.2757406234741211,
-0.48618990182876587,
-0.13852551579... |
func (d *Driver) Join(r *sdk.JoinRequest) (*sdk.JoinResponse, error) {
log.Debugf("Join request: %+v", &r)
nid := r.NetworkID
eid := r.EndpointID
d.Lock()
network, ok := d.networks[nid]
d.Unlock()
if !ok {
return nil, types.NotFoundErrorf("network %s does not exist", nid)
}
network.Lock()
endpoint, ok :=... | [
-0.3485378623008728,
-0.16248546540737152,
0.5791776180267334,
0.09033525735139847,
0.3310204744338989,
-0.09909317642450333,
-0.47594189643859863,
-0.346349835395813,
0.6030731797218323,
0.40935707092285156,
-0.010632316581904888,
-0.7087565064430237,
-1.1806631088256836,
0.00492752995342... |
func (d *Driver) Leave(r *sdk.LeaveRequest) error {
log.Debugf("Leave request: %+v", &r)
log.Debugf("Leave %s:%s", r.NetworkID, r.EndpointID)
return nil
} | [
-0.16597937047481537,
-0.021190395578742027,
0.3805866539478302,
-0.27692535519599915,
0.6056237816810608,
0.003372813807800412,
-0.17744171619415283,
-0.9440189003944397,
0.5744938254356384,
-0.3736738860607147,
0.47520509362220764,
-0.9650921821594238,
-1.2048004865646362,
-0.20275348424... |
func (d *Driver) DiscoverNew(r *sdk.DiscoveryNotification) error {
return nil
} | [
0.5059674382209778,
0.4933149814605713,
0.3865819573402405,
1.0031449794769287,
0.30983951687812805,
-0.1994202435016632,
0.07908415794372559,
-0.6581627130508423,
-0.2569810450077057,
-0.6820191740989685,
0.015698859468102455,
-0.37987834215164185,
0.6011374592781067,
1.347320318222046,
... |
func (d *Driver) DiscoverDelete(r *sdk.DiscoveryNotification) error {
return nil
} | [
0.9857349991798401,
0.40790578722953796,
0.3061184883117676,
0.7163608074188232,
0.6795697808265686,
-0.5244230031967163,
0.34566792845726013,
-0.12291006743907928,
0.6045843958854675,
-0.10649567097425461,
0.4680001437664032,
0.09340490400791168,
-0.4468865990638733,
0.7946165204048157,
... |
func (d *Driver) existingNetChecks() {
// Request all networks on the endpoint without any filters
} | [
-0.3874197006225586,
-0.740734338760376,
0.24280431866645813,
0.39222416281700134,
1.2553967237472534,
0.6233481168746948,
0.28801557421684265,
-0.08477401733398438,
-0.040424175560474396,
-0.5689560174942017,
0.17266125977039337,
-0.5884678959846497,
0.49666348099708557,
0.824424684047699... |
func getCommitID(r *http.Request) (vcs.CommitID, bool, error) {
return checkCommitID(mux.Vars(r)["CommitID"])
} | [
0.06871455907821655,
0.33274710178375244,
0.7565064430236816,
0.7685306072235107,
0.46270322799682617,
0.04838406667113304,
-0.18540918827056885,
-0.4489031732082367,
0.24038484692573547,
1.6282711029052734,
0.7238937616348267,
0.11907432973384857,
-1.1390702724456787,
0.49352097511291504,... |
func checkCommitID(commitID string) (vcs.CommitID, bool, error) {
if commitID == "" {
return "", false, &httpError{http.StatusBadRequest, errors.New("CommitID is empty")}
}
if !isLowercaseHex(commitID) {
return "", false, &httpError{http.StatusBadRequest, errors.New("CommitID must be lowercase hex")}
}
retur... | [
-0.5241665840148926,
-0.6837305426597595,
0.8673945665359497,
0.3092244267463684,
-0.15327198803424835,
0.05033573508262634,
-0.5739918947219849,
0.057315465062856674,
0.4991581439971924,
1.8076075315475464,
0.36158642172813416,
-0.10163526982069016,
-1.2641000747680664,
0.9728243947029114... |
func (c *packageListTasksCmd) run(settings *env.Settings) error {
pr, err := packageDiscovery(c.fs, settings, c.RepoName, c.pathOrName, c.AppVersion, c.OperatorVersion)
if err != nil {
return err
}
displayTasksTable(pr.OperatorVersion.Spec.Tasks, c.out)
return nil
} | [
-0.3133918344974518,
0.28348779678344727,
0.557654619216919,
0.4010956585407257,
0.027252094820141792,
0.21970106661319733,
1.1172741651535034,
0.5484310388565063,
-0.2645736634731293,
0.5286439657211304,
-0.9721840620040894,
-0.4385107755661011,
0.48076730966567993,
0.666963517665863,
-... |
func ReverseRunes(s string) string {
r := []rune(s)
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
r[i], r[j] = r[j], r[i]
}
return string(r)
} | [
0.03712429478764534,
0.016851887106895447,
0.4165371060371399,
-0.978807806968689,
-0.2617288827896118,
-0.6472927331924438,
0.08569587767124176,
0.8307062983512878,
-1.1010695695877075,
0.4029736816883087,
0.36005163192749023,
0.8258055448532104,
-1.0478768348693848,
-1.1038339138031006,
... |
func NewDiscordBot() (*DiscordBot, error) {
bot := &DiscordBot{}
var discordErr error
// Create Discord session
s, discordErr := state.New("Bot " + Config.Discord.BotToken)
if discordErr != nil {
return nil, discordErr
}
bot.state = s
// Add our Discord handlers
bot.state.AddHandler(bot.onReady)
bot.state... | [
0.10254533588886261,
-0.5203281044960022,
0.7090529799461365,
-0.5238449573516846,
-0.670383870601654,
-0.4921349883079529,
-0.613487720489502,
-0.4233081340789795,
0.18264852464199066,
-0.3731824457645416,
-0.7567893266677856,
0.6646137833595276,
-0.10360902547836304,
1.3046170473098755,
... |
func (bot *DiscordBot) Close() error {
var closeErr error
if err := bot.watcher.Close(); err != nil {
closeErr = err
}
if err := bot.state.Session.Close(); err != nil {
closeErr = err
}
return closeErr
} | [
-0.3835141062736511,
-0.36697933077812195,
0.7240254282951355,
-0.2764059603214264,
-0.08816789835691452,
0.5901607275009155,
-0.27146440744400024,
-0.5357162356376648,
-0.5553991794586182,
-0.18751294910907745,
0.6001502871513367,
0.12570446729660034,
-0.7483388185501099,
0.93358170986175... |
func (bot *DiscordBot) WaitForMessages() {
// Make our messages channel
mc := make(chan *MinecraftMessage)
// Start our Minecraft watcher
go bot.watcher.Watch(mc)
for {
// Read message from the channel
msg := <-mc
Log.Debugf("Received a line from Minecraft: Username='%s', Text='%s'\n", msg.Username, msg.Mes... | [
0.6017720699310303,
-0.10198453813791275,
0.46867823600769043,
-1.0384143590927124,
0.19708600640296936,
0.13270702958106995,
-0.4946678578853607,
-0.43863606452941895,
-0.5645629167556763,
-0.4556151330471039,
0.3941207528114319,
0.026241982355713844,
-0.45712611079216003,
1.1469500064849... |
func (bot *DiscordBot) onReady(e *gateway.ReadyEvent) {
// Set the bot gaming status
err := bot.state.Gateway.UpdateStatus(gateway.UpdateStatusData{
Game: &discord.Activity{
Name: "Bridging the Minecraft/Discord gap",
},
})
if err != nil {
Log.Errorf("Unable to update Discord status: %s\n", err)
}
} | [
-0.01200931891798973,
-0.20352715253829956,
0.5367361903190613,
-0.8167413473129272,
-0.066864974796772,
-0.32140958309173584,
-1.012643575668335,
0.7911243438720703,
0.3252183496952057,
0.9464563131332397,
-0.34933581948280334,
0.8759909868240356,
0.22796054184436798,
1.0382729768753052,
... |
func (bot *DiscordBot) onGuildCreate(e *gateway.GuildCreateEvent) {
// Make sure the guild is available
if e.Unavailable {
Log.Warnf("Attempted to join Guild '%s', but it was unavailable\n", e.Guild.Name)
return
}
if bot.guildID.String() != "" {
Log.Warnf("Received a Guild join event for '%s', but we've alre... | [
1.5227930545806885,
0.07940935343503952,
0.4394433796405792,
-0.6606921553611755,
0.4003675878047943,
-0.122640460729599,
-1.018345594406128,
0.08762375265359879,
-0.020210547372698784,
0.6928776502609253,
-0.6516246795654297,
0.3295356333255768,
-0.04097563773393631,
1.4168726205825806,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.