text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func TestProposalBufferConcurrentWithDestroy(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ctx := context.Background()
var p testProposer
var b propBuf
var pc proposalCreator
clock := hlc.NewClock(hlc.UnixNano, time.Nanosecond)
b.Init(&p, tracker.NewLockfreeTracker(), clock, cluster... | [
0.1483859270811081,
0.7257640361785889,
1.1233543157577515,
-0.14936861395835876,
0.20955310761928558,
0.42767030000686646,
0.19563449919223785,
-0.33943718671798706,
-0.010100084356963634,
0.5143634080886841,
0.032514020800590515,
0.2603752911090851,
-0.957206130027771,
-0.351648151874542... |
func TestPropBufCnt(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
var count propBufCnt
const numReqs = 10
reqLeaseInc := makePropBufCntReq(true)
reqLeaseNoInc := makePropBufCntReq(false)
for i := 0; i < numReqs; i++ {
count.update(reqLeaseInc)
}
res := count.read()
assert.Equ... | [
0.10053480416536331,
-0.3617199957370758,
0.7049118280410767,
-0.37768757343292236,
0.9514221549034119,
0.5011497139930725,
0.6386218667030334,
-0.13437460362911224,
-0.13758178055286407,
-1.1765164136886597,
-0.018119776621460915,
0.3785686194896698,
0.17404820024967194,
-0.50335597991943... |
func TestProposalBufferRejectLeaseAcqOnFollower(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ctx := context.Background()
self := uint64(1)
// Each subtest will try to propose a lease acquisition in a different Raft
// scenario. Some proposals should be allowed, some should be rejecte... | [
0.7630816698074341,
0.43368178606033325,
0.6946205496788025,
-0.005058817099779844,
-0.7114893794059753,
0.7722162008285522,
0.1937958300113678,
-0.04729318246245384,
0.7327176928520203,
-0.6070017218589783,
-0.43797537684440613,
0.42960125207901,
-0.6938808560371399,
0.3854464590549469,
... |
func TestProposalBufferClosedTimestamp(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ctx := context.Background()
const maxOffset = 500 * time.Millisecond
mc := hlc.NewManualClock((1613588135 * time.Second).Nanoseconds())
clock := hlc.NewClock(mc.UnixNano, maxOffset)
st := cluster.Mak... | [
-0.2862139046192169,
-0.008418908342719078,
1.0584501028060913,
-0.17048145830631256,
0.08592855930328369,
0.9855075478553772,
0.0833120048046112,
-0.7894415855407715,
0.21846796572208405,
0.09590610861778259,
-0.38268256187438965,
0.2247912734746933,
-0.5114032626152039,
0.434064924716949... |
func relay(left, right net.Conn) (int64, int64, error) {
var toLeft, toRight int64
var err, errLeft, errRight error
var msgLeft, msgRight string
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
toRight, errRight = io.Copy(right, left)
if errRight != nil {
msgRight = fmt.Sprintf("copy to right... | [
-0.37529540061950684,
-0.09962201863527298,
0.8278299570083618,
-0.4848710596561432,
-0.8153461217880249,
-0.005203243810683489,
-0.2251330316066742,
-0.22936221957206726,
-0.331711083650589,
0.9112797975540161,
-0.30209437012672424,
0.39973241090774536,
-0.2025429606437683,
0.855623722076... |
func AbundantNumbers(below int) (answer []int) {
numbers := []int{}
for a := 2; a < below; a++ {
if IsAbundantNumber(a) {
numbers = append(numbers, a)
}
}
return numbers
} | [
-0.4678979516029358,
-0.7233049869537354,
0.7170799374580383,
0.5967215299606323,
-0.4529719054698944,
-0.14944861829280853,
0.00834044162184,
0.04560597985982895,
0.10373014211654663,
-0.01995447278022766,
-0.3711400628089905,
1.3180856704711914,
-0.1312851458787918,
1.6144185066223145,
... |
func NotSumOfAbundantNumbers(below int) (answer []int) {
abundant := AbundantNumbers(below)
sumOfAbundant := [][]int{}
// golang defaults bool to false
isSumOfAbundant := make([]bool, below)
count := 0
for n := 1; n < below; n++ {
Loop:
for i, a := range abundant {
for j := i; j < len(abundant); j++ {
... | [
-0.20014624297618866,
-0.5708263516426086,
1.0837842226028442,
0.03921278193593025,
-0.392128050327301,
0.2480161190032959,
0.8449980020523071,
-0.8629983067512512,
0.031181076541543007,
0.6232281923294067,
-0.41776326298713684,
0.434065043926239,
-0.06340246647596359,
0.7964912056922913,
... |
func NewPutUserSubscriptionsOwnerRepoNoContent() *PutUserSubscriptionsOwnerRepoNoContent {
return &PutUserSubscriptionsOwnerRepoNoContent{}
} | [
0.3206670582294464,
-0.1418175995349884,
0.34348830580711365,
-0.0019624754786491394,
-1.2135772705078125,
-1.242201328277588,
0.10439813137054443,
-0.49176061153411865,
0.7468401789665222,
0.2095504105091095,
0.4494204521179199,
0.3421904444694519,
-0.18930791318416595,
-1.415362715721130... |
func (o *PutUserSubscriptionsOwnerRepoNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(204)
} | [
-0.49662694334983826,
-0.30799099802970886,
0.3241010308265686,
0.33341842889785767,
0.6889731287956238,
-1.3537917137145996,
0.5222402215003967,
-0.5270800590515137,
0.39702412486076355,
0.07783059775829315,
0.1563752442598343,
-0.1748056709766388,
-1.0210332870483398,
-0.8654992580413818... |
func NewPutUserSubscriptionsOwnerRepoForbidden() *PutUserSubscriptionsOwnerRepoForbidden {
return &PutUserSubscriptionsOwnerRepoForbidden{}
} | [
-0.03790377080440521,
0.28532737493515015,
0.3889086842536926,
0.04067765921354294,
-1.048027753829956,
-0.33553802967071533,
0.1153242215514183,
-0.21115922927856445,
0.3936229646205902,
-0.2556544840335846,
0.39005881547927856,
0.9538609385490417,
0.023962100967764854,
-1.886469602584838... |
func (o *PutUserSubscriptionsOwnerRepoForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(403)
} | [
-0.15890425443649292,
0.12159471213817596,
0.28183701634407043,
0.4156154692173004,
0.5353273153305054,
-0.6929843425750732,
0.7544178366661072,
-0.9931381344795227,
0.308102011680603,
-0.040702369064092636,
0.4450616240501404,
0.3466106057167053,
-0.8166733980178833,
-1.004016637802124,
... |
func (o *foodOrder) selectShelf(s *orderShelves, arrivalDelay int, getNow timeFunc) *orderShelf {
matchingShelf := s.overflow
switch o.Temp {
case "cold":
matchingShelf = s.cold
case "hot":
matchingShelf = s.hot
case "frozen":
matchingShelf = s.frozen
}
overflowDecayScore := o.computeDecayScore(s.overflow... | [
-0.0066162412986159325,
-0.5953042507171631,
0.6895366907119751,
0.3534615933895111,
-0.4014403820037842,
-0.09441196918487549,
1.15535569190979,
-1.0074118375778198,
0.3770405054092407,
-0.6467015147209167,
0.44853711128234863,
-0.10547450929880142,
0.2719067931175232,
0.9542443752288818,... |
func (o GetGroupResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v GetGroupResult) string { return v.Description }).(pulumi.StringOutput)
} | [
0.121343694627285,
0.3849233388900757,
0.5475476980209351,
-0.10815396159887314,
0.4806991517543793,
0.14240972697734833,
-0.022446833550930023,
-0.22465729713439941,
-0.5112865567207336,
0.013834921643137932,
0.5838598012924194,
1.0087813138961792,
-0.2661770284175873,
-0.7818862795829773... |
func (o GetGroupResultOutput) DomainId() pulumi.StringOutput {
return o.ApplyT(func(v GetGroupResult) string { return v.DomainId }).(pulumi.StringOutput)
} | [
0.4085760712623596,
0.371611624956131,
0.35487768054008484,
0.14262931048870087,
0.4868234097957611,
0.8896434307098389,
0.46291765570640564,
-0.04278366267681122,
0.4875357747077942,
-0.7432331442832947,
0.2745751142501831,
1.6668009757995605,
-0.19335170090198517,
-0.20897990465164185,
... |
func (o GetGroupResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetGroupResult) string { return v.Id }).(pulumi.StringOutput)
} | [
0.3893393874168396,
0.4108538031578064,
0.25183913111686707,
0.10593268275260925,
0.7170003652572632,
0.4975997805595398,
0.39444297552108765,
-0.21799688041210175,
0.2726536989212036,
-0.3152390122413635,
-0.09660326689481735,
0.4366401731967926,
-0.6570953726768494,
-0.8133224248886108,
... |
func (o GetGroupResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetGroupResult) string { return v.Name }).(pulumi.StringOutput)
} | [
-0.2984004020690918,
0.4082317650318146,
0.37890082597732544,
-0.1938294768333435,
-0.18591560423374176,
0.03377246856689453,
0.14254513382911682,
-0.7394149303436279,
-0.6274301409721375,
0.3040260672569275,
-0.09056854993104935,
0.37468183040618896,
0.11276034265756607,
-0.58740800619125... |
func (o GetGroupResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v GetGroupResult) string { return v.Region }).(pulumi.StringOutput)
} | [
0.3618355691432953,
0.15978789329528809,
0.3251396715641022,
-0.39628541469573975,
0.46936267614364624,
0.561518669128418,
0.691313624382019,
-0.5351911783218384,
0.08498749881982803,
-0.47641533613204956,
0.6754879355430603,
1.2121189832687378,
-0.10286148637533188,
-0.8724120259284973,
... |
func GetNuggets(ID string, page int64) ([]*models.BringNuggets, bool) {
//avoid long timelapses
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
//database
db := MongoCN.Database("meganeuradb")
//collection
col := db.Collection("nugget")
var results []*models.BringNugge... | [
-0.28157299757003784,
1.1634384393692017,
0.8322571516036987,
-0.2008408159017563,
-0.07972410321235657,
0.4232497811317444,
0.03868239372968674,
-0.7924814224243164,
-0.2092682272195816,
0.4003874361515045,
-0.0925602987408638,
0.35555148124694824,
-0.49244144558906555,
1.578303575515747,... |
func (client *Client) DescribePhoneTwiceTelVerify(request *DescribePhoneTwiceTelVerifyRequest) (response *DescribePhoneTwiceTelVerifyResponse, err error) {
response = CreateDescribePhoneTwiceTelVerifyResponse()
err = client.DoAction(request, response)
return
} | [
-0.43972474336624146,
0.37070679664611816,
0.3450547158718109,
0.040845051407814026,
-0.21444472670555115,
-0.17511577904224396,
-0.44179344177246094,
-1.2631350755691528,
0.035519663244485855,
-0.578233540058136,
-1.2973244190216064,
1.0737733840942383,
-0.13872645795345306,
1.05097317695... |
func (client *Client) DescribePhoneTwiceTelVerifyWithChan(request *DescribePhoneTwiceTelVerifyRequest) (<-chan *DescribePhoneTwiceTelVerifyResponse, <-chan error) {
responseChan := make(chan *DescribePhoneTwiceTelVerifyResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(resp... | [
-0.381549596786499,
-0.014251645654439926,
0.4584234952926636,
-0.6563643217086792,
-0.009403611533343792,
-0.10940925031900406,
-0.2877142131328583,
-1.4284101724624634,
0.6486490368843079,
-0.6406955718994141,
-0.4091603755950928,
1.1913586854934692,
-0.016330044716596603,
1.105140447616... |
func (client *Client) DescribePhoneTwiceTelVerifyWithCallback(request *DescribePhoneTwiceTelVerifyRequest, callback func(response *DescribePhoneTwiceTelVerifyResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *DescribePhoneTwiceTelVerifyResponse
var err... | [
-0.14548805356025696,
0.4594133794307709,
0.751573383808136,
-0.4059489369392395,
-0.16027189791202545,
-0.5260897874832153,
-0.05994098633527756,
-1.1410456895828247,
1.161536693572998,
-0.4591222405433655,
-0.3928517699241638,
0.5199643969535828,
0.20124034583568573,
1.1574485301971436,
... |
func CreateDescribePhoneTwiceTelVerifyRequest() (request *DescribePhoneTwiceTelVerifyRequest) {
request = &DescribePhoneTwiceTelVerifyRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("Dytnsapi", "2020-02-17", "DescribePhoneTwiceTelVerify", "", "")
request.Method = requests.POST
return
} | [
-0.07469955831766129,
0.41461440920829773,
0.5455231666564941,
-0.06760414689779282,
0.6018865704536438,
0.13824155926704407,
-0.7391911149024963,
-0.8889830112457275,
-0.04217834770679474,
-1.149389624595642,
-0.6849499344825745,
1.2194147109985352,
0.06731104105710983,
1.6580449342727661... |
func CreateDescribePhoneTwiceTelVerifyResponse() (response *DescribePhoneTwiceTelVerifyResponse) {
response = &DescribePhoneTwiceTelVerifyResponse{
BaseResponse: &responses.BaseResponse{},
}
return
} | [
0.027855008840560913,
0.08875326812267303,
0.4049983620643616,
0.15341123938560486,
0.6806562542915344,
0.1901663839817047,
-0.11615385860204697,
-0.801150918006897,
0.35875463485717773,
-0.955640435218811,
-1.1641442775726318,
0.1359882354736328,
-0.32016924023628235,
1.3009560108184814,
... |
func (cfg *Config) ListConfigFiles() []string {
objects := cfg.Client.ListObjects(configBucket, "", true, make(chan struct{}, 1))
results := []string{}
for object := range objects {
results = append(results, object.Key)
}
return results
} | [
-0.9174924492835999,
-0.5671185255050659,
0.6900521516799927,
0.14963603019714355,
0.2247178852558136,
-0.727732241153717,
-0.29540786147117615,
0.06134257838129997,
-0.8277941942214966,
1.1572251319885254,
-1.5577143430709839,
-0.6303476691246033,
-0.7932225465774536,
0.41890597343444824,... |
func (_m *JobCache) AddJobs(_a0 []*types.Job) {
_m.Called(_a0)
} | [
0.048702917993068695,
0.9064609408378601,
0.4532623589038849,
-0.2543942928314209,
-0.5114343762397766,
0.27846598625183105,
0.9336869716644287,
0.12938164174556732,
0.5462457537651062,
-0.31502485275268555,
0.644157350063324,
-0.7012342810630798,
0.08462542295455933,
0.9110088348388672,
... |
func (_m *JobCache) GetAllCachedJobs() []*types.Job {
ret := _m.Called()
var r0 []*types.Job
if rf, ok := ret.Get(0).(func() []*types.Job); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.Job)
}
}
return r0
} | [
-0.31587859988212585,
0.26037150621414185,
0.5876213908195496,
1.2632554769515991,
0.09474865347146988,
-0.27554845809936523,
0.43300604820251465,
0.46015849709510803,
0.28150659799575806,
-1.2887171506881714,
-1.079426884651184,
0.6006653308868408,
-0.7621504068374634,
0.5987492203712463,... |
func (_m *JobCache) GetJob(_a0 string) (*types.Job, error) {
ret := _m.Called(_a0)
var r0 *types.Job
if rf, ok := ret.Get(0).(func(string) *types.Job); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Job)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string) error); ok {
r... | [
0.2850880026817322,
0.017899975180625916,
0.39339229464530945,
0.014574103988707066,
0.19618426263332367,
-0.6305425763130188,
1.0573104619979858,
0.7275781035423279,
0.23702721297740936,
-0.20215703547000885,
0.8149741888046265,
0.28397542238235474,
0.5635197758674622,
0.28950297832489014... |
func (_m *JobCache) GetJobMaybeExpired(_a0 context.Context, _a1 string) (*types.Job, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.Job
if rf, ok := ret.Get(0).(func(context.Context, string) *types.Job); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Job)
}
}
var r1 e... | [
0.09369972348213196,
-0.39692941308021545,
0.64266037940979,
-0.3030232787132263,
0.1343322992324829,
-0.22613321244716644,
-0.48809534311294556,
0.2771908938884735,
-0.5347399115562439,
0.00875398050993681,
-0.2501198947429657,
0.4139590561389923,
-0.25204768776893616,
0.4876546561717987,... |
func (_m *JobCache) GetJobsByRepoState(_a0 string, _a1 types.RepoState) ([]*types.Job, error) {
ret := _m.Called(_a0, _a1)
var r0 []*types.Job
if rf, ok := ret.Get(0).(func(string, types.RepoState) []*types.Job); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.Job)
}
}
... | [
-0.24898594617843628,
0.08792530000209808,
0.626950740814209,
-0.5188052654266357,
-0.10140211135149002,
-0.34754639863967896,
0.34423699975013733,
0.3324543237686157,
-0.1507575958967209,
0.18581517040729523,
-0.12495802342891693,
-0.3661532998085022,
0.030875977128744125,
0.3101040124893... |
func (_m *JobCache) GetJobsFromDateRange(_a0 time.Time, _a1 time.Time) ([]*types.Job, error) {
ret := _m.Called(_a0, _a1)
var r0 []*types.Job
if rf, ok := ret.Get(0).(func(time.Time, time.Time) []*types.Job); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.Job)
}
}
var ... | [
-0.4527100622653961,
0.12808340787887573,
0.5868135690689087,
-0.14680205285549164,
-0.016260961070656776,
0.1959594190120697,
0.38120171427726746,
-0.04441376402974129,
-0.8862499594688416,
-0.04788810759782791,
0.10468599200248718,
-0.2801358103752136,
0.33778369426727295,
0.514776289463... |
func (_m *JobCache) GetMatchingJobsFromDateRange(names []string, from time.Time, to time.Time) (map[string][]*types.Job, error) {
ret := _m.Called(names, from, to)
var r0 map[string][]*types.Job
if rf, ok := ret.Get(0).(func([]string, time.Time, time.Time) map[string][]*types.Job); ok {
r0 = rf(names, from, to)
... | [
-0.7949879765510559,
-0.32592734694480896,
0.7021962404251099,
-0.45147398114204407,
-0.8315870761871338,
0.23067916929721832,
-0.11877067387104034,
-0.10454793274402618,
-1.1951311826705933,
-0.706525444984436,
-0.9914776086807251,
-0.263931542634964,
-0.059450626373291016,
0.182246789336... |
func (_m *JobCache) UnfinishedJobs() ([]*types.Job, error) {
ret := _m.Called()
var r0 []*types.Job
if rf, ok := ret.Get(0).(func() []*types.Job); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.Job)
}
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} ... | [
-0.6744387149810791,
0.12286858260631561,
0.4585610330104828,
0.07180861383676529,
-0.012856355868279934,
0.02104080654680729,
1.148433804512024,
0.11210865527391434,
-0.7080032229423523,
-0.5141562223434448,
-0.34762638807296753,
-0.5316328406333923,
-0.9685890674591064,
0.605766534805297... |
func (_m *JobCache) Update(ctx context.Context) error {
ret := _m.Called(ctx)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
} | [
-0.4967447519302368,
-0.2457071840763092,
0.3571082353591919,
-0.12571267783641815,
-0.27787068486213684,
0.26603513956069946,
0.11782873421907425,
-0.025945080444216728,
0.24082480370998383,
-0.30202484130859375,
-0.012111186981201172,
-0.28795427083969116,
-0.41737666726112366,
-0.121854... |
func NewJobCache(t testing.TB) *JobCache {
mock := &JobCache{}
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
} | [
0.25994476675987244,
-0.24207042157649994,
0.22530536353588104,
0.31348636746406555,
-0.625182032585144,
0.17416313290596008,
0.3527434170246124,
0.2236456274986267,
-0.5630185604095459,
-0.4165346324443817,
-0.4328743517398834,
-0.8082602620124817,
-0.28551632165908813,
0.4967561364173889... |
func Configure() {
log = cfg.Logging.Logger
fastlog = cfg.Logging.FastLogger
// http://www.gorillatoolkit.org/pkg/sessions
sessstore = sessions.NewCookieStore([]byte(cfg.Cfg.Session.Key))
sessstore.Options.HttpOnly = cfg.Cfg.Cookie.HTTPOnly
sessstore.Options.Secure = cfg.Cfg.Cookie.Secure
sessstore.Options.SameS... | [
-0.5420739054679871,
0.45893481373786926,
0.6135147213935852,
0.9741057753562927,
0.3186458647251129,
-0.8563022613525391,
0.3035746216773987,
0.07319299876689911,
0.5952019691467285,
0.49386048316955566,
-0.9740287065505981,
-0.17526516318321228,
-0.25198549032211304,
0.7267153859138489,
... |
func ParseOverwrite(arg string, overwriteImage bool) (*Overwrite, error) {
// match <image>@<digest>
if d := strings.Split(arg, "@"); len(d) > 1 {
return &Overwrite{
Name: d[0],
Digest: d[1],
}, nil
}
// match <image>:<tag>
if t := pattern.FindStringSubmatch(arg); len(t) == 3 {
return &Overwrite{
... | [
-0.9871320724487305,
-0.5449140667915344,
0.5805760622024536,
-0.4057129919528961,
-0.5460309386253357,
-1.2822390794754028,
0.4635252356529236,
-0.128081277012825,
-0.27342289686203003,
0.042154710739851,
0.030796287581324577,
-1.1957346200942993,
-0.19539740681648254,
0.23100586235523224... |
func Help(cs *Command) *Command {
return &Command{
Usage: "help [command]",
Description: `Print articles and detailed information about subcommands.`,
Run: func(c *Command, args ...string) error {
// If there aren't any arguments, print the main command help.
if len(args) == 0 {
cs.Help()
ret... | [
0.9030099511146545,
0.1607505828142166,
0.6054272055625916,
0.39127063751220703,
0.2936023771762848,
0.14780385792255402,
0.40849876403808594,
-0.41240987181663513,
-0.08656713366508484,
-0.6436845660209656,
0.22204914689064026,
0.8844760656356812,
0.2287427932024002,
0.041527148336172104,... |
func queryFirst(services ...string) <-chan string {
c := make(chan string)
for _, serv := range services {
go func(s string) { c <- query(s) }(serv)
}
return c
} | [
-0.054469045251607895,
0.5496288537979126,
0.5058354735374451,
-0.7093472480773926,
0.2575013041496277,
0.24924588203430176,
-0.7408126592636108,
-1.3696017265319824,
-0.5948437452316284,
-0.3949228823184967,
0.7358883619308472,
1.0485318899154663,
0.013006583787500858,
0.5024293661117554,... |
func (client *Client) Start() error {
return client.startNode()
} | [
0.07269708812236786,
0.3987547755241394,
-0.03362296149134636,
0.09940683096647263,
0.03406953439116478,
0.04036158323287964,
0.5404465198516846,
0.6471280455589294,
-0.5847753286361694,
0.390669047832489,
-0.5949923396110535,
2.072968006134033,
-0.3096569776535034,
-0.18685686588287354,
... |
func (net *Network) NewClient(cfg *ClientCfg) (*Client, error) {
clientName := fmt.Sprintf("client-%d", len(net.clients))
clientDir, err := net.baseDir.NewSubDir(clientName)
if err != nil {
net.logger.Error("failed to create client subdir",
"err", err,
"client_name", clientName,
)
return nil, fmt.Errorf... | [
0.015339297242462635,
0.20682771503925323,
0.45946982502937317,
-0.6092734336853027,
0.07887934893369675,
0.4777931272983551,
1.060962438583374,
-0.5250581502914429,
-0.17636536061763763,
-0.36653369665145874,
0.15852855145931244,
-0.2672972083091736,
0.3295603394508362,
-0.515387952327728... |
func BenchmarkLocal_StartSpanFromContext(b *testing.B) {
b.ReportAllocs()
parentSpan := opentracing.StartSpan("parent operation name")
ctx := opentracing.ContextWithSpan(context.Background(), parentSpan)
for n := 0; n < b.N; n++ {
StartSpanFromContext(ctx)
}
} | [
1.3193843364715576,
0.6696967482566833,
0.3868340253829956,
0.302871435880661,
-0.010086982510983944,
0.30335789918899536,
1.6775128841400146,
-0.9282703399658203,
1.406818151473999,
-0.39909371733665466,
-0.13223247230052948,
0.16752180457115173,
0.25058794021606445,
0.34196317195892334,
... |
func New(token string) *API {
return &API{
Token: token,
hasHandlers: false,
}
} | [
-0.3599325120449066,
-0.9162377715110779,
-0.07295291870832443,
-0.26729482412338257,
-0.9960076808929443,
-0.2700028419494629,
-0.5723198056221008,
0.013393075205385685,
-0.3949967324733734,
-0.6570332050323486,
-0.9839574694633484,
0.098690927028656,
0.38298794627189636,
-0.1680066138505... |
func (api *API) RequireToken(fn http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
auth := r.Header.Get("Authorization")
want := fmt.Sprintf("Bearer %s", api.Token)
if auth != want {
w.WriteHeader(http.StatusUnauthorized)
return
}
log.Debug("Valid token found.")
... | [
-0.3154255747795105,
-0.29292598366737366,
0.3683021664619446,
0.49024635553359985,
0.0390210784971714,
-0.0466352179646492,
-0.1535317301750183,
0.7710232138633728,
0.39436018466949463,
-0.5702805519104004,
-0.09016282111406326,
-0.014371161349117756,
0.9856408834457397,
0.439780026674270... |
func (api *API) RegisterFunc(path string, fn http.HandlerFunc) {
api.hasHandlers = true
http.HandleFunc(path, api.RequireToken(fn))
} | [
0.3001572787761688,
0.1448720246553421,
0.2103448212146759,
-0.026049768552184105,
1.0555514097213745,
-0.4186584949493408,
-0.269722044467926,
1.16415274143219,
-0.47630050778388977,
-0.8998121023178101,
-0.5623228549957275,
0.6224899888038635,
1.4362940788269043,
-0.07651407271623611,
... |
func (api *API) RegisterHandler(path string, handler http.Handler) {
api.hasHandlers = true
http.Handle(path, api.RequireToken(handler.ServeHTTP))
} | [
-0.20245261490345,
0.3951234519481659,
0.19280773401260376,
0.2839871048927307,
1.0236350297927856,
0.5405377745628357,
-0.8330763578414917,
1.2240190505981445,
-0.532799243927002,
-0.7170423865318298,
-0.7354607582092285,
0.09235826134681702,
0.07859551161527634,
0.7770098447799683,
0.2... |
func (api *API) Start(block bool) error {
if !api.hasHandlers {
log.Debug("Watchtower HTTP API skipped.")
return nil
}
if api.Token == "" {
log.Fatal(tokenMissingMsg)
}
if block {
runHTTPServer()
} else {
go func() {
runHTTPServer()
}()
}
return nil
} | [
-0.0442749559879303,
-0.1377888321876526,
0.5020534992218018,
0.5587758421897888,
0.6392408609390259,
0.19896641373634338,
0.37673187255859375,
0.4449659287929535,
-0.4785389304161072,
0.3872576653957367,
-0.5384277105331421,
0.9437017440795898,
-0.4452308118343353,
0.8300986289978027,
0... |
func Default() types.Importer {
return &vendorImporter{
imported: make(map[string]*types.Package),
base: importer.Default(),
skipTestFiles: true,
}
} | [
0.26233336329460144,
0.07993493229150772,
0.24510276317596436,
0.7832168340682983,
0.7631202340126038,
0.03314720839262009,
0.4003850817680359,
0.14224407076835632,
0.32073917984962463,
0.17624998092651367,
-0.6227434873580933,
-0.431540310382843,
-0.639114260673523,
0.4080422818660736,
... |
func DefaultWithTestFiles() types.Importer {
return &vendorImporter{
imported: make(map[string]*types.Package),
base: importer.Default(),
skipTestFiles: false,
}
} | [
0.7120434641838074,
-0.18441230058670044,
0.3551507890224457,
0.7131101489067078,
0.3426993191242218,
0.0987449660897255,
0.31915369629859924,
-0.6280821561813354,
0.3943229615688324,
0.523746132850647,
-0.6042839884757996,
-1.4297364950180054,
-0.6531699895858765,
0.5249617099761963,
-1... |
func IsSet(set *core.Set, index int64) int64 {
shift := int(index >> 6)
pos := uint64(index % 64)
if len(set.Data) <= shift || set.Data[shift]&(1<<pos) == 0 {
return 0
}
return 1
} | [
-1.0873891115188599,
0.5657638907432556,
0.44279932975769043,
-0.20254579186439514,
-0.10108529031276703,
-0.4280467927455902,
0.12374908477067947,
-0.7330304980278015,
0.5738415718078613,
-0.07445720583200455,
0.398030549287796,
0.5936992168426514,
-0.5138933658599854,
-0.2577572762966156... |
func getLDS(svcRouteConfigName, svcListenerName string) (types.Resource, error) {
httpConnRds := &hcm.HttpConnectionManager_Rds{
Rds: &hcm.Rds{
RouteConfigName: svcRouteConfigName,
ConfigSource: &core.ConfigSource{
ConfigSourceSpecifier: &core.ConfigSource_Ads{
Ads: &core.AggregatedConfigSource{},
... | [
-0.3923127055168152,
0.3016725182533264,
0.8179970979690552,
-0.9417577385902405,
0.29211702942848206,
-0.5523537993431091,
-1.4285085201263428,
-0.6194161772727966,
0.3054012656211853,
0.2313506156206131,
0.551555871963501,
1.2543238401412964,
0.009088803082704544,
0.6977298259735107,
0... |
func getRDS(svcRouteConfigName, svcVirtualHostName, svcListenerName string) types.Resource {
vhost := &route.VirtualHost{
Name: svcVirtualHostName,
Domains: []string{svcListenerName},
Routes: []*route.Route{{
Match: &route.RouteMatch{
PathSpecifier: &route.RouteMatch_Prefix{
Prefix: "",
},
... | [
0.24614697694778442,
0.8824477791786194,
0.5953973531723022,
-0.38330012559890747,
0.39108899235725403,
-0.8325877785682678,
-0.7665399312973022,
0.7395166158676147,
0.6396497488021851,
0.1765880435705185,
0.7585350871086121,
1.3682953119277954,
-0.3690495193004608,
0.47391122579574585,
... |
func getCDS() types.Resource {
return types.Resource(
&api.Cluster{
Name: someClusterName,
LbPolicy: api.Cluster_ROUND_ROBIN, // as of grpc-go 1.32.x it's the only option
ClusterDiscoveryType: &api.Cluster_Type{Type: api.Cluster_EDS}, // points to EDS
EdsClust... | [
-0.7011799216270447,
0.4562411904335022,
0.4433547258377075,
-1.0530644655227661,
0.16885337233543396,
-0.5085983276367188,
-0.07266577333211899,
-0.6103640198707581,
0.15163865685462952,
0.0496709831058979,
0.48721417784690857,
0.835268497467041,
-0.19207356870174408,
-0.02452936954796314... |
func getEDS(ip string, port uint32, localitiesZone2Reg map[string]string) types.Resource {
var lbeps []*ep.LbEndpoint
hst := &core.Address{
Address: &core.Address_SocketAddress{
SocketAddress: &core.SocketAddress{
Address: ip,
Protocol: core.SocketAddress_TCP,
PortSpecifier: &core.SocketAddress_Port... | [
-0.5983899235725403,
-0.2383776307106018,
0.702997088432312,
-1.3833249807357788,
0.23455698788166046,
-0.5369292497634888,
-0.6641513109207153,
-0.35848498344421387,
0.7314242720603943,
0.19025610387325287,
0.9322196841239929,
0.9888038039207458,
-0.16027943789958954,
0.03981494903564453,... |
func (tc *TestCase) SetPreTestFunc(curFunc func(data interface{}, context *TestContext)) {
if tc.PreTestFunc == nil {
tc.PreTestFunc = curFunc
}
} | [
0.22178271412849426,
-0.19490104913711548,
0.3211822211742401,
-0.23812109231948853,
0.1289214938879013,
-0.6188088655471802,
1.5939128398895264,
0.3301820158958435,
0.8885113000869751,
-0.22962301969528198,
-0.0005364680546335876,
0.47768867015838623,
0.6250799298286438,
0.109430193901062... |
func (tc *TestCase) SetPostTestFunc(curFunc func(data interface{}, context *TestContext)) {
if tc.PostTestFunc == nil {
tc.PostTestFunc = curFunc
}
} | [
-0.006640094798058271,
-0.9359626770019531,
0.17572058737277985,
-0.29979050159454346,
-0.43866580724716187,
-0.4483785033226013,
0.799132227897644,
0.11556623876094818,
0.16426625847816467,
0.004401963669806719,
-0.3675135672092438,
-0.059273697435855865,
0.08379370719194412,
0.2689738571... |
func (tc *TestCase) SetVerifyTestFunc(curFunc func(data interface{}, context *TestContext) bool) {
if tc.VerifyTestFunc == nil {
tc.VerifyTestFunc = curFunc
}
} | [
0.4320187568664551,
-0.7872886657714844,
0.3370034694671631,
-0.020940003916621208,
0.593778669834137,
-0.4535767138004303,
0.9456711411476135,
0.31189191341400146,
1.0083059072494507,
0.28649550676345825,
-0.6391021609306335,
0.7845349311828613,
0.13756567239761353,
0.23788519203662872,
... |
func RunTestCases(t *testing.T, testcases *[]TestCase, ctx *TestContext) {
context := ctx
if context == nil {
context = &TestContext{
NameIDMap: make(map[string]string),
NameObjectMap: make(map[string]interface{}),
}
}
for _, tc := range *testcases {
TestLog = t
if true { //tc.Enabled){
t.Lo... | [
-0.6686340570449829,
0.04837594926357269,
0.4239480793476105,
0.836734414100647,
-0.4010698199272156,
0.42661574482917786,
0.5992858409881592,
-0.3344624936580658,
0.6213395595550537,
0.4761321246623993,
0.6538860201835632,
-0.5979781150817871,
-0.5117585062980652,
0.8685946464538574,
-1... |
func testcaseFunc(runner TestExecuter, context *TestContext, tc *TestCase) func(*testing.T) {
return func(t *testing.T) {
TestLog = t
err := runner.PreExecute(tc, context)
if err != nil {
t.Fatalf("Client pre-Execute test failed. Err=%s", err)
}
//process the data before running Test if preTestFunc if n... | [
0.8664683699607849,
-0.3037540316581726,
0.6891698837280273,
0.17810824513435364,
0.35054272413253784,
0.07690174877643585,
1.3738833665847778,
0.12977494299411774,
0.30229806900024414,
0.5085240006446838,
-0.27092137932777405,
0.16349391639232635,
0.12909090518951416,
0.3712347745895386,
... |
func GetOSEnv(name string, defaultValue string) string {
value := os.Getenv(name)
if len(value) == 0 {
value = defaultValue
}
return value
} | [
-0.28050753474235535,
0.6050493121147156,
0.3977176547050476,
0.35065412521362305,
0.27954450249671936,
-0.26906728744506836,
-0.5150660276412964,
-0.07319775223731995,
-0.5809834599494934,
0.6411315202713013,
-0.5799984335899353,
0.4442092776298523,
0.091013103723526,
-0.21094219386577606... |
func IsExportedOrBuiltinType(t reflect.Type) bool {
for t.Kind() == reflect.Ptr {
t = t.Elem()
}
// PkgPath will be non-empty even for an exported type,
// so we need to check the type name as well.
return IsExportedName(t.Name()) || t.PkgPath() == ""
} | [
0.44997382164001465,
0.14018994569778442,
0.5006592273712158,
1.0321767330169678,
-0.06611984968185425,
0.5740786194801331,
0.3189068138599396,
-0.6755391359329224,
1.0579712390899658,
0.9601892828941345,
-0.7417336106300354,
0.021868089213967323,
-0.5056701302528381,
1.0796159505844116,
... |
func IsExportedName(name string) bool {
rune, _ := utf8.DecodeRuneInString(name)
return unicode.IsUpper(rune)
} | [
-0.252997487783432,
0.4736688733100891,
0.6108667850494385,
0.6037746071815491,
-1.070459008216858,
0.024755798280239105,
-0.5623737573623657,
0.1420181691646576,
1.5637151002883911,
1.2332578897476196,
-0.6872207522392273,
0.0005355562316253781,
-0.8617874383926392,
-0.1308911144733429,
... |
func NewSyncPoolCompessors() *SyncPoolCompessors {
return &SyncPoolCompessors{
GzipWriterPool: &sync.Pool{
New: func() interface{} { return newGzipWriter() },
},
GzipReaderPool: &sync.Pool{
New: func() interface{} { return newGzipReader() },
},
ZlibWriterPool: &sync.Pool{
New: func() interface{} { r... | [
-0.7999477386474609,
-0.45610231161117554,
0.5473734140396118,
-0.03267166391015053,
-0.29488739371299744,
-0.4263949692249298,
0.858547031879425,
-0.603022038936615,
-0.1908431500196457,
-0.2307211458683014,
-0.8242490291595459,
0.4133692979812622,
-0.3998754620552063,
0.6268112659454346,... |
func NewPriorityQueue(c Compare) *PriorityQueue {
return &PriorityQueue{
elements: make([]interface{}, defaultQueueInitSize),
size: 0,
cmp: c,
}
} | [
0.39735087752342224,
-0.9824809432029724,
0.29718929529190063,
0.437071830034256,
-0.09301240742206573,
-0.4305260479450226,
-0.09666848182678223,
-0.011691216379404068,
0.23101109266281128,
0.016987163573503494,
-0.6444699168205261,
-0.3737317621707916,
-0.6081859469413757,
1.248214006423... |
func (q *PriorityQueue) Empty() bool {
return q.size == 0
} | [
-0.596747100353241,
-0.6897301077842712,
0.34889909625053406,
-0.9166430830955505,
0.19758647680282593,
1.1766963005065918,
-1.0241637229919434,
-0.004909561015665531,
-0.5363295078277588,
0.3475634753704071,
-0.5450891256332397,
-0.11041662096977234,
-0.9393949508666992,
0.538876056671142... |
func (q *PriorityQueue) Size() int {
return q.size
} | [
0.07653903216123581,
-0.0314958319067955,
0.26264527440071106,
-0.9453340172767639,
-0.4180610477924347,
0.919181227684021,
-0.08354614675045013,
0.11212405562400818,
0.005198187194764614,
-0.8484854698181152,
-0.48819342255592346,
0.007860161364078522,
-0.9501436352729797,
0.7007365822792... |
func (q *PriorityQueue) Top() (interface{}, error) {
if q.size == 0 {
return nil, errors.New("empty priority queue")
}
return q.elements[0], nil
} | [
-0.473388671875,
-0.13971969485282898,
0.6225118041038513,
0.1330905258655548,
-0.22580987215042114,
0.22213773429393768,
-0.9019061326980591,
0.09713181853294373,
0.43312039971351624,
0.5623936653137207,
0.2088964730501175,
-0.07754438370466232,
-0.8050585985183716,
-0.1632964015007019,
... |
func (q *PriorityQueue) Push(e interface{}) {
i := q.size
if i >= len(q.elements) {
newElements := make([]interface{}, len(q.elements)*2)
copy(newElements, q.elements)
q.elements = newElements
}
q.siftup(i, e)
q.size++
} | [
-0.731084942817688,
0.6666500568389893,
0.583919107913971,
0.14646023511886597,
-0.17987796664237976,
0.6688507199287415,
-0.1200888380408287,
0.05805616080760956,
0.9058349132537842,
0.5118357539176941,
-0.6220028400421143,
0.3549745976924896,
-0.507867693901062,
0.8254218697547913,
0.5... |
func (q *PriorityQueue) Pop() {
if q.size == 0 {
return
}
q.elements[0] = q.elements[q.size-1]
q.elements[q.size-1] = nil
q.size--
q.siftdown()
} | [
0.27965980768203735,
0.03374624252319336,
0.47915300726890564,
-0.18872517347335815,
0.2608197033405304,
0.6668285727500916,
-0.18781425058841705,
0.5250576734542847,
0.32381671667099,
0.8913710117340088,
-0.06429815292358398,
0.06355392932891846,
-0.9161249995231628,
0.7161843776702881,
... |
func (q *PriorityQueue) siftupWithDefaultComparator(k int, e interface{}) {
var cmp Compare
switch e.(type) {
case byte:
cmp = byteCmp
case int:
cmp = intCmp
case int64:
cmp = int64Cmp
case string:
cmp = stringCmp
default:
panic("Queue element doesn't have valid Comparator")
}
q.elements[k] = e
pos... | [
-0.4038875102996826,
-0.40029218792915344,
0.7319337725639343,
-0.4010747969150543,
0.1880415976047516,
0.22285564243793488,
-0.6464800238609314,
0.17590594291687012,
0.47762531042099,
0.19921137392520905,
-0.20033058524131775,
-1.049298644065857,
-0.6675217151641846,
0.9396029114723206,
... |
func DeclarativeFriendlyResource(d desc.Descriptor) *desc.MessageDescriptor {
switch m := d.(type) {
case *desc.MessageDescriptor:
// Get the google.api.resource annotation and see if it is styled
// declarative-friendly.
if resource := GetResource(m); resource != nil {
for _, style := range resource.GetStyl... | [
0.6799678802490234,
-0.05558399111032486,
0.7653340697288513,
-0.13832376897335052,
-0.43233394622802734,
-0.9003450870513916,
0.4327356219291687,
-0.8949180841445923,
-0.2172149419784546,
-0.49045902490615845,
1.3479841947555542,
-0.005893538240343332,
0.4597083330154419,
0.72813570499420... |
func IsDeclarativeFriendlyMessage(m *desc.MessageDescriptor) bool {
return DeclarativeFriendlyResource(m) != nil
} | [
0.6002928018569946,
0.6267184615135193,
0.4781216084957123,
-0.11708863079547882,
-0.09369503706693649,
-0.2390023171901703,
0.09867419302463531,
-0.34954899549484253,
-0.3938237130641937,
-0.2412174642086029,
1.1793382167816162,
0.4083523452281952,
0.31595852971076965,
1.4299577474594116,... |
func IsDeclarativeFriendlyMethod(m *desc.MethodDescriptor) bool {
return DeclarativeFriendlyResource(m) != nil
} | [
0.5866581797599792,
0.8570042848587036,
0.29319342970848083,
0.18768277764320374,
-0.7562763094902039,
-0.7467269897460938,
0.15069931745529175,
-0.4817048907279968,
-0.46306559443473816,
0.010121753439307213,
1.2273197174072266,
-0.021717458963394165,
0.814426839351654,
1.3091509342193604... |
func CreateCustomerOrderKey(orderNumber string) string {
return ledgerapi.MakeKey(orderNumber)
} | [
-0.16453030705451965,
-0.7050701379776001,
0.10983797907829285,
-0.05152617767453194,
-0.12133357673883438,
-0.3065315783023834,
0.06251034885644913,
-0.4262043237686157,
-0.04994251951575279,
0.3283920884132385,
-0.5951030254364014,
-0.004066898953169584,
-0.03685415908694267,
0.927300274... |
func (cp *CustomerOrder) UnmarshalJSON(data []byte) error {
jcp := jsonCustomerOrder{customerOrderAlias: (*customerOrderAlias)(cp)}
err := json.Unmarshal(data, &jcp)
if err != nil {
return err
}
cp.state = jcp.State
// Added for party number
cp.CustomerNumber = jcp.CustomerNumber
cp.RetailerNumber = jcp.R... | [
-0.05242690071463585,
-0.777392566204071,
0.5083202123641968,
-1.0884673595428467,
-1.03452467918396,
-0.47068801522254944,
-0.24775277078151703,
0.29842478036880493,
0.07266944646835327,
0.18356552720069885,
-1.2095714807510376,
-0.1555674821138382,
0.004580244887620211,
0.497096151113510... |
func (cp CustomerOrder) MarshalJSON() ([]byte, error) {
jcp := jsonCustomerOrder{customerOrderAlias: (*customerOrderAlias)(&cp), State: cp.state, Class: "org.shouldbeconsider", Key: ledgerapi.MakeKey(cp.OrderNumber)}
return json.Marshal(&jcp)
} | [
0.5169270634651184,
-0.7366113662719727,
0.22140444815158844,
-0.09051965922117233,
-0.982489287853241,
-0.2087419480085373,
-0.05531419813632965,
0.25223830342292786,
0.4901446998119354,
0.21369653940200806,
-1.253535509109497,
0.36511221528053284,
-0.06674081832170486,
1.0274853706359863... |
func (cp *CustomerOrder) GetState() State {
return cp.state
} | [
0.5470359325408936,
-0.20080509781837463,
0.3107021450996399,
1.0050203800201416,
-0.05269366130232811,
-0.4699261784553528,
0.4202195703983307,
-0.19232842326164246,
-0.0525486133992672,
-0.48702770471572876,
-0.7990624308586121,
0.18440084159374237,
-0.5813889503479004,
0.823665261268615... |
func (cp *CustomerOrder) SetCreated() {
cp.state = CREATED
// Add some new value
//cp.Owner = ''
cp.CreatedDate = time.Now()
} | [
0.4307161569595337,
-0.7736859917640686,
0.17340098321437836,
1.2076185941696167,
0.3430502414703369,
-0.034771572798490524,
-0.0648496076464653,
-0.2833710312843323,
-0.6276496052742004,
-0.793762743473053,
-0.8207446932792664,
0.24550290405750275,
0.7216941714286804,
0.7191499471664429,
... |
func (cp *CustomerOrder) SetReceived() {
cp.state = RECEIVED
// Add some new value
//cp.Owner = ''
cp.ReceivedDate = time.Now()
} | [
0.30424103140830994,
-0.88599693775177,
0.2551270127296448,
0.09108330309391022,
0.17088845372200012,
-0.23351594805717468,
-0.01681615598499775,
0.20187227427959442,
-0.5902407765388489,
-0.8827991485595703,
-1.0676884651184082,
0.6312994956970215,
0.6822366714477539,
0.4392845034599304,
... |
func (cp *CustomerOrder) SetDelToShip() {
cp.state = DELTOSHIP
// Add some new value
//cp.Owner = ''
cp.ToShippingDate = time.Now()
} | [
-0.2480498105287552,
-0.7921222448348999,
0.5036190748214722,
0.32005763053894043,
-0.3389101028442383,
0.09345737099647522,
-0.24659167230129242,
-0.14778763055801392,
0.49353891611099243,
-0.1192047968506813,
-0.35142865777015686,
0.47463861107826233,
0.9059603810310364,
0.13255806267261... |
func (cp *CustomerOrder) SetInstock() {
cp.state = INSTOCK
// Add some new value
//cp.Owner = ''
cp.InStockDate = time.Now()
} | [
-0.49949944019317627,
-1.2509307861328125,
0.33075135946273804,
0.9851164817810059,
-0.27643489837646484,
0.11938124895095825,
0.2387443631887436,
-0.5562572479248047,
-0.38983649015426636,
-0.44561365246772766,
-1.1914585828781128,
0.5942734479904175,
-0.275215208530426,
1.211321115493774... |
func (cp *CustomerOrder) SetDelivering() {
cp.state = DELIVERING
// Add some new value
//cp.Owner = ''
cp.InDeliveryDate = time.Now()
} | [
0.11229824274778366,
-0.7159932851791382,
0.360078901052475,
0.8084691762924194,
-0.293468713760376,
0.2507975399494171,
-0.4497053623199463,
0.3521842956542969,
-0.5654619932174683,
-0.055282365530729294,
-1.2044897079467773,
-0.35681021213531494,
0.3503343462944031,
0.92198246717453,
-... |
func (cp *CustomerOrder) SetCompleted() {
cp.state = COMPLETED
// Add some new value
//cp.Owner = ''
cp.CompletedDate = time.Now()
} | [
0.24987536668777466,
-1.0174915790557861,
0.23783041536808014,
0.7408364415168762,
-0.14848972856998444,
-0.3394932746887207,
0.6081839799880981,
-0.31351378560066223,
-0.3862585425376892,
-0.17714151740074158,
-1.1353793144226074,
0.3565167188644409,
0.7292076945304871,
0.2619982361793518... |
func (cp *CustomerOrder) IsCreated() bool {
return cp.state == CREATED
} | [
0.37997421622276306,
-0.35910025238990784,
0.07066784054040909,
1.1831085681915283,
0.9662476778030396,
-0.333580881357193,
-0.2412729561328888,
0.05182057246565819,
0.24560822546482086,
-0.3991575837135315,
-1.2676080465316772,
-0.08148044347763062,
0.257742315530777,
0.4402531385421753,
... |
func (cp *CustomerOrder) IsReceived() bool {
return cp.state == RECEIVED
} | [
0.24450673162937164,
-0.17795082926750183,
0.39316555857658386,
0.12835930287837982,
0.42031803727149963,
-0.7285992503166199,
-0.17998197674751282,
0.7293326258659363,
0.4309644401073456,
-0.5673794150352478,
-1.4325759410858154,
0.19999895989894867,
0.009203482419252396,
-0.0966516584157... |
func (cp *CustomerOrder) IsDelToShip() bool {
return cp.state == DELTOSHIP
} | [
-0.38909798860549927,
-0.342898428440094,
0.4787164032459259,
0.6232550740242004,
-0.5601940155029297,
0.13161903619766235,
-0.836521565914154,
-0.22406534850597382,
1.6268221139907837,
0.3002651631832123,
-0.21246527135372162,
0.32422134280204773,
0.6200012564659119,
-0.18838413059711456,... |
func (cp *CustomerOrder) IsInstock() bool {
return cp.state == INSTOCK
} | [
-0.2282480150461197,
-0.896492063999176,
0.23249906301498413,
1.197405457496643,
-0.18892069160938263,
-0.07360444217920303,
-0.28000566363334656,
-0.4057634174823761,
0.5314162969589233,
-0.28337690234184265,
-1.2654932737350464,
0.3963521122932434,
-0.4124639332294464,
0.8240824937820435... |
func (cp *CustomerOrder) IsDelivering() bool {
return cp.state == DELIVERING
} | [
0.15695159137248993,
-0.15167497098445892,
0.329267293214798,
1.0054434537887573,
-0.35080447793006897,
0.22079788148403168,
-0.9053165912628174,
0.32427892088890076,
0.6944580078125,
0.3251156508922577,
-1.2270277738571167,
-0.526584804058075,
-0.03410082310438156,
0.5244581699371338,
-... |
func (cp *CustomerOrder) IsCompleted() bool {
return cp.state == COMPLETED
} | [
0.021629847586154938,
-0.6545329093933105,
0.2122298628091812,
0.7671653032302856,
-0.03426605090498924,
-0.7719029188156128,
0.3951888680458069,
0.012119440361857414,
0.4895514249801636,
0.24741365015506744,
-1.4139546155929565,
-0.26679423451423645,
0.3502666652202606,
0.0317247100174427... |
func (cp *CustomerOrder) GetSplitKey() []string {
return []string{cp.orderNumber}
} | [
-1.2343171834945679,
0.012905902229249477,
0.5080626606941223,
0.6853778958320618,
0.4185645580291748,
-0.761008620262146,
-0.048829469829797745,
-0.26942190527915955,
0.6272115111351013,
0.867003858089447,
-1.3503590822219849,
0.7775296568870544,
-0.6108837723731995,
0.6836377382278442,
... |
func (cp *CustomerOrder) Serialize() ([]byte, error) {
return json.Marshal(cp)
} | [
-0.11919071525335312,
-0.19674137234687805,
0.504736065864563,
0.5781368613243103,
-0.2682817578315735,
-0.9114241003990173,
-0.5700061321258545,
-0.5659851431846619,
-0.1334095448255539,
0.14992773532867432,
-1.7351980209350586,
0.15437783300876617,
-1.1036217212677002,
0.8190904855728149... |
func Deserialize(bytes []byte, cp *CustomerOrder) error {
err := json.Unmarshal(bytes, cp)
if err != nil {
return fmt.Errorf("Error deserializing customer order. %s", err.Error())
}
return nil
} | [
0.4362355172634125,
-0.19846799969673157,
0.49808794260025024,
0.02328670583665371,
-0.557604968547821,
-0.8580169677734375,
-0.5590471625328064,
-0.10318580269813538,
-0.7709144949913025,
0.49617141485214233,
-1.1391385793685913,
-0.16286057233810425,
-1.2523136138916016,
-0.0575170256197... |
func (d *defaultDeploymentManager) CreateAndWaitTillDeploymentIsReady(deployment *v1.Deployment, timeout time.Duration) (*v1.Deployment, error) {
ctx := context.Background()
err := d.k8sClient.Create(ctx, deployment)
if err != nil {
return nil, err
}
// Allow for the cache to sync
time.Sleep(utils.PollInterval... | [
-0.4543475806713104,
0.22450686991214752,
0.45032110810279846,
0.15541870892047882,
0.5983749628067017,
0.11223415285348892,
-0.7615086436271667,
-0.5111429691314697,
0.6592925190925598,
1.0744314193725586,
-0.20228353142738342,
-0.4881795346736908,
0.18401986360549927,
0.6975664496421814,... |
func Force(path string, force bool) RunFn {
if path == "." || path == "" {
pwd, _ := os.Getwd()
path = pwd
}
return func(r *Runner) error {
_, err := os.Stat(path)
if err != nil {
// path doesn't exist. move on.
return nil
}
if !force {
return errors.Errorf("path %s already exists", path)
}
... | [
-0.4768551290035248,
0.6331402063369751,
0.5625883936882019,
0.1828484833240509,
0.24224354326725006,
-0.14923064410686493,
0.6984986066818237,
-0.1503783017396927,
0.1527748554944992,
-0.004712999332696199,
-0.2944200038909912,
0.6383068561553955,
0.14074809849262238,
0.16674138605594635,... |
func (s Server) DeprecatedPresentationFromMediaID(ctx context.Context, id scalar.ID) (_ *deprecated.Presentation, err error) {
dto, err := s.app.MediaByID(ctx, id)
if err != nil {
return
}
pID, err := scalar.NPresentation.ID(id.Data())
if err != nil {
return
}
switch dto := dto.(type) {
case *user_content.I... | [
0.22250305116176605,
-0.933154821395874,
0.7190184593200684,
-0.08343763649463654,
-0.902593195438385,
-0.8726258873939514,
-0.2834938168525696,
-1.0994846820831299,
0.6732397079467773,
0.1553184986114502,
-0.06600858271121979,
0.4802473783493042,
-0.24865828454494476,
0.5939812660217285,
... |
func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerAttachConfig) error {
keys := []byte{}
var err error
if c.DetachKeys != "" {
keys, err = term.ToBytes(c.DetachKeys)
if err != nil {
return fmt.Errorf("Invalid escape keys (%s) provided", c.DetachKeys)
}
}
container, err := dae... | [
-0.2509075999259949,
-0.6230418682098389,
1.0916460752487183,
-0.3731207549571991,
-0.6523723006248474,
-1.0276658535003662,
0.1380547285079956,
-0.364277184009552,
0.0772845596075058,
0.5595585107803345,
0.8592385649681091,
0.5995827317237854,
0.10589919239282608,
1.2531577348709106,
0.... |
func (daemon *Daemon) ContainerAttachRaw(prefixOrName string, stdin io.ReadCloser, stdout, stderr io.Writer, stream bool) error {
container, err := daemon.GetContainer(prefixOrName)
if err != nil {
return err
}
cfg := &containerAttachConfig{
stdin: stdin,
stdout: stdout,
stderr: stderr,
stream: stream,
... | [
-0.7013734579086304,
-0.44661006331443787,
0.8221415281295776,
-0.27517804503440857,
-1.4962576627731323,
-0.4825728237628937,
-0.10042527318000793,
-0.5528333187103271,
0.4605120122432709,
-0.5781289339065552,
1.1374913454055786,
0.6473419666290283,
0.8454511165618896,
1.0295605659484863,... |
func (p *PPU) stepOAMSearch() {
// Do OAM search every other clock.
if p.sc%2 != 0 {
return
}
// If the OAM cache is full, exit.
if len(p.oamCache) == MaxSpritesPerScanline {
return
}
// Decode the next entry into a Sprite.
sprite := p.newSprite(p.sc * 2)
// Determine if the sprite is in the current sca... | [
-0.5521079897880554,
0.4775833487510681,
0.5483560562133789,
-0.2886486053466797,
-0.3359073996543884,
-0.19383041560649872,
0.07798107713460922,
-0.3240211009979248,
0.4001077711582184,
0.03890509903430939,
-0.5983448028564453,
0.033727601170539856,
-0.38151049613952637,
0.192708626389503... |
func (d *Display) resetBuffer() {
d.width = d.device.Width()
d.height = d.device.Height()
d.buffer = make([][]byte, d.height)
for y := range d.buffer {
d.buffer[y] = make([]byte, d.width)
}
} | [
-0.3938988447189331,
0.5287986993789673,
0.24775779247283936,
-0.05275161564350128,
-0.17915460467338562,
0.10977718979120255,
1.0652587413787842,
-0.9109864234924316,
0.14848539233207703,
-0.9926729202270508,
-0.48035287857055664,
1.4382015466690063,
-0.6505411267280579,
0.741026997566223... |
func (d *Display) growBuffer(newX, newY int) {
if newX < 0 || newY < 0 {
panic("coordinates must be 0 or greater")
}
if newX < d.width && newY < d.height {
// Coords already within buffer
return
}
newWidth, newHeight := d.width, d.height
if newX >= newWidth {
newWidth = newX + 1
}
if newY >= newHeight ... | [
-0.26471441984176636,
0.4860489070415497,
1.0214763879776,
-0.20579534769058228,
-0.5085010528564453,
0.4163523018360138,
-0.0569751001894474,
-1.28920578956604,
0.843504011631012,
-1.201367735862732,
0.37933996319770813,
0.4117007553577423,
-0.30904096364974976,
1.057678461074829,
0.674... |
func MakeUserHandlers(r *mux.Router, n negroni.Negroni, service user.UseCase) {
r.Handle("/api/v1/users", n.With(
negroni.Wrap(listUsers(service)),
)).Methods("GET", "OPTIONS").Name("listUsers")
r.Handle("/api/v1/users", n.With(
negroni.Wrap(createUser(service)),
)).Methods("POST", "OPTIONS").Name("createUser"... | [
-0.5552663207054138,
0.1356285959482193,
0.5741308927536011,
0.7481932640075684,
-0.4514519274234772,
0.387908011674881,
0.4426931142807007,
-0.4342779517173767,
0.4948522448539734,
-0.44048604369163513,
-0.23533830046653748,
0.012945907190442085,
0.25968649983406067,
-0.20934630930423737,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.