text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (o *EditL3ServiceProfileUsingPUTParams) WithContext(ctx context.Context) *EditL3ServiceProfileUsingPUTParams {
o.SetContext(ctx)
return o
} | [
0.20631106197834015,
0.2593945562839508,
0.5912541151046753,
-0.8265650272369385,
-0.8867690563201904,
0.5983484983444214,
-0.11372832208871841,
-0.8815777897834778,
0.5293717384338379,
0.5132769346237183,
-0.36551257967948914,
-0.3171153962612152,
-1.149609088897705,
-0.6779290437698364,
... |
func (o *EditL3ServiceProfileUsingPUTParams) SetContext(ctx context.Context) {
o.Context = ctx
} | [
0.09432755410671234,
0.44476112723350525,
0.36242157220840454,
-0.28301626443862915,
-0.15530841052532196,
0.8220214247703552,
0.1969735473394394,
-0.5302372574806213,
0.23234224319458008,
0.4725968837738037,
-0.3690575957298279,
-0.24491336941719055,
-1.3496639728546143,
-0.30189478397369... |
func (o *EditL3ServiceProfileUsingPUTParams) WithHTTPClient(client *http.Client) *EditL3ServiceProfileUsingPUTParams {
o.SetHTTPClient(client)
return o
} | [
0.37581536173820496,
-0.3818201720714569,
0.43773186206817627,
-0.9837471842765808,
-0.8042486310005188,
0.5436193943023682,
0.5064740777015686,
-0.7534462213516235,
-0.31221362948417664,
0.23538276553153992,
-0.3629741370677948,
-0.39240309596061707,
-0.5833503603935242,
-0.73994922637939... |
func (o *EditL3ServiceProfileUsingPUTParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
} | [
0.47227001190185547,
-0.05283680558204651,
0.30358967185020447,
-1.086954951286316,
-0.6064714789390564,
0.5019235014915466,
0.7152878642082214,
-0.5948584675788879,
-0.9852654337882996,
0.3687756359577179,
-0.5521058440208435,
-0.14279022812843323,
-1.1779234409332275,
-0.6601359248161316... |
func (o *EditL3ServiceProfileUsingPUTParams) WithAuthorization(authorization string) *EditL3ServiceProfileUsingPUTParams {
o.SetAuthorization(authorization)
return o
} | [
-0.003655356355011463,
0.3466283977031708,
0.35323721170425415,
-0.025391772389411926,
-0.7356162667274475,
0.06136003136634827,
0.7671259045600891,
-0.3185901641845703,
0.6049464344978333,
0.9329363107681274,
-0.3090437352657318,
-0.23400621116161346,
-0.3532203435897827,
-0.2878721356391... |
func (o *EditL3ServiceProfileUsingPUTParams) SetAuthorization(authorization string) {
o.Authorization = authorization
} | [
-0.4022181034088135,
0.3619813919067383,
0.17790059745311737,
0.4578583538532257,
-0.48200780153274536,
0.06893836706876755,
1.0985366106033325,
-0.01724904403090477,
0.2211214303970337,
0.988433837890625,
-0.47605666518211365,
-0.16015246510505676,
-1.0032943487167358,
0.11923167109489441... |
func (o *EditL3ServiceProfileUsingPUTParams) WithLastUpdatedDate(lastUpdatedDate string) *EditL3ServiceProfileUsingPUTParams {
o.SetLastUpdatedDate(lastUpdatedDate)
return o
} | [
0.29169684648513794,
0.10854625701904297,
0.5653173327445984,
-0.7359585165977478,
-0.9981259703636169,
0.32486656308174133,
-0.28861862421035767,
0.3104597330093384,
0.7667719721794128,
0.09931479394435883,
-0.2612713575363159,
-0.6651202440261841,
-0.7054285407066345,
-0.3764939904212951... |
func (o *EditL3ServiceProfileUsingPUTParams) SetLastUpdatedDate(lastUpdatedDate string) {
o.LastUpdatedDate = lastUpdatedDate
} | [
-0.06771671772003174,
0.035387519747018814,
0.5574276447296143,
-0.9614488482475281,
-0.765389621257782,
0.8340162038803101,
-0.1787019670009613,
0.44903358817100525,
0.460272878408432,
-0.09257498383522034,
-0.3734855055809021,
-0.14124555885791779,
-1.2977771759033203,
-0.342998445034027... |
func (o *EditL3ServiceProfileUsingPUTParams) WithServiceProfileModel(serviceProfileModel *models.ServiceProfileModelv3) *EditL3ServiceProfileUsingPUTParams {
o.SetServiceProfileModel(serviceProfileModel)
return o
} | [
0.3196398913860321,
-0.010525812394917011,
0.5862064361572266,
0.432959645986557,
-0.9967718124389648,
1.0663642883300781,
-0.1122761145234108,
-0.5703675746917725,
0.30752086639404297,
0.6388494372367859,
-1.237513542175293,
-0.8202645778656006,
-0.5421498417854309,
-0.2452431172132492,
... |
func (o *EditL3ServiceProfileUsingPUTParams) SetServiceProfileModel(serviceProfileModel *models.ServiceProfileModelv3) {
o.ServiceProfileModel = serviceProfileModel
} | [
-0.3457415699958801,
0.07161838561296463,
0.5565807819366455,
0.512779951095581,
-0.41741320490837097,
1.434084415435791,
0.08168975263834,
-0.4115426242351532,
-0.1666443943977356,
0.8109792470932007,
-1.518541932106018,
-0.42324569821357727,
-0.9708316922187805,
-0.09399819374084473,
-... |
func (o *EditL3ServiceProfileUsingPUTParams) WithUUID(uuid string) *EditL3ServiceProfileUsingPUTParams {
o.SetUUID(uuid)
return o
} | [
-0.0466015599668026,
-0.08183908462524414,
0.4927699863910675,
-0.8108324408531189,
-1.0860899686813354,
0.7840034365653992,
0.3806439936161041,
0.30274277925491333,
0.2249947190284729,
0.46037906408309937,
-0.1616961508989334,
-0.2796846032142639,
-0.7248690128326416,
-0.42143404483795166... |
func (o *EditL3ServiceProfileUsingPUTParams) SetUUID(uuid string) {
o.UUID = uuid
} | [
-0.2191532403230667,
-0.028203824535012245,
0.35579606890678406,
-0.4261236786842346,
-0.8062171936035156,
0.961441695690155,
0.5433933734893799,
0.7737441658973694,
-0.12077029794454575,
0.19894888997077942,
-0.20281672477722168,
0.1449361890554428,
-1.146867036819458,
0.00609713792800903... |
func (o *EditL3ServiceProfileUsingPUTParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// header param Authorization
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
return err
}... | [
-0.9138087630271912,
-0.13894781470298767,
1.0487499237060547,
-0.6874326467514038,
0.41013407707214355,
0.16715414822101593,
0.7537584900856018,
-0.24149486422538757,
-0.7589549422264099,
0.6078845262527466,
0.2717683017253876,
0.025861645117402077,
-0.7743510603904724,
-0.120947457849979... |
func (r *IsContactInListRequest) ConditionOr() *IsContactInListRequest {
r.request.Add("condition", "or")
return r
} | [
-0.708977460861206,
-0.7220823764801025,
0.30717477202415466,
0.15145066380500793,
-0.6872736811637878,
0.5860195755958557,
0.35761067271232605,
0.7845257520675659,
0.6973583698272705,
-0.5511785745620728,
0.46314093470573425,
-1.1310460567474365,
0.40189626812934875,
0.4429430365562439,
... |
func (r *IsContactInListRequest) ConditionAnd() *IsContactInListRequest {
r.request.Add("condition", "and")
return r
} | [
-0.3567902147769928,
-1.230154275894165,
0.27406853437423706,
0.16973403096199036,
-0.5520246624946594,
1.0926357507705688,
0.6791356801986694,
0.9861024022102356,
0.607602596282959,
-0.447614461183548,
0.2983342707157135,
0.2265450805425644,
-0.2571212351322174,
0.9356465935707092,
-0.5... |
func (r *IsContactInListRequest) Execute() (res bool, err error) {
err = r.request.Execute("isContactInList", &res)
return
} | [
-1.4181420803070068,
-0.47083091735839844,
0.5599040389060974,
0.8918054103851318,
0.44279301166534424,
-0.15176944434642792,
-0.5324673056602478,
-0.09885724633932114,
0.44128313660621643,
0.6229993104934692,
-0.46297553181648254,
-0.8449791669845581,
-0.8646194338798523,
-0.2910059392452... |
func IsContactInList(request *api.Request, email string, listIDs ...int64) *IsContactInListRequest {
ids := make([]string, len(listIDs))
for n, id := range listIDs {
ids[n] = strconv.FormatInt(id, 10)
}
request.Add("email", email).
Add("list_ids", strings.Join(ids, ","))
return &IsContactInListRequest{
req... | [
-1.1108132600784302,
-0.5945259928703308,
0.514640212059021,
-0.018149083480238914,
-0.055155761539936066,
-0.247060626745224,
-0.6368370652198792,
0.766554057598114,
0.7551860213279724,
0.5273159146308899,
-0.7496922612190247,
0.47176802158355713,
-0.8122962713241577,
0.36983737349510193,... |
func LoadConfig() (*Config, error) {
config := Config{
MetricBatchIntervalMilliseconds: 60000,
MetricSourceID: "metron",
IncomingUDPPort: 3457,
DebugPort: 14824,
GRPC: GRPC{
Port: 3458,
},
}
err := envstruct.Load(&config)
if err != nil {
return... | [
0.6149339079856873,
0.3729657828807831,
0.5541455745697021,
-0.5396553874015808,
-0.20695389807224274,
0.6690477728843689,
-0.18373078107833862,
0.39464831352233887,
-0.30188995599746704,
0.1960204839706421,
0.21766100823879242,
0.2670244574546814,
-0.3262854516506195,
0.8871657848358154,
... |
func TestConsumerTickerLoop(t *testing.T) {
expect := shared.NewExpect(t)
mockC := getMockConsumer()
mockC.setState(PluginStateActive)
// accept timeroff by abs( 8 ms)
delta := float64(8 * time.Millisecond)
counter := new(int32)
tickerLoopTimeout := 20 * time.Millisecond
var timeRecorded time.Time
onTimeOut :=... | [
0.6187297701835632,
-0.0937107652425766,
0.5766439437866211,
0.36850371956825256,
0.24976472556591034,
0.03598188981413841,
1.0713529586791992,
-0.2678009271621704,
-0.43657323718070984,
0.4191126227378845,
-0.8348516225814819,
-0.32033562660217285,
-0.7982436418533325,
0.7783719897270203,... |
func TestConsumerControlLoop(t *testing.T) {
expect := shared.NewExpect(t)
mockC := getMockConsumer()
stop := new(int32)
roll := new(int32)
mockC.SetStopCallback(func() {
atomic.StoreInt32(stop, 1)
})
mockC.SetRollCallback(func() {
atomic.StoreInt32(roll, 1)
})
go mockC.ControlLoop()
// let the go rout... | [
0.26228323578834534,
-0.11349917203187943,
0.5769285559654236,
0.0869603231549263,
0.42097923159599304,
-0.08950482308864594,
1.0734916925430298,
-0.7326050400733948,
0.18106609582901,
-0.07288871705532074,
-0.20402522385120392,
-0.31009942293167114,
-0.358214795589447,
-0.3756186068058014... |
func New(poolKey string, connInfo ConnectionInfo) *sql.DB {
isGoodKey := registerConnectionPool(poolKey)
if !isGoodKey {
fmt.Println("isGoodKey == false")
return nil
}
dbs[poolKey] = connect(connInfo)
if dbs[poolKey] != nil {
dbs[poolKey].SetMaxIdleConns(connInfo.MaxIdleConns)
dbs[poolKey].SetMaxOpenCon... | [
-0.7202004194259644,
-0.5192508101463318,
0.4858859181404114,
0.18898022174835205,
-0.6884873509407043,
-0.0012455713003873825,
-0.7143260836601257,
0.0782647356390953,
-0.41217687726020813,
0.13106688857078552,
-0.4455519914627075,
-0.2505985498428345,
-0.49291834235191345,
0.371520400047... |
func Delete(poolKey string) bool {
_, ok := dbs[poolKey]
if !ok {
return false
}
dbs[poolKey].Close()
delete(dbs, poolKey)
return true
} | [
-0.4879184663295746,
0.663029670715332,
0.6126167178153992,
0.1414177417755127,
-0.4581836760044098,
0.863609254360199,
0.37584659457206726,
0.05873485654592514,
0.3301842212677002,
0.946784257888794,
-0.6482758522033691,
-0.6414007544517517,
-1.908657193183899,
0.3015874922275543,
-0.80... |
func DeleteAll() bool {
success := true
for key := range dbs {
if Delete(key) == false {
success = false
}
}
return success
} | [
-0.19854681193828583,
0.9475042223930359,
0.7687325477600098,
0.7011023759841919,
0.20798711478710175,
0.8841671347618103,
-0.5179228186607361,
0.13623061776161194,
-0.4448627531528473,
0.11243095248937607,
-0.8213974237442017,
-0.5023143887519836,
-1.0570188760757446,
1.0890973806381226,
... |
func Pool(poolKey string) *sql.DB {
pool, ok := dbs[poolKey]
if !ok {
return nil
}
return pool
} | [
-0.23434628546237946,
0.563664972782135,
0.2775629460811615,
0.32433193922042847,
-0.14213113486766815,
-0.2062806338071823,
0.014909690245985985,
-0.5343749523162842,
0.8389803767204285,
0.32205721735954285,
-0.4097611606121063,
0.2650986909866333,
-0.3407045900821686,
0.06714316457509995... |
func (rm *resourceManager) sdkFind(
ctx context.Context,
r *resource,
) (latest *resource, err error) {
rlog := ackrtlog.FromContext(ctx)
exit := rlog.Trace("rm.sdkFind")
defer exit(err)
// If any required fields in the input shape are missing, AWS resource is
// not created yet. Return NotFound here to indicate... | [
-0.3954789340496063,
-0.08535276353359222,
0.7018104791641235,
0.12032458186149597,
-0.7392551302909851,
0.22930973768234253,
0.32358160614967346,
-0.4029848873615265,
0.5423074960708618,
0.21932494640350342,
0.9436559677124023,
0.6875962615013123,
0.350350558757782,
0.623015820980072,
0... |
func (rm *resourceManager) requiredFieldsMissingFromReadOneInput(
r *resource,
) bool {
return rm.customCheckRequiredFieldsMissingMethod(r)
} | [
-0.9382646679878235,
-0.123873770236969,
0.2980194091796875,
-0.7236675024032593,
-0.6150800585746765,
1.1962422132492065,
0.6450889706611633,
-0.6958905458450317,
0.656940221786499,
0.39562442898750305,
-0.4550417363643646,
-1.3269530534744263,
-0.7537802457809448,
0.8258716464042664,
0... |
func (rm *resourceManager) newDescribeRequestPayload(
r *resource,
) (*svcsdk.DescribeModelPackageInput, error) {
res := &svcsdk.DescribeModelPackageInput{}
if r.ko.Spec.ModelPackageName != nil {
res.SetModelPackageName(*r.ko.Spec.ModelPackageName)
}
return res, nil
} | [
-0.8378711342811584,
0.06796523928642273,
0.3807373046875,
0.16476832330226898,
-0.7095544934272766,
0.09429485350847244,
-0.6986564993858337,
-1.194908857345581,
0.6757652759552002,
-0.29566943645477295,
0.33648887276649475,
-0.0965777263045311,
-0.2439626157283783,
0.5346264243125916,
... |
func (rm *resourceManager) sdkCreate(
ctx context.Context,
desired *resource,
) (created *resource, err error) {
rlog := ackrtlog.FromContext(ctx)
exit := rlog.Trace("rm.sdkCreate")
defer exit(err)
input, err := rm.newCreateRequestPayload(ctx, desired)
if err != nil {
return nil, err
}
var resp *svcsdk.Crea... | [
-0.6618652939796448,
0.40372103452682495,
0.5502008199691772,
0.4638899564743042,
-0.3648540675640106,
-0.15772993862628937,
0.08206398040056229,
-0.4409690499305725,
0.3576037585735321,
-0.1974618285894394,
0.13938747346401215,
0.2207067459821701,
0.4269134998321533,
-0.1001301109790802,
... |
func (rm *resourceManager) newCreateRequestPayload(
ctx context.Context,
r *resource,
) (*svcsdk.CreateModelPackageInput, error) {
res := &svcsdk.CreateModelPackageInput{}
if r.ko.Spec.CertifyForMarketplace != nil {
res.SetCertifyForMarketplace(*r.ko.Spec.CertifyForMarketplace)
}
if r.ko.Spec.ClientToken != ni... | [
-0.6825542449951172,
-0.5727728605270386,
0.5198125839233398,
-0.10259193927049637,
-0.15177327394485474,
-0.08995915204286575,
0.11085371673107147,
-0.7240689992904663,
-0.07452687621116638,
-0.46637171506881714,
-0.011325934901833534,
-0.5530759692192078,
0.5325785875320435,
0.8194469809... |
func (rm *resourceManager) sdkUpdate(
ctx context.Context,
desired *resource,
latest *resource,
delta *ackcompare.Delta,
) (updated *resource, err error) {
rlog := ackrtlog.FromContext(ctx)
exit := rlog.Trace("rm.sdkUpdate")
defer exit(err)
if err = rm.requeueUntilCanModify(ctx, latest); err != nil {
return n... | [
-1.0391173362731934,
-0.3555261194705963,
0.7585968971252441,
0.1842528134584427,
-0.8583604693412781,
-0.2515236735343933,
-0.11894772946834564,
-0.28844937682151794,
0.3781232237815857,
0.028311802074313164,
0.433942973613739,
0.4412820041179657,
0.2705562710762024,
-0.344370573759079,
... |
func (rm *resourceManager) newUpdateRequestPayload(
ctx context.Context,
r *resource,
) (*svcsdk.UpdateModelPackageInput, error) {
res := &svcsdk.UpdateModelPackageInput{}
if r.ko.Spec.ApprovalDescription != nil {
res.SetApprovalDescription(*r.ko.Spec.ApprovalDescription)
}
if r.ko.Spec.ModelApprovalStatus != ... | [
-1.000577688217163,
-1.2113103866577148,
0.43625494837760925,
-0.24726101756095886,
-1.4094091653823853,
0.11374848335981369,
-0.7755292654037476,
-0.7408487796783447,
0.2840084433555603,
0.42775842547416687,
0.30684077739715576,
-0.05380699783563614,
-0.27666980028152466,
0.10175482183694... |
func (rm *resourceManager) sdkDelete(
ctx context.Context,
r *resource,
) (latest *resource, err error) {
rlog := ackrtlog.FromContext(ctx)
exit := rlog.Trace("rm.sdkDelete")
defer exit(err)
if err = rm.requeueUntilCanModify(ctx, r); err != nil {
return r, err
}
input, err := rm.newDeleteRequestPayload(r)
i... | [
-0.4250797927379608,
0.2386728823184967,
0.6989021897315979,
0.9973936080932617,
-0.24247539043426514,
-0.4654563367366791,
0.7095845341682434,
-0.37196090817451477,
0.8717013597488403,
0.05720653012394905,
0.16654714941978455,
-0.07570984214544296,
0.5151600241661072,
0.7047756314277649,
... |
func (rm *resourceManager) newDeleteRequestPayload(
r *resource,
) (*svcsdk.DeleteModelPackageInput, error) {
res := &svcsdk.DeleteModelPackageInput{}
if r.ko.Spec.ModelPackageName != nil {
res.SetModelPackageName(*r.ko.Spec.ModelPackageName)
}
return res, nil
} | [
-0.8355566263198853,
-0.7546361088752747,
0.22728684544563293,
0.23731696605682373,
-1.3132234811782837,
0.06905043125152588,
-0.4302627444267273,
-1.0236774682998657,
1.2010433673858643,
-0.5809580087661743,
0.12696614861488342,
-0.5086485147476196,
-0.0707864984869957,
0.4511849880218506... |
func (rm *resourceManager) setStatusDefaults(
ko *svcapitypes.ModelPackage,
) {
if ko.Status.ACKResourceMetadata == nil {
ko.Status.ACKResourceMetadata = &ackv1alpha1.ResourceMetadata{}
}
if ko.Status.ACKResourceMetadata.OwnerAccountID == nil {
ko.Status.ACKResourceMetadata.OwnerAccountID = &rm.awsAccountID
}
... | [
0.3548302948474884,
-0.254120409488678,
0.2636536955833435,
0.15482701361179352,
0.11375246942043304,
0.007019899785518646,
-0.004566538613289595,
0.07574068754911423,
0.48713770508766174,
0.35121122002601624,
-1.0198224782943726,
-0.049711327999830246,
-0.18052589893341064,
0.930700898170... |
func (rm *resourceManager) updateConditions(
r *resource,
onSuccess bool,
err error,
) (*resource, bool) {
ko := r.ko.DeepCopy()
rm.setStatusDefaults(ko)
// Terminal condition
var terminalCondition *ackv1alpha1.Condition = nil
var recoverableCondition *ackv1alpha1.Condition = nil
var syncCondition *ackv1alpha... | [
-0.10746122151613235,
-0.93074631690979,
0.6995893716812134,
-0.37762176990509033,
-1.1440623998641968,
-0.38176941871643066,
-0.03922384977340698,
-0.1933603435754776,
-0.28780055046081543,
0.7536389231681824,
0.4126232862472534,
-0.28931182622909546,
-0.03266462683677673,
0.5112271308898... |
func LoadConfigFromString(jsonStr string) (Configs, error) {
return LoadConfigFromBytes([]byte(jsonStr))
} | [
-0.1928945928812027,
-0.32600700855255127,
0.21283215284347534,
0.3276376724243164,
-1.6409273147583008,
-0.7639652490615845,
-0.5090144872665405,
-0.5278054475784302,
-0.08334660530090332,
0.7286123037338257,
-1.3269050121307373,
-0.3135114312171936,
-0.5380372405052185,
0.461926162242889... |
func SimpleGet(w http.ResponseWriter, req *http.Request) {
log.Println("Get Succeeded")
w.WriteHeader(http.StatusOK)
w.Write([]byte(os.Getenv("COPILOT_APPLICATION_NAME") + "-" + os.Getenv("COPILOT_ENVIRONMENT_NAME") + "-" + os.Getenv("COPILOT_SERVICE_NAME")))
} | [
-0.3185913860797882,
-1.0042811632156372,
0.6679871082305908,
-0.6259444952011108,
0.1653309166431427,
1.1206129789352417,
-0.5000995397567749,
0.2561061382293701,
-0.8398554921150208,
0.17354898154735565,
0.401314914226532,
0.7437120676040649,
-0.3434555232524872,
-0.2810046076774597,
0... |
func ProxyRequest(w http.ResponseWriter, r *http.Request) {
url := r.URL.Query().Get("url")
log.Printf("Proxying request to %q", url)
ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second)
defer cancel()
handleErr := func(format string, a ...any) {
msg := fmt.Sprintf(format, a...)
log.Println(msg)
... | [
-0.5552477836608887,
-0.2530811131000519,
0.882417619228363,
-0.3982033133506775,
0.5485361218452454,
-0.07057052105665207,
0.15404626727104187,
0.1408306360244751,
0.05071241036057472,
0.1636306494474411,
0.29529517889022827,
0.7420002818107605,
-0.2248566597700119,
0.2812085449695587,
... |
func ContainsString(src []string, x string) bool {
i := sort.Search(len(src), func(i int) bool { return src[i] >= x })
return i < len(src) && src[i] == x
} | [
0.20774543285369873,
-0.010115929879248142,
0.5056385397911072,
-0.3981292247772217,
-1.198143482208252,
0.4774927496910095,
-1.0911445617675781,
-1.1636375188827515,
-0.056786809116601944,
0.49785304069519043,
-0.7324968576431274,
0.8329511880874634,
0.05890917032957077,
-0.58359074592590... |
func (i *MintedTokenInfo) toBigQueryMessage() *bqpb.MachineToken {
// LUCI_MACHINE_TOKEN is the only supported type currently.
if i.Request.TokenType != tokenserver.MachineTokenType_LUCI_MACHINE_TOKEN {
panic("unknown token type")
}
return &bqpb.MachineToken{
// Identifier of the token body.
Fingerprint: util... | [
-0.32677632570266724,
-0.43776264786720276,
0.594399094581604,
-1.4190001487731934,
0.5314070582389832,
0.2551802396774292,
-0.9935927391052246,
-1.0102393627166748,
-0.83741295337677,
-0.705216109752655,
-0.4940285384654999,
1.20749032497406,
-0.18260958790779114,
0.1499008685350418,
-0... |
func LogToken(c context.Context, i *MintedTokenInfo) error {
return machineTokensLog.Insert(c, &bq.Row{
Message: i.toBigQueryMessage(),
})
} | [
0.03152761980891228,
0.8928386569023132,
0.3849014639854431,
-0.8261532187461853,
0.4758494198322296,
0.15214505791664124,
-0.7193030118942261,
0.29576531052589417,
-0.6962164044380188,
-0.7305618524551392,
-1.5314525365829468,
0.9614949226379395,
0.1311342567205429,
0.41505688428878784,
... |
func FlushTokenLog(c context.Context) error {
_, err := machineTokensLog.Flush(c)
return err
} | [
0.1836228370666504,
0.30440375208854675,
0.06925404071807861,
-0.24300986528396606,
-1.1320421695709229,
0.6371797919273376,
-0.2934480607509613,
-0.779032289981842,
-0.7751989960670471,
0.7228560447692871,
-0.32515445351600647,
1.1449123620986938,
0.15505634248256683,
0.929229199886322,
... |
func (e *MyTest) Call(ctx context.Context, req *myTest.Request, rsp *myTest.Response) error {
log.Log("Received MyTest.Call request")
rsp.Msg = "Hello " + req.Name
return nil
} | [
-0.37469711899757385,
-0.27877599000930786,
0.5736560821533203,
-0.09691549092531204,
-0.20412655174732208,
1.0155937671661377,
-0.9520308375358582,
-0.3589462637901306,
0.3280474841594696,
0.03348996490240097,
0.23938526213169098,
0.6225725412368774,
-1.2047604322433472,
0.420201629400253... |
func (e *MyTest) Stream(ctx context.Context, req *myTest.StreamingRequest, stream myTest.MyTest_StreamStream) error {
log.Logf("Received MyTest.Stream request with count: %d", req.Count)
for i := 0; i < int(req.Count); i++ {
log.Logf("Responding: %d", i)
if err := stream.Send(&myTest.StreamingResponse{
Count:... | [
-0.643835186958313,
0.26242053508758545,
0.6109491586685181,
0.292715460062027,
0.34747838973999023,
0.4083694517612457,
0.7690224647521973,
-0.5051212310791016,
0.3030453324317932,
-0.5845590233802795,
0.3192722797393799,
0.5241307020187378,
-0.7657681107521057,
0.9711910486221313,
0.05... |
func (e *MyTest) PingPong(ctx context.Context, stream myTest.MyTest_PingPongStream) error {
for {
req, err := stream.Recv()
if err != nil {
return err
}
log.Logf("Got ping %v", req.Stroke)
if err := stream.Send(&myTest.Pong{Stroke: req.Stroke}); err != nil {
return err
}
}
} | [
0.3000537157058716,
0.14262838661670685,
0.668566882610321,
-0.5000619292259216,
0.42339274287223816,
0.1983465850353241,
-0.022114988416433334,
0.40651655197143555,
-0.36523959040641785,
0.4372791647911072,
-0.3215990662574768,
0.31768250465393066,
-0.5794546604156494,
0.7922996878623962,... |
func ReadPublicacionesSeguidores(w http.ResponseWriter, r *http.Request) {
if len(r.URL.Query().Get("page")) < 1 {
http.Error(w, "Debe enviar el parametro pagina", http.StatusBadRequest)
return
}
page, err := strconv.Atoi(r.URL.Query().Get("page"))
if err != nil {
http.Error(w, "Debe enviar el parametro pagin... | [
-1.1252968311309814,
-0.21787740290164948,
0.9821082353591919,
0.5692790150642395,
-0.13133729994297028,
0.0002399995137238875,
0.2956382632255554,
-0.11222252249717712,
-0.3777697682380676,
1.0034706592559814,
-0.17918825149536133,
-0.2313067764043808,
-0.037208445370197296,
0.58529895544... |
func columnNamesFromCsvFile(fileName string) ([]string, error) {
fileReader, err := os.Open(fileName)
if err != nil {
return nil, err
}
defer fileReader.Close()
csvReader := csv.NewReader(fileReader)
record, err := csvReader.Read()
if err != nil {
return nil, fmt.Errorf("Error reading first row of `%s`: %v... | [
0.5163039565086365,
-1.0747992992401123,
0.37144169211387634,
-0.10987155139446259,
-0.030271317809820175,
0.21376203000545502,
-0.3901445269584656,
0.0007768432260490954,
-0.3957010805606842,
0.4511781930923462,
-0.29893165826797485,
-0.22112680971622467,
-0.10690383613109589,
0.390111982... |
func lineCounter(r io.Reader) (int, error) {
buf := make([]byte, 32*1024)
count := 0
lineSep := []byte{'\n'}
var lastByte byte
lastByte = '\n'
for {
c, err := r.Read(buf)
if c > 0 {
lastByte = buf[c-1]
}
count += bytes.Count(buf[:c], lineSep)
switch {
case err == io.EOF:
if lastByte != '\n' {
... | [
1.0008089542388916,
-0.7288751006126404,
1.129150390625,
-0.4820532202720642,
-0.4029443860054016,
0.05604282021522522,
0.13716469705104828,
0.14084723591804504,
0.0702664852142334,
-0.7093732357025146,
-0.4655582308769226,
-0.6704515218734741,
-0.0580725260078907,
1.377106785774231,
0.3... |
func rowsInFile(fileName string) (int, error) {
fileReader, err := os.Open(fileName)
if err != nil {
return 0, err
}
defer fileReader.Close()
return lineCounter(fileReader)
} | [
0.5617426037788391,
-0.1620720624923706,
0.6790730953216553,
-0.7237604856491089,
-0.5120081305503845,
0.1928761899471283,
0.7188919186592102,
1.161386489868164,
-0.6628707051277161,
-0.27003014087677,
0.4527342915534973,
-0.21711136400699615,
-0.6426016688346863,
1.189115285873413,
-0.8... |
func versionToShorthand(version string) (string, error) {
parts := strings.Split(version, ".")
if len(parts) != 2 && len(parts) != 3 {
return "", fmt.Errorf("Version string must be like X.Y or X.Y.Z, not '%s'", version)
}
return parts[0] + parts[1], nil
} | [
-0.000789834011811763,
-1.5252476930618286,
0.4906584322452545,
0.2404930591583252,
-0.18111801147460938,
0.8606030941009521,
0.5889194011688232,
0.0784248560667038,
0.49765944480895996,
1.0353915691375732,
-0.5432394742965698,
0.4571514129638672,
-0.15618310868740082,
-0.8923789262771606,... |
func databaseName(modelVersion string) (shortVersion string, err error) {
if shortVersion, err = versionToShorthand(modelVersion); err != nil {
return
}
return fmt.Sprintf("pedsnet_dcc_v%s", shortVersion), nil
} | [
-0.02834245190024376,
0.2251434028148651,
0.3516412377357483,
0.021944068372249603,
-0.9384719133377075,
0.175204336643219,
-0.09742336720228195,
-0.2997850775718689,
0.6451800465583801,
0.9613954424858093,
-0.5237946510314941,
-0.41310232877731323,
0.44487783312797546,
0.4756959080696106,... |
func (d *Database) load(datadirectory *datadirectory.DataDirectory) error {
var err error
// We will parallelize our loads, using a concurrency of 4, or the number in the PREPDB_JOBS environment variable
tasks := make(chan *CopyCommandArgs, 100) // 100 is an impossibly large number of vocab files
taskErrors := mak... | [
0.031086793169379234,
0.5862962603569031,
0.942072331905365,
-0.43189334869384766,
0.026172367855906487,
-0.0896514356136322,
-0.02068408951163292,
0.5346019268035889,
-0.5146309733390808,
0.19850362837314606,
0.055384423583745956,
0.08378585427999496,
-0.4783652126789093,
0.32614359259605... |
func (d *Database) Load(dataDirectory *datadirectory.DataDirectory) (err error) {
return d.load(dataDirectory)
} | [
-0.9270027279853821,
0.9062642455101013,
0.34936508536338806,
-1.0876339673995972,
-0.4984167516231537,
-0.1658824384212494,
-0.43805161118507385,
0.005990985315293074,
0.5263227820396423,
-0.20522627234458923,
-0.4772416055202484,
0.9176522493362427,
-0.5220543146133423,
0.308027416467666... |
func NewNotifier() base.Notifier {
return &indexerNotifier{}
} | [
-0.16629789769649506,
-0.7278407216072083,
0.1610625833272934,
0.9440168142318726,
-0.5128657817840576,
-0.44437718391418457,
0.1647394597530365,
0.16808289289474487,
0.3051460087299347,
-1.1089917421340942,
-0.9692588448524475,
0.07775560766458511,
-0.589109480381012,
0.29863008856773376,... |
func padPKCS7(in []byte, blockSize int) []byte {
if blockSize < 0 {
panic("size can't be less than 0")
}
if blockSize > 256 {
panic("size can't be greater than max byte")
}
padLen := blockSize - len(in)%blockSize
res := make([]byte, len(in)+padLen)
n := copy(res, in)
for i := 0; i < padLen; i++ {
res[n+... | [
-0.23092345893383026,
0.39982834458351135,
0.66518235206604,
0.49781283736228943,
-0.9328687191009521,
0.8084169626235962,
-1.00327730178833,
-0.3533205986022949,
0.4513291120529175,
0.7153207063674927,
0.09187755733728409,
-0.3419792950153351,
-1.0848166942596436,
0.1927315890789032,
-0... |
func discoverBlockSizeInfo(oracle EncryptionOracleFn) BlockSizeInfo {
// Assume block size is 8:
// =>
// suffix | inputSizeToGetFullPadding
// 0 | 8
// 1 | 7
// 2 | 6
// 3 | 5
// 4 | 4
// 5 | 3
// 6 | 2
... | [
1.238619327545166,
0.03950659558176994,
0.7201083302497864,
-0.5146170258522034,
-0.5349298715591431,
-0.8364824652671814,
0.6609839797019958,
-0.6350253224372864,
0.42590370774269104,
0.3537307679653168,
-0.83840012550354,
0.5842864513397217,
0.012542539276182652,
0.9381230473518372,
1.... |
func Distance(a, b string) (int, error) {
if len(a) != len(b) {
return 0, ErrUnequalLenths
}
if a == "" && b == "" {
return 0, nil
}
if len(a) == len(b) {
var differentWord int
for i := 0; i < len(a); i++ {
if a[i] != b[i] {
differentWord++
}
}
return differentWord, nil
}
return 0, nil
} | [
0.3126017451286316,
-0.13191092014312744,
0.7595489621162415,
-0.309831440448761,
-0.5473664999008179,
0.44225621223449707,
-0.08115247637033463,
0.4424915611743927,
0.6253752708435059,
1.1685502529144287,
0.39129939675331116,
1.0870057344436646,
-0.8911452889442444,
0.6022467613220215,
... |
func (_m *VersionInterface) GetVersion(ctx context.Context, r *admin.GetVersionRequest) (*admin.GetVersionResponse, error) {
ret := _m.Called(ctx, r)
var r0 *admin.GetVersionResponse
if rf, ok := ret.Get(0).(func(context.Context, *admin.GetVersionRequest) *admin.GetVersionResponse); ok {
r0 = rf(ctx, r)
} else {... | [
-0.4207612872123718,
-0.02040806971490383,
0.6049846410751343,
0.717746376991272,
0.2554754316806793,
0.1687805950641632,
0.724124014377594,
-0.14203143119812012,
0.6859806180000305,
0.3876912295818329,
-0.7092871069908142,
0.03109528310596943,
-0.18172596395015717,
0.2665988504886627,
0... |
func NewSwaggerSchemaFor(delegate discovery.SwaggerSchemaInterface, gv schema.GroupVersion) (*SwaggerSchema, error) {
log.Debugf("Fetching schema for %v", gv)
swagger, err := delegate.SwaggerSchema(gv)
if err != nil {
return nil, err
}
return &SwaggerSchema{api: swagger, delegate: delegate}, nil
} | [
0.004654922056943178,
-0.3581291437149048,
0.07051447033882141,
-0.39852070808410645,
-0.5358830690383911,
-0.13500916957855225,
-0.7390986084938049,
-0.19050827622413635,
-0.6076920032501221,
-0.27759793400764465,
-0.3253152668476105,
0.6148063540458679,
0.1317097395658493,
0.554500877857... |
func (s *SwaggerSchema) validateList(obj map[string]interface{}) []error {
items, exists := obj["items"]
if !exists {
return []error{fmt.Errorf("no items field in %#v", obj)}
}
return s.validateItems(items)
} | [
-0.8374519944190979,
-0.6335579752922058,
0.44407379627227783,
-0.15402327477931976,
0.974906861782074,
-0.32341593503952026,
-0.45631107687950134,
0.3750919699668884,
0.5828232765197754,
0.5177432298660278,
-0.8139658570289612,
-1.0212974548339844,
0.9861693382263184,
0.7761873602867126,
... |
func (s *SwaggerSchema) Validate(obj *unstructured.Unstructured) []error {
if obj.IsList() {
return s.validateList(obj.UnstructuredContent())
}
gvk := obj.GroupVersionKind()
return s.ValidateObject(obj.UnstructuredContent(), "", fmt.Sprintf("%s.%s", gvk.Version, gvk.Kind))
} | [
-0.6389142274856567,
-0.25791364908218384,
0.5299906134605408,
0.425596684217453,
0.08471834659576416,
0.2694699466228485,
-0.03521433472633362,
-0.5569716095924377,
-0.04594539478421211,
0.4440992772579193,
-0.426685094833374,
0.34895002841949463,
-0.005107666831463575,
0.6366178393363953... |
func (s *SwaggerSchema) ValidateObject(obj interface{}, fieldName, typeName string) []error {
allErrs := []error{}
models := s.api.Models
model, ok := models.At(typeName)
// Verify the api version matches. This is required for nested types with differing api versions because
// s.api only has schema for 1 api ve... | [
-0.7802603840827942,
-0.5879681706428528,
0.9274435043334961,
-0.06649487465620041,
0.059753451496362686,
0.2388635277748108,
0.21875253319740295,
-0.49121299386024475,
-0.14585602283477783,
0.4585859775543213,
-1.092930555343628,
-0.0878765657544136,
0.4949180781841278,
-0.223242163658142... |
func (s *SwaggerSchema) delegateIfDifferentApiVersion(obj *unstructured.Unstructured) (bool, []error) {
// Never delegate objects in the same ApiVersion or we will get infinite recursion
if !s.isDifferentApiVersion(obj) {
return false, nil
}
// Delegate validation of this object to the correct SwaggerSchema for ... | [
0.12302622944116592,
-0.6660265326499939,
0.6630721688270569,
0.17899379134178162,
0.016876518726348877,
0.5751712322235107,
0.06016175448894501,
-0.4902951121330261,
0.6773150563240051,
0.1447976678609848,
-0.6991844773292542,
-0.09200398623943329,
-0.7482471466064453,
0.580949068069458,
... |
func (s *SwaggerSchema) isDifferentApiVersion(obj *unstructured.Unstructured) bool {
groupVersion := obj.GetAPIVersion()
return len(groupVersion) > 0 && s.api.ApiVersion != groupVersion
} | [
-1.1730138063430786,
-1.0024558305740356,
0.5158812403678894,
0.32601895928382874,
0.06015417352318764,
0.8827036619186401,
0.35806477069854736,
-0.6371956467628479,
0.6457792520523071,
0.5871885418891907,
-1.050309658050537,
-0.22466588020324707,
-1.0138016939163208,
0.3702089190483093,
... |
func (s *SwaggerSchema) isGenericArray(p swagger.ModelProperty) bool {
return p.DataTypeFields.Type != nil &&
*p.DataTypeFields.Type == "array" &&
p.Items != nil &&
p.Items.Ref != nil &&
(*p.Items.Ref == "runtime.RawExtension" || *p.Items.Ref == "runtime.Object")
} | [
-1.3487073183059692,
-0.5168930292129517,
0.6662261486053467,
0.3286685347557068,
0.82477867603302,
0.6033506393432617,
-0.5952276587486267,
-0.5542026162147522,
0.2053220421075821,
0.5785564184188843,
-0.26237303018569946,
0.6512917876243591,
-0.7028408646583557,
0.8804216980934143,
0.3... |
func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *wire.Codec, storeName string, kb keys.Keybase, kafka bool, kafkaState rest.KafkaState) {
r.HandleFunc("/issue/fiat", IssueFiatHandlerFunction(cliCtx, cdc, kb, kafka, kafkaState)).Methods("POST")
r.HandleFunc("/fiat/{pegHash}", QueryFiatRequestHandlerF... | [
-0.6547690033912659,
0.961493968963623,
0.513985276222229,
0.678138256072998,
0.4266785681247711,
-0.7905421853065491,
0.05449715629220009,
0.18699879944324493,
-0.22834499180316925,
-0.6739765405654907,
-0.19596533477306366,
-0.8644406795501709,
-0.3818415403366089,
0.6434754133224487,
... |
func (l *store) queryLog(ctx context.Context, shardID uint64,
firstIndex Lsn, maxSize uint64) ([]LogRecord, Lsn, error) {
v, err := l.read(ctx, shardID, indexQuery{})
if err != nil {
return nil, 0, err
}
lastIndex := v.(uint64)
// FIXME: check whether lastIndex >= firstIndex
rs, err := l.nh.QueryRaftLog(shardI... | [
-0.12565554678440094,
0.6184425354003906,
0.5221964716911316,
-0.38352489471435547,
0.048071619123220444,
-0.8044588565826416,
0.38644176721572876,
-0.34529897570610046,
0.14960888028144836,
0.017624270170927048,
-0.00868114922195673,
0.40671539306640625,
-0.06740552932024002,
0.1945908665... |
func (l *store) hakeeperTick() {
isLeader, _, err := l.isLeaderHAKeeper()
if err != nil {
l.runtime.Logger().Error("failed to get HAKeeper Leader ID", zap.Error(err))
return
}
if isLeader {
cmd := hakeeper.GetTickCmd()
ctx, cancel := context.WithTimeout(context.Background(), hakeeperDefaultTimeout)
defer... | [
0.47553014755249023,
0.8795979619026184,
0.6590346097946167,
0.37418079376220703,
0.697524905204773,
0.42718979716300964,
0.625094473361969,
0.6814940571784973,
-0.4187377691268921,
0.1872939020395279,
0.3006528615951538,
-0.6487918496131897,
-0.0578325055539608,
0.9172139167785645,
0.43... |
func (l *store) leaderID(shardID uint64) (uint64, error) {
leaderID, _, ok, err := l.nh.GetLeaderID(shardID)
if err != nil {
return 0, err
}
if !ok {
return 0, nil
}
return leaderID, nil
} | [
0.5852437615394592,
-0.5459027886390686,
0.5295624732971191,
-0.020596137270331383,
0.2816865146160126,
0.12259496748447418,
-0.4092537760734558,
-0.0033377816434949636,
1.2810734510421753,
0.5455121397972107,
0.24934393167495728,
0.6576138138771057,
-0.817113995552063,
1.533812403678894,
... |
func init() {
if err := mb.Registry.AddMetricSet("postgresql", "activity", New); err != nil {
panic(err)
}
} | [
1.3725357055664062,
1.3111584186553955,
0.5871803760528564,
-0.2112526297569275,
1.1421058177947998,
0.7147021293640137,
1.0016794204711914,
-0.5287364721298218,
-0.8180107474327087,
0.12060890346765518,
0.679877758026123,
1.0934278964996338,
-0.8014387488365173,
-0.25633665919303894,
0.... |
func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
config := struct{}{}
if err := base.Module().UnpackConfig(&config); err != nil {
return nil, err
}
return &MetricSet{
BaseMetricSet: base,
}, nil
} | [
0.246793732047081,
-0.5020716190338135,
0.21305201947689056,
-0.15879172086715698,
-0.7643716335296631,
-0.18106810748577118,
0.38452067971229553,
-0.3654119074344635,
-0.9461557865142822,
-0.015928806737065315,
0.29172906279563904,
0.7667924165725708,
-0.5104090571403503,
0.27725207805633... |
func (m *MetricSet) Fetch() ([]common.MapStr, error) {
// TODO: Find a way to pass the timeout
db, err := sql.Open("postgres", m.Host())
if err != nil {
return nil, err
}
defer db.Close()
rows, err := db.Query("SELECT * FROM pg_stat_activity")
if err != nil {
return nil, err
}
columns, err := rows.Colum... | [
0.26326417922973633,
-0.2074459195137024,
0.6881877779960632,
0.05387776717543602,
-0.3403962552547455,
-0.49988311529159546,
-0.3723163902759552,
-0.6130929589271545,
-0.24658747017383575,
0.20585347712039948,
0.8859153389930725,
0.22225335240364075,
0.3582906126976013,
0.8196749687194824... |
func NewTeam(db *service.DB) *Team {
return &Team{db}
} | [
0.8211301565170288,
0.3447914719581604,
-0.18238063156604767,
0.49353548884391785,
-0.2534784972667694,
0.3347790539264679,
-0.809510350227356,
-0.6372882723808289,
-0.5309429168701172,
-1.027852177619934,
0.1735735386610031,
1.0811760425567627,
-0.020665312185883522,
-0.10263790190219879,... |
func main() {
const n = 100000
start := make(chan int)
left := start
right := left
for i := 0; i < n; i++ {
right = make(chan int)
go stage(left, right)
left = right
}
// make the last one a sink channel
sink := left
// inject the starting value into the daisy chain
start <- 0
fmt.Println(<-sink)
} | [
-0.6791789531707764,
0.6767948865890503,
0.6742534637451172,
0.2056736797094345,
0.7353203296661377,
-0.793432354927063,
1.117455244064331,
-0.392854779958725,
-0.1341441422700882,
-0.36897385120391846,
-0.7745422720909119,
0.6422334313392639,
-0.3773490786552429,
1.446865200996399,
0.05... |
func GetClientFactory() (ClientFactory, error) {
if factory == nil {
// Get the normal configuration
config, err := ConfigClient()
if err != nil {
return nil, err
}
// Create a new config based on what was gathered above but don't specify the bearer token to use
istioConfig := rest.Config{
Host: ... | [
0.6157525181770325,
-0.1740860939025879,
0.5061707496643066,
0.1658642441034317,
-0.429903507232666,
-0.6097337007522583,
0.3057996332645416,
-0.029277581721544266,
-0.24661187827587128,
-0.15186651051044464,
-0.33951863646507263,
0.2885930836200714,
-0.4824064075946808,
-0.462912291288375... |
func getClientFactory(istioConfig *rest.Config, expiry time.Duration) (*clientFactory, error) {
mutex.Lock()
if factory == nil {
clientEntriesMap := make(map[string]*clientEntry)
factory = &clientFactory{
baseIstioConfig: istioConfig,
clientEntries: clientEntriesMap,
}
go watchClients(clientEntriesM... | [
0.5713607668876648,
-0.14621001482009888,
0.43619492650032043,
0.09427135437726974,
0.24799185991287231,
-0.28616878390312195,
0.7125548720359802,
-0.6596277356147766,
-0.34761562943458557,
-0.6356234550476074,
0.06759205460548401,
0.9640373587608337,
-0.02730919048190117,
-0.1218977794051... |
func (cf *clientFactory) newClient(authInfo *api.AuthInfo) (ClientInterface, error) {
config := *cf.baseIstioConfig
config.BearerToken = authInfo.Token
// There is a feature when using OpenID strategy to allow using a proxy
// for the cluster API. People may want to place a proxy in
// front of the cluster API ... | [
-0.054126910865306854,
-0.40367797017097473,
0.7210254669189453,
0.1394365280866623,
-0.5831974744796753,
-0.08656325191259384,
0.11939174681901932,
-0.4072529375553131,
0.3955405652523041,
0.05244361609220505,
0.06963380426168442,
0.046632349491119385,
-0.42308029532432556,
-0.67019152641... |
func (cf *clientFactory) GetClient(authInfo *api.AuthInfo) (ClientInterface, error) {
clientEntry, err := cf.getClientEntry(authInfo)
if err != nil {
return nil, err
}
return clientEntry.client, nil
} | [
0.10319763422012329,
-0.2214195728302002,
0.30535292625427246,
0.04396143555641174,
0.5768890380859375,
0.06399329006671906,
0.9354630708694458,
-0.8604286313056946,
0.004484433215111494,
-0.7345278263092041,
0.16184589266777039,
0.9868965148925781,
-0.09351273626089096,
-0.405261486768722... |
func (cf *clientFactory) getClientEntry(authInfo *api.AuthInfo) (*clientEntry, error) {
tokenHash := getTokenHash(authInfo)
mutex.RLock()
cEntry, ok := cf.clientEntries[tokenHash]
mutex.RUnlock()
if ok {
return cEntry, nil
} else {
client, err := cf.newClient(authInfo)
if err != nil {
log.Errorf("Error f... | [
1.189389705657959,
-0.41601231694221497,
0.27692052721977234,
-0.7195637822151184,
0.34872904419898987,
-0.3678251802921295,
-0.18452902138233185,
-1.2958523035049438,
-0.02087186835706234,
-0.1420261263847351,
0.5428733825683594,
1.0945731401443481,
-0.47507423162460327,
0.186851024627685... |
func watchClients(clientEntries map[string]*clientEntry, expiry time.Duration) {
for {
time.Sleep(expiry)
mutex.Lock()
for token, clientEntry := range clientEntries {
if time.Since(clientEntry.created) > expiry {
delete(clientEntries, token)
}
}
internalmetrics.SetKubernetesClients(len(clientEntrie... | [
0.9580499529838562,
-0.93254554271698,
0.24679307639598846,
-0.809954822063446,
0.04940138757228851,
0.17728421092033386,
-0.4271079897880554,
-0.7047619819641113,
-0.5310890674591064,
0.6191251277923584,
0.1884484738111496,
1.1534368991851807,
0.060238368809223175,
0.512182891368866,
-0... |
func isValidJSON(data []byte) bool {
var res interface{}
err := json.Unmarshal(data, &res)
return err == nil
} | [
-0.3797973096370697,
0.08320360630750656,
0.5714672803878784,
-0.6922738552093506,
-0.7305761575698853,
-0.08063123375177383,
-0.23567399382591248,
-0.04602537676692009,
1.2731308937072754,
-0.0776485875248909,
-0.9194398522377014,
-0.26845964789390564,
-1.014947533607483,
-0.0238700117915... |
func (p *portalProxy) DoProxyRequest(requests []interfaces.ProxyRequestInfo) (map[string]*interfaces.CNSIRequest, error) {
log.Debug("DoProxyRequest")
// send the request to each endpoint
done := make(chan *interfaces.CNSIRequest)
for _, requestInfo := range requests {
cnsiRequest, buildErr := p.buildCNSIRequest... | [
-0.8950487375259399,
-0.3143431544303894,
0.7512344121932983,
-0.16036081314086914,
0.5839808583259583,
-0.10383817553520203,
-0.3108227550983429,
-0.6323686838150024,
0.15418632328510284,
0.098166324198246,
0.1069084107875824,
-0.6041299104690552,
-0.43324193358421326,
0.7839239239692688,... |
func (p *portalProxy) DoProxySingleRequest(cnsiGUID, userGUID, method, requestUrl string, headers http.Header, body []byte) (*interfaces.CNSIRequest, error) {
requests := make([]interfaces.ProxyRequestInfo, 0)
proxyURL, err := url.Parse(requestUrl)
if err != nil {
return nil, err
}
req := interfaces.ProxyReque... | [
-0.8301959037780762,
0.27652159333229065,
0.8749938607215881,
0.29919061064720154,
-0.12744656205177307,
-0.3061465620994568,
0.019817138090729713,
-0.20713354647159576,
0.46713197231292725,
0.10347657650709152,
0.23787644505500793,
-0.05369573086500168,
-0.9028992056846619,
0.506657898426... |
func (p *portalProxy) DoProxySingleRequestWithToken(cnsiGUID string, token *interfaces.TokenRecord, method, requestURL string, headers http.Header, body []byte) (*interfaces.CNSIRequest, error) {
proxyURL, err := url.Parse(requestURL)
if err != nil {
return nil, err
}
done := make(chan *interfaces.CNSIRequest)
... | [
-0.4110349416732788,
0.28273212909698486,
0.6558381915092468,
0.2128159999847412,
0.0052840993739664555,
-0.35851672291755676,
-0.8380913138389587,
-0.3388043940067291,
0.3276752829551697,
-0.1042482927441597,
-0.21156449615955353,
0.27803441882133484,
-0.45183682441711426,
0.1482316702604... |
func parseName(raw string) (name, error) {
head, tail := peel(raw, "/")
if tail == "" {
n := name{Kind: idName}
var err error
n.ID, err = reflow.Digester.Parse(head)
if _, ok := err.(hex.InvalidByteError); ok {
return n, errors.E("invalid reflow object name: ", raw, err)
}
return n, err
}
var n name
... | [
0.1553293764591217,
-0.41669347882270813,
1.1842235326766968,
-0.0999297946691513,
-1.095373511314392,
-0.03852885961532593,
-0.1431657075881958,
-0.5271446704864502,
0.3526509702205658,
0.10271293669939041,
0.3143092691898346,
0.29472988843917847,
0.14917270839214325,
0.2993628978729248,
... |
func Uint32ToString(uint32_ uint32) (string_ string) {
string_ = fmt.Sprint(uint32_)
return
} | [
-0.4002470076084137,
0.20588265359401703,
0.4494388997554779,
-1.435884952545166,
-0.09171847999095917,
0.6371927857398987,
-0.9309077262878418,
-1.0639519691467285,
-0.27057281136512756,
-0.04798223078250885,
0.4724877178668976,
-0.5112805366516113,
0.6442423462867737,
0.04008737578988075... |
func Uint32ToPtr(uint32_ uint32) (ptr_uint32_ *uint32) {
ptr_uint32_ = Uint32ToPtrUint32(uint32_)
return
} | [
-0.3302708864212036,
0.5288130640983582,
0.5628734230995178,
-2.1129894256591797,
-0.2896479070186615,
0.35203415155410767,
-0.690608561038971,
-1.2525728940963745,
-0.031744662672281265,
-0.13373248279094696,
0.3947051167488098,
-0.774653971195221,
0.27402815222740173,
-0.7688624262809753... |
func Uint32ToPtrString(uint32_ uint32) (ptr_string_ *string) {
ptr_string_ = new(string)
*ptr_string_ = fmt.Sprint(uint32_)
return
} | [
-0.28832197189331055,
0.5966476202011108,
0.6933461427688599,
-2.1504154205322266,
-0.17178688943386078,
0.634182333946228,
-0.6366019248962402,
-0.9663746356964111,
0.06361866742372513,
-0.008025899529457092,
0.8693220019340515,
-0.5435564517974854,
0.13434721529483795,
-0.714596927165985... |
func Uint32ToPtrUint64(uint32_ uint32) (ptr_uint64_ *uint64) {
ptr_uint64_ = new(uint64)
*ptr_uint64_ = uint64(uint32_)
return
} | [
-0.6451318860054016,
0.4944640100002289,
0.46856358647346497,
-1.2013177871704102,
0.16710147261619568,
-0.34157752990722656,
-0.6536917686462402,
-0.2860700190067291,
-0.14211909472942352,
-0.06860063970088959,
0.17927494645118713,
-0.8719037175178528,
0.20602287352085114,
-0.461131632328... |
func Uint32ToPtrUint32(uint32_ uint32) (ptr_uint32_ *uint32) {
ptr_uint32_ = new(uint32)
*ptr_uint32_ = uint32(uint32_)
return
} | [
-0.2427084892988205,
0.24367240071296692,
0.4735467731952667,
-2.3271405696868896,
0.020955746993422508,
0.18040522933006287,
-0.7565613985061646,
-0.2547287344932556,
0.15304067730903625,
-0.057456232607364655,
-0.11716265976428986,
-0.22732363641262054,
0.25561171770095825,
-0.9399940371... |
func Uint32ToPtrUint16(uint32_ uint32) (ptr_uint16_ *uint16) {
ptr_uint16_ = new(uint16)
*ptr_uint16_ = uint16(uint32_)
return
} | [
0.08132310956716537,
0.749472439289093,
0.3490660786628723,
-2.2806622982025146,
0.2320002019405365,
-0.13186033070087433,
-0.7569736838340759,
-0.36929214000701904,
0.5907099843025208,
-0.005277861375361681,
-0.2647753655910492,
-0.20058876276016235,
0.331256628036499,
-0.9774292707443237... |
func Uint32ToPtrUint8(uint32_ uint32) (ptr_uint8_ *uint8) {
ptr_uint8_ = new(uint8)
*ptr_uint8_ = uint8(uint32_)
return
} | [
-0.8010057806968689,
0.30978068709373474,
0.12518341839313507,
-1.592097282409668,
-0.0668662041425705,
0.22060982882976532,
-0.6479672193527222,
0.06785150617361069,
0.839150607585907,
0.37537792325019836,
-0.09044097363948822,
0.05154675990343094,
-0.1301770806312561,
-0.8751325607299805... |
func Uint32ToPtrUint(uint32_ uint32) (ptr_uint_ *uint) {
ptr_uint_ = new(uint)
*ptr_uint_ = uint(uint32_)
return
} | [
-0.7279943823814392,
0.15904437005519867,
0.4431588053703308,
-2.5810985565185547,
0.026648538187146187,
0.18155346810817719,
-0.278192937374115,
0.2603687644004822,
0.3409314751625061,
-0.6034900546073914,
-0.4152017831802368,
-0.014148864895105362,
-0.14213499426841736,
-0.99426978826522... |
func Uint32ToPtrInt64(uint32_ uint32) (ptr_int64_ *int64) {
ptr_int64_ = new(int64)
*ptr_int64_ = int64(uint32_)
return
} | [
-0.2202749252319336,
0.5746545195579529,
0.4463813304901123,
-1.440321683883667,
0.13211071491241455,
-0.6995432376861572,
-0.7022896409034729,
-0.45267948508262634,
-0.10715687274932861,
0.3615845739841461,
0.25723332166671753,
-1.0068448781967163,
-0.5857908129692078,
-0.0754298195242881... |
func Uint32ToPtrInt32(uint32_ uint32) (ptr_int32_ *int32) {
ptr_int32_ = new(int32)
*ptr_int32_ = int32(uint32_)
return
} | [
0.4800414443016052,
0.16460809111595154,
0.5282831192016602,
-2.440805673599243,
0.029829690232872963,
0.10378223657608032,
-0.7160161733627319,
-0.6679219007492065,
0.20483773946762085,
0.16371430456638336,
-0.04831608012318611,
-0.5322606563568115,
-0.4563409984111786,
-0.543450295925140... |
func Uint32ToPtrInt16(uint32_ uint32) (ptr_int16_ *int16) {
ptr_int16_ = new(int16)
*ptr_int16_ = int16(uint32_)
return
} | [
0.670214831829071,
0.5727362632751465,
0.35529825091362,
-2.5459108352661133,
0.25805720686912537,
-0.26937979459762573,
-0.8333777785301208,
-0.7876863479614258,
0.6040179133415222,
0.3699146807193756,
-0.10861615836620331,
-0.26363131403923035,
-0.48478594422340393,
-0.6220601797103882,
... |
func Uint32ToPtrInt8(uint32_ uint32) (ptr_int8_ *int8) {
ptr_int8_ = new(int8)
*ptr_int8_ = int8(uint32_)
return
} | [
-0.1465219259262085,
0.15403114259243011,
0.09778640419244766,
-1.615318775177002,
-0.13716058433055878,
0.0020054341293871403,
-0.6834779977798462,
-0.2576136589050293,
0.8676252365112305,
0.8830196857452393,
0.19938622415065765,
-0.3122277855873108,
-0.9508932828903198,
-0.52975189685821... |
func Uint32ToPtrInt(uint32_ uint32) (ptr_int_ *int) {
ptr_int_ = new(int)
*ptr_int_ = int(uint32_)
return
} | [
0.22754544019699097,
0.025677256286144257,
0.4722689688205719,
-2.4725940227508545,
-0.2528638243675232,
-0.1402282863855362,
-0.03797890245914459,
-0.7504832744598389,
-0.15131616592407227,
0.032660529017448425,
0.07066135853528976,
-0.45308443903923035,
-0.7195284962654114,
-0.4710695147... |
func Uint32ToPtrBool(uint32_ uint32) (ptr_bool_ *bool) {
ptr_bool_ = new(bool)
if uint32_ == 0 {
*ptr_bool_ = false
} else if uint32_ == 1 { // || int_ > 0 {
*ptr_bool_ = true
} else {
ptr_bool_ = nil
}
return
} | [
-0.49779805541038513,
0.7032860517501831,
0.7657096982002258,
-1.1878838539123535,
0.10233531892299652,
0.6240689158439636,
0.1681586503982544,
-0.07939672470092773,
-0.00739495363086462,
0.2611928880214691,
-0.3790567219257355,
-0.591213047504425,
-0.058246735483407974,
-0.523753166198730... |
func Uint32ToUint64(uint32_ uint32) (uint64_ uint64) {
uint64_ = uint64(uint32_)
return
} | [
-0.5688055753707886,
0.9456574320793152,
0.42142531275749207,
-0.8921515941619873,
0.23925931751728058,
0.146689310669899,
-0.641006350517273,
-0.2733994424343109,
-0.6829470992088318,
-0.4460747241973877,
-0.15516476333141327,
-1.1177945137023926,
0.17401203513145447,
-0.2511568069458008,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.