text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func createBSTFromList(list []int, left, right int) *BST {
var middle int
var root *BST
// leaf nodes
// left: left to middle - 1 (right): middle - 1 will keep moving left going past left,
// thus becoming > right
// right: middle + 1, which is left for right subgraph, which will keep moving right
// going pas... | [
0.9482633471488953,
-0.11568853259086609,
0.6984718441963196,
1.2703887224197388,
-0.7887439131736755,
-0.03457268327474594,
-0.6180146932601929,
-0.8014873266220093,
0.10675927996635437,
0.2804625928401947,
-1.2899844646453857,
-0.11100734770298004,
-0.6863133311271667,
0.7335253357887268... |
func inOrderBST(root *BST) {
if root != nil {
inOrderBST(root.left)
fmt.Printf(" %d ", root.value)
inOrderBST(root.right)
}
} | [
0.957094132900238,
-0.3584814965724945,
0.8994578719139099,
0.4775771498680115,
-1.2719882726669312,
0.1470775008201599,
-0.45260804891586304,
-0.026440264657139778,
-0.04449223354458809,
0.23827874660491943,
-0.5888307690620422,
1.1780842542648315,
-0.24559007585048676,
1.9064176082611084... |
func preOrderBST(root *BST) {
if root != nil {
fmt.Printf(" %d ", root.value)
preOrderBST(root.left)
preOrderBST(root.right)
}
} | [
0.818588137626648,
0.2609679400920868,
0.9164009690284729,
0.6881679892539978,
-0.7818096876144409,
-0.021717557683587074,
0.1457517296075821,
0.02073550410568714,
0.7102508544921875,
-0.2058904618024826,
-0.7690603137016296,
0.4522152543067932,
0.19717788696289062,
2.1135575771331787,
-... |
func postOrderBST(root *BST) {
if root != nil {
postOrderBST(root.left)
postOrderBST(root.right)
fmt.Printf(" %d ", root.value)
}
} | [
0.6350674629211426,
-0.505639910697937,
0.7695229649543762,
0.5382609963417053,
-1.4316151142120361,
0.44730621576309204,
-0.28139299154281616,
0.014058553613722324,
-0.07317905873060226,
-0.15600256621837616,
-1.0102496147155762,
0.379249632358551,
-0.01277273241430521,
1.9669798612594604... |
func extractMinAdjust(list []int) int {
// Creste Min Heap
// listSize/2 -1 are all the non-leaf nodes
// Start with lowest level of non-leaf nodes and their children
// Move smaller values up, push larger values down
for i := CurrentSize/2 - 1; i >= 0; i-- {
createMinHeap(list, i, CurrentSize)
}
// All roo... | [
-0.04346873238682747,
-0.8943555951118469,
0.8354499340057373,
-0.06300614029169083,
-0.7201090455055237,
-0.16516417264938354,
0.3938906788825989,
0.015416149981319904,
0.4097694456577301,
-0.17321722209453583,
-0.413558691740036,
0.1875581294298172,
-1.7656831741333008,
1.164278626441955... |
func (tc *TokenCache) Close() {
tc.Client.Close()
} | [
-0.12500828504562378,
0.12509950995445251,
-0.10325393080711365,
-0.9646274447441101,
-0.8145935535430908,
0.663300633430481,
-0.36278235912323,
-0.3158949315547943,
-0.8877025246620178,
0.19203875958919525,
0.1562691479921341,
0.40470850467681885,
-0.6753581762313843,
0.00795918982475996,... |
func (tc *TokenCache) Ping() error {
_, err := tc.Client.Ping().Result() // testing the cache connection
if err != nil {
// when the cache connection fails.
return ex.NewErr(&ex.ErrCacheQuery{}, err, "Failed to connect to cache", "TokenCache.Ping")
}
return nil
} | [
-0.09737882763147354,
0.3887418806552887,
0.09819040447473526,
0.004147778265178204,
0.5438300371170044,
-0.08780454844236374,
-0.8150233030319214,
0.06102561578154564,
-0.539690375328064,
1.053767442703247,
0.7056829333305359,
-0.3430899977684021,
-0.43563905358314514,
-0.0209955889731645... |
func (tc *TokenCache) TokenStatus(tok *JWTok) error {
_, err := tc.Client.Get(tok.UUID).Result()
if err != nil {
if err == redis.Nil {
return ex.NewErr(&ex.ErrTokenExpired{}, err, "Failed to get auth status", "TokenCache.TokenStatus/tc.Client.Get()")
}
return ex.NewErr(&ex.ErrCacheQuery{}, err, "Failed to ge... | [
-1.1144390106201172,
-0.1467089205980301,
0.27566972374916077,
-0.7298880219459534,
-0.7135064601898193,
-0.659814178943634,
-0.9667380452156067,
-0.15277792513370514,
0.59254390001297,
1.0485262870788574,
-0.8868690729141235,
0.5698019862174988,
0.5396395921707153,
-0.02581925131380558,
... |
func (tc *TokenCache) RefreshUser(refr *JWTok, result *TokenPair) error {
tc.LogoutToken(refr)
return tc.LoginUser(refr.User, refr.Role, result)
} | [
-0.3904539942741394,
0.17171147465705872,
0.12780649960041046,
0.8441988229751587,
-1.613988995552063,
-0.1411258429288864,
-0.2504144608974457,
-1.2954145669937134,
0.9590038657188416,
0.32382985949516296,
-0.7808917164802551,
-0.08364278078079224,
-0.10472089052200317,
-0.569010972976684... |
func (tc *TokenCache) LoginUser(email string, role int, result *TokenPair) error {
pair := &TokenPair{Auth: NewToken(email, role, AuthExp), Refr: NewToken(email, role, RefrExp)}
_, err := tc.Client.SetNX(pair.Auth.UUID, pair.Refr.UUID, AuthExp).Result()
if err != nil {
ex.NewErr(ex.ErrCacheQuery{}, err, "Failed to... | [
-1.0474767684936523,
0.3625236749649048,
0.5967692732810974,
-0.3235251307487488,
-1.031930923461914,
-0.22640801966190338,
-0.5742304921150208,
-0.6931999325752258,
0.23738998174667358,
0.21843630075454712,
-0.6444711089134216,
-0.11395327001810074,
-0.7587378621101379,
-0.855633676052093... |
func (tc *TokenCache) LogoutToken(tok *JWTok) error {
_, err := tc.Client.Del(tok.UUID).Result()
return err
} | [
-1.273764729499817,
0.37568235397338867,
0.1369837075471878,
-0.6872895359992981,
-1.037333607673645,
-0.19803392887115479,
-0.23796673119068146,
0.5914157629013062,
0.6462392807006836,
0.5838534235954285,
-1.2461386919021606,
0.943807065486908,
-0.006979360710829496,
-0.1743829846382141,
... |
func NewMockServersService(ctrl *gomock.Controller) *MockServersService {
mock := &MockServersService{ctrl: ctrl}
mock.recorder = &MockServersServiceMockRecorder{mock}
return mock
} | [
-0.16186553239822388,
0.24488481879234314,
0.03905007988214493,
0.1297471970319748,
-0.15815851092338562,
0.027982966974377632,
0.4826964735984802,
-2.0901784896850586,
1.17374587059021,
-0.026071300730109215,
-0.7616838812828064,
0.5756155252456665,
-1.0209455490112305,
1.7082221508026123... |
func (m *MockServersService) EXPECT() *MockServersServiceMockRecorder {
return m.recorder
} | [
0.2235037386417389,
0.7802046537399292,
0.33479219675064087,
-0.11511620879173279,
-0.06024812161922455,
0.31959813833236694,
-0.05626831576228142,
-0.3741779029369354,
0.6202744245529175,
-0.7487767934799194,
0.514715850353241,
1.351000428199768,
-1.0434291362762451,
1.1859347820281982,
... |
func (m *MockServersService) Actions(arg0 int) (bl.Actions, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Actions", arg0)
ret0, _ := ret[0].(bl.Actions)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.6498879790306091,
-0.07024980336427689,
0.2404373288154602,
-0.24129022657871246,
1.0069589614868164,
0.2163950800895691,
1.4278723001480103,
-0.7708210945129395,
-0.30862316489219666,
-0.4110412895679474,
-0.15639565885066986,
-0.9117416739463806,
-0.4730188846588135,
1.030568122863769... |
func (mr *MockServersServiceMockRecorder) Actions(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Actions", reflect.TypeOf((*MockServersService)(nil).Actions), arg0)
} | [
-0.44432735443115234,
0.7427612543106079,
0.1827683299779892,
-0.5070772767066956,
0.20203469693660736,
-0.020667769014835358,
-0.014712153002619743,
-1.1826356649398804,
0.9881359338760376,
-0.08526144176721573,
0.5318177938461304,
0.38718676567077637,
-0.5723617076873779,
1.4915179014205... |
func (m *MockServersService) Backups(arg0 int) (bl.Images, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Backups", arg0)
ret0, _ := ret[0].(bl.Images)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.7026832103729248,
-0.12112841010093689,
0.3675091564655304,
0.0762118324637413,
0.8742110729217529,
0.32553157210350037,
1.0863711833953857,
-0.7282977104187012,
-0.4771474599838257,
-0.6805040836334229,
-0.39243966341018677,
-0.520443856716156,
-0.6507939696311951,
1.065029501914978,
... |
func (mr *MockServersServiceMockRecorder) Backups(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Backups", reflect.TypeOf((*MockServersService)(nil).Backups), arg0)
} | [
-0.004065828397870064,
0.8099324107170105,
0.3070904016494751,
-0.11911346763372421,
-0.04229003190994263,
0.22951586544513702,
-0.32039958238601685,
-1.300555944442749,
0.8850550651550293,
-0.14606904983520508,
0.43727895617485046,
0.4047915041446686,
-0.6515854597091675,
1.22941541671752... |
func (m *MockServersService) Create(arg0 *binarylane.ServerCreateRequest, arg1 bool) (*bl.Server, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Create", arg0, arg1)
ret0, _ := ret[0].(*bl.Server)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.8810314536094666,
0.04911698028445244,
0.1628483086824417,
0.477161705493927,
1.573683738708496,
0.6145581603050232,
0.7772666811943054,
-0.585587203502655,
-1.2489768266677856,
0.29962384700775146,
-0.3878283202648163,
-0.7073902487754822,
-0.5974047183990479,
1.4817798137664795,
0.7... |
func (mr *MockServersServiceMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockServersService)(nil).Create), arg0, arg1)
} | [
-0.11957357823848724,
0.793368935585022,
0.21924711763858795,
0.5892017483711243,
0.15898041427135468,
0.7509020566940308,
-0.5337820053100586,
-1.5328457355499268,
-0.3170666992664337,
0.5667772889137268,
0.7901486754417419,
0.23131504654884338,
-0.7248088717460632,
2.0646121501922607,
... |
func (m *MockServersService) CreateMultiple(arg0 *binarylane.ServerMultiCreateRequest) (bl.Servers, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateMultiple", arg0)
ret0, _ := ret[0].(bl.Servers)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.6876744627952576,
0.19982942938804626,
0.38683369755744934,
0.3716076910495758,
1.3872863054275513,
0.4895537495613098,
0.4867231249809265,
-0.41707727313041687,
-0.9474771022796631,
0.009932954795658588,
-0.9549801349639893,
-1.4646992683410645,
-1.5445024967193604,
1.4810116291046143,... |
func (mr *MockServersServiceMockRecorder) CreateMultiple(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateMultiple", reflect.TypeOf((*MockServersService)(nil).CreateMultiple), arg0)
} | [
-0.2527165710926056,
0.769166111946106,
0.28438639640808105,
0.31835663318634033,
0.3182789981365204,
0.6834800243377686,
-0.7389461398124695,
-0.7672350406646729,
-0.23278410732746124,
0.5384256839752197,
-0.0056731547228991985,
-0.7506029009819031,
-1.4235339164733887,
1.5365707874298096... |
func (m *MockServersService) Delete(arg0 int) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Delete", arg0)
ret0, _ := ret[0].(error)
return ret0
} | [
-0.2597939372062683,
0.44354239106178284,
0.4471418559551239,
0.6295226216316223,
1.514103889465332,
0.2336331456899643,
0.7798194885253906,
-0.3517800569534302,
-0.17505671083927155,
-0.09230267256498337,
-0.04002576321363449,
-0.21772770583629608,
-1.2492578029632568,
1.3223286867141724,... |
func (mr *MockServersServiceMockRecorder) Delete(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockServersService)(nil).Delete), arg0)
} | [
0.06749316304922104,
1.0466166734695435,
0.35828515887260437,
0.45204290747642517,
0.04521242901682854,
0.3226889967918396,
-0.08674342930316925,
-1.0854823589324951,
0.92926025390625,
0.3472353518009186,
0.8585633635520935,
0.6668145656585693,
-1.201395869255066,
1.7073947191238403,
-0.... |
func (m *MockServersService) DeleteByTag(arg0 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteByTag", arg0)
ret0, _ := ret[0].(error)
return ret0
} | [
0.6702256202697754,
-0.35968920588493347,
0.03488709032535553,
0.15545259416103363,
1.112146258354187,
-0.15959817171096802,
1.854589819908142,
-1.0350346565246582,
-0.7806270718574524,
-0.11692626774311066,
-1.066305160522461,
-0.5507553219795227,
-0.4867761731147766,
1.2926313877105713,
... |
func (mr *MockServersServiceMockRecorder) DeleteByTag(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteByTag", reflect.TypeOf((*MockServersService)(nil).DeleteByTag), arg0)
} | [
0.7736794948577881,
0.21777991950511932,
0.10555315017700195,
-0.11212687939405441,
0.04471535235643387,
-0.13256482779979706,
0.810954749584198,
-1.2053388357162476,
0.10412757843732834,
0.4707639515399933,
-0.28160208463668823,
0.3144611120223999,
-0.24714861810207367,
1.4312465190887451... |
func (m *MockServersService) Get(arg0 int) (*bl.Server, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Get", arg0)
ret0, _ := ret[0].(*bl.Server)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-1.235545039176941,
-0.4606517553329468,
0.38240936398506165,
-0.15218093991279602,
1.563385009765625,
0.028455307707190514,
0.573321521282196,
-0.43851205706596375,
-1.0684219598770142,
-0.06878657639026642,
-0.6448272466659546,
0.32479235529899597,
-0.6228227615356445,
0.914076566696167,... |
func (mr *MockServersServiceMockRecorder) Get(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockServersService)(nil).Get), arg0)
} | [
-0.5478857755661011,
0.5039860010147095,
0.26606976985931396,
-0.2998540699481964,
0.3613845109939575,
0.052043616771698,
-0.5538919568061829,
-1.0223027467727661,
0.14392927289009094,
0.3402532637119293,
0.4593122601509094,
1.1890462636947632,
-0.6823430061340332,
1.615236520767212,
0.2... |
func (m *MockServersService) Kernels(arg0 int) (bl.Kernels, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Kernels", arg0)
ret0, _ := ret[0].(bl.Kernels)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-1.0538009405136108,
-0.11000976711511612,
0.3314272463321686,
0.005212262738496065,
0.5021263957023621,
-0.2657535970211029,
0.448712557554245,
-0.752303957939148,
-0.3250303566455841,
-0.5769234299659729,
-0.04672054201364517,
-0.42638835310935974,
-0.8666175007820129,
1.3950055837631226... |
func (mr *MockServersServiceMockRecorder) Kernels(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Kernels", reflect.TypeOf((*MockServersService)(nil).Kernels), arg0)
} | [
-0.5892111659049988,
0.886681854724884,
0.22008849680423737,
-0.2391665279865265,
-0.37862154841423035,
-0.300141304731369,
-0.8400070071220398,
-1.3147861957550049,
0.8853187561035156,
-0.02829626016318798,
0.5933583378791809,
0.532459557056427,
-0.7684173583984375,
1.7607996463775635,
... |
func (m *MockServersService) List() (bl.Servers, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "List")
ret0, _ := ret[0].(bl.Servers)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.582647442817688,
-0.4562795162200928,
0.13819944858551025,
0.48809584975242615,
1.2938679456710815,
0.027545947581529617,
0.8203645944595337,
-0.2828533947467804,
0.2661687731742859,
-0.08837296813726425,
-1.2561063766479492,
-0.12788522243499756,
-0.6006938219070435,
1.092028021812439,... |
func (mr *MockServersServiceMockRecorder) List() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockServersService)(nil).List))
} | [
-0.06835878640413284,
0.5721214413642883,
0.08490308374166489,
0.4268706738948822,
0.37411367893218994,
-0.00899285264313221,
-0.5065171718597412,
-0.6826705932617188,
1.0210161209106445,
0.38161981105804443,
-0.2974585294723511,
0.3365373909473419,
-0.8834269046783447,
2.1402952671051025,... |
func (m *MockServersService) ListByTag(arg0 string) (bl.Servers, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListByTag", arg0)
ret0, _ := ret[0].(bl.Servers)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
0.22901667654514313,
-0.7571346163749695,
-0.021701812744140625,
0.15482603013515472,
0.8158283829689026,
-0.307066947221756,
1.4834930896759033,
-1.1429733037948608,
-0.46953535079956055,
-0.3156109154224396,
-1.3254988193511963,
-0.11916369944810867,
-0.2638436555862427,
1.40951597690582... |
func (mr *MockServersServiceMockRecorder) ListByTag(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByTag", reflect.TypeOf((*MockServersService)(nil).ListByTag), arg0)
} | [
0.4787551164627075,
0.11279811710119247,
0.022485001012682915,
-0.0878969058394432,
0.06276467442512512,
-0.36460891366004944,
0.16234204173088074,
-1.0729198455810547,
0.2862393856048584,
0.45774418115615845,
-0.5961403846740723,
0.1171811893582344,
-0.2741798460483551,
1.972572684288025,... |
func (m *MockServersService) Neighbors(arg0 int) (bl.Servers, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Neighbors", arg0)
ret0, _ := ret[0].(bl.Servers)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-1.3469831943511963,
0.35789307951927185,
0.3461994528770447,
-0.2421899288892746,
1.0635255575180054,
0.4536025822162628,
0.9461413621902466,
-1.0823167562484741,
-0.8323085904121399,
-0.48105311393737793,
-0.6449904441833496,
0.04895784333348274,
-0.7940118908882141,
1.6625028848648071,
... |
func (mr *MockServersServiceMockRecorder) Neighbors(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Neighbors", reflect.TypeOf((*MockServersService)(nil).Neighbors), arg0)
} | [
-0.6491681933403015,
1.1780719757080078,
0.057084351778030396,
-0.35793033242225647,
-0.043904226273298264,
0.23244987428188324,
-0.36943069100379944,
-1.4698643684387207,
0.36022329330444336,
-0.28117504715919495,
0.3771139681339264,
0.9797312617301941,
-0.8403077125549316,
2.084354400634... |
func (m *MockServersService) Snapshots(arg0 int) (bl.Images, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Snapshots", arg0)
ret0, _ := ret[0].(bl.Images)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.5803282260894775,
0.44903692603111267,
0.19410620629787445,
-0.1198505163192749,
0.2650284171104431,
0.5274109840393066,
1.0788068771362305,
-0.5566611289978027,
-0.5183287262916565,
-0.931599497795105,
-0.2881029546260834,
-1.123173713684082,
-0.6331279873847961,
1.2070047855377197,
... |
func (mr *MockServersServiceMockRecorder) Snapshots(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Snapshots", reflect.TypeOf((*MockServersService)(nil).Snapshots), arg0)
} | [
-0.2664531171321869,
1.3112244606018066,
0.2503158450126648,
-0.40288928151130676,
-0.684583306312561,
0.1857949048280716,
-0.1648503988981247,
-0.9010013341903687,
0.9445083737373352,
-0.1388171911239624,
0.24811267852783203,
-0.130475714802742,
-0.6586954593658447,
1.4040935039520264,
... |
func (e insufficientScopesErr) Scopes() []string {
return e.scopes
} | [
-0.603561520576477,
-0.7098923921585083,
0.4277501404285431,
-0.18719936907291412,
-0.27615201473236084,
0.5508017539978027,
-0.39254412055015564,
-0.19626054167747498,
1.81546950340271,
0.7249160408973694,
0.09467428922653198,
1.122333288192749,
-1.02730393409729,
0.7049047350883484,
0.... |
func (e insufficientScopesErr) String() string {
return fmt.Sprintf("Missing scopes: %s", strings.Join(e.Scopes(), ", "))
} | [
-0.15464924275875092,
-1.3404574394226074,
0.4654558598995209,
-1.282641053199768,
-0.3654147982597351,
0.5181571841239929,
0.0662427619099617,
-0.6375320553779602,
0.6983033418655396,
1.1275713443756104,
0.5320608019828796,
1.0062073469161987,
-0.7391253113746643,
0.04893086478114128,
0... |
func NewInsufficientScopesErr(scopes []string) error {
return insufficientScopesErr{
scopes: scopes,
wrapped: ErrInsufficientScopes,
}
} | [
-1.4215704202651978,
-1.1399459838867188,
-0.0005618916475214064,
-0.6728398203849792,
-1.4243780374526978,
-0.2400185912847519,
-0.3695060908794403,
-0.09227104485034943,
0.799005925655365,
0.8913289308547974,
-0.4210295081138611,
0.6588156819343567,
-0.6905803680419922,
0.838401138782501... |
func AsInsufficientScopesErr(err error) ScopesList {
return err.(ScopesList) // nolint:errorlint
} | [
-1.2598623037338257,
-0.6715512275695801,
0.04844186455011368,
-0.17117351293563843,
-0.8332682847976685,
-0.6253528594970703,
-0.4957237243652344,
-0.16537407040596008,
1.1599608659744263,
0.8916944861412048,
-0.3583516478538513,
0.4000730514526367,
-0.3736773431301117,
1.004414439201355,... |
func parseIPRegHeader(sc *bufio.Scanner) int {
const prefix = "#ip "
fail := func(err error) {
msg := fmt.Sprintf("invalid header %q: expected '#ip <int>'")
if err != nil {
msg += " " + err.Error()
}
panic(msg)
}
if !sc.Scan() {
fail(nil)
}
line := sc.Text()
if !strings.HasPrefix(line, prefix) {
f... | [
-0.001236557960510254,
0.5921204686164856,
1.0396034717559814,
-0.3749370872974396,
-1.3168327808380127,
-0.5318129658699036,
0.20660308003425598,
0.8377938270568848,
-0.8527438044548035,
0.5522685647010803,
-0.08572769165039062,
-0.18240274488925934,
-0.9836374521255493,
-0.41428411006927... |
func intBool(b bool) int {
if b {
return 1
}
return 0
} | [
0.4154658019542694,
0.5620018839836121,
0.42118605971336365,
0.9864752888679504,
0.24142642319202423,
0.510625422000885,
0.5329490900039673,
0.637597382068634,
-0.18719550967216492,
0.846245527267456,
-0.6780949831008911,
0.17246592044830322,
-0.3056817352771759,
-0.17557130753993988,
0.... |
func executeProgram(r Registers, ipReg int, instructions []*Instruction) Registers {
var (
maxr = math.MinInt64
seen = make(map[int]bool)
prev = 0
)
for {
ip := r[ipReg]
if ip < 0 || ip >= len(instructions) {
break
}
if ip == 28 { // eqrr 5 0 2
if r[5] > maxr {
fmt.Printf("new halt max r[0] =... | [
-0.743069052696228,
0.5874624252319336,
0.7690855264663696,
-0.22052010893821716,
0.14268025755882263,
0.1336405724287033,
1.2103134393692017,
0.13194064795970917,
0.36425331234931946,
1.2649710178375244,
-0.16716305911540985,
-0.298454225063324,
-0.9432879090309143,
-0.3845735192298889,
... |
func letterCasePermutation(S string) []string {
letterCount := 0
for _, rune := range S {
if unicode.IsLetter(rune) {
letterCount++
}
}
ret := make([]string, 1, int(math.Pow(2, float64(letterCount))))
ret[0] = S
ret = makePossibleString(S, ret, 0)
return ret
} | [
-1.3132100105285645,
-0.17113928496837616,
0.4849770665168762,
0.804262638092041,
0.0003505165805108845,
-0.4328097701072693,
0.5627527832984924,
0.16021600365638733,
1.1571874618530273,
0.9433740973472595,
-0.25060856342315674,
-0.3747902810573578,
-0.6044122576713562,
-0.0965153723955154... |
func NewJSONWriter(logger logrus.FieldLogger) *JSONWriter {
writer := &JSONWriter{
logger: logger,
}
writer.Reporter = writer.reporter
return writer
} | [
-0.7316962480545044,
-0.18523992598056793,
0.04514053091406822,
-0.44855833053588867,
-1.4844918251037598,
-1.5097429752349854,
-0.24910752475261688,
0.25916242599487305,
-0.3755037188529968,
-0.3276788592338562,
-0.377338171005249,
-0.257006973028183,
0.292557954788208,
0.5644792914390564... |
func (h *JSONWriter) Write(w http.ResponseWriter, r *http.Request, e interface{}) {
h.WriteCode(w, r, http.StatusOK, e)
} | [
-1.9116437435150146,
-0.40510293841362,
0.632419764995575,
0.5174062848091125,
0.42156463861465454,
-0.008350164629518986,
0.22111515700817108,
0.6838372945785522,
-0.020108256489038467,
0.5601357221603394,
-0.5051221251487732,
-0.32631754875183105,
0.13629421591758728,
0.7617890238761902,... |
func (h *JSONWriter) WriteCode(w http.ResponseWriter, r *http.Request, code int, e interface{}) {
js, err := json.Marshal(e)
if err != nil {
h.WriteError(w, r, errors.WithStack(err))
return
}
if code == 0 {
code = http.StatusOK
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(code)
w.W... | [
-1.221116065979004,
0.010410131886601448,
0.8756168484687805,
0.04399556294083595,
0.24366967380046844,
-0.5186285972595215,
0.22856362164020538,
0.6745119094848633,
0.1301223635673523,
0.49369290471076965,
0.2740156054496765,
-0.31543564796447754,
0.4354918897151947,
0.9655132293701172,
... |
func (h *JSONWriter) WriteCreated(w http.ResponseWriter, r *http.Request, location string, e interface{}) {
w.Header().Set("Location", location)
h.WriteCode(w, r, http.StatusCreated, e)
} | [
-0.9842654466629028,
-0.8245046734809875,
0.5402461290359497,
0.02243705280125141,
0.853720486164093,
0.09946157783269882,
0.4723784923553467,
0.5053024291992188,
-0.07024458050727844,
-0.27744120359420776,
-0.41464120149612427,
0.1942325085401535,
1.0022077560424805,
0.4386155903339386,
... |
func NewConfig() Config {
lc := LocalConfig{
Addr: new(string),
CloseStdDesc: new(bool),
PProfAddr: new(string),
AutoConnect: new(bool),
CertFile: new(string),
KeyFile: new(string),
ConnTimeout: new(int64),
Port: new(int),
RootCA: new(string),
}
pprof := PProfCon... | [
0.44382745027542114,
-0.10678039491176605,
0.48828068375587463,
-0.06638821214437485,
-0.5795103311538696,
0.3005743622779846,
0.31245848536491394,
0.6468949913978577,
-0.24065208435058594,
-0.5207313299179077,
-0.08652704954147339,
0.46012312173843384,
-0.21798555552959442,
0.896006464958... |
func (*LoginRequest) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{0}
} | [
-1.504660964012146,
0.12378141283988953,
0.44023948907852173,
0.0857580304145813,
-0.4253684878349304,
-0.21834929287433624,
-0.19757667183876038,
0.09875653684139252,
-0.05781201645731926,
-0.29890045523643494,
-0.3781546950340271,
0.674580454826355,
-0.5463414192199707,
0.545056819915771... |
func (*LoginResponse) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{1}
} | [
-0.7034156918525696,
-0.223474383354187,
-0.008517942391335964,
-0.4053686559200287,
-0.09861340373754501,
-0.6862020492553711,
0.3477380573749542,
0.023540779948234558,
0.25930050015449524,
0.009739178232848644,
-0.995917558670044,
-0.22239305078983307,
-1.3737667798995972,
-0.53825998306... |
func (*Request_Null) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{2}
} | [
-0.7795820236206055,
-0.4422483444213867,
0.5770224928855896,
1.0440638065338135,
0.30417928099632263,
-0.6111479997634888,
-0.5112749934196472,
-0.3373073935508728,
0.5903262495994568,
-1.147810459136963,
-0.3829166293144226,
1.0005717277526855,
0.4431549906730652,
0.6263010501861572,
0... |
func (*Request_Workers) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{3}
} | [
-1.5595662593841553,
0.6874944567680359,
0.23290972411632538,
0.5288856029510498,
0.009926257655024529,
-0.07433431595563889,
-0.057774048298597336,
-0.20928733050823212,
-0.4603109359741211,
-0.8004344701766968,
-0.4872974157333374,
0.35578012466430664,
-1.0981860160827637,
0.293375134468... |
func (*Response_CreateWorker) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{4}
} | [
-0.32195910811424255,
0.104807548224926,
0.458852618932724,
0.10974234342575073,
0.11689983308315277,
-0.007532233837991953,
0.8410423994064331,
-1.110434651374817,
-0.1261814832687378,
-0.5338679552078247,
-1.465706706047058,
-0.9872775077819824,
-0.47848692536354065,
0.37652838230133057,... |
func (*Request_Workers_ID) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{5}
} | [
-0.606840193271637,
-0.05581554397940636,
0.02557814121246338,
0.6015859246253967,
0.0434606559574604,
-0.03821008652448654,
-0.5659663081169128,
-0.2619107663631439,
-0.08704900741577148,
-0.6179449558258057,
-0.4241069257259369,
1.0614538192749023,
-0.8950138092041016,
0.854290246963501,... |
func (*Request_Workers_Name) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{6}
} | [
-1.313118815422058,
0.17084328830242157,
0.26993927359580994,
0.7512215971946716,
-0.34894657135009766,
-0.1528467833995819,
0.007325038779526949,
-0.47263601422309875,
-0.27027496695518494,
-0.18680568039417267,
-0.546524167060852,
0.5510543584823608,
-0.9104996919631958,
0.23074473440647... |
func (*Response_Workers) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{7}
} | [
-0.3929292559623718,
0.34711575508117676,
0.13284191489219666,
0.014967456459999084,
0.11708816885948181,
-0.3584226071834564,
0.863897442817688,
-0.4486665427684784,
-0.16354680061340332,
-0.6891703605651855,
-0.815417468547821,
-0.5537253618240356,
-0.5234535336494446,
0.2197362184524536... |
func (*Response_Worker_Show) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{8}
} | [
0.03998209536075592,
-0.046170033514499664,
0.30329030752182007,
-0.43233823776245117,
-0.4431125521659851,
-0.22365832328796387,
0.9860761761665344,
-0.36793532967567444,
-0.11020685732364655,
-0.3071081340312958,
-0.7816401720046997,
-0.3280474543571472,
-0.27115753293037415,
-0.01048169... |
func (*Response_Workers_Show) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{9}
} | [
-0.007075383327901363,
0.17828573286533356,
0.07309677451848984,
-0.6036402583122253,
-0.33839648962020874,
-0.5275885462760925,
1.0139718055725098,
-0.2240486890077591,
-0.4710504710674286,
-0.21055930852890015,
-0.4053741693496704,
-0.029617995023727417,
-0.12057100981473923,
-0.09818140... |
func (*Response_Workers_Info) Descriptor() ([]byte, []int) {
return file_proto_work_proto_rawDescGZIP(), []int{10}
} | [
0.1429256796836853,
-0.21041178703308105,
0.08945012837648392,
-0.24894408881664276,
-0.10246849805116653,
-0.6049409508705139,
0.6477596759796143,
-0.6828494668006897,
-0.8219831585884094,
-0.47832924127578735,
-0.9223002195358276,
-0.7968342304229736,
0.1203421950340271,
0.17617157101631... |
func Save(willSave bool, popSaved uint, delSaved uint) {
os.Exit(0)
} | [
-0.07341614365577698,
-0.2536650598049164,
0.36339884996414185,
0.46945899724960327,
0.13692769408226013,
0.6007492542266846,
0.6101406812667847,
0.21385563910007477,
-0.22481662034988403,
0.4605560898780823,
-1.1304652690887451,
-0.03272072970867157,
-0.4565531015396118,
0.566222786903381... |
func handleConn(conn net.Conn) {
defer conn.Close()
log.Print("read request to buffer")
const maxHeaderSize = 4096
reader := bufio.NewReaderSize(conn, maxHeaderSize)
writer := bufio.NewWriter(conn)
counter := 0
buf := [maxHeaderSize]byte{}
// naive header limit
for {
if counter == maxHeaderSize {
log.Pri... | [
-0.31658974289894104,
-0.8434332013130188,
1.3590748310089111,
0.22202208638191223,
0.04755639284849167,
-0.42702141404151917,
-0.2032540738582611,
-0.6017111539840698,
-0.5113908648490906,
-1.1247843503952026,
0.18353600800037384,
-0.9570633769035339,
0.07913437485694885,
-0.3889797627925... |
func addIDToListRequest(r *resource, input *svcsdk.DescribeSubnetsInput) error {
if r.ko.Status.SubnetID == nil || *r.ko.Status.SubnetID == "" {
return errors.New("unable to extract subnetId from Kubernetes resource")
}
input.SubnetIds = []*string{r.ko.Status.SubnetID}
return nil
} | [
-0.3490806221961975,
0.2716171443462372,
0.5438901782035828,
0.06089643016457558,
0.5225299596786499,
0.9602943658828735,
-1.2336708307266235,
-0.24062970280647278,
1.3487358093261719,
-0.04441878944635391,
-0.06719375401735306,
0.871313214302063,
0.16365006566047668,
0.8948264122009277,
... |
func ParseSeatStrings(seatStrings []string) (*SeatMap, error) {
seatMap := &SeatMap{
seats: make([][]rune, len(seatStrings)),
}
rowLength := len(seatStrings[0])
for i, seatString := range seatStrings {
if len(seatString) != rowLength {
return nil, fmt.Errorf("Row %v different length to first row", i)
}
... | [
-0.5443443059921265,
-1.1608445644378662,
0.5839160084724426,
-0.4257100522518158,
-0.2570931315422058,
-0.17902663350105286,
0.19166199862957,
-0.7160012722015381,
0.7513699531555176,
0.44472455978393555,
0.8759114146232605,
0.23162813484668732,
-0.5682263374328613,
-0.4140862822532654,
... |
func EquilibriumOccupation(seatMap *SeatMap, count CountNeighbours, neighbourLimit int) int {
nextStep := seatMap
reachedEquilibrium := false
for !reachedEquilibrium {
nextStep, reachedEquilibrium = stepSeatMap(nextStep, count, neighbourLimit)
}
return nextStep.occupied
} | [
-1.437199592590332,
0.12961719930171967,
0.5146520137786865,
-0.3020709156990051,
0.6525341272354126,
-0.12850406765937805,
1.0059688091278076,
-0.32210129499435425,
-0.25904980301856995,
0.15390731394290924,
0.3488377034664154,
-0.8337081074714661,
-0.40856409072875977,
0.1468456685543060... |
func stepSeatMap(seatMap *SeatMap, count CountNeighbours, neighbourLimit int) (*SeatMap, bool) {
newMap := &SeatMap{
seats: make([][]rune, len(seatMap.seats)),
occupied: 0,
}
changed := false
for i := 0; i < len(seatMap.seats); i++ {
newMap.seats[i] = make([]rune, len(seatMap.seats[i]))
for j := 0; j < ... | [
-0.9648705720901489,
-0.7364726662635803,
1.0748445987701416,
-0.8054867386817932,
-0.9637686014175415,
-0.17456984519958496,
0.40359973907470703,
0.2594810426235199,
0.0200372114777565,
0.26973757147789,
-0.13136883080005646,
-0.0028169420547783375,
0.07191401720046997,
0.534887433052063,... |
func OccupiedNeighbours(seatMap *SeatMap, x, y int) int {
occupied := 0
for i := x - 1; i <= x+1; i++ {
if i < 0 || i >= len(seatMap.seats) {
continue
}
for j := y - 1; j <= y+1; j++ {
if j < 0 || j >= len(seatMap.seats[i]) || (i == x && j == y) {
continue
}
if seatMap.seats[i][j] == '#' {
... | [
-0.7629489898681641,
-0.29816120862960815,
0.9807994365692139,
-0.8629244565963745,
-0.964109480381012,
-0.03699561208486557,
0.22557035088539124,
-1.0251765251159668,
-0.5234384536743164,
0.6425939202308655,
0.14828331768512726,
0.5549899935722351,
-0.9285747408866882,
0.5001639723777771,... |
func OccupiedVisibleNeighbours(seatMap *SeatMap, x, y int) int {
occupied := 0
for i := -1; i <= 1; i++ {
for j := -1; j <= 1; j++ {
if i == 0 && j == 0 {
continue
}
if nextSeatOccupied(seatMap, x, y, i, j) {
occupied++
}
}
}
return occupied
} | [
-0.9786741137504578,
0.08062996715307236,
0.8820163011550903,
-0.6243537664413452,
-0.9368064999580383,
-0.28804266452789307,
0.35356634855270386,
-1.0879042148590088,
-0.07550407201051712,
0.7548663020133972,
0.09119794517755508,
0.8923059105873108,
-0.6305174827575684,
0.7170736193656921... |
func nextSeatOccupied(seatMap *SeatMap, x, y, stepX, stepY int) bool {
i := x + stepX
j := y + stepY
for i >= 0 && i < len(seatMap.seats) && j >= 0 && j < len(seatMap.seats[i]) {
if seatMap.seats[i][j] == 'L' {
return false
} else if seatMap.seats[i][j] == '#' {
return true
}
i += stepX
j += stepY
... | [
-0.9304060339927673,
-0.3115321397781372,
0.6540627479553223,
-0.5644124150276184,
-0.9054560661315918,
0.04590555280447006,
-0.03700491040945053,
0.1327543556690216,
-0.47364184260368347,
-0.08610748499631882,
0.14480531215667725,
0.20625866949558258,
-0.0821123868227005,
0.88703298568725... |
func ChangedAttrs(changeList []TableRowChange) set.Set {
attrs := set.NewSet()
dcs := NewDocChangeSet(changeList)
for _, tcs := range dcs.Changes {
for _, col := range tcs.ChangedColumnNames() {
for _, attr := range tcs.ColumnMap[col] {
attrs.Add(attr)
}
}
}
return attrs
} | [
-0.4611526429653168,
-0.351914644241333,
0.39299875497817993,
-0.4111027717590332,
-0.8495224714279175,
-0.3707648813724518,
-0.4533274471759796,
-0.0730975791811943,
-0.27643585205078125,
-0.15073388814926147,
0.2457779496908188,
0.1092572957277298,
0.29894211888313293,
1.4553114175796509... |
func NewDocChangeSet(changeList []TableRowChange) DocChangeSet {
s := DocChangeSet{Changes: map[string]TableChangeSet{}}
for _, c := range changeList {
s.ApplyChange(c)
}
s.PruneUnchangedTables()
return s
} | [
-0.36824101209640503,
-0.00923946127295494,
0.34860843420028687,
0.1972992718219757,
-1.4822726249694824,
-0.49117377400398254,
0.5316680669784546,
-0.47057995200157166,
0.005256730131804943,
0.04026912525296211,
0.20072394609451294,
0.23009203374385834,
0.1216069906949997,
1.0836782455444... |
func (s *DocChangeSet) ApplyChange(c TableRowChange) {
table := c.TableName
tableChangeSet, exists := s.Changes[table]
if !exists {
tableChangeSet = TableChangeSet{
Columns: c.Columns,
ColumnMap: c.ColumnMap,
Changes: map[PrimaryKey]RowDiff{},
}
s.Changes[table] = tableChangeSet
}
tableChangeSet... | [
0.023613350465893745,
0.4206402003765106,
0.43543824553489685,
-0.05750681459903717,
-0.4924312233924866,
0.16587677597999573,
0.430372953414917,
0.012305575422942638,
0.35869166254997253,
-0.872100830078125,
-0.07322127372026443,
-0.8853595852851868,
0.49131345748901367,
1.847776770591735... |
func (s *DocChangeSet) PruneUnchangedTables() {
for table, tcs := range s.Changes {
tcs.PruneUnchangedRows()
if len(tcs.Changes) == 0 {
delete(s.Changes, table)
}
}
} | [
0.0004500168142840266,
0.24109481275081635,
0.4548362195491791,
0.04327170178294182,
-1.0022919178009033,
0.5549032688140869,
0.5115169882774353,
-0.0178997665643692,
0.587173581123352,
-0.3453662693500519,
0.2641107738018036,
0.36142635345458984,
-0.08320385217666626,
1.7187371253967285,
... |
func (t *TableChangeSet) ApplyChange(c TableRowChange) {
diff, exists := t.Changes[c.PK]
if exists {
isInsert := diff.IsInsert && c.Action != canal.DeleteAction
isDelete := !diff.IsInsert && c.Action == canal.DeleteAction
t.Changes[c.PK] = RowDiff{
IsInsert: isInsert,
IsUpdate: !isInsert && !isDelete,
... | [
-0.24955926835536957,
0.013553908094763756,
0.7185290455818176,
-0.37224164605140686,
0.3707289695739746,
0.07587956637144089,
0.38903653621673584,
0.29654166102409363,
0.9005186557769775,
-0.3830294609069824,
-0.0034516339655965567,
-0.7010765075683594,
0.2212667018175125,
1.9185487031936... |
func (t *TableChangeSet) PruneUnchangedRows() {
for pk, diff := range t.Changes {
if reflect.DeepEqual(diff.Old, diff.New) {
delete(t.Changes, pk)
}
}
} | [
-0.10150399804115295,
-0.1595367193222046,
0.3449755609035492,
-0.376681923866272,
-0.7649279832839966,
0.11948145180940628,
0.1457708775997162,
0.12091949582099915,
0.31843382120132446,
-0.031919315457344055,
0.011892268434166908,
0.030420973896980286,
0.23029592633247375,
1.7741993665695... |
func (t *TableChangeSet) ChangedColumnNames() []string {
before := set.NewSet()
after := set.NewSet()
for _, diff := range t.Changes {
if diff.IsDelete || diff.IsUpdate {
before.Add(rowToArray(diff.Old))
}
if diff.IsInsert || diff.IsUpdate {
after.Add(rowToArray(diff.New))
}
}
if after.Equal(before)... | [
-0.47331503033638,
-0.64952152967453,
0.5829687714576721,
-0.09533437341451645,
-0.29374656081199646,
0.00878314021974802,
0.1992655247449875,
-0.7483443021774292,
-0.06699835509061813,
0.2823684811592102,
-1.0345741510391235,
0.3533658981323242,
0.3728877305984497,
0.8020270466804504,
-... |
func NewColumnValueDiff(v ValuePair, relation string) ColumnValueDiff {
var diff ColumnValueDiff
switch relation {
case IdentityRelation, OneToOneRelation:
diff = &PlainValueDiff{}
case OneToManyRelation:
diff = &SetValueDiff{}
default:
panic("unknown table relation type")
}
diff.Init(v)
return diff
} | [
-0.21527808904647827,
-0.5840136408805847,
0.2632685899734497,
0.9397555589675903,
-0.625666618347168,
0.33601653575897217,
-0.09926320612430573,
-0.17859290540218353,
-0.19236811995506287,
-0.6380470395088196,
0.19036439061164856,
0.3344789743423462,
-0.19254332780838013,
0.32594764232635... |
func checkDatabaseVersion(store kvstore.KVStore) error {
entry, err := store.Get(dbVersionKey)
if errors.Is(err, kvstore.ErrKeyNotFound) {
// set the version in an empty DB
return store.Set(dbVersionKey, []byte{DBVersion})
}
if err != nil {
return err
}
if len(entry) == 0 {
return fmt.Errorf("%w: no datab... | [
-0.14441697299480438,
0.9463465809822083,
0.4672105014324188,
0.2729269862174988,
0.43282875418663025,
-0.012187780812382698,
-0.3576773405075073,
0.42331770062446594,
0.48282521963119507,
1.442550778388977,
-0.48015889525413513,
0.09544999897480011,
-1.109237790107727,
0.9571418166160583,... |
func (o *Once) Do(f func()) {
if atomic.LoadUint32(&o.done) == 1 {
return
}
// Slow-path.
o.m.Lock()
defer o.m.Unlock()
if o.done == 0 {
defer atomic.StoreUint32(&o.done, 1)
f()
}
} | [
-0.08834805339574814,
1.2807344198226929,
0.4569261372089386,
0.8639940023422241,
0.29140546917915344,
0.26739147305488586,
1.3394793272018433,
-0.7062143683433533,
-0.22782348096370697,
0.005338448565453291,
-0.6347894668579102,
-0.4254254102706909,
0.005298481322824955,
0.893377006053924... |
func (o *Once) Reset() {
o.m.Lock()
defer o.m.Unlock()
atomic.StoreUint32(&o.done, 0)
} | [
-0.3475039303302765,
1.369476079940796,
0.2864533066749573,
0.44048765301704407,
0.720683753490448,
-0.26931169629096985,
1.493697166442871,
-0.7917200922966003,
-0.9787691235542297,
0.37163275480270386,
-1.2776930332183838,
0.7361891865730286,
-1.4039863348007202,
-0.07332778722047806,
... |
func evaluateCriteriaSet(result *keptnv2.SLIResult, sloCriteria *keptn.SLOCriteria, previousResults []*keptnv2.SLIEvaluationResult, comparison *keptn.SLOComparison) (bool, []*keptnv2.SLITarget, error) {
satisfied := true
var sliTargets []*keptnv2.SLITarget
for _, criteria := range sloCriteria.Criteria {
target := ... | [
-1.0150409936904907,
-0.27456891536712646,
0.42399778962135315,
-1.2864803075790405,
-0.1298871785402298,
-0.3280828297138214,
-0.28743916749954224,
0.17687763273715973,
-0.1547224372625351,
0.2345150262117386,
0.8775281310081482,
1.023669719696045,
-0.7425853610038757,
0.7981061935424805,... |
func aggregateValues(previousResults []*keptnv2.SLIEvaluationResult, comparison *keptn.SLOComparison) (float64, bool) {
if len(previousResults) == 0 {
// if no comparison values are available, the evaluation passes
return 0, true
}
var previousValues []float64
for _, val := range previousResults {
if val.Val... | [
-0.14291109144687653,
1.1968353986740112,
0.5771764516830444,
-0.06263754516839981,
-0.05413586646318436,
-0.12797029316425323,
0.47598889470100403,
0.30336248874664307,
-0.33804967999458313,
0.1552020162343979,
0.7896656394004822,
-0.16326572000980377,
-0.4833795130252838,
1.0020266771316... |
func (eh *EvaluateSLIHandler) getPreviousEvaluations(e *keptnv2.GetSLIFinishedEventData, numberOfPreviousResults int, includeResult string) ([]*keptnv2.EvaluationFinishedEventData, []string, error) {
var evaluationDoneEvents []*keptnv2.EvaluationFinishedEventData
var eventIDs []string
// previous results are fetche... | [
-0.13689468801021576,
1.0390256643295288,
0.9232720136642456,
-0.4778057932853699,
-0.6071008443832397,
-0.7867856025695801,
0.64418625831604,
-0.10298936814069748,
0.039031982421875,
0.44524842500686646,
-0.2812146544456482,
0.5478689670562744,
-0.8171284198760986,
0.9394212365150452,
0... |
func Handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
var data briefStruct
json.Unmarshal([]byte(request.Body), &data)
res := responseJson(data.Title, data.Text, briefText(data.Title, data.Text))
fmt.Println("res: ", res)
return events.APIGatewayProxyResponse{Body: res, Sta... | [
-0.5670595765113831,
-0.32889431715011597,
0.6716802716255188,
-1.0430275201797485,
-0.6448953151702881,
-0.06479194760322571,
-0.09755964577198029,
0.4815920889377594,
0.08033104240894318,
-0.42687156796455383,
-0.5266966819763184,
-0.04930095374584198,
-0.22685717046260834,
0.16341249644... |
func StartsWith(str, prefix string) bool {
return strings.HasPrefix(str, prefix)
} | [
1.1518876552581787,
-1.3386801481246948,
-0.02929597720503807,
0.4229470193386078,
-0.792377769947052,
-1.1602486371994019,
-2.09374737739563,
0.10548146069049835,
0.05123729258775711,
0.31208333373069763,
-0.328093945980072,
0.25310587882995605,
0.06086476147174835,
-0.13409636914730072,
... |
func EndsWith(str, suffix string) bool {
return strings.HasSuffix(str, suffix)
} | [
0.8196426630020142,
-0.7610312104225159,
0.011441131122410297,
0.2511495351791382,
-0.9157745838165283,
-0.4143770635128021,
-1.9896347522735596,
0.5170068144798279,
-0.13476163148880005,
0.38081538677215576,
-0.7630847692489624,
0.48948875069618225,
0.15646417438983917,
0.2523708045482635... |
func Contains(str, substr string) bool {
return strings.Contains(str, substr)
} | [
0.9790554642677307,
-0.9219253659248352,
-0.1006406769156456,
-0.1031559556722641,
-0.9218167066574097,
0.8926180601119995,
-0.8919427394866943,
-0.9258038997650146,
-0.5785202383995056,
-0.9895002245903015,
0.304450124502182,
1.1820926666259766,
-0.0890713706612587,
-0.10536526888608932,
... |
func Equals(strFirst, strSecond string) bool {
return strFirst == strSecond
} | [
-0.0323883481323719,
-1.392041563987732,
0.3545019328594208,
-0.9280766248703003,
-0.015748020261526108,
-0.5989444255828857,
-1.440539836883545,
-0.8302544951438904,
-0.8625901341438293,
-0.4538554251194,
-0.26935380697250366,
1.6244176626205444,
0.12173840403556824,
0.5566173195838928,
... |
func EqualsIgnoreCase(strFirst, strSecond string) bool {
strFirst = ToLower(strFirst)
strSecond = ToLower(strSecond)
return strFirst == strSecond
} | [
0.09215891361236572,
-0.9597013592720032,
0.5622766017913818,
-0.8786460161209106,
-0.19473834335803986,
-0.4743387699127197,
-0.8329226970672607,
-0.5245577096939087,
-0.26593756675720215,
0.5909286141395569,
-0.9719736576080322,
0.7001430988311768,
-0.21354474127292633,
-0.06718619912862... |
func Count(str, substr string) int {
return strings.Count(str, substr)
} | [
1.579843282699585,
-1.0838950872421265,
0.22880074381828308,
-0.06524962931871414,
-0.8581110835075378,
0.9146742820739746,
-0.14131245017051697,
-0.18769571185112,
-1.1990280151367188,
-0.12194464355707169,
-0.039580464363098145,
0.49987608194351196,
0.23219315707683563,
0.035376098006963... |
func Trim(str string) string {
return strings.TrimSpace(str)
} | [
0.10063737630844116,
0.028175298124551773,
-0.0887884870171547,
0.03619181737303734,
-0.367232084274292,
1.0258562564849854,
-0.12296345084905624,
-0.7269499897956848,
1.0929183959960938,
-0.31131139397621155,
0.3535420596599579,
0.47538694739341736,
0.2744392156600952,
-0.591925323009491,... |
func Replace(haystack, needle, gold string) string {
return strings.Replace(haystack, needle, gold, -1)
} | [
0.09188081324100494,
0.012251833453774452,
0.2554813623428345,
0.0332086980342865,
0.2656668722629547,
-0.44080036878585815,
-0.21099571883678436,
0.49527662992477417,
-0.17993594706058502,
0.5510854721069336,
-0.15196293592453003,
0.58125239610672,
-0.893262505531311,
-0.7457865476608276,... |
func ToLower(str string) string {
return strings.ToLower(str)
} | [
1.1641591787338257,
-0.39642542600631714,
0.1881846934556961,
-0.2866721749305725,
-0.25329411029815674,
0.5147761106491089,
-0.04130147770047188,
-0.9427624940872192,
0.4891792833805084,
0.2447470873594284,
0.042172376066446304,
0.07659102976322174,
-0.5326693654060364,
-0.575946509838104... |
func ToUpper(str string) string {
return strings.ToUpper(str)
} | [
-0.18043142557144165,
-0.3560081124305725,
0.08848864585161209,
0.3389144241809845,
-0.6933655142784119,
0.4972555935382843,
-0.21225543320178986,
-0.299825519323349,
0.31349611282348633,
0.5242900252342224,
0.29009318351745605,
0.1343330591917038,
0.16476935148239136,
-1.0796290636062622,... |
func ToTitle(str string) string {
return strings.Title(str)
} | [
0.25666549801826477,
-0.39457806944847107,
0.3960731625556946,
-0.482040137052536,
-0.5285634994506836,
-0.0807776004076004,
-0.6204545497894287,
-0.5143281817436218,
0.7626757025718689,
0.8995952010154724,
-0.3742249310016632,
0.4210813641548157,
-0.8676913380622864,
-1.4209191799163818,
... |
func If(b bool, yes string) string {
if b {
return yes
}
return ``
} | [
1.0475239753723145,
0.5478218197822571,
0.32168152928352356,
0.6183011531829834,
-1.0534040927886963,
0.6451327204704285,
-1.0808078050613403,
0.09509913623332977,
-0.5475848317146301,
-0.3164275288581848,
0.35116514563560486,
0.4265105724334717,
0.3481980264186859,
-0.09500972926616669,
... |
func IfElse(b bool, yes, no string) string {
if b {
return yes
}
return no
} | [
0.14350846409797668,
0.16649098694324493,
0.5323412418365479,
0.3501531183719635,
-0.26315838098526,
-0.2101663202047348,
-0.8787024617195129,
0.15461225807666779,
-0.9523749947547913,
0.23024331033229828,
-0.2085239589214325,
0.039787936955690384,
-0.44833841919898987,
-0.1617320924997329... |
func IfEmpty(str1, str2 string) string {
if str1 != `` {
return str1
}
return str2
} | [
0.4241492748260498,
-0.6567102670669556,
0.8216580748558044,
-0.08917246758937836,
0.0816693976521492,
0.7442643642425537,
-0.9640994071960449,
-0.29841017723083496,
-0.8843359351158142,
0.9475974440574646,
0.7205989360809326,
1.9054341316223145,
-0.04753148555755615,
-0.4820707142353058,
... |
func Coalesce(strs ...string) string {
for _, str := range strs {
if str != `` {
return str
}
}
return ``
} | [
1.060924768447876,
0.23298650979995728,
0.3541305959224701,
-0.1638878732919693,
0.7200649380683899,
-0.11207740008831024,
-1.3822840452194214,
0.08739594370126724,
-0.9926716685295105,
-0.06700236350297928,
1.0693038702011108,
0.7559248208999634,
-0.7124207019805908,
0.31567129492759705,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.