text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (app *application) Execute(script linkers.Script) (middle.Program, error) { langRef := script.Language() lang := langRef.Language() langApp := lang.Application() inVariable := langRef.Input() outVariable := langRef.Output() code := script.Code() codeValue, err := app.computableBuilder.Create().WithString(c...
[ 0.11621848493814468, -0.6293087005615234, 1.0108168125152588, 0.09899425506591797, -0.5628011226654053, 0.1382179856300354, -0.10554051399230957, -0.4633922278881073, -0.12253115326166153, 0.6002553701400757, 0.2177322953939438, 0.257863312959671, -0.8403344750404358, -0.21012377738952637,...
func IsValidISBN(s string) bool { counter, sum := 0, 0 for i := 0; i < len(s); i++ { switch s[i] { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': sum += int(s[i]-'0') * (10 - counter) counter++ case 'X': if i != len(s)-1 { return false } sum += 10 counter++ case '-': default: ...
[ 0.061363041400909424, 0.26114341616630554, 1.0035115480422974, 0.8253178596496582, 0.44863760471343994, 0.0890071764588356, -0.06125441938638687, 0.08914057165384293, 1.0867304801940918, -0.6127725839614868, -0.8435257077217102, 0.14646804332733154, -0.8346582055091858, 0.06710974127054214...
func applyColor(line, color string, re *regexp.Regexp) (string, bool) { if m := re.FindStringSubmatchIndex(line); m != nil { tagStart, tagEnd := m[4], m[5] line = bold + line[:tagStart] + color + line[tagStart:tagEnd] + reset + bold + line[tagEnd:] + reset return line, true } return line, false }
[ 0.3698083460330963, -0.5972863435745239, 0.9959666132926941, -0.3182755708694458, 0.17419996857643127, -0.05284840986132622, -0.8263924717903137, 0.7034503221511841, -0.7019094824790955, 0.001226847991347313, -0.2006552517414093, 0.24248474836349487, -0.16173265874385834, 0.100339956581592...
func (as1 Attributes) Union(as2 Attributes) (Attributes, error) { for k, v := range as2 { if _, ok := as1[k]; ok { return nil, fmt.Errorf("attribute %v already exists", k) } as1[k] = v } return as1, nil }
[ -1.3485394716262817, -0.4307307004928589, 0.49381276965141296, -0.28244519233703613, -0.2936328053474426, -0.4249840974807739, -0.8450663089752197, -0.09134949743747711, 0.205999493598938, 1.0390409231185913, -0.27814817428588867, 0.8791080117225647, 0.6519309282302856, -0.4341387450695038...
func ParseFile(path string) (*Config, error) { // Read file file, err := os.Open(path) if err != nil { return nil, errors.New("Unable to open config.json. Please check the file is present") } defer file.Close() config := Config{} decoder := json.NewDecoder(file) err = decoder.Decode(&config) if err != n...
[ 0.1473684459924698, -0.21379199624061584, 0.4770899713039398, -0.6478393077850342, -0.8509456515312195, 0.06673812121152878, -0.44353747367858887, 0.39187589287757874, -1.1373671293258667, 0.3555735945701599, -0.5054923892021179, -0.11169726401567459, 0.17310328781604767, 0.262606739997863...
func (r *promReporter) Flush() { }
[ 0.17631246149539948, 0.06444228440523148, 0.20592284202575684, -0.29659926891326904, 0.3628961443901062, 0.880440890789032, 0.8856658339500427, 0.1932424008846283, -0.15852192044258118, -0.9090481400489807, 0.81094890832901, 0.9066219329833984, -1.5947904586791992, 1.2211304903030396, -0...
func mergeRightTags(tagsLeft, tagsRight map[string]string) map[string]string { if tagsLeft == nil && tagsRight == nil { return nil } if len(tagsRight) == 0 { return tagsLeft } if len(tagsLeft) == 0 { return tagsRight } result := make(map[string]string, len(tagsLeft)+len(tagsRight)) for k, v := range tags...
[ 0.15615540742874146, 0.08631584793329239, 0.652054488658905, -0.5049334764480591, -0.23633940517902374, -0.46415257453918457, -1.9754503965377808, -0.8213064670562744, -0.5334897637367249, -0.27805429697036743, -0.881903350353241, -0.19722123444080353, -0.5068725943565369, 1.18087720870971...
func (wh *Webhooks) Run(ctx context.Context) { wh.workersNum.Inc() defer wh.workersNum.Dec() for { enqueuedItem, err := wh.queue.Pop(ctx) if err != nil { return } wh.queuedNum.Dec() tmpFile, err := wh.openStoredRequestFile(enqueuedItem) if err != nil { log.Println("failed to process", enqueuedItem....
[ -0.38983920216560364, -0.9740461111068726, 0.8291221261024475, -0.23722273111343384, 0.8653973340988159, 0.4303286671638489, 0.7959527373313904, 0.22781933844089508, -0.349273681640625, 0.20608282089233398, -0.28554612398147583, 0.16982616484165192, -0.5743451118469238, 0.7659047842025757,...
func (l Level) IsEnabled(threshold Level) bool { if threshold == Disabled { return false } return l >= threshold }
[ 0.07617858797311783, -0.16825006902217865, 0.40638622641563416, 0.5540722608566284, -0.9857833385467529, -0.08937786519527435, -0.8157776594161987, 0.9598991870880127, 0.02564500831067562, -0.07491131871938705, -1.0753902196884155, -0.6131008267402649, -0.9027850031852722, 0.19328519701957...
func LooksLikeAnInteger(inputStr string) (matched bool, value int) { matched = intRe.MatchString(inputStr) if matched { value, _ = strconv.Atoi(inputStr) return true, value } return }
[ -0.7573214173316956, -0.774045467376709, 0.49523091316223145, -1.1215070486068726, -1.3579809665679932, -0.25445306301116943, -0.48785391449928284, -0.2721908688545227, -0.5230394601821899, -0.25493037700653076, -0.6310628652572632, 0.26492011547088623, -0.5501018762588501, -0.199687898159...
func LooksLikeAFloat(inputStr string) (matched bool, value float64) { matched = floatRe.MatchString(inputStr) if matched { value, _ = strconv.ParseFloat(inputStr, 64) return true, value } return }
[ 0.44312772154808044, 0.05287397652864456, 0.4582403004169464, -0.30655646324157715, -1.2333253622055054, -0.3170417249202728, -0.311158150434494, -0.48122820258140564, -0.28121623396873474, -0.8927456736564636, 0.2377202957868576, -0.05797622725367546, 0.07817111909389496, 0.57224988937377...
func LooksLikeABool(inputStr string) (matched bool, value bool) { matched = boolRe.MatchString(inputStr) if matched { // strconv.ParseBool() is too willing for our needs, but we only let it loose // once our own Regexp condition is met. value, _ = strconv.ParseBool(strings.ToLower(inputStr)) return true, valu...
[ -0.09121845662593842, -0.5129294991493225, 0.6558626294136047, -0.39026105403900146, -0.7824831008911133, 0.02892891690135002, -0.1788986772298813, -0.19174957275390625, -0.5903156995773315, -0.07334399223327637, -0.3014851212501526, 0.30570992827415466, -0.4281923472881317, 0.052191410213...
func LooksLikeAKeyString(inputStr string) (matched bool) { return keyStringRe.MatchString(inputStr) }
[ -1.2932108640670776, 0.012198008596897125, 0.4302999675273895, -0.07176036387681961, -1.9997211694717407, 0.2228858321905136, -0.6872587203979492, -0.6956203579902649, 0.1141965240240097, 0.3627031743526459, -0.47646066546440125, 0.1445721983909607, -0.7050912380218506, -0.3009625673294067...
func (m *Mutator) Mutate(request *admissionv1.AdmissionRequest) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation if request.DryRun != nil && *request.DryRun { return result, nil } if request.Operation == admissionv1.Create { return m.MutateCreate(request) } if request.Operation == admi...
[ -1.9834645986557007, 0.23556651175022125, 0.7066144943237305, 0.7255565524101257, -0.20589333772659302, 0.2049720138311386, 0.5328353643417358, -0.6920934915542603, 0.9992415308952332, 0.6621451377868652, 0.21887511014938354, 0.5016728043556213, 0.35279253125190735, 0.9097151756286621, -...
func (m *Mutator) MutateCreate(request *admissionv1.AdmissionRequest) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation var patch []mutator.PatchOperation var err error awsCluster := &infrastructurev1alpha3.AWSCluster{} if _, _, err = mutator.Deserializer.Decode(request.Object.Raw, nil, awsC...
[ -0.8576405644416809, -0.03802645951509476, 0.76176518201828, 0.18217381834983826, 0.08987356722354889, 0.31192779541015625, 0.06982437521219254, -1.1317546367645264, 0.034198980778455734, 0.5187616348266602, 0.07715855538845062, 0.10903383791446686, 0.09445483982563019, 0.24981607496738434...
func (m *Mutator) MutateUpdate(request *admissionv1.AdmissionRequest) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation var patch []mutator.PatchOperation var err error awsCluster := &infrastructurev1alpha3.AWSCluster{} if _, _, err = mutator.Deserializer.Decode(request.Object.Raw, nil, awsC...
[ -1.0184108018875122, -0.45882871747016907, 0.7773447036743164, 0.034434761852025986, -0.10648705810308456, 0.09976426512002945, -0.0789894163608551, -0.7427791357040405, 0.6512839794158936, 0.6424691677093506, 0.33309727907180786, 0.6521058678627014, -0.11475435644388199, 0.102440588176250...
func (m *Mutator) MutatePodCIDR(awsCluster infrastructurev1alpha3.AWSCluster) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation //nolint:staticcheck // SA4022 the address of a variable cannot be nil if &awsCluster.Spec.Provider.Pods != nil { if awsCluster.Spec.Provider.Pods.CIDRBlock != "" { ...
[ -0.740313708782196, -0.12447170168161392, 0.7639887928962708, -0.3215804100036621, 0.8484100103378296, -0.23575226962566376, -0.04804307967424393, 0.0422796905040741, 0.2501227855682373, 0.7975446581840515, 0.13424506783485413, 0.035607434809207916, -0.8321239948272705, 0.4003154933452606,...
func (m *Mutator) MutateMasterPreHA(awsCluster infrastructurev1alpha3.AWSCluster) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation var availabilityZone string var instanceType string { //nolint:staticcheck // SA4022 the address of a variable cannot be nil if &awsCluster.Spec.Provider.Mas...
[ -0.7180730104446411, -0.37769436836242676, 0.7909879684448242, -0.05618928745388985, -0.18220272660255432, 0.42485499382019043, 0.5117447972297668, 1.0200213193893433, 0.746216893196106, 0.883659303188324, -0.46474429965019226, 0.37987056374549866, -0.8614535331726074, 0.8508588075637817, ...
func (m *Mutator) MutateCredential(awsCluster infrastructurev1alpha3.AWSCluster) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation if awsCluster.Spec.Provider.CredentialSecret.Name != "" && awsCluster.Spec.Provider.CredentialSecret.Namespace != "" { return result, nil } // If the cluster cre...
[ -0.546144425868988, -0.017351849004626274, 0.6842576265335083, 0.28037378191947937, 0.9920347929000854, 0.2765093445777893, -0.006625775247812271, -0.3265171945095062, 0.6402547359466553, 0.9085091352462769, -0.3867856562137604, 0.6751685738563538, -0.21069251000881195, 0.40862688422203064...
func (m *Mutator) MutateDescription(awsCluster infrastructurev1alpha3.AWSCluster) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation if awsCluster.Spec.Cluster.Description == "" { // If the cluster description is not set, we default here m.Log("level", "debug", "message", fmt.Sprintf("AWSClus...
[ -0.5240277647972107, 0.6815399527549744, 0.4410724639892578, -0.18752212822437286, 1.7039254903793335, -0.06427794694900513, -0.07683566957712173, -0.017114950343966484, 0.5919336676597595, 0.7444436550140381, 0.19956514239311218, 0.8281795978546143, -0.5113521814346313, 1.2688581943511963...
func (m *Mutator) MutateDomain(awsCluster infrastructurev1alpha3.AWSCluster) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation if awsCluster.Spec.Cluster.DNS.Domain == "" { // If the dns domain is not set, we default here m.Log("level", "debug", "message", fmt.Sprintf("AWSCluster %s DNS doma...
[ -1.4849578142166138, 0.930863618850708, 0.45553356409072876, -0.12167495489120483, 1.551235318183899, 0.025969766080379486, -0.05693378672003746, -0.26593732833862305, 0.8774842619895935, -0.12446680665016174, -0.4220331609249115, 0.9285749793052673, -0.1199219673871994, 0.7642076015472412...
func (m *Mutator) MutateRegion(awsCluster infrastructurev1alpha3.AWSCluster) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation if awsCluster.Spec.Provider.Region == "" { // If the region is not set, we default here m.Log("level", "debug", "message", fmt.Sprintf("AWSCluster %s region is not s...
[ -1.110716462135315, 0.7063347697257996, 0.33636757731437683, -0.39488568902015686, 1.0932179689407349, 0.13477498292922974, 0.39687883853912354, -0.3368139863014221, 0.918262243270874, 0.9352635741233826, 0.07621919363737106, 0.41501954197883606, -0.5387737154960632, 0.9606754779815674, ...
func (m *Mutator) MutateAnnotationNodeTerminateUnhealthy(awsCluster infrastructurev1alpha3.AWSCluster) ([]mutator.PatchOperation, error) { var result []mutator.PatchOperation release, err := semver.New(key.Release(&awsCluster)) if err != nil { return nil, microerror.Maskf(notAllowedError, fmt.Sprintf("AWSCluster ...
[ -0.97589111328125, -0.32370322942733765, 0.6222732067108154, -0.5862399339675903, 0.11438952386379242, 0.20185695588588715, -0.5964710712432861, -0.10707179456949234, -0.0031405561603605747, 1.0382955074310303, 0.09594983607530594, 0.2890368700027466, -0.14586219191551208, -0.1555879712104...
func TestPartitioningDataDirectory(t *testing.T) { table := partitionedTable(FlavorUnknown) table.CreateStatement = strings.Replace(table.CreateStatement, "LESS THAN (123)", "LESS THAN (123) DATA DIRECTORY = '/some/weird/dir'", 1) table.CreateStatement = strings.Replace(table.CreateStatement, "LESS THAN MAXVALUE", "...
[ -0.03688277304172516, 0.3739650845527649, 0.5006762146949768, -0.030116137117147446, 0.11810795962810516, -0.5083937048912048, 0.5912067294120789, 0.6921724081039429, 0.2555888593196869, -0.9534220099449158, -0.5278580784797668, 0.04819931462407112, 0.07954226434230804, 0.01513270940631628...
func partitionedTable(flavor Flavor) Table { t := unpartitionedTable(flavor) expression := "customer_id" if flavor.Min(FlavorMySQL80) || flavor.Min(FlavorMariaDB102) { expression = EscapeIdentifier(expression) } t.Partitioning = &TablePartitioning{ Method: "RANGE", Expression: expression, Partitions: [...
[ 0.47243767976760864, -0.07820303738117218, 0.5972462296485901, 0.37343883514404297, -0.904708743095398, -0.5749603509902954, 0.4199199080467224, 0.4467114806175232, -0.371352881193161, -0.1214371770620346, -0.02779144048690796, -0.07854339480400085, 0.0014514749636873603, -0.05860567092895...
func RandString(n int) string { b := make([]rune, n) for i := range b { b[i] = letters[rand.Intn(len(letters))] } return string(b) }
[ -0.8572814464569092, 1.0036468505859375, 0.05085961893200874, -1.3742082118988037, -0.20424632728099823, 0.47676101326942444, 0.052825529128313065, -1.2560713291168213, 0.5956835150718689, 0.5377483367919922, -0.07156624644994736, -0.10337646305561066, -0.755632221698761, -0.52844530344009...
func GenToken(id uint) string { jwt_token := jwt.New(jwt.GetSigningMethod("HS256")) // Set some claims jwt_token.Claims = jwt.MapClaims{ "id": id, "exp": time.Now().Add(time.Hour * 24).Unix(), } // Sign and get the complete encoded token as a string token, _ := jwt_token.SignedString([]byte(NBSecretPassword)...
[ -0.2585269510746002, -0.12851957976818085, 0.6883351802825928, 0.4235031008720398, -0.727435290813446, 0.28821685910224915, -0.6373991966247559, -0.010565017350018024, 0.5001356601715088, -0.48373058438301086, -1.523206114768982, 0.36111021041870117, 0.4947918653488159, 0.19397085905075073...
func (c CurationRemark) OlderThanLimit(cutOff time.Time) bool { return c.LastCompletionTimestamp.Before(cutOff) }
[ -0.15668557584285736, -0.2800397276878357, 0.5211518406867981, -0.9298768043518066, -0.3071132302284241, 0.16577903926372528, -0.4039979875087738, -0.22163115441799164, 0.25704437494277954, 0.4621889293193817, -0.3301825225353241, -0.26918885111808777, -0.07649385929107666, -0.078816913068...
func NewCurationRemarkFromDTO(d *dto.CurationValue) CurationRemark { return CurationRemark{ LastCompletionTimestamp: time.Unix(*d.LastCompletionTimestamp, 0), } }
[ -0.12160498648881912, -0.5013172626495361, 0.3607702851295471, -0.4799205958843231, -0.6013787388801575, 0.0431399829685688, 0.4331907331943512, -0.23336370289325714, 0.6961553692817688, -0.10714252293109894, 0.04073499143123627, 0.39109352231025696, 0.599314272403717, -0.0459752231836319,...
func NewKassa() *Kassa { return &Kassa{} }
[ -0.2330670952796936, -1.0284801721572876, -0.0016116499900817871, 1.1199233531951904, -1.6815615892410278, -0.9590914845466614, -0.836979329586029, -0.6714296340942383, -0.051884543150663376, -0.7947600483894348, 0.11871414631605148, 0.6406317353248596, 0.15185700356960297, 0.7183210253715...
func (c *Kassa) SetShopID(id string) *Kassa { c.ShopID = id return c }
[ -0.10886387526988983, -0.4695790112018585, 0.10590875893831253, 1.0272161960601807, -1.2685153484344482, 1.3588213920593262, -0.0037457647267729044, 0.3414303958415985, 1.7635893821716309, -0.0513581857085228, -0.41745641827583313, 0.9730669260025024, 0.8757913112640381, 0.8657439351081848...
func (c *Kassa) SetSecretKey(key string) *Kassa { c.SecretKey = key return c }
[ 0.6491748690605164, 0.2640938460826874, 0.0912749171257019, 1.2195829153060913, 0.41124415397644043, 0.10987510532140732, -0.025516018271446228, 0.7074262499809265, 0.3971228003501892, -0.29280129075050354, -1.0730925798416138, 0.8825488686561584, 0.39857059717178345, 0.9497525691986084, ...
func NewPayment() *Payment { return &Payment{} }
[ 0.20110824704170227, -0.709041953086853, -0.15443715453147888, 0.5093689560890198, -1.3413950204849243, -0.5767523646354675, 0.2064589411020279, -0.41112378239631653, 0.7181168794631958, -0.3198680281639099, 0.6187151670455933, 0.16929827630519867, -0.284891277551651, 0.28261426091194153, ...
func (p *Payment) SetKassa(kassa *Kassa) *Payment { p.Kassa = kassa return p }
[ -0.14394511282444, -0.022658444941043854, 0.09533858299255371, 0.8146272301673889, -1.1213738918304443, -0.7642138004302979, -0.8623281121253967, 0.19394360482692719, 0.6659757494926453, -0.433397114276886, 0.2725113034248352, 0.4911777377128601, 0.41747528314590454, 0.9834810495376587, ...
func (p *Payment) SetIdempotenceKey(key string) *Payment { p.IdempotenceKey = key return p }
[ -1.120363712310791, -0.23906444013118744, 0.1342562437057495, -0.20351767539978027, -0.02020137757062912, 0.5477938055992126, 0.5335218906402588, 0.9224677681922913, 0.5786039233207703, 0.7810424566268921, -0.8023141026496887, 0.065663181245327, -1.1363835334777832, 0.2929235100746155, -...
func (p *Payment) SetAmount(value decimal.Decimal, moneyType string) *Payment { p.Amount = Amount{ Value: value, Currency: moneyType, } return p }
[ -0.2644331753253937, -0.25052696466445923, 0.21697039902210236, 0.2733648717403412, -0.8422412276268005, 0.2898070216178894, -0.42129167914390564, -0.163527250289917, 0.6835837960243225, 0.4831056296825409, 0.2936129868030548, 0.07367095351219177, 0.27160876989364624, 0.5699700713157654, ...
func (p *Payment) SetCapture(cap bool) *Payment { p.Capture = cap return p }
[ -0.07691873610019684, 0.3776286244392395, 0.3103742003440857, 1.4685900211334229, -0.204619899392128, 0.32500728964805603, -0.33310455083847046, 0.0888369232416153, 0.8616484999656677, 0.24899783730506897, 0.3977510631084442, -0.3221050202846527, 0.0023193934466689825, 0.6807845234870911, ...
func (p *Payment) SetConfirmation(conf Confirmation) *Payment { p.Confirmation = &conf return p }
[ 0.5663089156150818, 0.3553544580936432, -0.009182898327708244, 1.4653061628341675, -0.047867272049188614, -0.19401274621486664, 0.26874473690986633, 0.516637921333313, -0.2028578519821167, 0.3294934332370758, -0.7854064106941223, -0.6632255911827087, 0.4075688421726227, 1.058978796005249, ...
func (p *Payment) SetDescription(desc string) *Payment { p.Description = desc return p }
[ 0.8142362833023071, 0.5830228328704834, -0.03465159982442856, 0.5483124256134033, 0.03334382176399231, 0.6922066807746887, -0.12797217071056366, 0.6285032629966736, 0.8385956287384033, 0.22132568061351776, 0.43316546082496643, 0.05834253504872322, -0.27268850803375244, 0.5841984152793884, ...
func (p *Payment) SetSavePaymentMethod(save bool) *Payment { p.SavePaymentMethod = save return p }
[ -0.4410531520843506, 0.18610447645187378, 0.19537043571472168, 0.35488346219062805, -0.3967494070529938, -0.18641629815101624, 0.6427577137947083, -0.19705505669116974, -0.2404836267232895, 0.5920124650001526, -0.042100947350263596, -0.9539695978164673, -0.5374298691749573, 0.5879591107368...
func (p *Payment) SetPaymentMethodID(id string) *Payment { p.PaymentMethodID = id return p }
[ 0.10470546036958694, -0.4705449938774109, -0.2782590687274933, 0.003397455206140876, -0.9370589256286621, 0.6161637306213379, -0.3320707380771637, -0.3161565065383911, 0.337503582239151, 0.38651442527770996, 0.7698033452033997, 0.3046230375766754, -0.11903776973485947, 0.4928523898124695, ...
func (p *Payment) SetPaymentMethodData(md MethodData) *Payment { p.PaymentMethodData = &md return p }
[ -0.3401147127151489, 0.3901722729206085, -0.17395198345184326, 0.3207687735557556, -1.1263086795806885, 0.8093498945236206, -0.614903450012207, -0.2993587851524353, 0.2929837703704834, -0.501706063747406, 0.5594730377197266, -0.17565631866455078, 0.19209812581539154, 0.841892421245575, -...
func (p *Payment) Do() (*YooKassaResponse, error) { payloadBytes, err := json.Marshal(p) if err != nil { return nil, err } body := bytes.NewReader(payloadBytes) req, err := http.NewRequest("POST", consts.Endpoint+"payments", body) if err != nil { return nil, err } req.SetBasicAuth(p.Kassa.ShopID, p.Kassa.S...
[ -0.8763135671615601, -0.14464282989501953, 1.0585103034973145, -0.48373183608055115, -0.4959738552570343, -0.8888117074966431, -0.5174190998077393, -0.8479206562042236, 0.48203811049461365, 0.1977137178182602, -0.1269982010126114, 0.7799503207206726, 0.08330374956130981, 0.7400560975074768...
func BuildImageName(format BuildFormat, image string, version string, branch string) string { imageVal := image if strings.Contains(image, ":") == false { imageVal += ":latest" } switch format { case SHAFormat: return imageVal + "-" + version case BranchAndSHAFormat: return imageVal + "-" + branch + "-" + ...
[ -0.6314784288406372, -1.182083010673523, 0.5038582682609558, -0.5000408291816711, -0.22145622968673706, -0.09862267225980759, -1.5918025970458984, 0.9610483050346375, -0.31127825379371643, 0.7480549812316895, 0.5392849445343018, 0.4460674822330475, 0.43981486558914185, 0.6847622394561768, ...
func (quad *Quad) Draw() { gl.BindVertexArray(quad.vao) gl.DrawArrays(gl.TRIANGLES, 0, 6) }
[ 0.627822756767273, 0.35729503631591797, 0.32438114285469055, -0.3938024640083313, 0.41095733642578125, 1.1058956384658813, 0.5590275526046753, -0.6884647011756897, 0.5393363833427429, -0.4528905153274536, -0.5912603139877319, 0.5781108736991882, 0.31238919496536255, 0.17698988318443298, ...
func Sum(numbers []int) int { sum := 0 // range iterates over an array, returning index and value // we are ignoring index with the blank identifier for _, number := range numbers { sum += number } return sum }
[ -1.1170865297317505, -0.6205253005027771, 0.3357541561126709, 0.13511145114898682, 0.059247877448797226, 0.8600001931190491, 0.9002456665039062, 0.14349086582660675, 0.8606004118919373, 0.23025870323181152, -1.0140482187271118, 0.11656744033098221, -0.20256204903125763, 0.13042081892490387...
func SwapSliceByte(srcByteSlice, targetType interface{}) (interface{}, error) { buffer, ok := srcByteSlice.([]byte) if !ok { return nil, errors.New("failed to cast source data to a byte slice") } structValue := reflect.ValueOf(targetType) structType := structValue.Type() structSize := structType.Size() // str...
[ -0.8251228928565979, -0.1876465231180191, 0.6682350039482117, -0.736566960811615, -0.06026621162891388, -0.11151371151208878, 0.0324595607817173, 0.1141275092959404, 0.5313682556152344, 0.8544573187828064, -0.208317369222641, 1.2001197338104248, -0.8966264128684998, 0.023479314520955086, ...
func SwapSliceData(srcSlice, targetType interface{}) interface{} { src := reflect.ValueOf(srcSlice) srcLen := src.Len() srcElementType := src.Type().Elem() // .Size() considers the array values. For example, if srcElementType=[16]rune, Size() returns 64. srcElementTypeSize := srcElementType.Size() // fmt.Printf("...
[ -0.7064263820648193, -0.4005260765552521, 0.7700832486152649, -1.080375075340271, -0.21809260547161102, -0.041400592774152756, -0.7180056571960449, -0.2633298337459564, 0.2407306432723999, 0.8062694072723389, 0.19581186771392822, 1.584674596786499, -0.483664333820343, 0.48402243852615356, ...
func CastToByteSlice(sliceData interface{}) []byte { sliceValue := reflect.ValueOf(sliceData) sliceLen := sliceValue.Len() elemType := sliceValue.Type().Elem() elemSize := elemType.Size() bufLen := sliceLen * int(elemSize) buffer := make([]byte, 0) bufHeader := (*reflect.SliceHeader)(unsafe.Pointer(&buffer)) b...
[ -0.519256591796875, -0.45509541034698486, 0.9662419557571411, -0.6525055766105652, -0.26427915692329407, 0.061468180269002914, -0.013129087164998055, -0.9119877219200134, 0.7984159588813782, 0.17721174657344818, -0.3838379383087158, 1.2572075128555298, -0.2542738616466522, 0.62998247146606...
func DataToByteSlice(srcData interface{}) []byte { value := reflect.ValueOf(srcData) size := int(value.Type().Size()) buffer := make([]byte, size) (*reflect.SliceHeader)(unsafe.Pointer(&buffer)).Data = uintptr((*MValue)(unsafe.Pointer(&value)).Ptr) return buffer }
[ -0.43822014331817627, -0.07258148491382599, 0.6630762815475464, -0.907431423664093, -0.21190856397151947, -0.20275600254535675, -0.3861839771270752, -1.0900213718414307, 0.3212994933128357, 0.008086420595645905, -0.697419285774231, 0.8957123160362244, -0.2555571496486664, 0.575927555561065...
func AnalyticInboxes(formats []string, analyticID string) []string { seen := make(map[string]bool) for _, f := range formats { seen[AnalyticInbox(f, analyticID)] = true } var names []string for name := range seen { names = append(names, name) } return names }
[ -0.8376067280769348, -0.8133744597434998, 0.4920389652252197, 0.14131677150726318, 0.13818857073783875, -0.015807436779141426, -0.11948826909065247, -1.180266261100769, 0.1503743827342987, 0.5852259993553162, 0.1020243838429451, 0.20802585780620575, 0.5878903865814209, 0.7953015565872192, ...
func AnalyticInbox(format, analyticID string) string { return fmt.Sprintf(format, url.PathEscape(analyticID)) }
[ -0.013965429738163948, -0.9538953304290771, 0.24608203768730164, -0.08540742099285126, -0.28840765357017517, -0.1969781070947647, -0.6761518120765686, -0.512667179107666, 0.651248037815094, -0.497808575630188, 0.7540589570999146, 0.7507166266441345, 1.0232771635055542, -0.2424970120191574,...
func reflectResources(v reflect.Value, handler ResourceHandler, seenPtrs map[uintptr]bool) error { resourceType := reflect.TypeOf(pb.Resource{}) switch v.Kind() { case reflect.Interface: if v.IsNil() { return nil } return errors.Wrap(reflectResources(v.Elem(), handler, seenPtrs), "reflect interface") case...
[ -0.09657458961009979, -0.09897685796022415, 0.6811820864677429, -0.3900623023509979, -0.5428993105888367, -0.12290891259908676, 0.9184625148773193, -0.38246992230415344, -0.048155151307582855, 0.06389955431222916, -0.3256990909576416, -0.385172039270401, -0.3869456946849823, 0.930803298950...
func FindDetectionRequestResources(det *pb.Detection) ([]*pb.Resource, error) { return findResourcesImpl(det.GetRequest()) }
[ -0.878008246421814, -0.5777482986450195, 0.17065632343292236, 1.2061636447906494, 0.15759184956550598, -0.0425066277384758, 0.10216517746448517, -0.6335801482200623, -0.012112697586417198, -0.42918848991394043, 0.8825740814208984, -0.9995295405387878, -0.04398691654205322, 1.77213835716247...
func FindDetectionResources(det *pb.Detection) ([]*pb.Resource, error) { return findResourcesImpl(det) }
[ -0.12414892762899399, -0.0021608173847198486, 0.10598673671483994, 1.5919914245605469, -0.17477376759052277, -0.3111417591571808, 0.7643608450889587, -0.19755737483501434, -0.028209758922457695, 0.14125923812389374, -0.07940097153186798, -1.3543310165405273, -0.3458695113658905, 2.16454672...
func findResourcesImpl(val interface{}) ([]*pb.Resource, error) { var resources []*pb.Resource handler := func(r *pb.Resource) { resources = append(resources, r) } seen := make(map[uintptr]bool) if err := reflectResources(reflect.ValueOf(val), handler, seen); err != nil { return nil, errors.Wrap(err, "search f...
[ -0.6526182293891907, 0.08193057030439377, 0.44165685772895813, -0.00881037674844265, -0.3539123833179474, 0.03256336972117424, 0.9242637753486633, -0.5382292866706848, 0.15352606773376465, 0.22711516916751862, -0.05358821898698807, -0.9955113530158997, -0.855053722858429, 1.577203750610351...
func FusionOutDir(fus *pb.Fusion) (string, error) { switch fus.GetRequest().(type) { case *pb.Fusion_ImgManipReq: return fus.GetImgManipReq().GetOutDir(), nil case *pb.Fusion_VidManipReq: return fus.GetVidManipReq().GetOutDir(), nil case *pb.Fusion_ImgSpliceReq: return fus.GetImgSpliceReq().GetOutDir(), nil ...
[ -1.741649866104126, -0.24964745342731476, 0.6398231983184814, 0.806158185005188, -0.9049234390258789, -0.748376727104187, 0.12427430599927902, 0.0713791474699974, 0.15419234335422516, -0.9885854721069336, 0.8175856471061707, 0.19325010478496552, 0.11186912655830383, 1.1672760248184204, 0...
func FusionFromDetections(ds []*pb.AnnotatedDetection, outDir string) (fusion *pb.Fusion, err error) { if len(ds) == 0 { return nil, errors.New("no detections given for fusion") } fusion = new(pb.Fusion) firstDet := ds[0].GetDetection() switch val := firstDet.GetRequest().(type) { case *pb.Detection_ImgManipR...
[ -0.6910557746887207, 0.00036372392787598073, 0.5455965399742126, 0.9805966019630432, -0.044325970113277435, -0.9862080812454224, -0.2576340138912201, 0.3004536032676697, 0.9863278269767761, -0.5644359588623047, 0.21334224939346313, -0.11511701345443726, 0.5984340310096741, 1.57645106315612...
func OutDir(det *pb.Detection) (string, error) { switch det.GetRequest().(type) { case *pb.Detection_ImgManipReq: return det.GetImgManipReq().GetOutDir(), nil case *pb.Detection_VidManipReq: return det.GetVidManipReq().GetOutDir(), nil case *pb.Detection_ImgSpliceReq: return det.GetImgSpliceReq().GetOutDir(),...
[ -1.100812315940857, -0.6949365735054016, 0.7636067867279053, 1.0509305000305176, -0.649716317653656, 0.009172121994197369, 0.6726725697517395, -0.4882691502571106, 0.08775261044502258, -0.7427659034729004, 1.0145410299301147, 0.07971768826246262, 0.1453390121459961, 1.3766361474990845, 0...
func SetOutDir(det *pb.Detection, dir string) error { switch det.GetRequest().(type) { case *pb.Detection_ImgManipReq: det.GetImgManipReq().OutDir = dir case *pb.Detection_VidManipReq: det.GetVidManipReq().OutDir = dir case *pb.Detection_ImgSpliceReq: det.GetImgSpliceReq().OutDir = dir case *pb.Detection_Img...
[ -1.3037118911743164, -0.5357090830802917, 0.7164626717567444, 0.9911225438117981, -0.4844445288181305, 0.338741272687912, 0.3290642499923706, -0.08872649818658829, -0.032866910099983215, -0.7247359156608582, 0.45337533950805664, 0.6269227862358093, 0.06301682442426682, 1.5442837476730347, ...
func UnmarshalDetectionJSON(s string) (*pb.Detection, error) { // Unmarshal to a nested map, find missing response element and set it to empty instead of null. val := make(map[string]interface{}) if err := json.Unmarshal([]byte(s), &val); err != nil { return nil, errors.Wrap(err, "unmarshal detection JSON (unmarsh...
[ -0.15524670481681824, -1.094082236289978, 0.7934973239898682, 0.17663560807704926, -0.9603888988494873, -0.25275999307632446, 0.6717093586921692, 0.14074602723121643, 0.7736557722091675, -0.19230641424655914, -0.48166537284851074, -0.37795308232307434, -0.059066999703645706, 0.530396580696...
func AnalyticIDsFromFusion(fusion *pb.Fusion) ([]string, error) { var analyticIDs []string switch val := fusion.GetRequest().(type) { case *pb.Fusion_ImgManipReq: fReq := fusion.GetImgManipReq() for _, imgManip := range fReq.ImgManip { analyticIDs = append(analyticIDs, imgManip.Id) } case *pb.Fusion_VidMan...
[ -0.9409277439117432, -0.6072024703025818, 0.3776533603668213, 0.9345019459724426, 0.32377955317497253, -0.37846675515174866, -0.5896105170249939, -0.5174401998519897, 0.13730734586715698, 0.10158950835466385, 1.1256771087646484, 0.6128193140029907, 0.602527916431427, 0.7024259567260742, ...
func buildPatternDict(root *Node) (map[byte]ByteSeq, error) { leafNodes := make([]*Node, 0) root.InOrderTraversal(func(n *Node) { if n.IsLeaf() { leafNodes = append(leafNodes, n) } }) dict := make(map[byte]ByteSeq) for i := 0; i < len(leafNodes); i++ { // traverse to root var byteSeq ByteSeq n := le...
[ -0.6489981412887573, -0.1565442532300949, 0.9844253063201904, -0.2779392898082733, -1.0681719779968262, -0.3996889293193817, 0.7168967127799988, 0.27336764335632324, -0.45424774289131165, 0.1344045102596283, -0.9342429041862488, 0.2011958211660385, -0.10014677047729492, 1.0593003034591675,...
func canonicalCodebook(codebook map[byte]ByteSeq) (map[byte]ByteSeq, error) { ps := make(symbolByteSeqPairLenNameSort, 0) for k, v := range codebook { ps = append(ps, symbolByteSeqPair{k, v}) } sort.Stable(ps) newCodeBook := make(map[byte]ByteSeq) patLen := uint(0) pat := uint64(0) for i := 0; i < len(ps); i...
[ -0.42101675271987915, -0.6541137099266052, 0.9243608117103577, 0.0632389634847641, -0.8836696743965149, 0.43120962381362915, 0.708858847618103, 0.18902075290679932, -0.1767951101064682, 0.505617618560791, -0.7268509268760681, -0.17931391298770905, -0.1343323141336441, 0.5420791506767273, ...
func newPowGen(e float64) func() float64 { var i float64 return func() (r float64) { r = math.Pow(i, e) i++ return } }
[ -0.4693323075771332, 0.8250635862350464, 0.6113027334213257, -0.22147810459136963, -0.34567275643348694, 0.0638115331530571, 0.051530204713344574, 0.9824166893959045, -1.2545750141143799, -0.09594886749982834, -1.0198371410369873, -0.6945338845252991, 0.47088372707366943, 0.532204806804657...
func newMonoIncA_NotMonoIncB_Gen(af, bf func() float64) func() float64 { a, b := af(), bf() return func() (r float64) { for { if a < b { r = a a = af() break } if b == a { a = af() } b = bf() } return } }
[ -0.24779948592185974, -0.036718130111694336, 0.6145524382591248, 0.6362437009811401, 0.4245072305202484, 0.43418508768081665, 0.38317859172821045, -0.5473658442497253, -1.002347707748413, 0.19068056344985962, -0.06286049634218216, -0.41169291734695435, -0.6738101243972778, 0.70129609107971...
func (c *Client) Group(ctx context.Context, id string) (Group, error) { result := Group{} err := c.sendRequest( ctx, "GET", fmt.Sprintf("%s%s/%s", c.getRootURL(), groupSlug, id), nil, &result) return result, err }
[ -0.9461598992347717, 0.6988938450813293, 0.17924287915229797, 0.02488129585981369, -0.15323132276535034, -0.6405219435691833, -0.2708880305290222, -1.1002496480941772, -0.33254125714302063, -0.9668078422546387, -0.2699543535709381, 1.7287040948867798, -0.7781742215156555, 0.192207098007202...
func (c *Client) CreateGroup(ctx context.Context, group Group) (Group, error) { result := Group{} body, err := json.Marshal(group) if err != nil { return Group{}, err } err = c.sendRequest( ctx, "POST", fmt.Sprintf("%s%s", c.getRootURL(), groupSlug), bytes.NewReader(body), &result) if err != nil { r...
[ -0.5272454619407654, 0.6728261709213257, 0.20463651418685913, -0.15037593245506287, 0.24480625987052917, -0.4974045753479004, -0.41666650772094727, -0.959258496761322, -0.24154998362064362, -0.397677481174469, -0.3155826926231384, 0.6950766444206238, -1.2250207662582397, 0.5655339360237122...
func (c *Client) UpdateGroup(ctx context.Context, group Group) (Group, error) { result := Group{} body, err := json.Marshal(group) if err != nil { return Group{}, err } err = c.sendRequest( ctx, "PUT", fmt.Sprintf("%s%s/%s", c.getRootURL(), groupSlug, group.ID), bytes.NewReader(body), &result) if err ...
[ -1.3941086530685425, 0.31790047883987427, -0.015754472464323044, -0.169327050447464, -0.5810405611991882, -0.6262686848640442, -0.08434726297855377, -0.7994378209114075, -0.31708699464797974, -0.0009784550638869405, -0.3812365233898163, 1.0583652257919312, -1.1989110708236694, 0.2253874987...
func (c *Client) DeleteGroup(ctx context.Context, groupID string) error { return c.sendRequest( ctx, "DELETE", fmt.Sprintf("%s%s/%s", c.getRootURL(), groupSlug, groupID), nil, nil) }
[ -0.4809666872024536, 0.7319788336753845, -0.07144638150930405, -0.3894011080265045, 0.45436742901802063, -0.43019235134124756, 0.08693739026784897, -0.6865173578262329, 0.08556555956602097, -0.7368972301483154, 0.16687831282615662, 1.5854564905166626, -0.9072238802909851, 1.191691398620605...
func cleanup(indexDir string, repos []string, now time.Time) { start := time.Now() trashDir := filepath.Join(indexDir, ".trash") if err := os.MkdirAll(trashDir, 0755); err != nil { log.Printf("failed to create trash dir: %v", err) } trash := getShards(trashDir) index := getShards(indexDir) tombstonesEnabled ...
[ 0.5126024484634399, -0.0413704551756382, 0.8060968518257141, -0.7980597615242004, 0.4409084916114807, -0.41542118787765503, 0.9816300272941589, -0.18370798230171204, 1.09775710105896, -0.17276786267757416, -0.035064343363046646, 0.0033669862896203995, 0.00046304817078635097, -0.41652655601...
func Unpad(buf []byte, data interface{}) []byte { return unpad(buf, data, 0) }
[ 0.2603117823600769, 0.23195749521255493, 0.48775050044059753, -0.4302704930305481, -0.21026551723480225, -0.11159703135490417, -0.32210057973861694, 0.2983129620552063, -0.05082082375884056, -0.6931815147399902, -0.46590569615364075, 0.08659809082746506, -0.3585042953491211, -0.06454006582...
func (self *Rain) Id() string { return fmt.Sprintf("%02x:%02x", self.id>>8, self.id&0xff) }
[ -0.06454840302467346, -0.7578395009040833, 0.6331358551979065, -0.3499325215816498, 0.26676660776138306, 2.0267772674560547, -0.9965543150901794, -0.49041426181793213, 1.2095168828964233, -0.4263618290424347, -0.8427248001098633, -0.3818499445915222, -0.9208645224571228, -0.366415411233902...
func (self *Rain) Type() string { return rainTypes[self.typeId] }
[ -0.6766694784164429, 0.1022355780005455, 0.2457815706729889, -0.2604069113731384, 0.30561500787734985, 0.9814337491989136, -0.01116217765957117, -1.4398316144943237, 0.6566091179847717, -0.08311886340379715, 0.1405027061700821, 0.7395979166030884, -0.7351115942001343, 0.21722841262817383, ...
func (s *ClusterListener) Create(inctx context.Context, in *protocol.ClusterCreateRequest) (_ *protocol.ClusterResponse, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot create cluster") if s == nil { return nil, fail.InvalidInstanceError() } if in =...
[ -0.41016483306884766, 0.28443804383277893, 0.6872559189796448, 0.35343775153160095, -0.34125596284866333, 0.49533310532569885, 0.4258624315261841, -0.9514849781990051, -0.29875174164772034, 0.46449872851371765, 0.26757651567459106, -0.05352238193154335, -0.6555412411689758, -0.498079001903...
func (s *ClusterListener) State(inctx context.Context, in *protocol.Reference) (ht *protocol.ClusterStateResponse, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot get cluster status") if s == nil { return nil, fail.InvalidInstanceError() } if in == ...
[ -0.41629064083099365, 0.05575098097324371, 0.6182104349136353, -0.19052448868751526, -0.3704545497894287, 0.19059115648269653, 0.5079457759857178, -1.0381797552108765, 0.2224390059709549, 0.5822677612304688, 0.6274278163909912, 0.7033904194831848, -0.8978231549263, 0.24947364628314972, 0...
func (s *ClusterListener) Stop(inctx context.Context, in *protocol.Reference) (empty *googleprotobuf.Empty, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot stop cluster") empty = &googleprotobuf.Empty{} if s == nil { return empty, fail.InvalidInstanc...
[ -0.9626451134681702, 0.005308309569954872, 0.7644054293632507, -0.18804152309894562, -0.14829544723033905, 0.6681674122810364, 0.30109885334968567, -0.37511366605758667, -0.3829209506511688, 0.873055636882782, -0.20243073999881744, 0.8704009056091309, -1.1246163845062256, -0.30427023768424...
func (s *ClusterListener) Expand(inctx context.Context, in *protocol.ClusterResizeRequest) (_ *protocol.ClusterNodeListResponse, ferr error) { defer fail.OnExitConvertToGRPCStatus(inctx, &ferr) defer fail.OnExitWrapError(inctx, &ferr, "cannot expand cluster") if s == nil { return nil, fail.InvalidInstanceError() ...
[ -1.0458741188049316, 0.780422031879425, 0.9036152958869934, 0.13136449456214905, -0.24546408653259277, -0.13834770023822784, 0.46827131509780884, -0.09907522797584534, -0.12487603724002838, 0.6756494045257568, 0.02359766699373722, 0.3402027487754822, -0.4183100461959839, 0.0925653874874115...
func (s *ClusterListener) Shrink(inctx context.Context, in *protocol.ClusterResizeRequest) (_ *protocol.ClusterNodeListResponse, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot shrink cluster") if s == nil { return nil, fail.InvalidInstanceError() } ...
[ -1.0736454725265503, 0.5026931166648865, 0.8992583751678467, -0.02559952437877655, -0.1328335404396057, 0.12394539266824722, 0.7040566802024841, -0.3445047438144684, 0.43017086386680603, 0.6632649302482605, -0.14410969614982605, 0.7647058963775635, -0.7191866636276245, -0.24501334130764008...
func (s *ClusterListener) ListNodes(inctx context.Context, in *protocol.Reference) (_ *protocol.ClusterNodeListResponse, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot list cluster nodes") if s == nil { return nil, fail.InvalidInstanceError() } if ...
[ -0.9883393049240112, 0.31690919399261475, 0.7066247463226318, -0.5365405678749084, 0.027021480724215508, -0.1916617453098297, 0.0637565553188324, -0.31536799669265747, 0.24575255811214447, 1.3544703722000122, 0.0294197965413332, 0.9320038557052612, -0.6340745687484741, -0.00547926081344485...
func (s *ClusterListener) InspectNode(inctx context.Context, in *protocol.ClusterNodeRequest) (_ *protocol.Host, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot inspect cluster node") if s == nil { return nil, fail.InvalidInstanceError() } if inctx ...
[ -0.6347475051879883, 0.34175339341163635, 0.881307065486908, -0.40621432662010193, -0.2985146641731262, -0.04062947630882263, 0.3832961320877075, -0.46235454082489014, -0.5588682293891907, 0.5392636060714722, 0.8656790256500244, 1.3467414379119873, -0.8899772763252258, -0.502273678779602, ...
func (s *ClusterListener) DeleteNode(inctx context.Context, in *protocol.ClusterDeleteNodeRequest) (empty *googleprotobuf.Empty, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot delete ClassicCluster Node") empty = &googleprotobuf.Empty{} if s == nil { ...
[ -0.5082671046257019, 0.4600747525691986, 0.7752177119255066, -0.13124002516269684, 0.4983205795288086, 0.3494510054588318, 0.2942642867565155, -0.3298477530479431, -0.1650707721710205, 0.096128910779953, 0.8289794921875, 1.1960057020187378, -1.0274895429611206, 0.19652241468429565, 0.526...
func (s *ClusterListener) StopNode(inctx context.Context, in *protocol.ClusterNodeRequest) (empty *googleprotobuf.Empty, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot stop cluster node") empty = &googleprotobuf.Empty{} if s == nil { return empty, f...
[ -1.4089562892913818, 0.13183391094207764, 0.861298143863678, -0.24109208583831787, -0.06080992519855499, 0.6513225436210632, 0.1749732345342636, -0.18377578258514404, -0.9853771924972534, 0.3623684346675873, 0.28018927574157715, 0.8200013041496277, -0.658190131187439, -0.2600129544734955, ...
func (s *ClusterListener) StartNode(inctx context.Context, in *protocol.ClusterNodeRequest) (empty *googleprotobuf.Empty, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot start cluster node") empty = &googleprotobuf.Empty{} if s == nil { return empty,...
[ -0.81697678565979, 0.18779537081718445, 0.8412060737609863, 0.32474538683891296, 0.04293178394436836, 0.7098667621612549, 0.35350319743156433, 0.08288956433534622, -0.4631386995315552, 0.3592292368412018, 0.3050523102283478, 1.1701754331588745, -0.6010785102844238, -0.04765785485506058, ...
func (s *ClusterListener) StateNode(inctx context.Context, in *protocol.ClusterNodeRequest) (_ *protocol.HostStatus, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot get cluster node state") if s == nil { return nil, fail.InvalidInstanceError() } if ...
[ -1.1216034889221191, 0.16383297741413116, 0.7189610600471497, -0.37529465556144714, -0.5757157802581787, 0.24807217717170715, -0.08168340474367142, -0.48160049319267273, -0.5037977695465088, 0.902891993522644, 0.08331233263015747, 0.9569624662399292, -0.5283771753311157, 0.2453625351190567...
func (s *ClusterListener) ListMasters(inctx context.Context, in *protocol.Reference) (_ *protocol.ClusterNodeListResponse, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot list masters") if s == nil { return nil, fail.InvalidInstanceError() } if in =...
[ -0.922867476940155, 0.010596267879009247, 0.6061463356018066, -0.3217974603176117, -0.5243234634399414, -0.12170686572790146, -0.25620970129966736, -0.8519349098205566, 0.22532472014427185, 0.941016435623169, -0.051178257912397385, 1.0231122970581055, -0.6211104393005371, 0.115894719958305...
func (s *ClusterListener) FindAvailableMaster(inctx context.Context, in *protocol.Reference) (_ *protocol.Host, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot find available master") if s == nil { return nil, fail.InvalidInstanceError() } if in == ...
[ -0.38776353001594543, -0.2578035593032837, 0.6628255844116211, -0.33301421999931335, -0.8307188153266907, 0.1494837999343872, -0.3121764659881592, -0.5544180274009705, -0.2663041949272156, 0.9225552082061768, 0.13887347280979156, 1.0838613510131836, -1.2537729740142822, 0.5495825409889221,...
func (s *ClusterListener) InspectMaster(inctx context.Context, in *protocol.ClusterNodeRequest) (_ *protocol.Host, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot inspect cluster master") if s == nil { return nil, fail.InvalidInstanceError() } if in...
[ -0.8971871733665466, 0.061314668506383896, 0.9323651790618896, -0.07158171385526657, -0.8465924263000488, 0.10560258477926254, 0.19623413681983948, -0.5274067521095276, -0.625632643699646, 0.3690999448299408, 0.08443684875965118, 1.1060923337936401, -0.9191516637802124, 0.05903865024447441...
func (s *ClusterListener) StopMaster(inctx context.Context, in *protocol.ClusterNodeRequest) (empty *googleprotobuf.Empty, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot stop ClassicCluster master") empty = &googleprotobuf.Empty{} if s == nil { retu...
[ -1.270440697669983, -0.20666012167930603, 0.7848904132843018, -0.2940930724143982, -0.6164136528968811, 0.6107485890388489, -0.1006685346364975, -0.20205159485340118, -1.0498167276382446, 0.07131576538085938, -0.04820563644170761, 0.6618841886520386, -0.9894035458564758, 0.0529133714735507...
func (s *ClusterListener) StartMaster(inctx context.Context, in *protocol.ClusterNodeRequest) (empty *googleprotobuf.Empty, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot start ClassicCluster master") empty = &googleprotobuf.Empty{} if s == nil { re...
[ -0.6984300017356873, -0.2444549798965454, 0.8083375692367554, 0.27361905574798584, -0.42655548453330994, 0.5537484288215637, -0.01329752430319786, -0.10720767825841904, -0.5172101259231567, 0.08897916227579117, 0.05126659944653511, 0.9904556274414062, -0.8049600720405579, 0.215599700808525...
func (s *ClusterListener) StateMaster(inctx context.Context, in *protocol.ClusterNodeRequest) (_ *protocol.HostStatus, err error) { defer fail.OnExitConvertToGRPCStatus(inctx, &err) defer fail.OnExitWrapError(inctx, &err, "cannot get ClassicCluster master state") if s == nil { return nil, fail.InvalidInstanceErro...
[ -1.0066958665847778, -0.04985419288277626, 0.6009107828140259, -0.26656007766723633, -1.2016069889068604, 0.3722715675830841, -0.45338374376296997, -0.567653238773346, -0.38045743107795715, 0.3963576853275299, 0.10568107664585114, 0.7431044578552246, -0.7899549603462219, 0.2198092639446258...
func (cl *Client) Create(c context.Context, r *http.Request, currentUser User) (*Client, error) { cl.CreatedBy = currentUser.Id cl.Created = time.Now() _, err := cl.Save(c) return cl, err }
[ -0.30465778708457947, -0.3336610496044159, 0.3249364197254181, 1.2069953680038452, 0.6028285026550293, 1.138039231300354, 0.6338338255882263, -0.5776174068450928, -1.2422922849655151, 0.08341880142688751, -0.06879157572984695, -0.310304194688797, -0.5314478874206543, 0.503371000289917, 0...
func (cl *Client) Save(c context.Context) (*Client, error) { // Update the Updated time cl.Updated = time.Now() k, err := nds.Put(c, cl.BaseKey(c, "Client"), cl) if err != nil { log.Errorf(c, "%v", err) return nil, err } cl.Id = k.IntID() return cl, nil }
[ -0.6853451728820801, -0.1350606232881546, 0.36685606837272644, -0.34579718112945557, 0.07168843597173691, 0.44958174228668213, 0.20101971924304962, -0.6902783513069153, -0.3954955041408539, 0.8350546956062317, -0.8446502089500427, 0.12252164632081985, -1.0866305828094482, 0.018786357715725...
func (skill *Skill) GetHTTPSkillHandler() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { //Validate request if !skill.SkipValidation { if err := isValidAlexaCertificate(r); err != nil { http.Error(w, err.Error(), http.StatusUnauthorized) return } } // unmar...
[ -0.4537818431854248, -0.9225006103515625, 1.0258923768997192, 0.1695893406867981, -0.3327522575855255, 0.03037361055612564, 0.21019016206264496, -0.6333118677139282, -0.059539392590522766, 0.3210844099521637, -0.21257856488227844, 0.8857163190841675, 0.6096397638320923, 0.41983601450920105...
func (p *udpPacket) saveReceivedAt() int64 { return p.receivedAt.UnixNano() }
[ -1.038945198059082, 0.6120485663414001, 0.6313763856887817, -1.497291088104248, -0.11115708947181702, 0.1660875678062439, -0.47155722975730896, -0.003106088377535343, -0.13023173809051514, -1.1172435283660889, -1.6229467391967773, -0.1138797253370285, -0.22128921747207642, -0.0275652408599...
func (p *udpPacket) loadReceivedAt(nsec int64) { p.receivedAt = time.Unix(0, nsec) }
[ -0.32406100630760193, 0.7112920880317688, 0.6121322512626648, -1.7916054725646973, -0.42208239436149597, 0.4551483392715454, -1.1497507095336914, -0.42543676495552063, -0.07841682434082031, -1.0237048864364624, -0.8107902407646179, 0.15548406541347504, 0.2492791712284088, 0.043938305228948...
func (e *endpoint) afterLoad() { stack.StackFromEnv.RegisterRestoredEndpoint(e) }
[ 0.3625922203063965, -0.04316691681742668, 0.22470399737358093, 0.17207932472229004, 0.1927250772714615, -0.2750670611858368, 0.012777913361787796, 0.41858237981796265, 0.3800351619720459, 0.1580255776643753, -0.6847599148750305, -0.38971182703971863, -0.5891317129135132, -1.518174290657043...
func (e *endpoint) beforeSave() { e.freeze() }
[ -0.19316934049129486, 0.2201218158006668, 0.2709229588508606, 0.6979536414146423, 0.9391143918037415, -0.37772616744041443, -0.3366750478744507, -0.5564150214195251, -0.2664206027984619, 1.5918456315994263, -0.3938697278499603, -0.5310595631599426, -1.1484202146530151, 0.285490483045578, ...
func Compose(patterns ...goji.Pattern) goji.Pattern { return compose(patterns) }
[ -0.40825599431991577, 0.3118721544742584, 0.1571502387523651, 0.893734335899353, 0.5181137323379517, 0.15948262810707092, 0.46470797061920166, -0.8639125823974609, -0.4449588656425476, -0.2833019196987152, -0.18773001432418823, -0.4436856210231781, 0.0851828083395958, 0.4183274209499359, ...
func httpDo(opt *httpclientOption) ([]byte, error) { domain := opt.cfg.endpointByBalancer() if !strings.HasPrefix(domain, "http://") && !strings.HasPrefix(domain, "https://") { domain = "http://" + domain } url := domain + opt.uri c := &http.Client{ Timeout: time.Duration(opt.cfg.RetryTimeout) * time.Mill...
[ -0.03839178755879402, 0.592881977558136, 1.4371635913848877, -0.30371159315109253, -0.19886204600334167, 0.026096811518073082, -0.7275246977806091, -0.99985671043396, -0.5327227115631104, 0.23209123313426971, 0.30598098039627075, 1.4458580017089844, -0.23028266429901123, -0.377689719200134...