text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (e *Executor) Execute() (<-chan *Row, error) {
// Initialize processors.
for _, p := range e.processors {
p.start()
}
// Create output channel and stream data in a separate goroutine.
out := make(chan *Row, 0)
go e.execute(out)
return out, nil
} | [
-0.025804800912737846,
0.45903030037879944,
0.6179865598678589,
-0.31229734420776367,
0.67856365442276,
-0.7154462337493896,
-0.7012748122215271,
-0.38493815064430237,
-0.6779175996780396,
0.371255487203598,
0.5378035306930542,
0.1561775952577591,
-0.31267017126083374,
0.12292693555355072,... |
func (e *Executor) execute(out chan *Row) {
// TODO: Support multi-value rows.
// Initialize map of rows by encoded tagset.
rows := make(map[string]*Row)
// Combine values from each processor.
loop:
for {
// Retrieve values from processors and write them to the approprite
// row based on their tagset.
for ... | [
-0.006382705643773079,
0.7087199687957764,
0.7583175897598267,
-0.7026164531707764,
0.25870978832244873,
-0.981800377368927,
-0.6270407438278198,
-0.4089526832103729,
-0.6947864294052124,
0.7292132377624512,
0.6095090508460999,
0.13818727433681488,
0.30372148752212524,
0.9053615927696228,
... |
func (e *Executor) createRowValuesIfNotExists(rows map[string]*Row, name string, tagset []byte, timestamp int64) []interface{} {
// TODO: Add "name" to lookup key.
// Find row by tagset.
var row *Row
if row = rows[string(tagset)]; row == nil {
row = &Row{Name: name}
// Create tag map.
row.Tags = make(map[st... | [
-0.4654088020324707,
0.8938061594963074,
0.6430376172065735,
-0.6723937392234802,
0.3313477039337158,
-1.2970201969146729,
-1.0537281036376953,
-0.969411313533783,
-0.32360199093818665,
0.38298124074935913,
0.3034902513027191,
-0.8731426000595093,
0.3104933202266693,
0.6913152933120728,
... |
func dimensionKeys(dimensions Dimensions) (a []string) {
for _, d := range dimensions {
a = append(a, d.Expr.(*VarRef).Val)
}
return
} | [
-0.9248459339141846,
0.19718284904956818,
0.22220471501350403,
0.15915606915950775,
-0.34985989332199097,
-0.20607760548591614,
-0.10355228185653687,
-0.11126735806465149,
-0.545802891254425,
1.2609920501708984,
0.2550089955329895,
0.8607920408248901,
-0.44273841381073,
0.7493999004364014,... |
func newMapper(e *Executor, seriesID uint32, fieldID uint8, typ DataType) *mapper {
return &mapper{
executor: e,
seriesID: seriesID,
fieldID: fieldID,
typ: typ,
c: make(chan map[string]interface{}, 0),
done: make(chan chan struct{}, 0),
}
} | [
-0.28551575541496277,
-0.017986424267292023,
0.4292890727519989,
0.2483043074607849,
-0.8695713877677917,
-0.35681793093681335,
-0.3211454451084137,
-1.0913819074630737,
0.43093445897102356,
0.07716495543718338,
0.11815336346626282,
0.5707588195800781,
-0.050843335688114166,
0.733755409717... |
func (m *mapper) start() {
m.itr = m.executor.db.CreateIterator(m.seriesID, m.fieldID, m.typ,
m.executor.min, m.executor.max, m.executor.interval)
go m.run()
} | [
-0.6910460591316223,
-0.2148810774087906,
0.20813846588134766,
-0.2799097001552582,
-0.17162615060806274,
0.09330528974533081,
-0.19500800967216492,
0.008025266230106354,
-0.8558728694915771,
0.2075742930173874,
0.1608315110206604,
0.8186014294624329,
-0.06384294480085373,
0.25201803445816... |
func (m *mapper) stop() { syncClose(m.done) } | [
-1.5382335186004639,
-0.08550078421831131,
0.34620189666748047,
-0.12975448369979858,
-0.25332048535346985,
1.0378247499465942,
0.36788544058799744,
-0.3106333017349243,
-0.650172770023346,
0.013980618678033352,
-0.5167181491851807,
-0.23315967619419098,
-0.34815624356269836,
0.45799347758... |
func (m *mapper) C() <-chan map[string]interface{} { return m.c } | [
-0.424582302570343,
-0.9022852778434753,
0.4755421280860901,
-0.5021595358848572,
-1.2514883279800415,
1.0623666048049927,
0.32654276490211487,
-0.6770647764205933,
0.33858221769332886,
-0.9601755738258362,
0.9526180624961853,
0.6912441849708557,
0.6062329411506653,
0.03256479650735855,
... |
func (m *mapper) run() {
for m.itr.NextIterval() {
m.fn(m.itr, m)
}
close(m.c)
} | [
-1.6667134761810303,
-0.8437801003456116,
0.2770370841026306,
-0.33251798152923584,
-0.729863703250885,
0.6210077404975891,
0.6945903897285461,
-0.1903197020292282,
-1.0961805582046509,
-0.9531970024108887,
0.42668551206588745,
-0.587577223777771,
-0.23960775136947632,
0.40782642364501953,... |
func (m *mapper) emit(key int64, value interface{}) {
// Encode the timestamp to the beginning of the key.
binary.BigEndian.PutUint64(m.key, uint64(key))
// OPTIMIZE: Collect emit calls and flush all at once.
m.c <- map[string]interface{}{string(m.key): value}
} | [
-0.7625242471694946,
0.8799082636833191,
0.45911669731140137,
-0.24083992838859558,
-0.15737031400203705,
-0.15798868238925934,
-0.8169054985046387,
-0.6812997460365295,
-0.09222909063100815,
0.6189529895782471,
-0.22005265951156616,
0.4745236337184906,
-0.19221481680870056,
0.385377615690... |
func mapCount(itr Iterator, m *mapper) {
n := 0
for k, _ := itr.Next(); k != 0; k, _ = itr.Next() {
n++
}
m.emit(itr.Time(), float64(n))
} | [
-0.6328610181808472,
-0.2597579061985016,
0.523824155330658,
0.1351298987865448,
-0.669230043888092,
-0.07615723460912704,
-0.05745745450258255,
0.4089052379131317,
-0.4655839204788208,
0.7309331893920898,
-0.4426902234554291,
-0.4340236783027649,
0.7891093492507935,
1.2399438619613647,
... |
func mapSum(itr Iterator, m *mapper) {
n := float64(0)
for k, v := itr.Next(); k != 0; k, v = itr.Next() {
n += v.(float64)
}
m.emit(itr.Time(), n)
} | [
-0.8803749680519104,
0.02799116261303425,
0.555553674697876,
0.5943917632102966,
-0.5771977305412292,
0.06573639810085297,
-0.1469370424747467,
-0.3867699205875397,
0.4244716465473175,
0.2696409523487091,
-0.2688060402870178,
-0.05149124935269356,
0.2217581570148468,
1.2398810386657715,
... |
func newReducer(e *Executor) *reducer {
return &reducer{
executor: e,
c: make(chan map[string]interface{}, 0),
done: make(chan chan struct{}, 0),
}
} | [
0.051701564341783524,
0.05725615844130516,
0.3003282845020294,
-0.3032744824886322,
-0.4150940775871277,
-0.4789144992828369,
-0.48216068744659424,
0.08327291905879974,
-0.08151483535766602,
0.023913906887173653,
-0.3582969605922699,
0.18653571605682373,
0.06742389500141144,
1.657091259956... |
func (r *reducer) start() {
for _, m := range r.mappers {
m.start()
}
go r.run()
} | [
-0.7685641646385193,
-0.34465378522872925,
0.41942283511161804,
-0.11255191266536713,
0.8702477216720581,
-0.4036039412021637,
-0.25059974193573,
0.1652425080537796,
0.056262172758579254,
-0.1593725085258484,
-0.3563033938407898,
0.7327157258987427,
-0.4155884385108948,
0.7305829524993896,... |
func (r *reducer) stop() {
for _, m := range r.mappers {
m.stop()
}
syncClose(r.done)
} | [
-1.590157151222229,
-0.09918420761823654,
0.36775484681129456,
-0.4541357457637787,
0.792797327041626,
-0.06705368310213089,
0.1480388343334198,
-0.38523873686790466,
-0.6215707063674927,
0.004442429170012474,
-0.24003630876541138,
-0.30471715331077576,
-0.644051194190979,
0.58896559476852... |
func (r *reducer) C() <-chan map[string]interface{} { return r.c } | [
-0.1262207329273224,
-0.7088074684143066,
0.5970105528831482,
-1.077964186668396,
-0.28698086738586426,
0.305190771818161,
0.552678108215332,
-0.2424677610397339,
0.3414684534072876,
-0.463137149810791,
0.6867544651031494,
0.6689740419387817,
0.7288196682929993,
0.18409346044063568,
-0.5... |
func (r *reducer) name() string { return r.stmt.Source.(*Measurement).Name } | [
-0.1274258941411972,
0.17603936791419983,
0.5660216212272644,
-0.9923669695854187,
-0.9927948713302612,
-0.39291322231292725,
-0.1442444771528244,
-0.2216057926416397,
-0.33395999670028687,
1.5465198755264282,
-0.1601688712835312,
-0.5661033391952515,
0.38407227396965027,
1.056572914123535... |
func (r *reducer) run() {
loop:
for {
// Combine all data from the mappers.
data := make(map[string][]interface{})
for _, m := range r.mappers {
kv, ok := <-m.C()
if !ok {
break loop
}
for k, v := range kv {
data[k] = append(data[k], v)
}
}
// Reduce each key.
for k, v := range data... | [
-0.8418957591056824,
-0.32805460691452026,
0.6498360633850098,
-0.970304012298584,
0.5197031497955322,
-0.7198370099067688,
0.04746606945991516,
-0.14281831681728363,
-0.8447081446647644,
-0.466825008392334,
-0.6879539489746094,
-0.1188948005437851,
-0.7898726463317871,
0.3868286907672882,... |
func (r *reducer) emit(key string, value interface{}) {
r.c <- map[string]interface{}{key: value}
} | [
-0.43111807107925415,
0.41348376870155334,
0.34343814849853516,
-1.1697511672973633,
0.11887781322002411,
-0.11988416314125061,
-1.0440298318862915,
0.3714192509651184,
-0.5829600095748901,
0.679733157157898,
-0.3502452075481415,
0.29972928762435913,
-0.4720730185508728,
0.3341557383537292... |
func reduceSum(key string, values []interface{}, r *reducer) {
var n float64
for _, v := range values {
n += v.(float64)
}
r.emit(key, n)
} | [
-0.39436107873916626,
0.7241730690002441,
0.3211250901222229,
0.4919220209121704,
0.7993223667144775,
-0.873281717300415,
0.14597532153129578,
0.2868873178958893,
0.30329278111457825,
-0.03417349234223366,
-0.7329078912734985,
0.004732904490083456,
-0.09634149074554443,
1.290103554725647,
... |
func newBinaryExprEvaluator(e *Executor, op Token, lhs, rhs processor) *binaryExprEvaluator {
return &binaryExprEvaluator{
executor: e,
op: op,
lhs: lhs,
rhs: rhs,
c: make(chan map[string]interface{}, 0),
done: make(chan chan struct{}, 0),
}
} | [
-0.32037487626075745,
0.19484391808509827,
0.5235522389411926,
-0.04055401682853699,
-1.2952499389648438,
-0.6492935419082642,
-0.3016108572483063,
0.9178852438926697,
-0.5051401853561401,
-0.20593737065792084,
-0.9498647451400757,
1.0852888822555542,
-0.7568679451942444,
0.942882537841796... |
func (e *binaryExprEvaluator) start() {
e.lhs.start()
e.rhs.start()
go e.run()
} | [
-0.44026654958724976,
-0.027842983603477478,
0.3900904357433319,
0.5611324906349182,
0.18425598740577698,
0.9143720865249634,
0.43191656470298767,
1.286263346672058,
-0.6826128959655762,
0.07888568192720413,
-0.21826998889446259,
1.6277662515640259,
-0.029660359025001526,
1.237285137176513... |
func (e *binaryExprEvaluator) stop() {
e.lhs.stop()
e.rhs.stop()
syncClose(e.done)
} | [
-1.117150068283081,
0.3283657729625702,
0.3526642918586731,
0.0904160588979721,
-0.06965693831443787,
0.9977524280548096,
0.7382781505584717,
0.9132094383239746,
-1.2315526008605957,
0.12175434827804565,
-0.4407634139060974,
0.8931136131286621,
-0.3441322147846222,
0.8439126014709473,
0.... |
func (e *binaryExprEvaluator) C() <-chan map[string]interface{} { return e.c } | [
-0.2011726200580597,
-0.1976025551557541,
0.5478785634040833,
-0.30334222316741943,
-0.5986213684082031,
0.8975881338119507,
0.6838381886482239,
0.26738741993904114,
-0.20706985890865326,
-0.7503408789634705,
0.5598653554916382,
1.2279006242752075,
0.5809471011161804,
0.6850826740264893,
... |
func (e *binaryExprEvaluator) name() string { return "" } | [
-0.7619715332984924,
0.256413072347641,
0.5029280781745911,
0.2916635274887085,
-1.397034764289856,
0.5140912532806396,
0.14053943753242493,
0.4890947937965393,
-0.16374513506889343,
0.09310147166252136,
-1.0062512159347534,
-0.006870332174003124,
-0.20124706625938416,
0.813530683517456,
... |
func (e *binaryExprEvaluator) run() {
for {
// Read LHS value.
lhs, ok := <-e.lhs.C()
if !ok {
break
}
// Read RHS value.
rhs, ok := <-e.rhs.C()
if !ok {
break
}
// Merge maps.
m := make(map[string]interface{})
for k, v := range lhs {
m[k] = e.eval(v, rhs[k])
}
for k, v := range rh... | [
-0.7773883938789368,
-0.4143577218055725,
0.7432634830474854,
-0.6655846238136292,
0.04198113828897476,
0.5088046789169312,
0.449737548828125,
0.05282147601246834,
-1.24144446849823,
-0.23360732197761536,
-0.10108093917369843,
0.2968197762966156,
-0.8728440999984741,
0.829913854598999,
0... |
func (e *binaryExprEvaluator) eval(lhs, rhs interface{}) interface{} {
switch e.op {
case ADD:
return lhs.(float64) + rhs.(float64)
case SUB:
return lhs.(float64) - rhs.(float64)
case MUL:
return lhs.(float64) * rhs.(float64)
case DIV:
rhs := rhs.(float64)
if rhs == 0 {
return float64(0)
}
return ... | [
0.06707006692886353,
0.27250155806541443,
0.6870680451393127,
0.46604788303375244,
-0.5865649580955505,
1.1698497533798218,
0.23049743473529816,
0.5024963617324829,
-0.1141391322016716,
0.3405233323574066,
0.3650376498699188,
0.766369104385376,
0.08987250179052353,
0.1619967371225357,
0.... |
func newLiteralProcessor(val interface{}) *literalProcessor {
return &literalProcessor{
val: val,
c: make(chan map[string]interface{}, 0),
done: make(chan chan struct{}, 0),
}
} | [
0.7345390915870667,
-0.7924214601516724,
0.34480759501457214,
-1.1372482776641846,
-1.9271031618118286,
-0.276650607585907,
-0.652016282081604,
0.10681931674480438,
0.5301753282546997,
0.3193787932395935,
-0.5214290618896484,
0.5076091289520264,
-0.7456337213516235,
0.4467209279537201,
0... |
func (p *literalProcessor) C() <-chan map[string]interface{} { return p.c } | [
0.08142751455307007,
-0.6887505650520325,
0.528063952922821,
-1.2229282855987549,
-0.6370848417282104,
0.8394984006881714,
0.41585251688957214,
0.2648337781429291,
-0.4091772735118866,
-0.5592783689498901,
0.5978817343711853,
0.6632186770439148,
0.5426638722419739,
0.008397877216339111,
... |
func (p *literalProcessor) start() { go p.run() } | [
0.48056477308273315,
-0.588069498538971,
0.1752316951751709,
-0.9827100038528442,
0.15333278477191925,
0.8834973573684692,
-0.1838129758834839,
1.5400031805038452,
-0.9475350379943848,
0.3883185088634491,
-0.4752409756183624,
1.2866182327270508,
-0.32084551453590393,
-0.024258075281977654,... |
func (p *literalProcessor) run() {
for {
select {
case ch := <-p.done:
close(ch)
return
case p.c <- map[string]interface{}{"": p.val}:
}
}
} | [
-0.3999197781085968,
-0.31522783637046814,
0.478742390871048,
-1.3453720808029175,
-0.5226918458938599,
0.4959453046321869,
0.03717483580112457,
-0.21326209604740143,
-0.9805088639259338,
0.17833952605724335,
-0.44927525520324707,
-0.23749448359012604,
-0.6922556161880493,
0.15630562603473... |
func (p *literalProcessor) stop() { syncClose(p.done) } | [
-0.20590633153915405,
-0.10468007624149323,
0.26418229937553406,
-1.3191378116607666,
0.2858251631259918,
1.096842885017395,
0.2735247015953064,
0.7001944780349731,
-1.0370283126831055,
0.4390734136104584,
-0.7624132037162781,
0.3072575628757477,
-0.6383072733879089,
-0.039421431720256805,... |
func (p *literalProcessor) name() string { return "" } | [
-0.2567695379257202,
-0.6436441540718079,
0.716698408126831,
-0.9621873497962952,
-1.286531925201416,
0.3122025728225708,
-0.11366923153400421,
0.4715839624404907,
0.04112861678004265,
0.7208690643310547,
-0.9080507159233093,
-0.5944841504096985,
-0.13688057661056519,
0.18139781057834625,
... |
func syncClose(done chan chan struct{}) {
ch := make(chan struct{}, 0)
done <- ch
<-ch
} | [
0.2909257709980011,
0.5310860872268677,
0.5763439536094666,
0.23396070301532745,
0.02791169099509716,
0.1379556804895401,
0.35216015577316284,
-1.5449494123458862,
-0.9375578165054321,
0.3239758610725403,
-0.7597575783729553,
0.6836294531822205,
-0.20946206152439117,
0.5945876240730286,
... |
func (r *Row) tagsHash() uint64 {
h := fnv.New64a()
keys := r.tagsKeys()
for _, k := range keys {
h.Write([]byte(k))
h.Write([]byte(r.Tags[k]))
}
return h.Sum64()
} | [
0.642694354057312,
1.058281421661377,
0.4205954372882843,
-0.11789783090353012,
0.17259521782398224,
-0.42323043942451477,
-0.6082267761230469,
-0.8682981133460999,
-0.37090250849723816,
-0.3459402620792389,
-0.514181911945343,
-0.06631793081760406,
-0.47338736057281494,
0.1494501978158950... |
func (r *Row) tagsKeys() []string {
a := make([]string, len(r.Tags))
for k := range r.Tags {
a = append(a, k)
}
sort.Strings(a)
return a
} | [
-0.19898031651973724,
0.2851039171218872,
0.24850942194461823,
-0.6086734533309937,
0.03829557076096535,
-0.5468947291374207,
-0.8749215006828308,
-1.6570188999176025,
-0.43384790420532227,
0.5724014639854431,
0.07319752871990204,
0.29046007990837097,
-0.29252907633781433,
0.18132595717906... |
func marshalStrings(a []string) (ret []byte) {
for _, s := range a {
// Create a slice for len+data
b := make([]byte, 2+len(s))
binary.BigEndian.PutUint16(b[0:2], uint16(len(s)))
copy(b[2:], s)
// Append it to the full byte slice.
ret = append(ret, b...)
}
return
} | [
0.5924858450889587,
0.3918311595916748,
0.45381730794906616,
-0.4644733965396881,
-0.11882690340280533,
-0.195327028632164,
-0.5898375511169434,
-0.15880659222602844,
0.5689771175384521,
0.011759024113416672,
0.31031692028045654,
0.4267137050628662,
-0.6383949518203735,
0.00870138686150312... |
func unmarshalStrings(b []byte) (ret []string) {
for {
// If there's no more data then exit.
if len(b) == 0 {
return
}
// Decode size + data.
n := binary.BigEndian.Uint16(b[0:2])
ret = append(ret, string(b[2:n+2]))
// Move the byte slice forward and retry.
b = b[n+2:]
}
} | [
-0.10777674615383148,
0.8145380020141602,
0.6136119961738586,
-0.5887437462806702,
-0.13585679233074188,
-1.0175083875656128,
-0.16515767574310303,
-0.03821147233247757,
0.373283714056015,
0.09386111050844193,
0.2308647185564041,
-0.0633864551782608,
-0.8300961256027222,
-0.615953028202056... |
func WithMethodCallingLoggerServerInterceptor(logger *logger.Logger) grpc.UnaryServerInterceptor {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
l := logger.WithServiceInfo(info.FullMethod)
requestID := GetRequestIDFromConte... | [
-0.052467621862888336,
-0.5430496335029602,
1.0763156414031982,
-0.8338112831115723,
-0.9683619141578674,
0.038569070398807526,
-0.7008857727050781,
-0.13142240047454834,
0.4358798861503601,
0.00336600374430418,
0.8434527516365051,
0.29086780548095703,
0.07962694019079208,
0.83576697111129... |
func (server *Server) parse(ctx context.Context, r *types.Reference) (*types.Package, error) {
node, err := server.api.Unixfs().Get(ctx, r.Path())
if err != nil {
return nil, err
}
file := files.ToFile(node)
opts := ld.NewJsonLdOptions(r.Resource)
input, err := ld.NewJsonLdProcessor().FromRDF(file, opts)
if e... | [
-0.6561281085014343,
0.39076104760169983,
0.44412529468536377,
-0.31970080733299255,
0.14208604395389557,
-0.7904514670372009,
-0.29013144969940186,
-0.7841060161590576,
-0.08184961974620819,
-0.3738270103931427,
0.2958618700504303,
0.20902639627456665,
-0.28603440523147583,
0.388134270906... |
func (e *UserDisabledEvent) GetBroadcastPayload() EventPayload {
return EventPayload{
"type": ErrorUserDisabled,
"id": e.ID,
"timestamp": e.Timestamp,
"user": e.User,
}
} | [
0.7072232961654663,
-0.07241793721914291,
0.5091875195503235,
0.07909397035837173,
-1.3471380472183228,
0.5536766052246094,
0.0367557518184185,
0.14407449960708618,
1.2552121877670288,
0.4699588716030121,
-0.00477586267516017,
1.6015924215316772,
-0.8586877584457397,
-0.2139035165309906,
... |
func CreateAlbum(title string, clientID string) (albumID, deleteHash interface{}) {
apiURL := "https://api.imgur.com"
resource := "/3/album/"
data := url.Values{}
data.Set("title", title)
u, _ := url.ParseRequestURI(apiURL)
u.Path = resource
urlStr := u.String() // "https://api.com/user/"
client := &http.Cli... | [
0.30198541283607483,
-0.7929803133010864,
0.824783205986023,
-0.18065741658210754,
0.4033743739128113,
1.0830514430999756,
-0.5106973648071289,
-0.2965489625930786,
-0.7340279221534729,
0.3767607510089874,
-1.072284460067749,
0.9744449853897095,
-0.7716398239135742,
0.5592077374458313,
1... |
func GetResponseImages(albumID string, clientID string) (imageLink string) { // removed: (imageLink interface{})
// This hash is the albumID hash
url := "https://api.imgur.com/3/album/" + albumID + "/images.json"
method := "GET"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
err := writer.Clo... | [
-0.47479426860809326,
-0.7959411144256592,
0.9824195504188538,
-0.3533478081226349,
0.6093997359275818,
-0.3885762393474579,
-0.04477197304368019,
-0.7877762317657471,
-0.3069053590297699,
-0.10300268232822418,
-0.6783499717712402,
0.3730994462966919,
-0.555989682674408,
0.7239215970039368... |
func GetLinkClient(albumID string, clientID string) (imageLink string) {
// This hash is the albumID hash
url := "https://api.imgur.com/3/album/" + albumID + "/images"
method := "GET"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
err := writer.Close()
if err != nil {
fmt.Println(err)
}
... | [
-0.30807676911354065,
-0.46519461274147034,
0.8024418354034424,
-0.622124969959259,
0.3824484348297119,
-0.30726510286331177,
-0.10327106714248657,
-0.5304663777351379,
-0.7465656399726868,
-0.3450167775154114,
-0.44998303055763245,
1.4541383981704712,
-0.7931991815567017,
0.36151450872421... |
func DeleteAlbum(albumDeleteHash string, clientID string) {
url := "https://api.imgur.com/3/album/" + albumDeleteHash
method := "DELETE"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
err := writer.Close()
if err != nil {
fmt.Println(err)
}
client := &http.Client{}
req, err := http.NewRe... | [
0.36752521991729736,
-0.7867528200149536,
0.814899206161499,
0.1686873883008957,
0.6954424977302551,
0.9569681286811829,
-0.18787728250026703,
0.028093809261918068,
-0.09215772151947021,
0.14841793477535248,
-0.26330408453941345,
1.4110909700393677,
-0.7861728072166443,
0.5012462735176086,... |
func NewCreateStorageV1CSINodeOK() *CreateStorageV1CSINodeOK {
return &CreateStorageV1CSINodeOK{}
} | [
0.05352210998535156,
-0.2863941490650177,
0.2602827250957489,
1.1555509567260742,
0.02401498518884182,
0.25142034888267517,
0.32484158873558044,
0.28311944007873535,
-0.30805033445358276,
0.751305103302002,
-1.0968083143234253,
-0.6133093237876892,
0.48172393441200256,
0.25945600867271423,... |
func (o *CreateStorageV1CSINodeOK) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeOK {
o.Payload = payload
return o
} | [
0.2514651119709015,
0.1277853548526764,
0.20286031067371368,
0.37260007858276367,
0.17559202015399933,
0.17925724387168884,
0.08107190579175949,
-0.45034149289131165,
0.07027377933263779,
0.5524466633796692,
-0.5084545612335205,
-0.8132705688476562,
0.4638291299343109,
-0.38900265097618103... |
func (o *CreateStorageV1CSINodeOK) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {
o.Payload = payload
} | [
0.19617663323879242,
0.3406960368156433,
0.01839127391576767,
0.4901845455169678,
0.4562161862850189,
0.5911228060722351,
-0.12811745703220367,
-0.26527485251426697,
-0.2907335162162781,
0.5805741548538208,
-0.6522473692893982,
-0.3726714253425598,
-0.02943127043545246,
0.0896601602435112,... |
func (o *CreateStorageV1CSINodeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.195755735039711,
-0.004469146486371756,
0.11281904578208923,
0.7974326014518738,
0.8481997847557068,
-0.17285750806331635,
0.34694963693618774,
-0.13568775355815887,
0.08605343848466873,
0.5586278438568115,
-0.4275065064430237,
-0.6177650690078735,
-0.32405444979667664,
-0.1773079782724... |
func NewCreateStorageV1CSINodeCreated() *CreateStorageV1CSINodeCreated {
return &CreateStorageV1CSINodeCreated{}
} | [
0.6283392906188965,
-0.6184260845184326,
0.10269705206155777,
0.6267027258872986,
0.4904586374759674,
0.3102218210697174,
-0.29003024101257324,
-0.07155998051166534,
0.08440963178873062,
-0.8321508169174194,
-0.8793544173240662,
-0.5337396860122681,
0.7234364748001099,
0.08894162625074387,... |
func (o *CreateStorageV1CSINodeCreated) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeCreated {
o.Payload = payload
return o
} | [
0.5215498208999634,
0.09512584656476974,
0.09477094560861588,
0.03297368809580803,
0.3827766180038452,
0.33005475997924805,
-0.34402337670326233,
-0.7418509125709534,
0.40723469853401184,
-0.5764833688735962,
-0.4137710928916931,
-0.745628297328949,
0.8582106828689575,
-0.31568074226379395... |
func (o *CreateStorageV1CSINodeCreated) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {
o.Payload = payload
} | [
0.3825201094150543,
0.33844202756881714,
-0.03130774199962616,
0.20042051374912262,
0.6870613098144531,
0.6382665634155273,
-0.32517483830451965,
-0.37384775280952454,
-0.03685156628489494,
-0.27802979946136475,
-0.6020656228065491,
-0.2462156116962433,
0.2996354401111603,
0.05743231624364... |
func (o *CreateStorageV1CSINodeCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(201)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.26150891184806824,
0.2244178056716919,
0.20729504525661469,
0.8903902769088745,
0.87694251537323,
-0.08131531625986099,
0.2139328420162201,
-0.14752596616744995,
0.38025718927383423,
-0.05600808933377266,
-0.5089896321296692,
-0.4712968170642853,
0.07394856959581375,
-0.1167869940400123... |
func NewCreateStorageV1CSINodeAccepted() *CreateStorageV1CSINodeAccepted {
return &CreateStorageV1CSINodeAccepted{}
} | [
0.6995318531990051,
-0.22828465700149536,
0.28421515226364136,
0.01330429408699274,
-0.530447244644165,
0.5070382356643677,
0.6808438897132874,
0.05034751072525978,
-0.4073675870895386,
-0.49955183267593384,
-0.7840705513954163,
-0.17239095270633698,
0.9429601430892944,
-0.2247461527585983... |
func (o *CreateStorageV1CSINodeAccepted) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeAccepted {
o.Payload = payload
return o
} | [
0.5097094774246216,
0.32660597562789917,
0.23582491278648376,
-0.3237033486366272,
-0.45561179518699646,
0.5910167694091797,
0.32022321224212646,
-0.2972027659416199,
0.2848685383796692,
-0.2869950830936432,
-0.32932642102241516,
-0.17018352448940277,
1.0237476825714111,
-0.409295231103897... |
func (o *CreateStorageV1CSINodeAccepted) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {
o.Payload = payload
} | [
0.33073890209198,
0.7707321047782898,
0.14770770072937012,
-0.1650993674993515,
-0.3471773564815521,
0.8534116744995117,
0.20945537090301514,
-0.046652257442474365,
-0.04719995707273483,
0.1590527892112732,
-0.44503915309906006,
0.39324507117271423,
0.37363526225090027,
-0.1493652909994125... |
func (o *CreateStorageV1CSINodeAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(202)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.3344840705394745,
0.5594655275344849,
0.26829513907432556,
0.7506175637245178,
0.30281227827072144,
-0.19110934436321259,
0.5368620753288269,
0.083320751786232,
0.37573277950286865,
0.136029452085495,
-0.27282005548477173,
-0.021299442276358604,
0.036281779408454895,
-0.2246805131435394... |
func NewCreateStorageV1CSINodeUnauthorized() *CreateStorageV1CSINodeUnauthorized {
return &CreateStorageV1CSINodeUnauthorized{}
} | [
-0.3308878540992737,
-0.1721363067626953,
0.32318270206451416,
0.734015941619873,
0.13134309649467468,
0.1022350937128067,
0.07038092613220215,
0.8366725444793701,
-0.29008573293685913,
-0.56673663854599,
-0.3806585967540741,
0.8169189691543579,
0.4674544334411621,
-0.2547639310359955,
-... |
func (o *CreateStorageV1CSINodeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(401)
} | [
-0.6078013777732849,
-0.18477731943130493,
0.19249695539474487,
0.7438452839851379,
0.868857741355896,
-0.18158389627933502,
0.5154253244400024,
0.08300787210464478,
0.04220527783036232,
0.1018352061510086,
-0.39902350306510925,
0.11970886588096619,
-0.681438684463501,
-0.4070938229560852,... |
func (*HelloRequest) Descriptor() ([]byte, []int) {
return file_proto_sample_proto_rawDescGZIP(), []int{0}
} | [
-1.1532623767852783,
0.4669942259788513,
0.4759516716003418,
0.1042567640542984,
0.09478570520877838,
0.059327930212020874,
0.4617003798484802,
0.5250462293624878,
-0.4735192656517029,
-0.9224421381950378,
-0.7642121315002441,
0.3252297341823578,
0.004946721252053976,
0.7326018214225769,
... |
func (*HelloResponse) Descriptor() ([]byte, []int) {
return file_proto_sample_proto_rawDescGZIP(), []int{1}
} | [
-0.3382646441459656,
0.18996798992156982,
0.43602630496025085,
-0.22148746252059937,
0.38310444355010986,
-0.5578405261039734,
0.8473002314567566,
0.40255361795425415,
-0.351480633020401,
-0.8073191046714783,
-1.5875300168991089,
-0.3253731429576874,
-0.8909759521484375,
0.2364906370639801... |
func (*CreateUserRequest) Descriptor() ([]byte, []int) {
return file_proto_sample_proto_rawDescGZIP(), []int{2}
} | [
-0.34988147020339966,
0.13421346247196198,
0.31478580832481384,
0.4676438868045807,
-0.560634970664978,
-0.03178057819604874,
0.6569980382919312,
0.36262938380241394,
-0.4309086501598358,
0.04962233826518059,
-0.781855046749115,
-0.07965441048145294,
-0.41275811195373535,
1.188810110092163... |
func (*CreateUserResponse) Descriptor() ([]byte, []int) {
return file_proto_sample_proto_rawDescGZIP(), []int{3}
} | [
0.03585639223456383,
-0.19034896790981293,
-0.16725492477416992,
0.05042998120188713,
-0.18628883361816406,
-0.3071628510951996,
1.0416114330291748,
0.1718667596578598,
-0.10995437204837799,
0.07176379859447479,
-1.0785497426986694,
-0.6724435091018677,
-1.1049907207489014,
0.2801247537136... |
func (*ProxyRequest) Descriptor() ([]byte, []int) {
return file_proto_sample_proto_rawDescGZIP(), []int{4}
} | [
-0.5975193381309509,
0.6619579792022705,
0.5783132910728455,
-0.33363932371139526,
-0.18712902069091797,
-0.5696136355400085,
0.5520505309104919,
1.0576624870300293,
-0.5960014462471008,
-0.42844194173812866,
-0.12598492205142975,
0.47132396697998047,
-0.0977063775062561,
0.970647811889648... |
func (*ProxyResponse) Descriptor() ([]byte, []int) {
return file_proto_sample_proto_rawDescGZIP(), []int{5}
} | [
-0.1700223833322525,
0.4719241261482239,
0.18245577812194824,
-0.5003154277801514,
0.09078045934438705,
-0.9783635139465332,
0.9851568937301636,
0.6884502172470093,
-0.479218453168869,
-0.5016912221908569,
-1.0161277055740356,
-0.3698844015598297,
-0.9897648096084595,
0.09110378473997116,
... |
func (v *Context) Native() uintptr {
return uintptr(unsafe.Pointer(v.native()))
} | [
-0.16287951171398163,
-1.1689928770065308,
0.181735098361969,
-0.0956336036324501,
-0.7698301076889038,
-0.28063681721687317,
-0.4892740249633789,
-0.6442055106163025,
0.06060924753546715,
-0.011304779909551144,
0.5322709083557129,
0.8460294604301453,
0.29174965620040894,
-0.94808524847030... |
func (UnitOfMedicine) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
}
} | [
-0.4229840338230133,
-0.30584877729415894,
-0.03599296882748604,
-2.104097366333008,
0.9463769793510437,
0.6804819703102112,
-1.3877605199813843,
-0.3476177155971527,
0.7484458088874817,
-0.5551442503929138,
-0.07271584123373032,
-0.21882905066013336,
0.05375204607844353,
-0.72570097446441... |
func (UnitOfMedicine) Edges() []ent.Edge {
return []ent.Edge{
edge.To("Medicine", Medicine.Type),
}
} | [
-0.6986925005912781,
-0.4532782733440399,
0.25050216913223267,
-1.1468336582183838,
0.88181471824646,
0.23967616260051727,
-1.4150826930999756,
-0.3220313489437103,
0.9331845045089722,
-0.435516357421875,
1.2143220901489258,
0.8695821762084961,
0.37066739797592163,
-0.03611705079674721,
... |
func New(folder string, cfg *Config) (*DB, error) {
env, err := lmdb.NewEnv()
if err != nil {
return nil, errors.Wrap(err, "env create failed")
}
err = env.SetMaxDBs(cfg.MaxDBs)
if err != nil {
return nil, errors.Wrap(err, "env config failed")
}
err = env.SetMapSize(cfg.SizeMbs * 1024 * 1024)
if err != ni... | [
-0.0691317692399025,
-0.11435116082429886,
0.7994439601898193,
-0.45220258831977844,
-0.549086332321167,
0.7909499406814575,
0.1319855898618698,
0.027620526030659676,
-1.18390953540802,
0.5058250427246094,
0.505013644695282,
0.381901353597641,
-0.5879600644111633,
1.3280985355377197,
0.7... |
func NewConnection() (*PGSQLConnection, error) {
url, ok := os.LookupEnv(databaseENV)
if !ok {
return nil, fmt.Errorf("missing ENV %s", databaseENV)
}
db, err := sqlx.Connect("postgres", url)
if err != nil {
return nil, err
}
return &PGSQLConnection{
connection: db,
}, nil
} | [
-0.01964450068771839,
-0.015059155412018299,
0.43844151496887207,
0.4236232042312622,
-0.23478582501411438,
-0.16880632936954498,
-0.3955574929714203,
-0.08375908434391022,
-0.9640838503837585,
0.4139094352722168,
0.23287315666675568,
0.0064923083409667015,
0.22619082033634186,
0.430163532... |
func (p PGSQLConnection) GetCluster(clusterName string) (*ClusterModel, error) {
cluster := new(ClusterModel)
if err := p.connection.Get(cluster, fmt.Sprintf("SELECT * FROM clusters WHERE cluster_name=%s", clusterName)); err != nil {
return nil, err
}
return cluster, nil
} | [
0.03749923035502434,
0.6211466789245605,
0.35037335753440857,
0.5869842767715454,
0.8549413084983826,
0.20972321927547455,
-0.19776934385299683,
-0.07678021490573883,
-0.31199514865875244,
-0.055933862924575806,
0.25690150260925293,
0.6427819728851318,
-0.3152772784233093,
-0.4017306268215... |
func (p PGSQLConnection) UpdateCluster(cluster *ClusterModel) error {
tx, err := p.connection.Beginx()
if err != nil {
return err
}
_, err = tx.NamedExec("UPDATE clusters SET color = :color WHERE cluster_name = :cluster_name", cluster)
if err != nil {
return err
}
return tx.Commit()
} | [
-1.2205705642700195,
-0.1114179939031601,
0.4937756061553955,
-0.054514799267053604,
-0.02301453799009323,
0.5630806684494019,
0.08988253772258759,
-0.11012297123670578,
-0.3272240459918976,
0.9914465546607971,
-0.10479719936847687,
0.49249228835105896,
-0.0178011953830719,
0.3634571731090... |
func (p PGSQLConnection) GetAllClusters() ([]ClusterModel, error) {
clusters := []ClusterModel{}
if err := p.connection.Select(&clusters, "SELECT * FROM clusters"); err != nil {
return nil, err
}
return clusters, nil
} | [
-0.5698273777961731,
-0.07999696582555771,
0.49551549553871155,
1.6731055974960327,
0.8677550554275513,
0.49037256836891174,
-0.6756720542907715,
-0.5210562944412231,
0.009756644256412983,
-0.3623165786266327,
-0.1089380607008934,
0.5212435126304626,
-0.7602325677871704,
0.0558248460292816... |
func (p PGSQLConnection) CreateCluster(cluster *ClusterModel) error {
tx, err := p.connection.Beginx()
if err != nil {
return err
}
_, err = tx.NamedExec("INSERT INTO clusters (cluster_name, color) VALUES (:cluster_name, :color)", cluster)
if err != nil {
return err
}
return tx.Commit()
} | [
-0.1636476069688797,
0.5279011726379395,
0.5215194225311279,
-0.0011496362276375294,
0.797577977180481,
0.6793781518936157,
-0.1295931488275528,
-0.45369476079940796,
-0.5512579083442688,
0.4184066951274872,
-0.27208003401756287,
-0.5762912631034851,
-0.20907637476921082,
0.158613994717597... |
func (p PGSQLConnection) DeleteCluster(cluster *ClusterModel) error {
tx, err := p.connection.Beginx()
if err != nil {
return err
}
_, err = tx.NamedExec("DELETE FROM clusters WHERE cluster_name = :cluster_name", cluster)
if err != nil {
return err
}
return tx.Commit()
} | [
-0.24330270290374756,
0.4379594326019287,
0.5258992314338684,
0.441024512052536,
0.355275958776474,
0.4742342233657837,
0.06835804134607315,
-0.3530568480491638,
0.025287173688411713,
0.10422271490097046,
-0.06506136059761047,
0.03810347989201546,
-0.3342081606388092,
0.22399486601352692,
... |
func GenCerts(hosts []string, outname string, isCA bool) (err error) {
priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
return fmt.Errorf("GenerateKey: %v", err)
}
template := x509.Certificate{
SerialNumber: big.NewInt(1),
Subject: pkix.Name{
Organization: []string{"Acme Co"},
... | [
-0.7288341522216797,
0.9775204062461853,
0.8007245659828186,
0.0681692585349083,
-0.6325619220733643,
0.10814128816127777,
0.053328197449445724,
-0.15043321251869202,
-0.31203997135162354,
0.4451391398906708,
0.0019799943547695875,
-0.25412803888320923,
0.23671185970306396,
0.2280125319957... |
func NamesInCert(cert_file string) (names []string) {
cert, err := ParseCertPemFile(cert_file)
if err != nil {
log.Printf("ParseCert %s: %v", cert_file, err)
return
}
for _, netip := range cert.IPAddresses {
ip := netip.String()
names = append(names, ip)
}
for _, domain := range cert.DNSNames {
names = ... | [
0.0552595853805542,
-0.5506976842880249,
0.48900675773620605,
-0.6051723957061768,
-1.120529294013977,
0.8284977674484253,
-0.7572150826454163,
0.21594350039958954,
-0.9600957036018372,
0.35083889961242676,
-1.040953278541565,
-0.632221519947052,
-0.2754816710948944,
0.39388570189476013,
... |
func ParseCertPemFile(cert_file string) (cert *x509.Certificate, err error) {
cert_data, err := os.ReadFile(cert_file)
if err != nil {
err = fmt.Errorf("Read ca-cert.pem: %v", err)
return
}
return ParsePem(cert_data)
} | [
1.0824627876281738,
-0.23606233298778534,
0.5408860445022583,
0.22238387167453766,
-0.9316640496253967,
0.9202513098716736,
0.4774165749549866,
1.1209388971328735,
-0.43316081166267395,
0.007587977219372988,
-0.12479523569345474,
-1.2093305587768555,
-0.6415799856185913,
-0.190555259585380... |
func GetFingerprint(cert_file string) string {
cert, err := ParseCertPemFile(cert_file)
if err != nil {
log.Printf("GetFingerprint: ParseCert %s: %v", cert_file, err)
return ""
}
return SHA256SumRaw(cert.Raw)
} | [
0.8939793705940247,
0.09786250442266464,
0.6429791450500488,
1.0549763441085815,
-0.44396451115608215,
0.44880586862564087,
0.5028296709060669,
1.250011682510376,
-0.6536825895309448,
0.7681534886360168,
-0.3346008360385895,
-0.7860856652259827,
-0.9874824285507202,
-0.2555235028266907,
... |
func (self *SAliyunRegionDriver) RequestBindIPToNatgateway(ctx context.Context, task taskman.ITask, natgateway *models.SNatGateway,
eipId string) error {
taskman.LocalTaskRun(task, func() (jsonutils.JSONObject, error) {
model, err := models.ElasticipManager.FetchById(eipId)
if err != nil {
return nil, err
}
... | [
-1.5673905611038208,
-0.4736992120742798,
0.8999110460281372,
-0.6235600113868713,
0.10652841627597809,
0.17805837094783783,
-0.1845806986093521,
-0.2847190201282501,
0.17362990975379944,
1.4891186952590942,
-0.0814150795340538,
0.3143250346183777,
0.013906885869801044,
1.3372427225112915,... |
func NewGobEncoderLight() *GobEncoderLight {
ret := &GobEncoderLight{
bytes: &bytes.Buffer{},
}
ret.encoder = gob.NewEncoder(ret.bytes)
return ret
} | [
0.6755643486976624,
-0.15397150814533234,
0.3783172070980072,
0.14712616801261902,
-0.8105577826499939,
0.17219366133213043,
-1.5702506303787231,
-0.219744473695755,
-0.3527461290359497,
0.2741602063179016,
-0.9635372757911682,
0.8280215263366699,
-1.5148942470550537,
1.3447661399841309,
... |
func NewGobDecoderLight() *GobDecoderLight {
ret := &GobDecoderLight{
bytes: &bytes.Buffer{},
}
ret.decoder = gob.NewDecoder(ret.bytes)
return ret
} | [
0.8413469791412354,
-0.34626835584640503,
0.2848030924797058,
-0.2586452066898346,
-0.5322146415710449,
-0.13374698162078857,
-1.7231255769729614,
-0.06780485808849335,
-0.6587340831756592,
-0.2181890308856964,
-0.7208582162857056,
0.08703726530075073,
-0.7206025123596191,
0.66801589727401... |
func NewGobTranscoder() *GobTranscoder {
ret := &GobTranscoder{
inBytes: &bytes.Buffer{},
outBytes: &bytes.Buffer{},
encoderMut: &sync.Mutex{},
decoderMut: &sync.Mutex{},
}
ret.encoder = gob.NewEncoder(ret.outBytes)
ret.decoder = gob.NewDecoder(ret.inBytes)
return ret
} | [
-0.5102470517158508,
-0.2262830138206482,
0.5186035633087158,
-0.7620668411254883,
-0.6797012686729431,
-1.0633490085601807,
-0.9835550785064697,
-0.4798640310764313,
-0.7298605442047119,
0.10305571556091309,
-1.156301498413086,
0.13372699916362762,
-1.0733141899108887,
0.6341426372528076,... |
func (g *GobTranscoder) EncodeType(t interface{}) ([]byte, error) {
g.encoderMut.Lock()
defer func() {
g.outBytes.Reset()
g.encoderMut.Unlock()
}()
err := g.encoder.Encode(t)
if err != nil {
return nil, err
}
return g.outBytes.Bytes(), nil
} | [
-0.9979853630065918,
0.7494017481803894,
0.518665075302124,
0.2770872712135315,
-0.06669153273105621,
-0.5803325176239014,
-0.03591255098581314,
-1.4642918109893799,
0.09829488396644592,
0.8444135785102844,
-0.4724295437335968,
0.2875523865222931,
-1.056640386581421,
1.3372665643692017,
... |
func (g *GobEncoderLight) EncodeType(t interface{}) ([]byte, error) {
defer func() {
g.bytes.Reset()
}()
err := g.encoder.Encode(t)
if err != nil {
return nil, err
}
return g.bytes.Bytes(), nil
} | [
-0.3102361857891083,
0.8362312912940979,
0.4750773012638092,
0.39256128668785095,
0.5219199657440186,
-0.2123253047466278,
-0.8227200508117676,
-1.3732202053070068,
0.19930824637413025,
1.0704320669174194,
-0.40844497084617615,
0.6825663447380066,
-0.9253061413764954,
1.649469256401062,
... |
func (g *GobTranscoder) DecodeType(buf []byte, outT interface{}) error {
g.decoderMut.Lock()
defer func() {
g.inBytes.Reset()
g.decoderMut.Unlock()
}()
reader := bytes.NewReader(buf)
if _, err := io.Copy(g.inBytes, reader); err != nil {
return err
}
return g.decoder.Decode(outT)
} | [
-0.8556041717529297,
0.20311610400676727,
0.48251911997795105,
0.331539511680603,
-0.19320183992385864,
-0.9680703282356262,
0.3038386106491089,
-0.8077664375305176,
-0.11244259029626846,
0.2268173098564148,
-0.5267224907875061,
0.2519899606704712,
-0.9071820974349976,
0.6252864003181458,
... |
func (g *GobDecoderLight) DecodeType(buf []byte, outT interface{}) error {
defer func() {
g.bytes.Reset()
}()
reader := bytes.NewReader(buf)
if _, err := io.Copy(g.bytes, reader); err != nil {
return err
}
return g.decoder.Decode(outT)
} | [
-0.059289317578077316,
0.16655384004116058,
0.5819686651229858,
0.23074714839458466,
0.08401603251695633,
-0.5193886160850525,
-0.23469087481498718,
-0.8054419159889221,
-0.18753787875175476,
0.35392171144485474,
-0.31803977489471436,
0.29300495982170105,
-0.799443781375885,
0.665437340736... |
func ValidateToken(r *http.Request) error {
token, err := VerifyToken(r)
if err != nil {
return err
}
if _, ok := token.Claims.(jwt.Claims); !ok && !token.Valid {
return err
}
return nil
} | [
0.0059804767370224,
-0.23442675173282623,
0.3746773600578308,
0.08992090076208115,
0.7639369368553162,
0.018123125657439232,
-0.27254918217658997,
0.10672439634799957,
0.06354924291372299,
-1.19651198387146,
0.031214455142617226,
0.8356316089630127,
0.8915322422981262,
1.205114722251892,
... |
func InitDB() {
os.Remove("./threat_analyser.db")
var err error
db, err = sql.Open("sqlite3", "./threat_analyser.db")
if err != nil {
log.Fatal(err)
}
createCmd := `
create table ip (ip_address TEXT PRIMARY KEY,
uuid TEXT,
created_at DATETIME,
updated_at DATETIME,
response_code TEXT);
... | [
0.11735265702009201,
0.6577608585357666,
0.7379658222198486,
0.5045591592788696,
0.7568913102149963,
0.8000901341438293,
0.34252187609672546,
-0.019584663212299347,
-0.6591227650642395,
0.3095957040786743,
0.31548142433166504,
-0.5065621137619019,
-0.3220445215702057,
-0.1975790411233902,
... |
func (sqlDb *SqliteDB) SaveIp(ip *model.IP) error {
upsert, err := db.Prepare("INSERT OR REPLACE INTO ip (ip_address, uuid, created_at, updated_at, response_code) VALUES (?, ?, ?, ?, ?)")
defer upsert.Close()
if err != nil {
return errors.New(fmt.Sprint("ERROR preparing db insert statement:", err.Error()))
}
_, ... | [
-1.6074676513671875,
0.3760994076728821,
0.8487706184387207,
0.13418380916118622,
-0.02410976216197014,
0.13367657363414764,
-0.22789178788661957,
0.49529561400413513,
0.12313401699066162,
0.8571996688842773,
-0.14131967723369598,
-1.8448679447174072,
-0.6719846129417419,
-0.75527918338775... |
func (sqlDb *SqliteDB) GetIp(ipAddr string) (*model.IP, error) {
row := db.QueryRow("SELECT * FROM ip WHERE ip_address = ?", ipAddr)
ip := model.IP{}
err := row.Scan(&ip.IPAddress, &ip.UUID, &ip.CreatedAt, &ip.UpdatedAt, &ip.ResponseCode)
if err != nil {
if err == sql.ErrNoRows {
return nil, nil
} else {
... | [
-0.8013404011726379,
0.4041864275932312,
0.622492253780365,
0.7440162897109985,
-0.4584794044494629,
-0.49041444063186646,
-0.2568414509296417,
0.4042195677757263,
0.28412219882011414,
0.5830217599868774,
0.6875441670417786,
-1.040001630783081,
-0.04428809508681297,
-1.2438483238220215,
... |
func formatUnix(unixTime int64) string {
t := time.Unix(unixTime, 0)
return t.Format(timeFormat)
} | [
-0.6313614845275879,
-0.37464645504951477,
0.4433233439922333,
-0.07063990831375122,
-0.15143999457359314,
0.010121900588274002,
-1.4053359031677246,
0.010493740439414978,
0.9701047539710999,
-1.1630756855010986,
0.4928465783596039,
0.9811655282974243,
0.1283733993768692,
0.828185796737670... |
func PrepayBalanceKey(acc []byte) []byte {
return append(PrepayBalancePrefix, acc...)
} | [
-0.08426759392023087,
0.3331664204597473,
0.7079982161521912,
-0.35498854517936707,
-0.31566759943962097,
-0.0316973440349102,
0.167692169547081,
-0.6981196999549866,
1.1885218620300293,
0.44090735912323,
-0.1966840922832489,
0.3068985939025879,
0.36177241802215576,
1.313683032989502,
-0... |
func FileStoreKey(sender []byte) []byte {
return append(FileStoreKeyPrefix, sender...)
} | [
-0.1445445418357849,
-0.2452380210161209,
0.25913575291633606,
-0.09271591156721115,
0.001377929700538516,
-0.532580554485321,
-0.12383170425891876,
-0.2717759907245636,
0.5167002081871033,
0.09562332183122635,
-0.9783720374107361,
0.3556663990020752,
0.3369520902633667,
0.7761206030845642... |
func skip(key, path string, user *user.User, conf *config.Config) bool {
for _, exclude := range vcsSetting(key, conf) {
if strings.HasPrefix(path, exclude) {
return true
}
}
return false
} | [
-0.7006232738494873,
0.17130602896213531,
0.3051040768623352,
0.9533939957618713,
-1.1562854051589966,
0.2977767884731293,
0.012731489725410938,
0.08643358945846558,
-0.5047510862350464,
1.2689380645751953,
-0.24796244502067566,
-0.5743330121040344,
-0.7723909020423889,
-0.7893606424331665... |
func (cs *Stats) SetStatistics(s StatsEntry) {
cs.mutex.Lock()
defer cs.mutex.Unlock()
s.Container = cs.Container
cs.StatsEntry = s
} | [
1.082856297492981,
0.6309352517127991,
0.08656813204288483,
0.511191189289093,
0.6764810681343079,
-0.2962362766265869,
0.6792668104171753,
-0.6994287967681885,
0.6411126255989075,
-0.288067102432251,
-0.5827953815460205,
0.8218204379081726,
0.6013883352279663,
0.38757288455963135,
-0.69... |
func (cs *Stats) GetStatistics() StatsEntry {
cs.mutex.Lock()
defer cs.mutex.Unlock()
return cs.StatsEntry
} | [
1.3066370487213135,
0.7804383635520935,
0.2914845645427704,
0.322739839553833,
0.9797772169113159,
-0.37083518505096436,
0.5500432252883911,
-1.505088448524475,
0.6445180177688599,
-0.8629316091537476,
0.0625741258263588,
0.48687493801116943,
-0.6612346172332764,
-0.0025994067545980215,
... |
func NewStatsFormat(source, osType string) formatter.Format {
if source == formatter.TableFormatKey {
if osType == winOSType {
return formatter.Format(winDefaultStatsTableFormat)
}
return formatter.Format(defaultStatsTableFormat)
} else if source == formatter.AutoRangeFormatKey {
return formatter.Format(au... | [
0.13500575721263885,
0.04685608297586441,
0.22335897386074066,
-0.032076314091682434,
-0.7159122824668884,
-0.930980384349823,
-1.0487431287765503,
-1.2892111539840698,
-0.07196857780218124,
-0.8013715744018555,
0.7832890152931213,
0.9441919922828674,
0.69969242811203,
1.6467421054840088,
... |
func NewStats(container string) *Stats {
return &Stats{StatsEntry: StatsEntry{Container: container}}
} | [
1.5020017623901367,
0.18755723536014557,
0.03270932286977768,
-0.03527954965829849,
0.28032657504081726,
-0.23351551592350006,
-0.3976110517978668,
-1.55629563331604,
0.9866942763328552,
-0.3929528295993805,
0.45207902789115906,
0.6129940152168274,
0.3165028393268585,
0.2015557885169983,
... |
func statsFormatWrite(ctx formatter.Context, Stats []StatsEntry, osType string, trunc bool) error {
render := func(format func(subContext formatter.SubContext) error) error {
for _, cstats := range Stats {
statsCtx := &statsContext{
s: cstats,
os: osType,
trunc: trunc,
}
if err := format(... | [
-0.049098122864961624,
-0.3838316798210144,
0.5635228753089905,
-0.3898971378803253,
0.2688223719596863,
-0.4817703366279602,
0.09685880690813065,
-0.42870455980300903,
0.5226842761039734,
-0.1994086056947708,
0.322598397731781,
0.35899344086647034,
0.4447741210460663,
0.6634733080863953,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.