text
stringlengths
11
6.3k
embedding
listlengths
768
768
func find(a []string, x string) int { for i, n := range a { if x == n { return i } } return len(a) }
[ 0.753939151763916, -0.2974352240562439, 0.4587547183036804, -0.9052943587303162, -0.861677885055542, -0.36039313673973083, -0.25864937901496887, -0.23443813621997833, -0.27201634645462036, 1.058841586112976, -0.08095702528953552, 0.6103886365890503, 0.06354022771120071, 0.10992162674665451...
func NewMockKeystore(ctrl *gomock.Controller) *MockKeystore { mock := &MockKeystore{ctrl: ctrl} mock.recorder = &MockKeystoreMockRecorder{mock} return mock }
[ 0.046498093754053116, 0.18267695605754852, 0.262538880109787, 0.5651758313179016, -0.6311020255088806, 0.09220225363969803, 0.06122956424951553, -0.6126189231872559, 0.29264357686042786, 0.5787975788116455, -0.7676642537117004, -0.025699419900774956, -1.0727331638336182, 0.9460391402244568...
func (m *MockKeystore) EXPECT() *MockKeystoreMockRecorder { return m.recorder }
[ -0.06021060794591904, 0.32556405663490295, 0.3515128195285797, 0.09401270747184753, -0.5914667844772339, 0.28943297266960144, -0.21667297184467316, 0.2717704474925995, 0.5761038661003113, -0.1677975058555603, 0.5264898538589478, 0.778469443321228, -0.9729886651039124, 0.3228975832462311, ...
func (m *MockKeystore) Close() error { ret := m.ctrl.Call(m, "Close") ret0, _ := ret[0].(error) return ret0 }
[ -0.7689247727394104, -0.046029433608055115, 0.328769326210022, 1.066287875175476, 0.40853169560432434, 0.8907201886177063, 0.591881513595581, -0.6099912524223328, -0.7416576743125916, 0.07168260961771011, 0.012950938194990158, -1.0242161750793457, -1.4227510690689087, 1.549216389656067, ...
func (mr *MockKeystoreMockRecorder) Close() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockKeystore)(nil).Close)) }
[ -0.5614055395126343, 0.7671872973442078, 0.4006105065345764, 0.38844284415245056, -0.5573710203170776, 0.8762018084526062, -0.2289886474609375, -1.1078300476074219, 0.29657259583473206, 0.5613300800323486, 0.8255619406700134, 0.29421064257621765, -1.5673401355743408, 1.8597407341003418, ...
func (m *MockKeystore) CleanPrefix(prefix string) error { ret := m.ctrl.Call(m, "CleanPrefix", prefix) ret0, _ := ret[0].(error) return ret0 }
[ -0.9198237657546997, -0.4768570363521576, 0.1086011752486229, -0.005358537193387747, 0.2912106215953827, 0.05424167960882187, 0.7509125471115112, -0.04985639080405235, -0.30982860922813416, 0.44600793719291687, -1.205744743347168, 0.07982835173606873, -0.7517924308776855, 0.953394591808319...
func (mr *MockKeystoreMockRecorder) CleanPrefix(prefix interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanPrefix", reflect.TypeOf((*MockKeystore)(nil).CleanPrefix), prefix) }
[ -0.7212398648262024, 0.3931417167186737, 0.4992336630821228, -0.27859050035476685, -0.7075336575508118, 0.30748075246810913, -0.25473737716674805, -0.2777397334575653, 0.6510955691337585, 1.1571513414382935, 0.039510633796453476, 0.7960332036018372, -0.44957393407821655, 1.0903794765472412...
func (m *MockKeystore) Add(keyValues []keystoreregistry.KeyValue) error { ret := m.ctrl.Call(m, "Add", keyValues) ret0, _ := ret[0].(error) return ret0 }
[ -0.5464818477630615, -0.030138680711388588, 0.30233249068260193, 0.4068112373352051, 0.5139131546020508, 1.11296546459198, 0.2563505172729492, -0.22560039162635803, -0.18508301675319672, -0.0030473151709884405, -0.07923649996519089, -0.6478512287139893, -0.9084234833717346, 1.2812017202377...
func (mr *MockKeystoreMockRecorder) Add(keyValues interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockKeystore)(nil).Add), keyValues) }
[ -0.7075740098953247, 0.48323318362236023, 0.33652758598327637, 0.39057713747024536, -0.22134514153003693, 1.0530201196670532, -0.6455203294754028, -0.8682703971862793, 0.816622257232666, 0.16939081251621246, 0.6812036633491516, 0.46263986825942993, -0.7604696154594421, 1.5881928205490112, ...
func (m *MockKeystore) Update(keyValues []keystoreregistry.KeyValueVersion) error { ret := m.ctrl.Call(m, "Update", keyValues) ret0, _ := ret[0].(error) return ret0 }
[ -0.403812438249588, -0.3016336262226105, 0.21254847943782806, 0.6228351593017578, 0.03574443608522415, 0.8866770267486572, 0.1187124103307724, -0.054717402905225754, -0.2757968008518219, 0.19038799405097961, -0.565787672996521, -1.0503053665161133, -1.11223566532135, 0.8196247816085815, ...
func (mr *MockKeystoreMockRecorder) Update(keyValues interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockKeystore)(nil).Update), keyValues) }
[ -0.4296353757381439, 0.37103012204170227, 0.3654254078865051, 0.5946788787841797, -0.74838787317276, 0.7595133781433105, -0.6937350630760193, -0.7928037643432617, 0.776917576789856, 0.41116029024124146, 0.483516126871109, 0.15327005088329315, -1.0386103391647339, 1.309520959854126, -0.50...
func (m *MockKeystore) DeleteAll(keyValues []keystoreregistry.KeyValueVersion) error { ret := m.ctrl.Call(m, "DeleteAll", keyValues) ret0, _ := ret[0].(error) return ret0 }
[ -0.018139617517590523, -0.41792356967926025, 0.3357962965965271, 0.4407947063446045, -0.4057510197162628, 0.7430930137634277, 0.2865489721298218, 0.09522921591997147, -0.19039568305015564, -0.7928563952445984, -0.28731977939605713, -0.369031697511673, -0.8213208317756653, 1.468422651290893...
func (mr *MockKeystoreMockRecorder) DeleteAll(keyValues interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAll", reflect.TypeOf((*MockKeystore)(nil).DeleteAll), keyValues) }
[ -0.03182072937488556, 0.3456351161003113, 0.5524969100952148, 0.26567840576171875, -0.8484063148498535, 0.5821980237960815, -0.7275911569595337, -0.16372497379779816, 0.7731080055236816, -0.13389384746551514, 0.6002750992774963, 0.7165907621383667, -0.44855552911758423, 1.7756609916687012,...
func (m *MockKeystore) GetAll(prefix string) ([]keystoreregistry.KeyValueVersion, error) { ret := m.ctrl.Call(m, "GetAll", prefix) ret0, _ := ret[0].([]keystoreregistry.KeyValueVersion) ret1, _ := ret[1].(error) return ret0, ret1 }
[ 0.10990915447473526, -0.172855406999588, 0.2937958538532257, 1.2048377990722656, 0.5033780336380005, 0.5699092745780945, 0.02809229865670204, -0.06487393379211426, -0.02452080138027668, -0.2127383053302765, -0.7738117575645447, 0.387531578540802, -0.25079354643821716, 1.119260311126709, ...
func (mr *MockKeystoreMockRecorder) GetAll(prefix interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAll", reflect.TypeOf((*MockKeystore)(nil).GetAll), prefix) }
[ 0.3812020421028137, 0.7459090352058411, 0.5131030678749084, 0.6628935933113098, -0.0349312424659729, 0.30578044056892395, -0.8042718172073364, -0.4221208393573761, 0.9809937477111816, 0.49731534719467163, 0.3995804786682129, 1.1593307256698608, -0.4269464910030365, 1.401713490486145, -0....
func (m *MockKeystore) Get(key string) (keystoreregistry.KeyValueVersion, error) { ret := m.ctrl.Call(m, "Get", key) ret0, _ := ret[0].(keystoreregistry.KeyValueVersion) ret1, _ := ret[1].(error) return ret0, ret1 }
[ -1.16893470287323, -0.20736713707447052, 0.32361894845962524, 0.49220067262649536, 0.9179927706718445, 0.130557119846344, 0.2140393853187561, -0.25436240434646606, -0.9604006409645081, 0.33741217851638794, -0.5713240504264832, -0.13249465823173523, -0.38616642355918884, 0.8806164860725403,...
func (mr *MockKeystoreMockRecorder) Get(key interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockKeystore)(nil).Get), key) }
[ -0.929162859916687, 0.7350634336471558, 0.43147286772727966, -0.1573420912027359, 0.155115008354187, 0.13754671812057495, -0.7687227129936218, -0.7605025768280029, 0.43770840764045715, 0.9875121116638184, 0.5061934590339661, 0.9923772215843201, -0.7815383076667786, 1.3194812536239624, 0....
func (m *MockKeystore) WatchPrefix(prefix string, onUpdate func(*keystoreregistry.KeyValueVersion, *keystoreregistry.KeyValueVersion)) { m.ctrl.Call(m, "WatchPrefix", prefix, onUpdate) }
[ -0.46894335746765137, -0.7190106511116028, 0.09847346693277359, 0.534186601638794, -0.016567295417189598, 0.21499741077423096, 0.43701767921447754, 0.1451113522052765, -0.3132784962654114, 0.016200032085180283, -1.351806402206421, 0.4451659619808197, 0.2213197499513626, 0.7097326517105103,...
func (mr *MockKeystoreMockRecorder) WatchPrefix(prefix, onUpdate interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WatchPrefix", reflect.TypeOf((*MockKeystore)(nil).WatchPrefix), prefix, onUpdate) }
[ 0.10116901248693466, -0.06459388881921768, 0.31305861473083496, 0.1318620890378952, -0.7582279443740845, 0.0892786830663681, -0.4034176766872406, -0.4428568184375763, 0.6523398160934448, 0.6343514919281006, -0.3963375389575958, 1.1690424680709839, -0.23184336721897125, 0.6675382256507874, ...
func (m *MockKeystore) WatchKey(ctxt context.Context, key string, onUpdate func(*keystoreregistry.KeyValueVersion, *keystoreregistry.KeyValueVersion)) { m.ctrl.Call(m, "WatchKey", ctxt, key, onUpdate) }
[ -0.323171466588974, -0.0779857411980629, 0.0601096972823143, 0.7840055227279663, 0.5634428262710571, 0.8832049369812012, 0.528369128704071, 0.1961662769317627, -0.3346187472343445, 0.7381426692008972, -0.7042129635810852, 0.15374580025672913, -0.26521241664886475, 1.05935800075531, -0.29...
func (mr *MockKeystoreMockRecorder) WatchKey(ctxt, key, onUpdate interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WatchKey", reflect.TypeOf((*MockKeystore)(nil).WatchKey), ctxt, key, onUpdate) }
[ -0.1435001790523529, 0.5552365183830261, 0.10612744092941284, 0.2767831087112427, -0.259636253118515, 0.4275081157684326, -0.24195705354213715, -0.06329017877578735, 0.5241576433181763, 1.4402422904968262, 0.05987901613116264, 1.2565451860427856, -0.7678380012512207, 1.0716683864593506, ...
func (m *MockKeystore) KeepAliveKey(key string) error { ret := m.ctrl.Call(m, "KeepAliveKey", key) ret0, _ := ret[0].(error) return ret0 }
[ -1.2023372650146484, -0.5456369519233704, 0.37542447447776794, 0.25457140803337097, 0.9358558654785156, 0.7613340616226196, 0.42121782898902893, -0.8316360116004944, -0.5892126560211182, 0.9219652414321899, -0.7589716911315918, -0.6638509035110474, -1.338893175125122, 0.6654419898986816, ...
func (mr *MockKeystoreMockRecorder) KeepAliveKey(key interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeepAliveKey", reflect.TypeOf((*MockKeystore)(nil).KeepAliveKey), key) }
[ -0.85268634557724, 0.08971177786588669, 0.6263131499290466, 0.10166547447443008, 0.054079219698905945, 1.1109808683395386, -0.2357899248600006, -0.8069560527801514, 0.6252792477607727, 1.7901067733764648, 0.0916190966963768, 0.0771259218454361, -1.1023590564727783, 0.6635884046554565, 0....
func CreateScope(baseScope *Scope) *Scope { var scope Scope var symbolTable SymbolTable symbolTable = make(SymbolTable) scope.symbolTable = &symbolTable scope.BaseScope = baseScope scope.scopeIndex = nextScopeIndex nextScopeIndex++ return &scope }
[ -0.34261786937713623, -0.21851828694343567, 0.24096491932868958, -0.43564075231552124, -0.05741702392697334, -0.3679760992527008, -0.1770639419555664, -0.7429742813110352, 0.3148883581161499, 0.14975284039974213, -0.23337611556053162, 0.3040204346179962, -0.5532112121582031, 0.179300904273...
func (scope *Scope) CreateSubScope() *Scope { return CreateScope(scope) }
[ 0.2834511399269104, -0.42177748680114746, 0.3424413204193115, 0.08095525950193405, -0.3952150344848633, 0.056501347571611404, -0.7250863909721375, -0.3010106384754181, 0.4087171256542206, -0.3004109561443329, -0.6584228873252869, 0.4250049591064453, -0.41831836104393005, -0.015904221683740...
func (scope *Scope) CreateBindingCannotBeShadowed(identifier string, locator locator.Locator, typing typing.Typing) *Binding { binding := CreateBindingCannotBeShadowed(locator, typing) scope.symbolTable.Install(identifier, binding) return binding }
[ -0.572147786617279, 0.41295260190963745, 0.23867927491664886, 0.4636813998222351, -0.762691080570221, 0.8131927847862244, 0.7031561136245728, 0.4168209135532379, 0.8649653792381287, 0.5307716131210327, -0.9131500124931335, 0.28785547614097595, -0.1265476644039154, 0.7999886274337769, 0.9...
func New() *List { return &List{} }
[ -0.34756767749786377, -1.451356053352356, -0.2949753701686859, 0.10906550288200378, -0.4192700684070587, -0.2602680027484894, -0.783159077167511, 0.507745623588562, 0.4157005846500397, -0.8690541386604309, -1.399849534034729, 0.09744630753993988, 0.9166786074638367, 0.7373312711715698, -...
func (l *List) Add(i int) { if l == nil { return } node := newNode(i) if !l.Empty() { node.next = l.head } l.head = node l.size++ }
[ -0.9218080043792725, 0.8102535605430603, 0.3472349941730499, -0.6454761028289795, 0.05618772655725479, 0.5441873669624329, 0.2405732125043869, 0.7611061334609985, 1.3053245544433594, -0.08970833569765091, -1.359890103340149, -0.24584946036338806, -0.9881045818328857, 0.8770473003387451, ...
func GetOrganizationID(slug string, client *graphql.Client) (string, error) { var query struct { Organization struct { ID graphql.ID } `graphql:"organization(slug: $slug)"` } vars := map[string]interface{}{ "slug": slug, } err := client.Query(context.Background(), &query, vars) if err != nil { return "...
[ 0.12908761203289032, 0.36669987440109253, 0.38836145401000977, 0.10904628783464432, -0.14619208872318268, -0.4236582815647125, 0.4923616051673889, -0.6023784279823303, -0.3144916892051697, 0.7523229122161865, 0.05040960758924484, 0.5594664812088013, -0.1358635127544403, -0.0501865111291408...
func GetTeamID(slug string, client *Client) (string, error) { // Make sure the slug is prefixed with the organization prefix := fmt.Sprintf("%s/", client.organization) if !strings.HasPrefix(slug, prefix) { slug = prefix + slug } var query struct { Team TeamNode `graphql:"team(slug: $slug)"` } params := map[s...
[ 0.7080981731414795, 0.00815596617758274, 0.4706675410270691, -0.3403855562210083, 0.2185305505990982, -0.20012784004211426, 0.14317485690116882, -0.33121219277381897, -0.32559365034103394, 0.23490068316459656, 0.2725581228733063, 1.0329418182373047, -0.42858222126960754, -0.303943127393722...
func call(srv string, name string, args interface{}, reply interface{}) bool { c, err := rpc.Dial("unix", srv) if err != nil { err1 := err.(*net.OpError) if err1.Err != syscall.ENOENT && err1.Err != syscall.ECONNREFUSED { //fmt.Printf("paxos Dial() failed: %v\n", err1) } return false } defer c.Close() e...
[ -0.7632046341896057, 0.5844994187355042, 1.1071792840957642, -0.21416927874088287, -0.8237737417221069, 1.4945127964019775, -1.7768806219100952, -0.6587284803390503, 0.15160995721817017, -0.2193872332572937, 0.20705342292785645, 0.003656362183392048, -1.2163522243499756, -0.262834519147872...
func (px *Paxos) Start(seq int, v interface{}) { // Your code here. if seq < px.Min() { return } //args := RequestArgs{1, nil, 3, "12"} go func(v interface{}, seq int) { node, ok := px.prepareStatus.Find(seq) for !ok || !node.State.Done { //choose unique n n := (int(time.Now().Unix()) << 5) | px.me ...
[ -0.4060102105140686, 0.12003464251756668, 0.7105865478515625, 0.3328850567340851, -0.3515731394290924, 0.03262518718838692, 0.11957931518554688, 0.6707373261451721, 0.18080170452594757, 0.465844064950943, -0.7894882559776306, 0.635267972946167, 0.38800615072250366, 0.46477556228637695, -...
func (px *Paxos) Done(seq int) { // Your code here. px.localDoneMin = seq }
[ -0.48736095428466797, -0.09572381526231766, 0.35073646903038025, 0.9492604732513428, 0.2985333204269409, 0.7974406480789185, -0.14896103739738464, 0.637164294719696, 0.7847211360931396, -0.49294909834861755, -1.8417562246322632, -0.2915515899658203, 0.1971893310546875, 0.20691217482089996,...
func (px *Paxos) Max() int { // Your code here. max := -1 head := px.prepareStatus.Head for head.Next != nil { state := head.Next if max < state.Seq { max = state.Seq } head = head.Next } return max }
[ -0.7122529745101929, 0.4484659433364868, 0.7519742250442505, 0.8002922534942627, -0.634451687335968, -0.5003536939620972, -0.8288318514823914, 1.0162838697433472, 0.5876471400260925, -0.09219818562269211, -0.36362719535827637, 0.40103256702423096, -0.41541364789009094, 0.5672802925109863, ...
func (px *Paxos) Min() int { // You code here. min := px.localDoneMin for _, v := range px.doneMins { if min > v { min = v } } //清理数据,或者放到decide中清理,但是总是会调用这个min的 head := px.prepareStatus.Head for head.Next != nil { seq := head.Seq head = head.Next if seq < min && seq != -1 { //log.Printf("now del...
[ -0.6877617239952087, 0.24062785506248474, 0.7722353935241699, 0.2423599809408188, -0.9268336892127991, 0.14547111093997955, -0.16901154816150665, 0.14964653551578522, 0.7253878712654114, -0.33545994758605957, -0.6110852956771851, 0.8077514171600342, -0.9557604789733887, 0.7782684564590454,...
func (px *Paxos) Status(seq int) (Fate, interface{}) { // Your code here. if seq < px.Min() { return Forgotten, nil } node, ok := px.prepareStatus.Find(seq) if ok && node.State.Done { return Decided, node.State.VA } return Pending, nil }
[ -0.7780700325965881, -0.5694630146026611, 0.423016756772995, -0.058220747858285904, -0.48227953910827637, -0.3657359182834625, -0.34800010919570923, 0.5890835523605347, 0.6968321204185486, 0.13804903626441956, -0.5232514142990112, 0.2032373696565628, 1.080329418182373, 0.662375271320343, ...
func (px *Paxos) Kill() { atomic.StoreInt32(&px.dead, 1) if px.l != nil { px.l.Close() } }
[ -0.11215636134147644, -0.3058435916900635, 0.30151036381721497, 0.4414146840572357, -0.1850195825099945, 1.7422409057617188, -0.8717895746231079, -0.07952520251274109, 0.2068224549293518, -0.15612944960594177, -0.32171398401260376, -0.26971733570098877, -0.06216913461685181, -0.37120360136...
func (px *Paxos) isdead() bool { return atomic.LoadInt32(&px.dead) != 0 }
[ -0.4569278061389923, -0.1546166092157364, 0.730760395526886, 0.25780919194221497, 0.15288706123828888, 1.5234782695770264, -1.1938992738723755, -0.7631333470344543, 1.0263946056365967, -0.9392215013504028, -0.0846698060631752, 0.2555610239505768, -0.42377379536628723, -0.3940163552761078, ...
func (px *Paxos) setunreliable(what bool) { if what { atomic.StoreInt32(&px.unreliable, 1) } else { atomic.StoreInt32(&px.unreliable, 0) } }
[ -0.686499834060669, 0.5719930529594421, 0.7236700654029846, -1.0956904888153076, 0.41999131441116333, 0.3476730287075043, -0.44216588139533997, -0.24486978352069855, -1.045442819595337, -0.7021812796592712, -1.0120463371276855, -0.15153688192367554, -0.735967218875885, -0.7872885465621948,...
func Make(peers []string, me int, rpcs *rpc.Server) *Paxos { px := &Paxos{} px.peers = peers px.me = me // Your initialization code here. px.prepareStatus = NewLinkedList() px.localDoneMin = -1 px.doneMins = make([]int, len(peers)) for i := 0; i < len(peers); i++ { px.doneMins[i] = -1 } if rpcs != nil { ...
[ -0.43860936164855957, 0.13699696958065033, 1.0243947505950928, -0.006303275935351849, 0.004353106487542391, 0.4772210717201233, -0.44454601407051086, -0.1590869277715683, 0.08841896057128906, -0.6598449349403381, 0.3539636433124542, 0.28088393807411194, -0.5075335502624512, 0.0285233575850...
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { return &executableSchema{ resolvers: cfg.Resolvers, directives: cfg.Directives, complexity: cfg.Complexity, } }
[ 0.12359616905450821, -0.624889075756073, 0.3856506049633026, 0.3890434503555298, -0.5765991806983948, 0.3744804859161377, 0.09621302038431168, 0.46767035126686096, -0.36183619499206543, 0.3167094588279724, -0.5453308820724487, -0.22916509211063385, -0.10190654546022415, -0.1977230012416839...
func (ec *executionContext) field_Mutation_createNewUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *string if tmp, ok := rawArgs["email"]; ok { arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) if err != ni...
[ -1.544197916984558, 0.17850267887115479, 0.5764594674110413, -0.33331745862960815, 0.22912798821926117, 0.4540809392929077, 0.19478875398635864, 0.16190293431282043, -0.6612042784690857, 0.9667490720748901, -0.5106615424156189, -0.18155935406684875, -0.5679574012756348, 0.405009925365448, ...
func (ec *executionContext) _ActionTicket_id(ctx context.Context, field graphql.CollectedField, obj *prisma.ActionTicket) (ret graphql.Marshaler) { ctx = ec.Tracer.StartFieldExecution(ctx, field) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } ec.Tracer....
[ 0.4052232503890991, -0.9062597155570984, 0.9648346900939941, -0.5416477918624878, -0.13836020231246948, 0.06312133371829987, -0.031169172376394272, -1.0065488815307617, 0.5760591626167297, 0.4728901982307434, 0.331734836101532, 0.15290704369544983, -0.4138542413711548, -0.00571483653038740...
func (ec *executionContext) unmarshalNActionTicketType2githubᚗcomᚋplaygroundᚋseedᚋclientᚐActionTicketType(ctx context.Context, v interface{}) (prisma.ActionTicketType, error) { tmp, err := graphql.UnmarshalString(v) return prisma.ActionTicketType(tmp), err }
[ 0.1637486219406128, 0.11325173079967499, 0.3927658200263977, -0.30362793803215027, -0.052347008138895035, -0.13490094244480133, 0.9518435001373291, -1.1586239337921143, 0.9639908075332642, 0.25594738125801086, -0.287434846162796, 0.7938640117645264, -1.0978635549545288, -0.5513322949409485...
func NewMemoryCache(db store.Store, ttl time.Duration) Cache { c := &MemoryCache{db: db, ttl: ttl} go c.worker() return c }
[ 1.4169403314590454, -0.025721613317728043, 0.3283356726169586, 0.33360353112220764, -1.0132758617401123, -0.6977031230926514, -1.112357497215271, 0.5110419988632202, 0.3531350791454315, 0.4440688192844391, -0.7750068306922913, 0.1821683943271637, 0.004308199509978294, 0.9548448920249939, ...
func (m *MemoryCache) GetSeverity(finding string) (string, bool) { m.RLock() defer m.RUnlock() severity, ok := m.categorization.Mapping[finding] return severity, ok }
[ -0.7748319506645203, 0.5504607558250427, 0.6224889755249023, 0.7306463718414307, -0.15714430809020996, -0.6142073273658752, 0.4566274881362915, 0.26505300402641296, -0.06751208007335663, 0.0876578688621521, -0.9057639837265015, -0.1902838796377182, -0.40359777212142944, 0.25667744874954224...
func (m *MemoryCache) worker() { ticker := time.NewTicker(m.ttl) m.refresh() // note: ignoring error // ending condition sig := make(chan os.Signal) signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM) for { select { case <-ticker.C: m.refresh() // note: ignoring error case <-sig: return } } }
[ -0.3074582815170288, 0.06427823007106781, 0.3734782040119171, 0.6697607636451721, -0.48505789041519165, 0.348697304725647, -0.3456237018108368, -0.42822858691215515, -0.043979961425065994, 0.3763410449028015, -1.0152523517608643, -0.7454757690429688, -0.04773329198360443, 1.049626827239990...
func (m *MemoryCache) refresh() error { fresh, err := m.db.GetCategorization() if err != nil { return err } m.RLock() stale := fresh.Version != m.categorization.Version m.RUnlock() if stale { m.Lock() m.categorization = *fresh m.Unlock() } return nil }
[ -0.1663917452096939, 0.3088218867778778, 0.2253136932849884, 0.5825554132461548, -0.053387176245450974, -0.2804240584373474, -0.8283261060714722, -0.7634608149528503, -0.16882166266441345, 0.3216627538204193, 0.14453601837158203, 0.40005773305892944, -0.005734297446906567, 1.50173890590667...
func NewClient(healthcheck, listDevices, createDevice, updateCharge, getChargeHistory, updateDevice goa.Endpoint) *Client { return &Client{ HealthcheckEndpoint: healthcheck, ListDevicesEndpoint: listDevices, CreateDeviceEndpoint: createDevice, UpdateChargeEndpoint: updateCharge, GetChargeHi...
[ 0.2245948761701584, -0.08500904589891434, 0.20862407982349396, 0.7709383964538574, 0.4290609657764435, 0.09737445414066315, 0.2980341613292694, -0.09807100147008896, 0.0004412362177390605, -0.4409385919570923, 0.6177554726600647, 0.08605267107486725, -0.24857042729854584, -0.13283777236938...
func (c *Client) Healthcheck(ctx context.Context) (res string, err error) { var ires interface{} ires, err = c.HealthcheckEndpoint(ctx, nil) if err != nil { return } return ires.(string), nil }
[ 0.06410292536020279, 0.00007020284101599827, 0.641777515411377, 0.6572591066360474, 0.8776354789733887, 0.19454514980316162, 0.7031235098838806, -0.7171564102172852, 0.427765816450119, 0.4491710960865021, 0.9366343021392822, 0.36416274309158325, -0.19997654855251312, -0.6872182488441467, ...
func (c *Client) ListDevices(ctx context.Context, p *ListDevicesPayload) (res *ListDevicesResult, err error) { var ires interface{} ires, err = c.ListDevicesEndpoint(ctx, p) if err != nil { return } return ires.(*ListDevicesResult), nil }
[ -0.9636256098747253, 0.630000650882721, 0.5067088007926941, 0.17868199944496155, 0.42820385098457336, -0.48014649748802185, -0.007552973926067352, -0.9675984978675842, 1.0013456344604492, -0.16390827298164368, -0.008854475803673267, 0.5291936993598938, -0.6693826913833618, 0.05841057375073...
func (c *Client) GetChargeHistory(ctx context.Context, p *GetChargeHistoryPayload) (res *GetChargeHistoryResult, err error) { var ires interface{} ires, err = c.GetChargeHistoryEndpoint(ctx, p) if err != nil { return } return ires.(*GetChargeHistoryResult), nil }
[ -0.1588403731584549, 0.8850763440132141, 0.5773894786834717, 0.4238053262233734, 0.22007280588150024, -0.35412704944610596, 0.18846602737903595, -0.5325465798377991, 0.03127861022949219, 0.18439966440200806, -0.2960062026977539, 0.8364853262901306, -0.6869552135467529, 0.30522701144218445,...
func (c *Client) UpdateDevice(ctx context.Context, p *UpdateDevicePayload) (res *UpdateDeviceResult, err error) { var ires interface{} ires, err = c.UpdateDeviceEndpoint(ctx, p) if err != nil { return } return ires.(*UpdateDeviceResult), nil }
[ -1.6616251468658447, -0.04327164590358734, 0.7564331889152527, 0.9924639463424683, -0.4221475124359131, 0.30831724405288696, 0.4378264248371124, -0.8043311238288879, 0.3119680881500244, -0.06372182071208954, 0.22569073736667633, 0.4999164342880249, -1.0598512887954712, 0.1014668419957161, ...
func NewWindows10XVpnConfiguration()(*Windows10XVpnConfiguration) { m := &Windows10XVpnConfiguration{ DeviceManagementResourceAccessProfileBase: *NewDeviceManagementResourceAccessProfileBase(), } odataTypeValue := "#microsoft.graph.windows10XVpnConfiguration" m.SetOdataType(&odataTypeValue) ...
[ 0.12865957617759705, -0.09905064851045609, 0.0658821389079094, -0.182700514793396, -0.23281846940517426, -0.8248039484024048, -0.04369381442666054, 0.42882639169692993, 0.4738732874393463, 0.9606626629829407, -1.093775987625122, -0.2249228060245514, -0.18058991432189941, 0.1797785311937332...
func CreateWindows10XVpnConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewWindows10XVpnConfiguration(), nil }
[ 0.5640488862991333, 0.17876377701759338, 0.40491583943367004, -0.07806126028299332, -0.5052247643470764, -0.06263554841279984, 0.007321853656321764, 0.8435139060020447, 0.4664629399776459, 0.3802945911884308, -0.466563880443573, -0.0251055508852005, 0.21435664594173431, 0.6815063953399658,...
func (m *Windows10XVpnConfiguration) GetAuthenticationCertificateId()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) { val, err := m.GetBackingStore().Get("authenticationCertificateId") if err != nil { panic(err) } if val != nil { return val.(*i561e97a8befe7661a...
[ 0.28561651706695557, -0.06060298904776573, 0.06954409182071686, -0.22959618270397186, -0.2040247917175293, -0.050324246287345886, 0.4435831308364868, 0.4584762454032898, 0.22221630811691284, 0.6711562275886536, 0.2940828800201416, -0.15114842355251312, -0.8371660709381104, -0.1791036427021...
func (m *Windows10XVpnConfiguration) GetCustomXml()([]byte) { val, err := m.GetBackingStore().Get("customXml") if err != nil { panic(err) } if val != nil { return val.([]byte) } return nil }
[ 0.8917194604873657, 0.633756697177887, 0.4065096974372864, 0.4744635224342346, -0.45046088099479675, -0.41956108808517456, -0.1537836343050003, 0.36700859665870667, 0.597629964351654, 0.28757065534591675, -0.550194263458252, 0.47366252541542053, -1.0045043230056763, -0.5786806344985962, ...
func (m *Windows10XVpnConfiguration) GetCustomXmlFileName()(*string) { val, err := m.GetBackingStore().Get("customXmlFileName") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil }
[ 0.7321699261665344, -0.1945340484380722, 0.4569385349750519, 0.3355298340320587, -0.17501716315746307, -0.15376219153404236, -0.5064727067947388, 0.7655061483383179, -0.23676688969135284, 0.02257312647998333, -0.2386389821767807, -0.1517593115568161, -0.32264161109924316, -0.84106802940368...
func (m *Windows10XVpnConfiguration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.DeviceManagementResourceAccessProfileBase.GetFieldDeserializers() res["authenticationCertificateId"] = func (n i878a80d2330e89d26896388a3f4...
[ 0.43936416506767273, 0.13184505701065063, 0.6889645457267761, -0.9490579962730408, -0.36487776041030884, -0.8045129179954529, 0.29878994822502136, 0.17630444467067719, -0.7537755966186523, -0.5069398880004883, -0.7817332744598389, 0.03724336251616478, -0.7920427322387695, -0.23301397264003...
func (m *Windows10XVpnConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { err := m.DeviceManagementResourceAccessProfileBase.Serialize(writer) if err != nil { return err } { err = writer.WriteUUIDValue("authentic...
[ 0.049497056752443314, 0.29967668652534485, 0.4682525396347046, -0.28629592061042786, 0.3582095801830292, -0.9951752424240112, 0.6421833634376526, 0.3382112383842468, -0.02181744948029518, 0.5583280324935913, -0.47193029522895813, -0.4999890625476837, -0.3886173665523529, 0.1014908328652381...
func (m *Windows10XVpnConfiguration) SetAuthenticationCertificateId(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() { err := m.GetBackingStore().Set("authenticationCertificateId", value) if err != nil { panic(err) } }
[ -0.1409996896982193, -0.040902845561504364, -0.19233761727809906, -0.4652133882045746, -0.24061718583106995, -0.05815187841653824, 0.22230394184589386, 0.16868296265602112, -0.18929769098758698, 1.161636233329773, -0.08606088161468506, -0.5084227323532104, -0.4816427528858185, 0.1351805627...
func (m *Windows10XVpnConfiguration) SetCustomXml(value []byte)() { err := m.GetBackingStore().Set("customXml", value) if err != nil { panic(err) } }
[ 0.7169116735458374, 0.48297709226608276, 0.17405027151107788, 0.31180253624916077, -0.4787243604660034, -0.21393407881259918, 0.05623827874660492, 0.4407743811607361, 0.4159737229347229, 0.4882362484931946, -0.9659036993980408, -0.1273096203804016, -0.6943029761314392, -0.18693634867668152...
func (m *Windows10XVpnConfiguration) SetCustomXmlFileName(value *string)() { err := m.GetBackingStore().Set("customXmlFileName", value) if err != nil { panic(err) } }
[ 0.28415393829345703, -0.3968750536441803, 0.19108594954013824, 0.27970200777053833, -0.12171327322721481, -0.04537557438015938, -0.46369683742523193, 0.7111635804176331, -0.37804433703422546, 0.24605879187583923, -0.6138120889663696, -0.5929745435714722, 0.005533385090529919, -0.7932496070...
func Insert(port string, ip string) error { args := []string{"-I", "INPUT", "-p", "tcp", "-s", ip, "--dport", port, "-m", "state", "--state", "NEW,ESTABLISHED", "-j", "ACCEPT"} cmd := exec.Command("iptables", args...) err := cmd.Run() if err != nil { return err } args[1] = "OUTPUT" args[11] = "ESTABLISHED"...
[ -0.2413051277399063, 0.888887882232666, 0.9976493716239929, -0.5070518255233765, 0.16450661420822144, 0.4864422082901001, 0.5544016361236572, 0.3261984586715698, -1.4997683763504028, 0.20052021741867065, -0.16767318546772003, 0.02837207354605198, -0.98972487449646, 0.24939504265785217, 0...
func Delete(port string, ip string) error { args := []string{"-D", "INPUT", "-p", "tcp", "-s", ip, "--dport", port, "-m", "state", "--state", "NEW,ESTABLISHED", "-j", "ACCEPT"} cmd := exec.Command("iptables", args...) err := cmd.Run() if err != nil { return err } args[1] = "OUTPUT" args[11] = "ESTABLISHED"...
[ 0.5078411102294922, 0.31617918610572815, 1.06057608127594, 0.2104083001613617, 0.08742600679397583, 0.5045771598815918, 0.5079947710037231, 0.1962607204914093, -0.9038501977920532, 0.3876826763153076, 0.5786267518997192, 0.1484174132347107, -0.5922174453735352, 0.12726199626922607, 0.564...
func BenchmarkInsertionSortSortedInt(b *testing.B) { const dataSize int = 5000 var data = [dataSize]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, ...
[ 0.6264922618865967, 0.058723095804452896, 1.304368257522583, -0.9906380772590637, 0.025844501331448555, -0.20666024088859558, 1.4279133081436157, -0.5952125191688538, -0.6565032601356506, 0.15699490904808044, -0.7727792263031006, 0.15987950563430786, -0.48615962266921997, 0.684027791023254...
func BenchmarkHeapSortSortedInt(b *testing.B) { const dataSize int = 5000 var data = []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 5...
[ 0.596794605255127, -0.34807494282722473, 1.4094427824020386, -0.6319624781608582, 0.09027799963951111, -0.2819139063358307, 1.129963755607605, -0.4667917788028717, -0.5852285027503967, 0.027784138917922974, -0.801600992679596, 0.12292361259460449, -0.39637210965156555, 0.7595959901809692, ...
func HeapifyInt(arr *[]int, n int, i int) { largest := i // Initialize largest as root l := 2*i + 1 // left = 2*i + 1 r := 2*i + 2 // right = 2*i + 2 // If left child is larger than root if l < n && (*arr)[l] > (*arr)[largest] { largest = l } // If right child is larger than largest so far if r < n && (*arr...
[ 0.48706722259521484, -0.043294090777635574, 0.7184925675392151, -0.2729663848876953, -0.4377954602241516, -0.30489903688430786, -0.7201045155525208, -0.8027323484420776, -0.15769831836223602, 0.3411879241466522, -1.0785948038101196, -0.0190268587321043, -0.0892127975821495, 1.5448597669601...
func HeapifyDouble(arr *[]float64, n int, i int) { largest := i // Initialize largest as root l := 2*i + 1 // left = 2*i + 1 r := 2*i + 2 // right = 2*i + 2 // If left child is larger than root if l < n && (*arr)[l] > (*arr)[largest] { largest = l } // If right child is larger than largest so far if r < n &...
[ 0.1529294103384018, 0.20326897501945496, 0.8603798747062683, 0.2967742085456848, -0.5949622988700867, -0.08060125261545181, -0.4030616581439972, -0.9565925002098083, -0.16751259565353394, 0.3113100230693817, -1.2568717002868652, 0.1301996260881424, 0.4580945670604706, 1.54518461227417, 0...
func BenchmarkBubbleSortSortedInt(b *testing.B) { var i, j int const dataSize int = 5000 data := [dataSize]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,...
[ 0.5599061846733093, -0.26554808020591736, 1.418573260307312, -1.0931459665298462, -0.36211562156677246, -0.4601217210292816, 1.447330355644226, -0.6357905864715576, -0.5366413593292236, 0.05698540806770325, -1.0784376859664917, 0.28065335750579834, -0.5959148406982422, 0.5473745465278625, ...
func BenchmarkQuickSortSortedInt(b *testing.B) { const dataSize int = 5000 data := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59...
[ 0.6022590398788452, -0.34098488092422485, 1.2552335262298584, -1.066651463508606, 0.19056515395641327, -0.37214016914367676, 1.0940097570419312, -0.6784332990646362, -0.383193701505661, -0.1571752279996872, -0.8588384985923767, 0.13085485994815826, -0.35004788637161255, 0.5361996293067932,...
func QuickSortInt(arr *[]int, low int, high int) { if low < high { /* pi is partitioning index, arr[p] is now at right place */ pi := PartitionInt(arr, low, high) // Separately sort elements before partition and after partition QuickSortInt(arr, low, pi-1) QuickSortInt(arr, pi+1, high) } }
[ 0.3138285279273987, -0.6737408638000488, 0.4426543116569519, -0.48212459683418274, -0.49722108244895935, 0.3322151005268097, 0.10769697278738022, -0.7003352642059326, 0.5972846150398254, -0.23724162578582764, -0.3491651713848114, 0.17699995636940002, -1.0148016214370728, -0.366754382848739...
func QuickSortDouble(arr *[]float64, low int, high int) { if low < high { /* pi is partitioning index, arr[p] is now at right place */ pi := PartitionDouble(arr, low, high) // Separately sort elements before partition and after partition QuickSortDouble(arr, low, pi-1) QuickSortDouble(arr, pi+1, high) } }
[ -0.020073065534234047, -0.21203221380710602, 0.598257839679718, 0.39122429490089417, -0.3611152470111847, 0.052539415657520294, 0.3599293828010559, -1.0275325775146484, 0.3579331338405609, -0.35198307037353516, -0.5181604027748108, 0.0018457083497196436, 0.006020353641360998, 0.23122274875...
func (d *DownloadableTorrent) GetID() string { return "" }
[ 1.103112816810608, -1.068050742149353, 0.5402865409851074, -0.3251839578151703, 0.9624805450439453, 0.6795592308044434, -0.7261605262756348, 0.08291210979223251, 1.1415694952011108, -0.29078176617622375, -0.2197987139225006, -0.04222425818443298, -0.8834530711174011, 0.3386220932006836, ...
func (d *MagnetDownloadable) GetID() string { return d.Infohash }
[ 1.369182825088501, -0.9694693088531494, 0.2788114547729492, 0.2187313288450241, 0.6978616714477539, 1.312911868095398, -0.5910093784332275, 0.12621429562568665, 0.23609721660614014, -0.6808052062988281, 0.06361047178506851, -0.03550107032060623, -0.4149075746536255, 0.30543214082717896, ...
func NewTorrentDownloader(dst string) *TorrentDownloader { return &TorrentDownloader{ destination: dst, } }
[ 0.19310852885246277, -0.5350099205970764, 0.08110398799180984, -0.8655121922492981, -0.9199206829071045, 0.04598644748330116, -1.474696159362793, -0.676365315914154, -0.9673411846160889, -0.17266631126403809, -0.6705722212791443, 0.439107209444046, 0.23871536552906036, 0.259408175945282, ...
func (d *TorrentDownloader) Download(dnl Downloadable) error { switch v := dnl.(type) { case *MagnetDownloadable: fn := fmt.Sprintf("%s/%s.magnet", d.destination, dnl.GetID()) if err := ioutil.WriteFile(fn, []byte(v.Magnet), 0644); err != nil { return err } return nil default: return ErrNotImplemented ...
[ -0.34628865122795105, 0.0922146663069725, 0.5583778619766235, -0.20382370054721832, 0.3706173598766327, 0.2095220386981964, -0.5101333260536194, -0.01735011301934719, -0.4247089922428131, -0.175629124045372, -0.005852334666997194, -0.39170488715171814, 0.06479290127754211, 0.31308415532112...
func New( serverID string, tracer *zipkin.Tracer, fS fetching.Service, aS adding.Service, mS modifying.Service, rS removing.Service, ) Server { a := &server{ serverID: serverID, tracer: tracer, fetching: fS, adding: aS, modifying: mS, removing: rS} router(a) return a }
[ -0.43212875723838806, -0.7971730828285217, 0.2729912996292114, -0.5478479862213135, -0.1447460800409317, -0.35072752833366394, 0.43831926584243774, -0.4376886785030365, 0.5400341153144836, -0.427709698677063, 0.247147798538208, 0.9669146537780762, 0.5156732797622681, 1.3649848699569702, ...
func (s *server) FetchGophers(w http.ResponseWriter, r *http.Request) { gophers, _ := s.fetching.FetchGophers(r.Context()) w.Header().Set("Content-Type", "application/json") _ = json.NewEncoder(w).Encode(gophers) }
[ -0.7930738925933838, 0.3559808135032654, 0.2498084306716919, 0.005001960787922144, -0.7691540122032166, 0.301530122756958, 0.04058113321661949, -1.243431806564331, -0.13893213868141174, 1.8688812255859375, -0.8446907997131348, 1.2428817749023438, -0.20774595439434052, 0.6631538271903992, ...
func (s *server) FetchGopher(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) gopher := s.fetching.FetchGopherByID(r.Context(), vars["ID"]) w.Header().Set("Content-Type", "application/json") if gopher == nil { w.WriteHeader(http.StatusNotFound) _ = json.NewEncoder(w).Encode("Gopher Not found") re...
[ -0.645746111869812, -0.16350218653678894, 0.45385873317718506, -0.1014833003282547, -1.0824702978134155, 0.16952954232692719, -0.5929595232009888, -0.9124554395675659, 0.12275392562150955, 1.5461875200271606, -0.9213551878929138, 1.2361257076263428, -0.46003633737564087, 0.5282642841339111...
func (s *server) AddGopher(w http.ResponseWriter, r *http.Request) { decoder := json.NewDecoder(r.Body) var g addGopherRequest err := decoder.Decode(&g) w.Header().Set("Content-Type", "application/json") if err != nil { w.WriteHeader(http.StatusInternalServerError) _ = json.NewEncoder(w).Encode("Error unmars...
[ -1.1348787546157837, 0.43822845816612244, 1.0183908939361572, -0.4343433678150177, -0.12150842696428299, 0.5952147245407104, -0.19293735921382904, -0.27259594202041626, -0.1650661677122116, 0.6631302833557129, -0.48417431116104126, 0.6883067488670349, -1.4069187641143799, 0.515702486038208...
func (s *server) ModifyGopher(w http.ResponseWriter, r *http.Request) { decoder := json.NewDecoder(r.Body) var g addGopherRequest err := decoder.Decode(&g) w.Header().Set("Content-Type", "application/json") if err != nil { w.WriteHeader(http.StatusInternalServerError) _ = json.NewEncoder(w).Encode("Error unm...
[ -2.0036122798919678, 0.0071404059417545795, 0.6734569668769836, -0.6353303790092468, -0.34904855489730835, -0.10953793674707413, -0.19594915211200714, -0.38766342401504517, 0.24111677706241608, 0.9795029759407043, -0.3289594054222107, 1.0046100616455078, -1.4747172594070435, 1.109740257263...
func (s *server) RemoveGopher(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) _ = s.removing.RemoveGopher(r.Context(), vars["ID"]) w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusNoContent) }
[ -1.5769695043563843, 0.17432433366775513, 0.5343586802482605, -0.2450147569179535, -1.1114556789398193, -0.5255939364433289, 0.1177610382437706, 0.2524544894695282, -0.035145774483680725, 1.107706069946289, -1.1423085927963257, 0.7364413142204285, -1.2660119533538818, 0.21724116802215576, ...
func New(image, rootfs string) (Driver, error) { for _, name := range drivers { v := reflect.New(driverRegistry[name]) d, ok := v.Interface().(Driver) if !ok { return nil, fmt.Errorf("%s driver doesn't seem to implement the fsdriver.Driver interface") } if err := d.Init(image, rootfs); err == nil { re...
[ -0.6818745732307434, -0.5095920562744141, 0.3817497789859772, 0.6902664303779602, -0.27835220098495483, -1.3284685611724854, -0.7314175963401794, 0.3650359511375427, -0.9411553144454956, -0.2696724534034729, 0.5982781648635864, -0.7372727394104004, 0.000027364327252143994, 1.38859045505523...
func (m *LookmlModelExploreJoins) Validate(formats strfmt.Registry) error { return nil }
[ 0.009503565728664398, 0.6850511431694031, 0.5537184476852417, -0.2508828341960907, 0.6868734955787659, 0.9909276962280273, 0.6523039937019348, 0.21306686103343964, 0.30834051966667175, -0.4793018400669098, 0.87462317943573, 0.09381471574306488, -1.8917882442474365, -0.02256985567510128, ...
func (m *LookmlModelExploreJoins) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateDependentFields(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateFields(ctx, formats); err != nil { res = append(res, err) } if e...
[ -0.10827431082725525, 0.1344275176525116, 1.0078215599060059, 0.16996021568775177, -0.4986763894557953, 0.8244962692260742, 0.5455502867698669, -0.5288211703300476, 0.44818150997161865, -0.12689292430877686, 0.3383859097957611, 0.12129221856594086, -1.178257942199707, 0.2588263750076294, ...
func (o *PutNmsRefreshcertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewPutNmsRefreshcertificateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } ...
[ 0.06598035991191864, -0.7945118546485901, 0.5281547904014587, 0.33192309737205505, -0.2591524124145508, -1.0311765670776367, -0.059046003967523575, -0.6275723576545715, 0.2834816575050354, 0.6198751926422119, 0.3311856985092163, -0.2829935848712921, -1.24380624294281, -0.38724303245544434,...
func NewPutNmsRefreshcertificateOK() *PutNmsRefreshcertificateOK { return &PutNmsRefreshcertificateOK{} }
[ 0.3188546597957611, 0.14634418487548828, 0.0001938581553986296, 0.8203114867210388, -0.6931177377700806, -0.43163105845451355, 0.4554501473903656, -0.004727104213088751, -0.36331814527511597, 0.6274654269218445, -0.30732232332229614, -0.2721116542816162, 0.06516369432210922, 0.008548064157...
func NewPutNmsRefreshcertificateUnauthorized() *PutNmsRefreshcertificateUnauthorized { return &PutNmsRefreshcertificateUnauthorized{} }
[ -0.019594285637140274, 0.16884423792362213, 0.368193656206131, 0.090477354824543, -0.7330884337425232, -0.6356967091560364, 0.0899834930896759, -0.11518571525812149, -0.47193029522895813, -0.7456509470939636, -0.5026635527610779, 0.8565420508384705, -0.2709437906742096, -0.8755820393562317...
func NewPutNmsRefreshcertificateForbidden() *PutNmsRefreshcertificateForbidden { return &PutNmsRefreshcertificateForbidden{} }
[ 0.7137663960456848, 1.063149094581604, 0.31108319759368896, 0.2270646095275879, -0.8100894689559937, -0.03589651361107826, 0.18921886384487152, -1.2309883832931519, -0.3644910454750061, -0.4063314199447632, -0.2953411340713501, 0.34100964665412903, -0.5138562917709351, -1.269803524017334, ...
func ChangePrice(config Config,orderid string,price float64,cookie *http.Cookie) Change { // Create our url. // Send our URL to the DialCoinSwapPrivate function to create an order and receive response. url := "https://api.coin-swap.net/order/change/"+orderid+"/"+config.Apikey+"/"+strconv.FormatFloat(price,'...
[ -1.31642746925354, 0.196848526597023, 0.4727591872215271, -0.030709462240338326, -0.1683201640844345, -1.4585185050964355, -1.1874877214431763, 0.06388973444700241, 0.0035514081828296185, 0.8247556090354919, -0.18368323147296906, 0.7959878444671631, -0.6492851972579956, 0.39587345719337463...
func writeResponse(status int, w http.ResponseWriter, out io.Reader) error { // hijack the connection so we can write our own chunked output and trailers hijacker, ok := w.(http.Hijacker) if !ok { log.Error("Failed to create hijacker! cannot continue!") return errors.New("Could not create hijacker") } conn, wr...
[ 0.41490820050239563, -1.2562930583953857, 0.7754649519920349, -0.14628320932388306, 0.04004739224910736, -0.9000579118728638, -0.11354832351207733, -0.20277288556098938, 0.18533718585968018, 0.22657538950443268, 0.3094094693660736, -0.4248064160346985, -0.8355847597122192, -0.1809944212436...
func New() *Malcolm { // Construct Redis conn host := os.Getenv("REDISHOST") if host == "" { panic("Redis Host Required!") } port := os.Getenv("REDISPORT") if port == "" { panic("REDISPORT Required!") } pw := os.Getenv("REDISPASSWORD") rdb := redis.NewClient(&redis.Options{ Addr: fmt.Sprintf("%s:%...
[ -0.11849422007799149, -0.3324263095855713, 0.755260169506073, -0.5272529125213623, -1.037394404411316, 0.297263503074646, -0.7523220777511597, 0.5300785303115845, -0.20564454793930054, 0.24276763200759888, 0.2721036672592163, -0.05070873722434044, -0.350507527589798, 1.0671589374542236, ...
func StructToStruct(filter FieldFilter, src, dst interface{}, userOpts ...Option) error { opts := newDefaultOptions() for _, o := range userOpts { o(opts) } dstVal := reflect.ValueOf(dst) if dstVal.Kind() != reflect.Ptr { return errors.Errorf("dst must be a pointer, %s given", dstVal.Kind()) } srcVal := ind...
[ -0.2930918335914612, 0.24441631138324738, 0.5398035049438477, -0.7620204091072083, -1.2346562147140503, 0.2685311436653137, 0.5166472792625427, -0.7826520204544067, -0.010065790265798569, 0.23451584577560425, -0.5444461703300476, 0.8268741965293884, 0.31072333455085754, -0.4692594110965729...
func WithTag(s string) Option { return func(o *options) { o.DstTag = s } }
[ 0.5701374411582947, 0.364636093378067, 0.3750735819339752, -0.7028408646583557, -0.632856011390686, -0.0019662934355437756, 0.34064942598342896, 0.059089791029691696, -0.049148641526699066, 0.01185633335262537, -0.7181261777877808, -0.30826693773269653, 1.4997246265411377, -0.0066462489776...
func StructToMap(filter FieldFilter, src interface{}, dst map[string]interface{}, userOpts ...Option) error { opts := newDefaultOptions() for _, o := range userOpts { o(opts) } srcVal := indirect(reflect.ValueOf(src)) srcType := srcVal.Type() for i := 0; i < srcVal.NumField(); i++ { fieldName := srcType.Field...
[ -0.78227299451828, 0.48873743414878845, 0.9467644691467285, -0.288143515586853, -1.305593729019165, -0.10533244907855988, 0.5343881249427795, -0.36705389618873596, 0.3184818923473358, 0.4925750195980072, -0.8589929342269897, 0.39245232939720154, 0.7887542247772217, -0.13281124830245972, ...
func (er *ElasticsearchRequest) CreateOrUpdateSecurityContextConstraints() error { dpl := er.cluster // This scc prevents a container from running as privileged // It allows the pod access to the hostPath volume type and marks it as not read-only builder := securitycontextconstraints.New("elasticsearch-scc", false...
[ -0.5454962253570557, -0.8215548396110535, 0.832919180393219, 0.9597010612487793, 0.30317455530166626, -0.15159912407398224, -0.14433947205543518, -0.24476994574069977, 0.8200436234474182, 0.014156535267829895, -0.1974480003118515, 0.1438651829957962, -0.9389030337333679, -0.284991532564163...
func RunMockServer() { u1 := User{ID: 0, IsPremium: false} u2 := User{ID: 1, IsPremium: true} wg.Add(5) go createMockRequest(1, shortProcess, &u1) time.Sleep(1 * time.Second) go createMockRequest(2, longProcess, &u2) time.Sleep(2 * time.Second) go createMockRequest(3, shortProcess, &u1) time.Sleep(1 * time...
[ -1.5294016599655151, 0.16429761052131653, 0.6297675371170044, 0.8286009430885315, 0.5466108322143555, 0.38187307119369507, 0.7229490876197815, -0.6776887774467468, -0.46166157722473145, -0.6400848031044006, -1.0374687910079956, 0.5940348505973816, -1.0988333225250244, 0.889703094959259, ...
func TestDogstatsLabels(t *testing.T) { type testCase struct { name string resources []label.KeyValue labels []label.KeyValue expected string } labels := func(labels ...label.KeyValue) []label.KeyValue { return labels } cases := []testCase{ { name: "no labels", resources: nil, lab...
[ 0.3492417633533478, 0.23391197621822357, 0.6766791343688965, -0.42685431241989136, -0.3001927435398102, 0.5177580714225769, 0.24172158539295197, -0.3932681381702423, -0.43328115344047546, -0.21081852912902832, 0.15098252892494202, -0.39422401785850525, 0.6999515295028687, 0.153955787420272...
func (r *Resolver) Lookup(net string, req *dns.Msg) (message *dns.Msg, err error) { qname := req.Question[0].Name res := make(chan *dns.Msg, 1) L := func(nsPool pool.Pool) { //r, rtt, err := c.Exchange(req, nameserver) c, err := nsPool.Get() if err != nil { fmt.Println("socket error when get conn", err) ...
[ -0.8186442255973816, -0.05856594815850258, 1.1138792037963867, -0.26197147369384766, -0.5326700806617737, 0.28482967615127563, 0.7486250996589661, -1.1757620573043823, 0.7259456515312195, -0.08020896464586258, -0.30162882804870605, 0.5916741490364075, -0.3246331214904785, 0.747304618358612...