text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (qc *QueueClient) checkAndEnforceMessagePolicy(mp *pb.QueueMessagePolicy) error {
if mp.ExpirationSeconds > qc.policyCfg.MaxExpirationSeconds || mp.ExpirationSeconds < 0 {
return entities.ErrInvalidExpiration
}
if mp.MaxReceiveCount > qc.policyCfg.MaxReceiveCount || mp.MaxReceiveCount < 0 {
return entities... | [
0.5404506921768188,
-0.23070697486400604,
0.7097040414810181,
-1.0789058208465576,
0.5120068192481995,
0.31684955954551697,
-0.36802029609680176,
0.005522793624550104,
-0.30076515674591064,
0.3343251943588257,
0.49307307600975037,
0.47631537914276123,
-0.9127164483070374,
1.638960123062133... |
func (qc *QueueClient) checkAndEnforceReceiveQueueMessageRequest(req *pb.ReceiveQueueMessagesRequest) error {
err := ValidateReceiveQueueMessageRequest(req)
if err != nil {
return err
}
if req.MaxNumberOfMessages > qc.policyCfg.MaxNumberOfMessages || req.MaxNumberOfMessages < 1 {
return entities.ErrInvalidMaxM... | [
-0.5241504311561584,
0.183401957154274,
0.7366363406181335,
-0.654146671295166,
0.537693202495575,
-0.12520352005958557,
-0.5465004444122314,
-0.1267622709274292,
-0.33588388562202454,
0.32511889934539795,
0.7019556164741516,
0.01969270221889019,
-0.4396646320819855,
1.5564347505569458,
... |
func (qc *QueueClient) checkAndEnforceStreamQueueMessageRequest(req *pb.StreamQueueMessagesRequest) error {
if req.RequestID == "" {
req.RequestID = nuid.Next()
}
if req.ClientID == "" {
return entities.ErrInvalidClientID
}
switch req.StreamRequestTypeData {
case pb.StreamRequestType_ReceiveMessage:
if er... | [
-0.44318887591362,
-0.3281726539134979,
0.8658286333084106,
-0.36529070138931274,
0.1706411987543106,
0.3418707251548767,
-0.2209247499704361,
-0.987461507320404,
-0.1553184986114502,
0.5589660406112671,
0.9255449175834656,
1.2320722341537476,
-0.7672083973884583,
1.8106317520141602,
0.1... |
func NewProvisioner(cluster *model.Cluster) *Provisioner {
provisioner := &Provisioner{
Cluster: cluster,
WorkerNodeMachines: make(map[string]*WorkerNodeMachine),
ControlPlaneMachines: make(map[string]*ControlPlaneMachine),
}
if cluster.CpLeader != "" {
for _, node := range cluster.Nodes {
... | [
0.3062027394771576,
-0.5154990553855896,
0.29935696721076965,
0.5346683859825134,
-0.35752761363983154,
0.35919490456581116,
-0.835625946521759,
-0.14805282652378082,
-0.24355760216712952,
0.8439680337905884,
-0.09947992116212845,
-0.20097140967845917,
-0.8597970604896545,
1.10195815563201... |
func (self *Provisioner) AppendControlPlaneMachine(name string, csp app.CSP, region string, zone string, credential string) {
machine := &ControlPlaneMachine{
Machine: &Machine{
Name: name,
CSP: csp,
Role: app.CONTROL_PLANE,
Region: region,
Zone: zone,
Credential: cred... | [
0.3638608455657959,
-0.48087945580482483,
0.5051485896110535,
-0.26942169666290283,
0.10165847837924957,
1.7036547660827637,
-1.2276322841644287,
-0.28624266386032104,
0.6357390880584717,
-0.28571534156799316,
-0.6460916996002197,
-0.7246119379997253,
-0.8737837076187134,
0.546795547008514... |
func (self *Provisioner) AppendWorkerNodeMachine(name string, csp app.CSP, region string, zone string, credential string) {
self.WorkerNodeMachines[name] = &WorkerNodeMachine{
Machine: &Machine{
Name: name,
CSP: csp,
Role: app.WORKER,
Region: region,
Zone: zone,
Credent... | [
-0.18844790756702423,
-0.07292486727237701,
0.40175238251686096,
-0.3850334584712982,
-0.42178991436958313,
1.258009433746338,
-0.9824478626251221,
-0.45742493867874146,
0.3723994493484497,
-0.08349494636058807,
-0.8973976373672485,
0.008236821740865707,
-0.4806692898273468,
0.327969521284... |
func (self *Provisioner) BindVM(vms []tumblebug.VM) ([]*model.Node, error) {
nodes := []*model.Node{}
for _, vm := range vms {
// validate created vm
if vm.Status == tumblebug.VMSTATUS_FAILED {
status := app.Status{}
if err := json.Unmarshal([]byte(vm.SystemMessage), &status); err != nil {
status.Mess... | [
-0.5189090967178345,
-0.5206311345100403,
0.48710641264915466,
0.4599747359752655,
0.7409517765045166,
0.5521626472473145,
-0.35782790184020996,
-0.2513081729412079,
-0.07890454679727554,
0.8480879664421082,
0.5317700505256653,
0.21074548363685608,
-0.058299481868743896,
0.9458169937133789... |
func (self *Provisioner) AssignNodeLabelAnnotation() error {
// commons labels
for _, machine := range self.GetMachinesAll() {
var err error
var k8sNodeName string = machine.Name
if self.Cluster.ServiceType == app.ST_SINGLE {
if k8sNodeName, err = machine.GetHostname(); err != nil {
return err
}
}
... | [
-0.054055970162153244,
-0.561262845993042,
0.8481040596961975,
-0.0962914451956749,
0.3000013530254364,
1.0344983339309692,
0.17991425096988678,
0.0713622197508812,
-0.5341068506240845,
1.222698450088501,
0.15451420843601227,
0.11122315376996994,
0.11193431168794632,
1.168676733970642,
0... |
func (self *Provisioner) NewWorkerJoinCommand() (string, error) {
if joinCommand, err := self.leader.executeSSH("sudo kubeadm token create --print-join-command"); err != nil {
return "", err
} else if joinCommand == "" {
return "", errors.New("join command is empty")
} else {
return joinCommand, nil
}
} | [
0.36484915018081665,
-0.4614095985889435,
0.8799082636833191,
0.7612630724906921,
-0.24851557612419128,
0.5076783299446106,
-0.669726550579071,
-0.3837364614009857,
0.08893589675426483,
0.3210156261920929,
-0.13432329893112183,
0.33333486318588257,
-1.6975175142288208,
0.454338014125824,
... |
func (self *Provisioner) DrainAndDeleteNode(nodeName string) error {
var k8sNodeName string = nodeName
if self.Cluster.ServiceType == app.ST_SINGLE {
var err error = nil
for _, m := range self.GetMachinesAll() {
if m != self.leader.Machine && m.Name == nodeName {
if k8sNodeName, err = m.GetHostname(); err... | [
-0.029098408296704292,
0.19288519024848938,
0.9391488432884216,
-0.5571072101593018,
0.8824242353439331,
-0.13175636529922485,
-0.33083340525627136,
-0.07715847343206406,
0.5615620017051697,
0.5183695554733276,
0.817322313785553,
1.1460282802581787,
-0.598612368106842,
0.7117199301719666,
... |
func GetUserProfile(w http.ResponseWriter, r *http.Request) {
if utils.URLChecker(w, r, "/profile") {
if r.Method == "GET" {
//if userId now, createdPost uid equal -> show
u := models.User{
Session : session,
}
dislikedPost, likedPost, posts, comments, user := u.GetUserProfile(r, w)
//check if c... | [
0.48940449953079224,
0.5576236844062805,
0.9784088134765625,
1.049547553062439,
-0.2908983826637268,
0.5454761385917664,
0.29438650608062744,
-0.5640299320220947,
-0.12987565994262695,
0.3672886788845062,
-0.13798581063747406,
0.0525653176009655,
-0.4793527126312256,
1.2290623188018799,
... |
func GetAnotherProfile(w http.ResponseWriter, r *http.Request) {
if utils.URLChecker(w, r, "/user/id") {
//if r.Method == "POST" {
uid := models.User{Temp: r.FormValue("uid")}
if uid.Temp == "0" {
uid.Temp = r.URL.Query().Get("uid")
}
fmt.Println(uid, "UID")
posts, user, err := uid.GetAnotherPr... | [
0.6093096733093262,
0.04594523832201958,
0.8307191729545593,
0.7635343074798584,
0.06615456193685532,
0.22331503033638,
0.49852561950683594,
-0.6895482540130615,
-0.192136749625206,
-0.6605737805366516,
-0.3017750084400177,
0.21362470090389252,
-0.7983199954032898,
1.544613003730774,
0.4... |
func TestSearch_PrimaryBranch_NoReferenceImages_ReturnsEmptyResult(t *testing.T) {
ctx := context.Background()
db := useKitchenSinkData(ctx, t)
// Delete all reference images from the database.
_, err := db.Exec(ctx, "DELETE FROM DiffMetrics")
require.NoError(t, err)
s := New(db, 100)
res, err := s.Search(ctx,... | [
0.3528755009174347,
0.741845965385437,
0.5654798746109009,
-0.32811254262924194,
1.0683542490005493,
0.008006026968359947,
0.42767414450645447,
-0.800409734249115,
0.0850212424993515,
-0.8187385201454163,
0.12425650656223297,
-0.32285287976264954,
-0.9148800373077393,
1.018717646598816,
... |
func TestSearch_SecondaryBranch_NoReferenceImages_ReturnsEmptyResult(t *testing.T) {
ctx := context.Background()
db := useKitchenSinkData(ctx, t)
// Delete all reference images from the database.
_, err := db.Exec(ctx, "DELETE FROM DiffMetrics")
require.NoError(t, err)
clCommits := append([]frontend.Commit{}, ... | [
0.4563077688217163,
0.7255480885505676,
0.7245388031005859,
-0.05258483439683914,
0.422311395406723,
0.15432725846767426,
0.3836616277694702,
-0.8848057389259338,
-0.0053960420191287994,
-0.6198309659957886,
-0.0598805733025074,
0.23086607456207275,
-0.6156437397003174,
0.8817752003669739,... |
func fromDrawing(drawing string, groupings map[schema.MD5Hash]paramtools.Params) []untriagedDigestAtHead {
drawing = strings.TrimSpace(drawing)
lines := strings.Split(drawing, "\n")
findGroupingKey := func(testName string) schema.MD5Hash {
for key, params := range groupings {
if params[types.PrimaryKeyField] ==... | [
1.0473456382751465,
-0.08235898613929749,
0.6953383088111877,
-0.6181616187095642,
-0.15876106917858124,
-0.24185924232006073,
0.2746734321117401,
-0.45226311683654785,
0.06353460252285004,
-0.03663008660078049,
0.11059290915727615,
0.14479133486747742,
0.6245218515396118,
-0.0295855794101... |
func expandDigest(letter string) types.Digest {
if len(letter) != 1 {
panic("expected to expand a single letter into a digest: " + letter)
}
return types.Digest(strings.Repeat(letter, 2*md5.Size))
} | [
0.14555922150611877,
1.2979401350021362,
0.5377341508865356,
-0.3931223750114441,
-1.027916431427002,
-0.15738199651241302,
0.0868336409330368,
-0.024060837924480438,
0.7986152768135071,
-0.6774908304214478,
-0.061521533876657486,
0.05515970289707184,
-0.5669145584106445,
-0.14059297740459... |
func expandDigestToHash(letter string) schema.MD5Hash {
digest := expandDigest(letter)
db, err := sql.DigestToBytes(digest)
if err != nil {
panic(err)
}
return sql.AsMD5Hash(db)
} | [
-0.3351648151874542,
1.011500597000122,
0.669998049736023,
-0.48653465509414673,
-1.1042121648788452,
0.0996129959821701,
0.15425845980644226,
0.14966386556625366,
0.4458751678466797,
-0.10797066241502762,
-0.29807648062705994,
0.09163505584001541,
-0.08314725011587143,
-0.2844889461994171... |
func mustHash(grouping paramtools.Params) schema.MD5Hash {
_, b := sql.SerializeMap(grouping)
return sql.AsMD5Hash(b)
} | [
-0.3786579668521881,
0.3152479827404022,
0.43042856454849243,
1.0308328866958618,
-0.2780759930610657,
0.862708568572998,
0.10416240990161896,
-0.13858523964881897,
-0.6561213135719299,
0.7663129568099976,
0.4661169648170471,
0.03900933638215065,
-0.410202294588089,
0.10102804750204086,
... |
func waitForSystemTime() {
time.Sleep(150 * time.Millisecond)
} | [
0.3766477406024933,
0.35006585717201233,
0.3359973728656769,
-0.1808069348335266,
-0.593572735786438,
0.3858707845211029,
-0.14097410440444946,
-0.24941417574882507,
-0.3803541958332062,
-0.21404166519641876,
-0.698217511177063,
0.2758978307247162,
-0.16598716378211975,
1.1023926734924316,... |
func ts(ts string) time.Time {
t, err := time.Parse(time.RFC3339, ts)
if err != nil {
panic(err)
}
return t
} | [
0.01462799683213234,
0.7859328985214233,
0.1980607658624649,
-0.9169780611991882,
-0.3861396312713623,
0.4600948393344879,
-1.2456146478652954,
-0.6238888502120972,
0.6068713068962097,
0.38142693042755127,
-0.2798945903778076,
0.10610953718423843,
0.6003997921943665,
-1.130309820175171,
... |
func useKitchenSinkData(ctx context.Context, t *testing.T) *pgxpool.Pool {
db := sqltest.NewCockroachDBForTestsWithProductionSchema(ctx, t)
require.NoError(t, sqltest.BulkInsertDataTables(ctx, db, dks.Build()))
// Some queries use "AS OF SYSTEM TIME", so we do this by default so if we add those
// constraints, we d... | [
-0.03894053027033806,
0.7825693488121033,
0.4629844129085541,
0.2349904477596283,
0.30671343207359314,
-0.18084467947483063,
0.8128257989883423,
-0.36006802320480347,
0.022501293569803238,
-0.33481502532958984,
0.019945615902543068,
0.6001114249229431,
-0.4816199541091919,
0.35781943798065... |
func digestToBytes(t *testing.T, digest types.Digest) []byte {
bytes, err := sql.DigestToBytes(digest)
require.NoError(t, err)
return bytes
} | [
-0.7302685976028442,
0.3668753206729889,
0.5634539723396301,
-0.05477798730134964,
0.35391101241111755,
-0.3370373547077179,
-0.19765880703926086,
-0.5633187890052795,
0.764263391494751,
-0.014394697733223438,
-0.5818758606910706,
0.11915350705385208,
-0.6253807544708252,
0.749475836753845... |
func NewLevel(l string) Level {
switch l {
case "debug":
return LevelDebug
case "info":
return LevelInfo
case "warn":
return LevelWarn
case "error":
return LevelError
case "fatal":
return LevelFatal
default:
return LevelDebug
}
} | [
0.3861364424228668,
-0.42863088846206665,
0.193045511841774,
-0.031387463212013245,
-0.12034458667039871,
0.5211066603660583,
-0.6351062655448914,
-0.6176580190658569,
0.11751572042703629,
-0.22657829523086548,
-0.35852357745170593,
0.08992629498243332,
-0.25563153624534607,
0.312324941158... |
func AtoiDef(s string, def int) int {
if i, err := strconv.Atoi(s); err == nil {
return i
}
return def
} | [
0.28652381896972656,
-0.016503440216183662,
0.3341594338417053,
-0.5814064145088196,
-0.47435423731803894,
-1.3164563179016113,
-0.14442670345306396,
0.08444800227880478,
-0.7678836584091187,
1.0323015451431274,
-0.7307790517807007,
0.8427671194076538,
0.200214222073555,
-0.844996690750122... |
func ParseFloatDef(s string, def float64) float64 {
if f, err := strconv.ParseFloat(s, 32); err == nil {
return f
}
return def
} | [
1.433122158050537,
0.7248663902282715,
0.3322719633579254,
0.12089244276285172,
-0.363189160823822,
-0.7857378125190735,
-0.6270873546600342,
0.203025221824646,
-0.5525473952293396,
-0.5452156066894531,
-0.3301011919975281,
0.37475869059562683,
-0.2194063365459442,
0.7581311464309692,
-0... |
func FormatSeconds(seconds float64) string {
// Make sure localised strings are fetched
locOnce.Do(func() {
locDay = glib.Local("one day")
locDays = glib.Local("days")
})
minutes, secs := int(seconds)/60, int(seconds)%60
hours, mins := minutes/60, minutes%60
days, hrs := hours/24, hours%24
switch {
case da... | [
-0.4193628132343292,
-0.19439518451690674,
0.6440908312797546,
-0.9927956461906433,
-0.6844016313552856,
-0.3501136600971222,
-0.29735422134399414,
-1.5156804323196411,
-0.38407620787620544,
-0.14298748970031738,
1.2188071012496948,
0.14924703538417816,
0.5881069302558899,
0.52556443214416... |
func FormatSecondsStr(seconds string) string {
if f := ParseFloatDef(seconds, -1); f >= 0 {
return FormatSeconds(f)
}
return ""
} | [
0.5298026204109192,
-0.31643545627593994,
0.3360479474067688,
0.8329808115959167,
-0.6333109140396118,
-0.2817959189414978,
-0.12307893484830856,
-1.9986381530761719,
-0.5176606178283691,
-0.3386647701263428,
1.913205862045288,
0.2153959572315216,
0.4764367938041687,
0.7647663950920105,
... |
func Default(def string, value interface{}) string {
if set, ok := template.IsTrue(value); ok && set {
return fmt.Sprint(value)
}
return def
} | [
0.36944150924682617,
0.8239542245864868,
0.2120135873556137,
0.38499557971954346,
0.008105039596557617,
-0.18383659422397614,
-0.3930976688861847,
0.2717655599117279,
-0.09438487887382507,
0.27557775378227234,
0.5466471910476685,
0.21632003784179688,
-0.1528967022895813,
0.8569521307945251... |
func (v *Validator) Validate(cfg map[string]map[string]string) (map[string]map[string]interface{}, error) {
states := v.ensureTypes(cfg)
v.ensureValid(states)
known, required := v.getKnownRequired(states)
for section, options := range cfg {
optionKnown, sectionIsKnown := known[section]
if !sectionIsKnown {
... | [
-0.3828156590461731,
-0.44435086846351624,
0.9108769297599792,
-0.4617386758327484,
-0.4696715474128723,
-0.3676915466785431,
0.10230132937431335,
-0.6403264999389648,
-0.2784385085105896,
0.33070307970046997,
0.19391308724880219,
-0.6985472440719604,
0.12833461165428162,
1.323883891105651... |
func (v *Validator) ensureTypes(cfg map[string]map[string]string) map[string]map[string]*ParameterValidationState {
states := map[string]map[string]*ParameterValidationState{}
for section, options := range *v {
optionStates := map[string]*ParameterValidationState{}
for option, constraints := range options {
... | [
-0.7270760536193848,
-0.3014206290245056,
0.4422891438007355,
-0.5821614861488342,
1.242834448814392,
0.00934718456119299,
-0.30717113614082336,
-0.8600744009017944,
-0.01887092925608158,
0.8860703706741333,
0.19886818528175354,
-0.520052969455719,
-0.43780627846717834,
0.8872764706611633,... |
func (v *Validator) ensureValid(states map[string]map[string]*ParameterValidationState) {
for section, options := range *v {
optionStates := states[section]
for option, constraints := range options {
state := optionStates[option]
if state.Present && state.TypeError == nil {
state.ValidationError = cons... | [
0.06112731620669365,
-1.1703388690948486,
0.4613777995109558,
-0.06348158419132233,
0.9160891175270081,
0.6231852769851685,
-0.634831964969635,
-0.24661025404930115,
0.23219257593154907,
0.7114996314048767,
0.9709185361862183,
-0.4234983026981354,
0.194952592253685,
0.31479495763778687,
... |
func (v *Validator) getKnownRequired(states map[string]map[string]*ParameterValidationState) (known map[string]map[string]bool, required map[string]map[string]bool) {
known = map[string]map[string]bool{}
required = map[string]map[string]bool{}
for section, options := range *v {
optionKnown := map[string]bool{}
... | [
-0.9354727864265442,
-0.6334426999092102,
0.8412483334541321,
-0.5431612730026245,
-0.12344776839017868,
-0.15188287198543549,
-0.5937391519546509,
0.16796573996543884,
-0.4971899092197418,
0.8994846940040588,
-0.6845312714576721,
0.006649868097156286,
0.6002491116523743,
0.938637077808380... |
func replaceLocalhostWithSystemIp(addresses *[]string) []string {
out := []string{}
for _, address := range *addresses {
if address == "127.0.0.1" || strings.ToLower(address) == "localhost" {
address = GetSystemIp()
}
out = append(out, address)
}
return out
} | [
-0.13694578409194946,
-0.2674376666545868,
0.46066009998321533,
0.8084786534309387,
-0.24326667189598083,
-0.5832172632217407,
-0.8325157761573792,
0.8341213464736938,
1.0126838684082031,
1.2544443607330322,
-0.39804360270500183,
-0.05400000885128975,
-0.6478145718574524,
0.903975784778595... |
func abs(x int) int {
if x < 0{
return -x
}
return x
} | [
-1.0961229801177979,
0.16803443431854248,
0.3248300552368164,
-0.18877452611923218,
-0.7153193354606628,
1.065349817276001,
-1.297670602798462,
-0.5553025007247925,
-0.3668280839920044,
-0.5725286602973938,
0.22804827988147736,
1.0209152698516846,
0.7503883242607117,
0.18345056474208832,
... |
func (base *BaseProtocol) SendPeer(req *StreamRequest) error {
stream, err := NewStream(base.Host, req.PeerID, req.MsgID...)
if err != nil {
return err
}
defer CloseStream(stream)
err = WriteStream(req.Data, stream)
if err != nil {
return err
}
CloseStream(stream)
return nil
} | [
-0.7215558290481567,
-0.5822718143463135,
0.8019580245018005,
0.48733648657798767,
-0.3847728967666626,
0.3177906572818756,
0.0354868583381176,
-0.47834476828575134,
-0.46629923582077026,
-0.4557223320007324,
-0.16327227652072906,
0.18945398926734924,
-1.5483402013778687,
1.456461668014526... |
func (base *BaseProtocol) SendRecvPeer(req *StreamRequest, resp types.Message) error {
stream, err := NewStream(base.Host, req.PeerID, req.MsgID...)
if err != nil {
return err
}
defer CloseStream(stream)
err = WriteStream(req.Data, stream)
if err != nil {
return err
}
err = ReadStream(resp, stream)
if err... | [
-0.3505038022994995,
-0.12930303812026978,
0.8280323147773743,
0.08592337369918823,
0.08690979331731796,
-0.011080695316195488,
-0.20277711749076843,
-0.821678102016449,
-0.3964550793170929,
0.14186842739582062,
-0.09926281869411469,
0.5656610131263733,
-1.261574625968933,
0.80972266197204... |
func NewStream(host core.Host, pid core.PeerID, protoIDs ...core.ProtocolID) (core.Stream, error) {
stream, err := host.NewStream(context.Background(), pid, protoIDs...)
// EOF表示底层连接断开, 增加一次重试
if err == io.EOF {
log.Debug("NewStream", "msg", "RetryConnectEOF")
stream, err = host.NewStream(context.Background(), ... | [
-0.07564008235931396,
-0.2742919921875,
0.6828822493553162,
0.6480126976966858,
-0.6332969665527344,
0.013035837560892105,
0.2200743556022644,
-0.5015684366226196,
-0.08061975985765457,
0.3503875732421875,
0.4413178861141205,
0.535379946231842,
-1.1175708770751953,
1.24496591091156,
-0.0... |
func ReadStream(data types.Message, stream core.Stream) error {
return ReadStreamTimeout(data, stream, time.Second*30)
} | [
0.28271588683128357,
0.9525215029716492,
0.2735968828201294,
0.5597217679023743,
-0.6074249148368835,
0.3819190263748169,
-0.6394575238227844,
-0.4834892749786377,
-0.3198593854904175,
0.07383356988430023,
0.713580310344696,
1.2726938724517822,
-0.46484801173210144,
0.6689777970314026,
0... |
func WriteStream(data types.Message, stream core.Stream) error {
_ = stream.SetWriteDeadline(time.Now().Add(30 * time.Second))
writer := bufio.NewWriter(stream)
enc := protobufCodec.Multicodec(nil).Encoder(writer)
err := enc.Encode(data)
if err != nil {
log.Error("WriteStream", "pid", stream.Conn().RemotePeer().... | [
-0.15204569697380066,
0.2192925065755844,
0.7118492722511292,
0.2847832441329956,
-0.0967182070016861,
0.8869005441665649,
0.21039126813411713,
-0.013547682203352451,
-0.4345114827156067,
-0.7331532835960388,
-0.0664791464805603,
1.0094001293182373,
-0.9512969255447388,
1.7186964750289917,... |
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
return &Client{transport: transport, formats: formats}
} | [
-0.053929269313812256,
-1.4649492502212524,
-0.09012952446937561,
-0.8262796401977539,
-0.550800621509552,
0.6438911557197571,
0.3526709973812103,
-0.1351967602968216,
-0.9943568110466003,
-0.7430494427680969,
-0.3152836263179779,
0.610390305519104,
0.2375689148902893,
0.0706297904253006,
... |
func (a *Client) GetKeypair(params *GetKeypairParams, authInfo runtime.ClientAuthInfoWriter) (*GetKeypairOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetKeypairParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "getKeypair",
M... | [
-1.367650032043457,
0.1657787412405014,
0.6378141641616821,
0.2674950361251831,
-0.27838799357414246,
-0.590330958366394,
0.25146180391311646,
-0.5475154519081116,
-0.3706151843070984,
-0.2968612611293793,
0.24070397019386292,
1.2905478477478027,
-1.6452065706253052,
0.1525847166776657,
... |
func (a *Client) GetPublicKey(params *GetPublicKeyParams, authInfo runtime.ClientAuthInfoWriter) (*GetPublicKeyOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetPublicKeyParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "getPubli... | [
-0.772007405757904,
0.378829687833786,
0.7287505865097046,
0.8344046473503113,
-0.033772435039281845,
-0.3313163220882416,
0.8642614483833313,
-1.2672481536865234,
-0.35127389430999756,
0.43924659490585327,
-0.453657865524292,
1.2576355934143066,
-1.0111287832260132,
0.6644394397735596,
... |
func (a *Client) SaveKeypair(params *SaveKeypairParams, authInfo runtime.ClientAuthInfoWriter) (*SaveKeypairNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewSaveKeypairParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "saveK... | [
-1.7895549535751343,
0.1691780537366867,
0.6303316354751587,
-0.31296950578689575,
-0.8426596522331238,
0.4693314731121063,
0.22102272510528564,
-0.9359000325202942,
-0.838554322719574,
0.3825521171092987,
-1.2990461587905884,
0.42661988735198975,
-1.8144757747650146,
0.7349718809127808,
... |
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
} | [
0.43289124965667725,
-0.16396044194698334,
0.06502870470285416,
0.17467869818210602,
-0.022012455388903618,
0.3327627182006836,
1.1535402536392212,
-0.7375835180282593,
0.32833772897720337,
-1.0833802223205566,
-1.4707483053207397,
0.4919946491718292,
-0.44076064229011536,
0.62663459777832... |
func NewRequest() *Request {
r := &Request{}
return r
} | [
-0.4856863021850586,
-0.7486714124679565,
-0.22774282097816467,
0.7766233682632446,
-0.5796253085136414,
-0.1690003126859665,
-0.31356292963027954,
-0.3961981236934662,
0.6095657348632812,
-1.1884723901748657,
0.33403271436691284,
0.8881332278251648,
0.001398539519868791,
-0.54399216175079... |
func (r *Request) FromJSON(data string) (*Request, error) {
var req Request
err := json.Unmarshal([]byte(data), &req)
if err != nil {
return nil, fmt.Errorf("could not deserialise json into Putdataframeanalytics request: %w", err)
}
return &req, nil
} | [
-0.7571244835853577,
0.12427367269992828,
0.3150992691516876,
-1.1107556819915771,
-0.5389752388000488,
-0.5853914618492126,
-0.15647950768470764,
-0.3651244640350342,
0.4703100919723511,
0.15931648015975952,
0.3029569983482361,
0.872717559337616,
-0.36718273162841797,
-0.515181839466095,
... |
func RangeOverChannel() {
// 1st Example
// like maps and slices, channels must be created before use:
c := make(chan int, 10)
go fibonacci(cap(c), c) //cap built-in function returns the capacity of v, according to its type. In this case return as channel type
for i := range c { //receives values from the cha... | [
-0.17974340915679932,
-0.9703189730644226,
0.5902548432350159,
-0.33103805780410767,
0.21686026453971863,
0.2316579967737198,
0.04066777601838112,
-1.3223824501037598,
-0.47792428731918335,
-0.24763984978199005,
-0.04781857132911682,
1.2243987321853638,
-0.03030957095324993,
0.375679522752... |
func (r *SignInRequest) Get(ctx context.Context) (resObj *SignIn, err error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
return
} | [
-1.565272569656372,
-0.6662000417709351,
0.4407886266708374,
0.11633172631263733,
-0.2236003577709198,
-0.41220933198928833,
-0.41286152601242065,
-0.5482593178749084,
0.27185213565826416,
-0.19943316280841827,
-0.021322304382920265,
0.2474772185087204,
-0.379461407661438,
-0.5023161768913... |
func (r *SignInRequest) Update(ctx context.Context, reqObj *SignIn) error {
return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
} | [
-1.9911707639694214,
-1.539053201675415,
0.29010212421417236,
0.18524925410747528,
-1.098986029624939,
0.674003005027771,
-0.09401798993349075,
-0.13073261082172394,
0.6729487776756287,
0.5088005065917969,
-0.3388921320438385,
0.20203110575675964,
-0.830462634563446,
-0.19770659506320953,
... |
func (r *SignInRequest) Delete(ctx context.Context) error {
return r.JSONRequest(ctx, "DELETE", "", nil, nil)
} | [
-1.2567503452301025,
-0.2837704122066498,
0.4561682939529419,
0.8126795887947083,
0.10802856832742691,
-0.28778350353240967,
-0.1932131052017212,
-0.11298432946205139,
0.504640519618988,
0.17510958015918732,
0.03918930143117905,
0.44442957639694214,
-0.8424190282821655,
-0.1530981957912445... |
func ExampleFrame() {
// Create Frame with some data
Frame := Frame{
Ch: Channels{
0x000, // Minumum channel value?
0x000,
0x7ff, // Maxiumum channel value
0x000,
0x000,
0x000,
0x000,
0x400, // 0% channel value
0x000,
0x000,
0x720, // 100% positive channel value
0x000,
0x000,
... | [
0.9147811532020569,
0.10362962633371353,
0.7567659020423889,
-0.43380093574523926,
0.16914674639701843,
-0.31826668977737427,
-0.3315846025943756,
0.53947514295578,
0.9112582206726074,
-0.5163751244544983,
-0.8718819618225098,
1.0556823015213013,
-0.24411362409591675,
0.3705223798751831,
... |
func NewZoneAssociation(ctx *pulumi.Context,
name string, args *ZoneAssociationArgs, opts ...pulumi.ResourceOption) (*ZoneAssociation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.VpcId == nil {
return nil, errors.New("invalid value for required argument ... | [
-0.7060656547546387,
0.6288517117500305,
-0.07387768477201462,
-0.019971735775470734,
-0.25025320053100586,
-0.0333753377199173,
0.864665150642395,
0.26413416862487793,
0.7733068466186523,
0.478360116481781,
-0.4568101465702057,
0.2689659297466278,
-0.5786868929862976,
-0.39921554923057556... |
func GetZoneAssociation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ZoneAssociationState, opts ...pulumi.ResourceOption) (*ZoneAssociation, error) {
var resource ZoneAssociation
err := ctx.ReadResource("aws:route53/zoneAssociation:ZoneAssociation", name, id, state, &resource, opts...)
if err != nil ... | [
-0.4776422679424286,
0.08669672161340714,
-0.04309333860874176,
0.10800228267908096,
-0.3917047679424286,
-0.6370415091514587,
0.9310383796691895,
-0.046596553176641464,
1.538392424583435,
-0.034095875918865204,
0.24040162563323975,
1.001606822013855,
-0.1416899710893631,
-1.36441826820373... |
func (o ZoneAssociationOutput) OwningAccount() pulumi.StringOutput {
return o.ApplyT(func(v *ZoneAssociation) pulumi.StringOutput { return v.OwningAccount }).(pulumi.StringOutput)
} | [
0.963153600692749,
-0.958550751209259,
0.4192098081111908,
0.786870002746582,
0.04887012764811516,
0.922543466091156,
2.038616418838501,
-0.399928480386734,
0.6667001843452454,
-0.6487669944763184,
0.9049850702285767,
1.3028634786605835,
0.6707885265350342,
-1.2747985124588013,
0.1646604... |
func (o ZoneAssociationOutput) VpcId() pulumi.StringOutput {
return o.ApplyT(func(v *ZoneAssociation) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
} | [
1.226166844367981,
-0.7647008895874023,
0.19409075379371643,
-0.13849827647209167,
0.22365222871303558,
1.036696434020996,
1.017883062362671,
0.23589403927326202,
0.9244452714920044,
-0.01910926215350628,
0.7781708240509033,
0.7217314839363098,
-0.042537569999694824,
-1.6212719678878784,
... |
func (o ZoneAssociationOutput) VpcRegion() pulumi.StringOutput {
return o.ApplyT(func(v *ZoneAssociation) pulumi.StringOutput { return v.VpcRegion }).(pulumi.StringOutput)
} | [
0.2845054268836975,
-0.7410818338394165,
0.24052350223064423,
-0.47206178307533264,
-0.04772211238741875,
1.1480354070663452,
0.7683441638946533,
0.3742745518684387,
0.24623987078666687,
-0.33482831716537476,
0.26602303981781006,
1.0996556282043457,
0.37490949034690857,
-1.3532609939575195... |
func (o ZoneAssociationOutput) ZoneId() pulumi.StringOutput {
return o.ApplyT(func(v *ZoneAssociation) pulumi.StringOutput { return v.ZoneId }).(pulumi.StringOutput)
} | [
1.0649573802947998,
-0.6555818915367126,
0.1559102088212967,
0.37220218777656555,
0.07393496483564377,
0.9515199065208435,
1.4143298864364624,
0.6677528023719788,
1.5239170789718628,
-0.04559582099318504,
0.5838088989257812,
0.7560793161392212,
0.18630872666835785,
-0.9630730152130127,
-... |
func main() {
fmt.Println(getKthFromEnd(&ListNode{
Val: 1,
Next: &ListNode{
Val: 2,
Next: &ListNode{
Val: 3,
Next: &ListNode{
Val: 4,
Next: &ListNode{
Val: 5,
Next: nil,
},
},
},
},
}, 2))
} | [
1.0641168355941772,
0.6163704991340637,
0.5354426503181458,
0.7338597178459167,
-0.8873926997184753,
-0.5395494103431702,
-0.02980712242424488,
0.023990217596292496,
-0.7463238835334778,
-0.1313466727733612,
-0.4305124878883362,
0.4581155478954315,
-0.22775065898895264,
0.252556711435318,
... |
func encodeResponse(ctx context.Context, responseWriter http.ResponseWriter, response interface{}) error {
if err, ok := response.(errorer); ok && err.error() != nil {
// Not a Go kit transport error, but a business-logic error.
// Provide those as HTTP errors.
encodeError(ctx, err.error(), responseWriter)
ret... | [
-0.10753937065601349,
-0.10288479924201965,
0.15058353543281555,
0.29438158869743347,
0.05865702033042908,
-0.6600212454795837,
-0.38885173201560974,
-0.7963480353355408,
0.7504969835281372,
0.6286695599555969,
-0.13201838731765747,
-0.22050385177135468,
-0.1690901517868042,
-0.13105852901... |
func NewGoalsController(database *gorm.DB) Goals {
return Goals{
database: database,
}
} | [
0.24756968021392822,
0.9305338859558105,
-0.013156652450561523,
0.6064922213554382,
-0.5034669041633606,
0.7255104780197144,
-0.49118825793266296,
-1.3402290344238281,
-0.9335529804229736,
0.145513117313385,
-0.5233157873153687,
-0.25280076265335083,
0.28524187207221985,
1.0651907920837402... |
func (controller Goals) SetWeightGoal(id int, weight int) error {
if err := controller.database.Model(&model.User{}).Where("id = ?", id).Update("weight_goal", weight).Error; err != nil {
log.Error(err)
return errors.New("Error while updating weight goal")
}
return nil
} | [
-0.1983303725719452,
-0.8385612368583679,
0.6560274958610535,
0.853485643863678,
-0.5239125490188599,
0.43116384744644165,
-0.3420426845550537,
-0.3438233733177185,
-1.2119050025939941,
1.3020039796829224,
-0.5325936675071716,
0.3915044069290161,
-0.7770159840583801,
0.8418545722961426,
... |
func (controller Goals) SetStepGoals(id int, steps int) error {
if err := controller.database.Model(&model.User{}).Where("id = ?", id).Update("steps_goal", steps).Error; err != nil {
log.Error(err)
return errors.New("Error while updating steps goal")
}
return nil
} | [
-0.4097236096858978,
0.16056600213050842,
0.581530749797821,
0.7370406985282898,
0.06327559053897858,
0.8769530057907104,
-0.05339626222848892,
-0.6869904398918152,
-1.2959997653961182,
0.27750203013420105,
-0.9806892275810242,
-0.5180901288986206,
-0.23199999332427979,
0.7647289633750916,... |
func (fa *FileAppender) writeLogItem(log *LogItem) {
ts := toolkit.GetTimeStamp(log.t0)
if fa.logFile == nil {
// output to console
fmt.Println(ts, log.severity, log.file, log.line, log.info)
return
}
if fa.logFormat == "" {
// no logformat specified
fa.logFile.WriteString(log.file)
fa.logFile.WriteS... | [
-0.06251967698335648,
-1.0986261367797852,
0.8062316179275513,
0.09893690049648285,
-0.12451176345348358,
0.28040748834609985,
-0.33229878544807434,
-0.005478686653077602,
-0.5336925983428955,
-0.3368780016899109,
-0.10025985538959503,
-0.313897043466568,
0.008548797108232975,
-0.022644108... |
func NewServer(router *mux.Router, db *gorm.DB, logger *log.Logger) *Server {
return &Server{
router: router,
db: db,
logger: logger,
}
} | [
0.03505798801779747,
-0.5312709212303162,
0.45915019512176514,
0.25026002526283264,
-0.3310253620147705,
0.31070592999458313,
-0.5925281643867493,
0.2166825383901596,
0.16936026513576508,
-0.04475228488445282,
0.1635451316833496,
1.3363715410232544,
-0.43768230080604553,
0.4824789464473724... |
func (s Server) ListenAndServe(port int) {
s.router.HandleFunc("/accounts/{accountID}", s.retrieveAccountInfoHandler()).Methods("GET")
s.router.HandleFunc("/accounts", s.createAccountHandler()).Methods("POST")
s.router.HandleFunc("/transactions", s.createTransactionHandler()).Methods("POST")
s.logger.Println(`HTTP... | [
0.01567310467362404,
-0.5902385115623474,
0.4905594289302826,
-0.26069575548171997,
0.7361158728599548,
-0.09548506140708923,
0.3109947741031647,
-0.23177872598171234,
-0.35542821884155273,
-0.9202438592910767,
-0.23532181978225708,
-0.2745687961578369,
0.20480650663375854,
0.7058600187301... |
func DecayNone() DecayFn {
return func(value DecayingValue) (_ int, rm bool) {
return value.Value, false
}
} | [
-0.010839613154530525,
-0.3266943097114563,
0.5757014751434326,
0.14636142551898956,
0.10752727091312408,
-0.8636295795440674,
0.9515565633773804,
-0.30523499846458435,
-0.015994345769286156,
-1.0682507753372192,
-0.9298047423362732,
-0.4386741816997528,
0.19907157123088837,
0.147191628813... |
func DecayFixed(minuend int) DecayFn {
return func(value DecayingValue) (_ int, rm bool) {
v := value.Value - minuend
return v, v <= 0
}
} | [
0.16979046165943146,
-0.6431301832199097,
0.3890683650970459,
0.22642292082309723,
-0.4729241132736206,
0.42271438241004944,
0.14546456933021545,
-0.3926386535167694,
-0.16634586453437805,
-0.842212438583374,
-1.2733186483383179,
-0.025382734835147858,
0.010194970294833183,
0.7948799133300... |
func DecayLinear(coef float64) DecayFn {
return func(value DecayingValue) (after int, rm bool) {
v := math.Floor(float64(value.Value) * coef)
return int(v), v <= 0
}
} | [
0.3877345323562622,
-0.8577597141265869,
0.47963908314704895,
-0.05066818743944168,
-1.172537088394165,
0.6624588966369629,
0.12051088362932205,
0.05357498675584793,
-0.30648910999298096,
-0.4731571674346924,
-0.7293517589569092,
-0.00721493735909462,
-0.07176931947469711,
0.29606658220291... |
func DecayExpireWhenInactive(after time.Duration) DecayFn {
return func(value DecayingValue) (_ int, rm bool) {
rm = time.Until(value.LastVisit) >= after
return 0, rm
}
} | [
-0.5620179176330566,
-1.1407842636108398,
0.41065412759780884,
0.09390269964933395,
-1.1319549083709717,
0.16115735471248627,
-0.22850431501865387,
0.20155666768550873,
-0.0492166243493557,
0.29145193099975586,
-0.6381677389144897,
-0.16611039638519287,
-0.3298454284667969,
-0.113594122231... |
func BumpSumUnbounded() BumpFn {
return func(value DecayingValue, delta int) (after int) {
return value.Value + delta
}
} | [
-0.3643321692943573,
-0.08179236203432083,
0.7863257527351379,
0.27367687225341797,
-0.6816950440406799,
0.8557191491127014,
0.5902596712112427,
-0.21748489141464233,
0.5561873912811279,
-1.1144875288009644,
-1.5564911365509033,
0.3166026473045349,
0.4218277633190155,
-0.19650809466838837,... |
func BumpSumBounded(min, max int) BumpFn {
return func(value DecayingValue, delta int) (after int) {
v := value.Value + delta
if v >= max {
return max
} else if v <= min {
return min
}
return v
}
} | [
-0.19163334369659424,
0.14244207739830017,
0.6480005383491516,
0.20681974291801453,
-0.5346724390983582,
0.7504141330718994,
0.010756254196166992,
-0.8076770901679993,
0.31457918882369995,
-1.38948655128479,
-1.0412514209747314,
0.5396183729171753,
0.5840303897857666,
-0.4225679934024811,
... |
func BumpOverwrite() BumpFn {
return func(value DecayingValue, delta int) (after int) {
return delta
}
} | [
-0.850938081741333,
0.006195567082613707,
0.5210704207420349,
0.12380912154912949,
-0.13091826438903809,
-0.16452869772911072,
1.2158833742141724,
0.20478244125843048,
-0.06688829511404037,
-0.7328053712844849,
-0.3048890233039856,
-1.2123905420303345,
0.1862737536430359,
-0.20601740479469... |
func Get(fixture string) ([]form.Form, error) {
file, err := os.Open(path + fixture + ".json")
if err != nil {
return nil, err
}
defer file.Close()
var fms []form.Form
err = json.NewDecoder(file).Decode(&fms)
if err != nil {
return nil, err
}
return fms, nil
} | [
-1.2557343244552612,
-1.1777161359786987,
0.6442969441413879,
-1.1885591745376587,
0.2198287546634674,
-0.8164031505584717,
-0.7342063188552856,
-0.3290688097476959,
-0.4114084839820862,
-0.3656403422355652,
-1.028639316558838,
0.5021511316299438,
0.1974603235721588,
0.22252824902534485,
... |
func Add(context interface{}, db *db.DB, fms []form.Form) error {
for _, fm := range fms {
if err := form.Upsert(context, db, &fm); err != nil {
return err
}
}
return nil
} | [
-1.6934868097305298,
-0.09739120304584503,
0.5058273077011108,
-0.026823021471500397,
1.2556262016296387,
0.06320711970329285,
-0.2570264935493469,
-0.3368823230266571,
0.11522387713193893,
-0.2993803322315216,
0.028003865852952003,
-0.639775276184082,
-0.8046883940696716,
1.36167681217193... |
func Remove(context interface{}, db *db.DB, pattern string) error {
f := func(c *mgo.Collection) error {
q := bson.M{"header.title": bson.RegEx{Pattern: "^" + pattern}}
_, err := c.RemoveAll(q)
return err
}
if err := db.ExecuteMGO(context, form.Collection, f); err != nil {
return err
}
return nil
} | [
-0.783858597278595,
-0.0035893917083740234,
0.6318650841712952,
-0.4772648513317108,
-0.46192774176597595,
0.1693171262741089,
-0.4272150993347168,
0.6931146383285522,
-0.136659637093544,
0.4726848602294922,
-0.42030420899391174,
-0.5864279866218567,
-1.1438488960266113,
-0.108383886516094... |
func DeleteModel(dbConn *sql.DB, modelId int) error {
// validate parameters
if modelId <= 0 {
return errors.New("invalid model id: " + strconv.Itoa(modelId))
}
// delete inside of transaction scope
trx, err := dbConn.Begin()
if err != nil {
return err
}
if err := doDeleteModel(trx, modelId); ... | [
-0.3434419631958008,
0.19212189316749573,
0.6337698101997375,
0.1721460074186325,
0.2362857311964035,
0.18557755649089813,
-0.27074283361434937,
-0.07412200421094894,
0.10869671404361725,
0.9745209217071533,
-0.18262754380702972,
-0.3144153952598572,
-0.3312590420246124,
0.3537011742591858... |
func doDeleteModel(trx *sql.Tx, modelId int) error {
// update model master record to prevent model use
smId := strconv.Itoa(modelId)
err := TrxUpdate(trx, "UPDATE model_dic SET model_name = 'deleted' WHERE model_id = "+smId)
if err != nil {
return err
}
// delete modeling tasks and task run history
... | [
0.03786036744713783,
0.010515336878597736,
1.1954302787780762,
-0.04959270730614662,
-0.3362272381782532,
0.6136979460716248,
0.8192992806434631,
-0.2032180279493332,
0.41969653964042664,
0.44887804985046387,
-0.35571232438087463,
-0.30536001920700073,
0.4900675117969513,
0.383358776569366... |
func selectBaseRunsOfSharedValues(trx *sql.Tx, q string) ([]runBaseItem, error) {
var rbArr []runBaseItem
err := TrxSelectRows(trx, q,
func(rows *sql.Rows) error {
var r runBaseItem
var n sql.NullInt64
if err := rows.Scan(&r.hId, &r.runId, &r.oldBase, &n); err != nil {
return err
}
if ... | [
-0.01154027134180069,
-0.3626546263694763,
0.7032885551452637,
1.0226385593414307,
0.5576664805412292,
-0.08397223800420761,
-0.07000706344842911,
-1.0735841989517212,
-0.1096825897693634,
0.4421895146369934,
-0.08471030741930008,
0.9496999382972717,
-0.8004354238510132,
1.3890937566757202... |
func selectBaseRunsOfSharedValuesNoTrx(dbConn *sql.DB, q string) ([]runBaseItem, error) {
var rbArr []runBaseItem
err := SelectRows(dbConn, q,
func(rows *sql.Rows) error {
var r runBaseItem
var n sql.NullInt64
if err := rows.Scan(&r.hId, &r.runId, &r.oldBase, &n); err != nil {
return err
}... | [
-0.2977244555950165,
-0.4160570800304413,
0.6822780966758728,
1.0363783836364746,
0.5055420398712158,
0.3126753568649292,
-0.5088541507720947,
-0.9662724137306213,
0.08782697468996048,
0.2217779904603958,
-0.15872633457183838,
0.5689471960067749,
-1.2308320999145508,
1.4880402088165283,
... |
func NewChrome() (update ChromeFunc, closeAll func()) {
var refresh func()
var lastheader dom.Element
var lastbody dom.Element
var lastfooter dom.Element
var lastresult dom.Element
var initialized bool
vRunFnMap := map[interface{}]dom.VRunFunc{}
vRunCloseMap := map[interface{}]func(){}
vRunUsedMap := map[inte... | [
-0.22409586608409882,
-0.5429551601409912,
0.8916320204734802,
0.2411748319864273,
-0.8207893371582031,
-0.5632528066635132,
0.634935736656189,
-0.12396981567144394,
0.3304861783981323,
-0.04194648936390877,
-0.30238258838653564,
0.46728333830833435,
-0.18428193032741547,
0.871874213218689... |
func NewFilter() (update FilterFunc, closeAll func()) {
var refresh func()
var lastselected *streams.S16
var lastresult dom.Element
var initialized bool
runFnMap := map[interface{}]dom.RunFunc{}
runCloseMap := map[interface{}]func(){}
runUsedMap := map[interface{}]bool{}
filterOptionFnMap := map[interface{}]f... | [
-0.12582330405712128,
-0.8769247531890869,
0.7687364220619202,
0.006179371383041143,
-0.9317287802696228,
-0.9396283030509949,
1.075095295906067,
-0.4404829442501068,
0.1626453995704651,
0.015658127143979073,
0.02980927750468254,
0.6526246666908264,
0.17316219210624695,
0.8846474885940552,... |
func newfilterOption() (update filterOptionFunc, closeAll func()) {
var refresh func()
var lastselected *streams.S16
var lastkey string
var lastresult dom.Element
var initialized bool
focusableFnMap := map[interface{}]dom.FocusableFunc{}
focusableCloseMap := map[interface{}]func(){}
focusableUsedMap := map[int... | [
-0.1479707956314087,
-0.8394587635993958,
0.7978750467300415,
0.19980700314044952,
-1.3226425647735596,
-0.6478483080863953,
1.1023551225662231,
-0.47893720865249634,
0.2188090682029724,
0.2728150486946106,
-0.1442277878522873,
0.1472141444683075,
0.19706261157989502,
0.801089346408844,
... |
func NewTextReset() (update TextResetFunc, closeAll func()) {
var refresh func()
var lasttext *streams.S16
var lastplaceholder string
var lastresult dom.Element
var initialized bool
textEditOFnMap := map[interface{}]dom.TextEditOFunc{}
textEditOCloseMap := map[interface{}]func(){}
textEditOUsedMap := map[inter... | [
-0.24579204618930817,
-0.6002945303916931,
0.7425471544265747,
-1.1178483963012695,
-0.961644172668457,
-1.2311638593673706,
0.6453872919082642,
-0.3909253180027008,
0.21180501580238342,
0.26979246735572815,
-0.08602146804332733,
-0.20305228233337402,
-0.48932933807373047,
-0.0821740105748... |
func (dl *DoublyLinkedList) push(value int32) {
node := Node{value, nil, nil}
if dl.head == nil {
dl.head = &node
dl.tail = &node
} else {
dl.tail.next = &node
node.previous = dl.tail
dl.tail = &node
}
dl.length++
} | [
-0.7397091388702393,
1.9802322387695312,
0.4782872200012207,
-1.5058845281600952,
-0.5254777073860168,
0.24605447053909302,
0.24326905608177185,
-0.23319846391677856,
0.612409234046936,
0.2504914104938507,
-0.7545557618141174,
0.9411092400550842,
0.12803566455841064,
1.2953871488571167,
... |
func (dl *DoublyLinkedList) traverse() {
current := dl.head
for current != nil {
fmt.Println(current.value)
current = current.next
}
} | [
-0.39830511808395386,
0.560888946056366,
0.558567464351654,
-0.3835970163345337,
0.3846527338027954,
-0.4302949011325836,
0.19885416328907013,
0.20676901936531067,
-0.05856071040034294,
-0.503747284412384,
0.20477627217769623,
0.9074172973632812,
-0.2801401913166046,
1.4130960702896118,
... |
func (dl *DoublyLinkedList) unshift(value int32) *DoublyLinkedList {
node := Node{value, nil, nil}
if dl.head == nil {
dl.head = &node
dl.tail = &node
} else {
node.next = dl.head
dl.head.previous = &node
dl.head = &node
}
dl.length++
return dl
} | [
-0.993482232093811,
1.5211457014083862,
0.6572644114494324,
-1.6083335876464844,
-1.0151054859161377,
0.0064084469340741634,
-0.24831624329090118,
-0.1326659470796585,
0.9252009987831116,
-0.46255195140838623,
-0.06767290830612183,
0.8231953382492065,
0.6967579126358032,
1.0523443222045898... |
func (dl *DoublyLinkedList) shift() *Node {
head := dl.head
if head == nil {
return nil
}
if dl.length == 1 {
dl.head = nil
dl.tail = nil
} else {
dl.head.next.previous = nil
dl.head = dl.head.next
head.next = nil
}
dl.length--
return head
} | [
-0.8603139519691467,
0.7460610270500183,
0.7982463240623474,
-0.2575090825557709,
-0.38195544481277466,
-0.06320435553789139,
-0.09311746805906296,
0.3713475167751312,
1.2632733583450317,
-0.5046015381813049,
-0.28415971994400024,
0.6795735955238342,
-1.0220519304275513,
0.3113380670547485... |
func (dl *DoublyLinkedList) get(position int32) *Node {
if dl.length == 0 || position >= dl.length {
return nil
}
var currentNode *Node
if position <= dl.length/2 {
currentNode = dl.head
for i := 0; int32(i) < dl.length; i++ {
if position == int32(i) {
return currentNode
}
currentNode = currentNo... | [
-0.6411385536193848,
0.6855896711349487,
0.9762575030326843,
-1.0998458862304688,
-0.138229638338089,
-0.4825604259967804,
-0.12918680906295776,
-0.3395152688026428,
0.1668245643377304,
0.03166346251964569,
-0.2735472619533539,
0.7428048849105835,
-0.7454883456230164,
-0.015232954174280167... |
func (dl *DoublyLinkedList) set(position int32, value int32) bool {
node := dl.get(position)
if node == nil {
return false
}
node.value = value
return true
} | [
-1.039175033569336,
0.7488975524902344,
0.5435733795166016,
-1.3836708068847656,
-0.27062278985977173,
0.4414389729499817,
-0.5776324272155762,
0.0016544186510145664,
-0.38309046626091003,
0.23322905600070953,
-0.590782105922699,
-0.9243470430374146,
-0.013838025741279125,
0.26451981067657... |
func (dl *DoublyLinkedList) insert(position int32, value int32) bool {
if dl.length == 0 || position >= dl.length {
return false
}
if position == 0 {
dl.unshift(value)
return true
} else if position == dl.length-1 {
dl.push(value)
return true
} else {
node := dl.get(position)
newNode := Node{value, n... | [
-0.963029682636261,
1.8862940073013306,
0.8945905566215515,
-1.202502727508545,
-0.692717432975769,
0.4929216206073761,
-0.15146735310554504,
0.5396834015846252,
-0.0878210961818695,
-0.1346377581357956,
-0.9366355538368225,
-0.7639806866645813,
-1.0340991020202637,
0.1899171769618988,
-... |
func (p PropertyPath) Get(v PropertyValue) (PropertyValue, bool) {
for _, key := range p {
switch {
case v.IsArray():
index, ok := key.(int)
if !ok || index < 0 || index >= len(v.ArrayValue()) {
return PropertyValue{}, false
}
v = v.ArrayValue()[index]
case v.IsObject():
k, ok := key.(string)
... | [
-0.5510619282722473,
-0.6956653594970703,
0.8061227202415466,
0.16930276155471802,
0.3878929913043976,
0.19529952108860016,
-0.4297521710395813,
0.48231908679008484,
-0.7224119305610657,
0.2420792281627655,
0.5597879886627197,
0.4522918462753296,
-0.09998521953821182,
-0.5547847151756287,
... |
func (p PropertyPath) Set(dest, v PropertyValue) bool {
if len(p) == 0 {
return false
}
dest, ok := p[:len(p)-1].Get(dest)
if !ok {
return false
}
key := p[len(p)-1]
switch {
case dest.IsArray():
index, ok := key.(int)
if !ok || index < 0 || index >= len(dest.ArrayValue()) {
return false
}
dest... | [
-1.0147323608398438,
-0.3650003969669342,
0.7081995010375977,
-0.0450686439871788,
-0.4941639006137848,
0.5483219623565674,
-0.9216311573982239,
0.204931378364563,
-0.6521078944206238,
0.5172321796417236,
0.24901369214057922,
0.14428849518299103,
-0.021772900596261024,
-0.5859014391899109,... |
func (p PropertyPath) Add(dest, v PropertyValue) (PropertyValue, bool) {
if len(p) == 0 {
return PropertyValue{}, false
}
// set sets the destination referred to by the last element of the path to the given value.
rv := dest
set := func(v PropertyValue) {
dest, rv = v, v
}
for _, key := range p {
switch k... | [
-0.8322904706001282,
-0.27763867378234863,
1.0589231252670288,
-0.09778544306755066,
-0.0865107998251915,
-0.11369059979915619,
-0.2673135995864868,
0.3662625551223755,
0.021662132814526558,
0.5546918511390686,
0.4958142340183258,
0.16425836086273193,
0.3630935251712799,
-0.669657886028289... |
func (p PropertyPath) Delete(dest PropertyValue) bool {
if len(p) == 0 {
return false
}
dest, ok := p[:len(p)-1].Get(dest)
if !ok {
return false
}
key := p[len(p)-1]
switch {
case dest.IsArray():
index, ok := key.(int)
if !ok || index < 0 || index >= len(dest.ArrayValue()) {
return false
}
dest... | [
-0.5929734706878662,
0.04412734508514404,
0.8743160963058472,
0.4893112778663635,
-0.3049202859401703,
0.5386313199996948,
-0.47535622119903564,
0.5139048099517822,
0.012038009241223335,
0.6501474380493164,
0.42923468351364136,
-0.5945672392845154,
-0.5152198076248169,
-0.6207756996154785,... |
func (sm *SpecMore) ServerURL(index uint) string {
if int(index)+1 > len(sm.Spec.Servers) {
return ""
}
server := sm.Spec.Servers[index]
return strings.TrimSpace(server.URL)
} | [
-1.0307238101959229,
0.09179504215717316,
0.32553812861442566,
0.049869854003190994,
0.06404934078454971,
0.37349453568458557,
0.2747608721256256,
-0.4273526668548584,
0.6209322810173035,
1.3840901851654053,
0.057785313576459885,
0.5503403544425964,
-0.8742183446884155,
0.42175325751304626... |
func (sm *SpecMore) ServerURLBasePath(index uint) (string, error) {
serverURL := sm.ServerURL(index)
if len(serverURL) == 0 {
return "", nil
}
serverURLParsed, err := urlutil.ParseURLTemplate(serverURL)
if err != nil {
return "", err
}
return serverURLParsed.Path, nil
} | [
0.03358418866991997,
-0.3992566466331482,
0.6868332624435425,
0.2820513844490051,
-0.20810271799564362,
-0.11103568226099014,
0.4506666362285614,
-0.6993816494941711,
0.7383948564529419,
0.8107302784919739,
-0.46572989225387573,
-0.10660908371210098,
-1.7051284313201904,
0.6438748240470886... |
func (sm *SpecMore) TagsMap(inclTop, inclOps bool) map[string]int {
tagsMap := map[string]int{}
if inclTop {
for _, tag := range sm.Spec.Tags {
tagName := strings.TrimSpace(tag.Name)
if len(tagName) > 0 {
if _, ok := tagsMap[tagName]; !ok {
tagsMap[tagName] = 0
}
tagsMap[tagName]++
}
}
... | [
-0.6449175477027893,
0.5554594993591309,
0.769008457660675,
-0.7167096734046936,
-0.44824492931365967,
-0.3694044053554535,
0.5830326676368713,
-0.13952837884426117,
0.30463650822639465,
0.0979207381606102,
0.28919318318367004,
-0.1866767555475235,
0.36927616596221924,
0.2163056880235672,
... |
func (*Group) Descriptor() ([]byte, []int) {
return edgelq_iam_proto_v1alpha_group_proto_rawDescGZIP(), []int{0}
} | [
-0.9614187479019165,
0.9544926881790161,
0.48210111260414124,
-0.05083129554986954,
-0.2522267699241638,
0.08436707407236099,
0.4994580149650574,
0.16360226273536682,
-0.7559670209884644,
-0.32793065905570984,
-0.22469961643218994,
0.3000757098197937,
-0.10802195966243744,
0.93120658397674... |
func (node *FloatNode) Accept(visitor Visitor) {
visitor.VisitFloatNode(node)
} | [
-0.3291000425815582,
0.9564624428749084,
0.4889875650405884,
-1.1828688383102417,
-0.46812015771865845,
1.3066822290420532,
1.7350441217422485,
0.1405762881040573,
-0.8144829273223877,
0.14104598760604858,
0.35053348541259766,
0.5139089822769165,
0.1714228391647339,
1.4872872829437256,
0... |
func (node *FloatNode) VisitChildren(visitor Visitor) {
} | [
-0.6334183812141418,
1.0072009563446045,
0.26804009079933167,
-0.7508583068847656,
-0.4248596131801605,
0.10680130869150162,
1.8413488864898682,
-0.8415953516960144,
-0.6901393532752991,
-0.40095382928848267,
-0.4616841673851013,
-0.26137223839759827,
0.02580334059894085,
0.867018580436706... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.