query
stringlengths
7
3.85k
document
stringlengths
11
430k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Execute begins execution of the query and returns a channel to receive rows.
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *RawExecutor) Execute(closing <-chan struct{}) <-chan *models.Row {\n\tout := make(chan *models.Row, 0)\n\tgo e.execute(out, closing)\n\treturn out\n}", "func (vc *vdbClient) Execute(query string) (*sqltypes.Result, error) {\n\t// Number of rows should never exceed relayLogMaxItems.\n\treturn vc.ExecuteF...
[ "0.7661195", "0.6501132", "0.6437562", "0.63833964", "0.63611424", "0.62889", "0.62788844", "0.6257603", "0.6251378", "0.6196262", "0.61617357", "0.6148566", "0.6122157", "0.6094865", "0.6034637", "0.5990816", "0.5990469", "0.59717685", "0.5960647", "0.5958406", "0.5949864", ...
0.7390879
1
execute runs in a separate separate goroutine and streams data from processors.
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 i, p := range e.processors { // Retrieve data from the processor. m, ok := <-p.C() if !ok { break loop } // Set values on returned row. for k, v := range m { // Extract timestamp and tag values from key. b := []byte(k) timestamp := int64(binary.BigEndian.Uint64(b[0:8])) // Lookup row values and populate data. values := e.createRowValuesIfNotExists(rows, e.processors[0].name(), b[8:], timestamp) values[i+1] = v } } } // Normalize rows and values. // This converts the timestamps from nanoseconds to microseconds. a := make(Rows, 0, len(rows)) for _, row := range rows { for _, values := range row.Values { values[0] = values[0].(int64) / int64(time.Microsecond) } a = append(a, row) } sort.Sort(a) // Send rows to the channel. for _, row := range a { out <- row } // Mark the end of the output channel. close(out) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (processor *Processor) Execute(input <-chan Message) <-chan Message {\n\tvar wg sync.WaitGroup\n\tnumTasks := processor.demux.FanOut()\n\twg.Add(numTasks)\n\n\tout := make(chan Message)\n\n\twork := func(taskId int, inputStream <-chan Message) {\n\t\tfor message := range inputStream {\n\t\t\tprocessor.process...
[ "0.6768461", "0.64574254", "0.6350197", "0.6306248", "0.63038504", "0.6270772", "0.62555313", "0.61808825", "0.61413014", "0.6004808", "0.59958047", "0.5968906", "0.5943362", "0.59123737", "0.584534", "0.584344", "0.58390856", "0.5833644", "0.58037674", "0.5782119", "0.577042...
0.57068914
27
creates a new value set if one does not already exist for a given tagset + timestamp.
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[string]string) for i, v := range unmarshalStrings(tagset) { row.Tags[e.tags[i]] = v } // Create column names. row.Columns = make([]string, 1, len(e.stmt.Fields)+1) row.Columns[0] = "time" for i, f := range e.stmt.Fields { name := f.Name() if name == "" { name = fmt.Sprintf("col%d", i) } row.Columns = append(row.Columns, name) } // Save to lookup. rows[string(tagset)] = row } // If no values exist or last value doesn't match the timestamp then create new. if len(row.Values) == 0 || row.Values[len(row.Values)-1][0] != timestamp { values := make([]interface{}, len(e.processors)+1) values[0] = timestamp row.Values = append(row.Values, values) } return row.Values[len(row.Values)-1] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewSet(timestamp Nanotime, values map[string]struct{}, source Source, tags Tags) Set {\n\treturn Set{Values: values, Timestamp: timestamp, Source: source, Tags: tags.Copy()}\n}", "func newSet(txn *Transaction, key []byte) *Set {\n\tnow := Now()\n\treturn &Set{\n\t\ttxn: txn,\n\t\tkey: key,\n\t\tmeta: &SetMe...
[ "0.70187044", "0.5677267", "0.5523787", "0.54961294", "0.5219592", "0.51507616", "0.514083", "0.51023275", "0.5094932", "0.5091561", "0.5059189", "0.5022734", "0.49620268", "0.49563345", "0.49500543", "0.49257427", "0.4912637", "0.49085042", "0.4883463", "0.48798203", "0.4877...
0.5942259
1
dimensionKeys returns a list of tag key names for the dimensions. Each dimension must be a VarRef.
func dimensionKeys(dimensions Dimensions) (a []string) { for _, d := range dimensions { a = append(a, d.Expr.(*VarRef).Val) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Measurement) TagKeys() []string {\n\tm.mu.RLock()\n\tdefer m.mu.RUnlock()\n\tkeys := make([]string, 0, len(m.seriesByTagKeyValue))\n\tfor k := range m.seriesByTagKeyValue {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\treturn keys\n}", "func (target *Target) TagKeys() []string {\n\n\tkeys :=...
[ "0.64260674", "0.59128034", "0.5869726", "0.5851657", "0.5818404", "0.57840663", "0.5758748", "0.56994116", "0.5590301", "0.5536994", "0.54531986", "0.544049", "0.54329765", "0.54284394", "0.5335913", "0.5327702", "0.5310732", "0.53080714", "0.5301138", "0.52743703", "0.52706...
0.8072088
0
newMapper returns a new instance of mapper.
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), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewMapper(config MapperConfig) *Mapper {\n\tm := Mapper{\n\t\tconfig: config,\n\t\tregexes: make([]*regexp.Regexp, len(config.Mappings)),\n\t\tvalidate: validator.New(),\n\t}\n\n\tm.Initialize()\n\n\treturn &m\n}", "func NewMapper(isBiFlow bool) *Mapper {\n\treturn &Mapper{\n\t\tmmap: make(map[string...
[ "0.77114105", "0.76382065", "0.7555538", "0.6776838", "0.6700106", "0.6485153", "0.63133055", "0.6229891", "0.61909276", "0.61140144", "0.6087086", "0.6048961", "0.59599954", "0.59437037", "0.59334576", "0.58699393", "0.5846827", "0.58250123", "0.5816489", "0.58098704", "0.57...
0.7831975
0
start begins processing the iterator.
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() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (w *Walker) startProcessing() {\n\tdoStart := false\n\tw.pipe.RLock()\n\tif w.pipe.filters == nil { // no processing up to now => start with initial node\n\t\tw.pipe.pushSync(w.initial, 0) // input is buffered, will return immediately\n\t\tdoStart = true // yes, we will have to start the pipeli...
[ "0.6754084", "0.6630149", "0.6614358", "0.6453262", "0.63123596", "0.6260204", "0.6162121", "0.6110421", "0.6065856", "0.60470873", "0.598306", "0.5982473", "0.5909885", "0.5909172", "0.58936924", "0.588361", "0.57815766", "0.5770956", "0.5755095", "0.5743116", "0.5717359", ...
0.7028437
0
stop stops the mapper.
func (m *mapper) stop() { syncClose(m.done) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *reducer) stop() {\n\tfor _, m := range r.mappers {\n\t\tm.stop()\n\t}\n\tsyncClose(r.done)\n}", "func (m *Map) Stop(c chan<- string) {\n\tm.bus.Stop(c)\n}", "func (p *literalProcessor) stop() { syncClose(p.done) }", "func (r *reaper) stop() {\n\tr.stopCh <- struct{}{}\n}", "func (cMap *MyStruct) S...
[ "0.7641731", "0.69857275", "0.6716965", "0.66754645", "0.6570976", "0.6499061", "0.6379476", "0.6372358", "0.6363777", "0.6234526", "0.6179535", "0.61789393", "0.61702853", "0.61676526", "0.61521393", "0.6150348", "0.612782", "0.6109738", "0.61095876", "0.6086529", "0.6082952...
0.8386904
0
C returns the streaming data channel.
func (m *mapper) C() <-chan map[string]interface{} { return m.c }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Subscription) C() <-chan interface{} {\n\treturn s.channel\n}", "func (s *subscription) C() <-chan interface{} {\n\treturn s.c\n}", "func (c *dataReceivedClient) GetStream() rpcc.Stream { return c.Stream }", "func (uc *UnboundedChannel) Get() <-chan interface{} {\n\treturn uc.channel\n}", "func (l...
[ "0.6759161", "0.6602864", "0.61977434", "0.6079438", "0.6015766", "0.59815305", "0.5894958", "0.5827573", "0.5811892", "0.5789283", "0.5787107", "0.5769193", "0.5764194", "0.57620907", "0.5744001", "0.57320946", "0.5710497", "0.5659543", "0.56509525", "0.56507605", "0.5619693...
0.53927493
38
run executes the map function against the iterator.
func (m *mapper) run() { for m.itr.NextIterval() { m.fn(m.itr, m) } close(m.c) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (conn *db) runMap(stmt Stmt, mapper MapMapper) (rowsReturned int, err error) {\n\tif err = conn.Connect(); err != nil {\n\t\treturn\n\t}\n\n\tvar (\n\t\tstmtx *sqlx.Stmt\n\t\trows *sqlx.Rows\n\t\tt time.Time\n\t)\n\n\tif conn.hasProfiling() {\n\t\tt = time.Now()\n\t}\n\n\tstmtx, err = preparex(conn, stmt...
[ "0.68111986", "0.66373616", "0.652552", "0.6495338", "0.6436401", "0.63472146", "0.63425344", "0.63047", "0.62997466", "0.61346835", "0.6010561", "0.58976614", "0.5892991", "0.5884971", "0.58690274", "0.5847752", "0.58225423", "0.5793468", "0.5769612", "0.5762774", "0.5732794...
0.816427
0
emit sends a value to the mapper's output channel.
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} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *reducer) emit(key string, value interface{}) {\n\tr.c <- map[string]interface{}{key: value}\n}", "func (c channelConveyor) Emit(v interface{}) error {\n\tc.outputCh <- v\n\n\treturn nil\n}", "func (b Broadcaster) Write(v interface{}) {\n\tutils.Debugf(\"Sending %v\\n\", v)\n\tb.Sendc <- v // write val...
[ "0.71517444", "0.7032162", "0.6520443", "0.6100109", "0.6080597", "0.6074423", "0.60067284", "0.598246", "0.593429", "0.5927578", "0.59140766", "0.5908921", "0.5881568", "0.5873035", "0.58528805", "0.582588", "0.5802329", "0.5796881", "0.5786085", "0.5757521", "0.5737987", ...
0.7160126
0
mapCount computes the number of values in an iterator.
func mapCount(itr Iterator, m *mapper) { n := 0 for k, _ := itr.Next(); k != 0; k, _ = itr.Next() { n++ } m.emit(itr.Time(), float64(n)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MapCount(itr Iterator) interface{} {\n\tn := float64(0)\n\tfor k, _ := itr.Next(); k != -1; k, _ = itr.Next() {\n\t\tn++\n\t}\n\tif n > 0 {\n\t\treturn n\n\t}\n\treturn nil\n}", "func Count(itr Iterator) int {\n\tconst mask = ^Word(0)\n\tcount := 0\n\tfor {\n\t\tw, n := itr.Next()\n\t\tif n == 0 {\n\t\t\tbr...
[ "0.8504498", "0.6812674", "0.67728424", "0.6678749", "0.66751015", "0.6630631", "0.66246307", "0.66168755", "0.65414244", "0.6417984", "0.6369643", "0.6345156", "0.6326942", "0.6302197", "0.6224095", "0.6205847", "0.6195354", "0.6176332", "0.6159858", "0.6153758", "0.6149981"...
0.8270534
1
mapSum computes the summation of values in an iterator.
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) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MapSum(itr Iterator) interface{} {\n\tn := float64(0)\n\tcount := 0\n\tvar resultType NumberType\n\tfor k, v := itr.Next(); k != -1; k, v = itr.Next() {\n\t\tcount++\n\t\tswitch n1 := v.(type) {\n\t\tcase float64:\n\t\t\tn += n1\n\t\tcase int64:\n\t\t\tn += float64(n1)\n\t\t\tresultType = Int64Type\n\t\t}\n\t...
[ "0.82898897", "0.70834136", "0.7009675", "0.6268281", "0.6250325", "0.62207806", "0.6212783", "0.6186013", "0.6122088", "0.6097039", "0.6060919", "0.60580987", "0.60206395", "0.5946613", "0.5935301", "0.5899053", "0.58673143", "0.585274", "0.5808694", "0.5794331", "0.5778898"...
0.8373971
0
newReducer returns a new instance of reducer.
func newReducer(e *Executor) *reducer { return &reducer{ executor: e, c: make(chan map[string]interface{}, 0), done: make(chan chan struct{}, 0), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewReducer(f func(*Ctx) *State) *ReduceFunc {\n\treturn &ReduceFunc{Func: f}\n}", "func newReconciler(mgr manager.Manager) *ReconcileCluster {\n\treturn &ReconcileCluster{\n\t\tClient: mgr.GetClient(),\n\t\tscheme: mgr.GetScheme(),\n\t\trecorder: mgr.GetEventRecorderFor(controllerName),\n\t}\n}", "fun...
[ "0.78301185", "0.5775491", "0.5751547", "0.57451856", "0.56922376", "0.5683029", "0.563016", "0.55568194", "0.554427", "0.55182046", "0.5517022", "0.5494841", "0.54838514", "0.54738325", "0.5473216", "0.5470393", "0.54662704", "0.5458371", "0.5450969", "0.5445709", "0.5444212...
0.8353731
0
start begins streaming values from the mappers and reducing them.
func (r *reducer) start() { for _, m := range r.mappers { m.start() } go r.run() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *mapper) start() {\n\tm.itr = m.executor.db.CreateIterator(m.seriesID, m.fieldID, m.typ,\n\t\tm.executor.min, m.executor.max, m.executor.interval)\n\tgo m.run()\n}", "func (w *SimpleMapReduce) Start() *SimpleMapReduce {\n if (w.hasStarted) {\n return w\n }\n\n w.hasStarted = true\n\n f...
[ "0.6495857", "0.6274932", "0.5855628", "0.5777703", "0.56839734", "0.5476287", "0.542622", "0.54102355", "0.53059393", "0.5219895", "0.5206251", "0.52048934", "0.49814385", "0.49803457", "0.4949015", "0.49386513", "0.49209532", "0.48929322", "0.48915768", "0.48896503", "0.488...
0.66319555
0
stop stops the reducer.
func (r *reducer) stop() { for _, m := range r.mappers { m.stop() } syncClose(r.done) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *reaper) stop() {\n\tr.stopCh <- struct{}{}\n}", "func (p *literalProcessor) stop() { syncClose(p.done) }", "func (e *binaryExprEvaluator) stop() {\n\te.lhs.stop()\n\te.rhs.stop()\n\tsyncClose(e.done)\n}", "func (m *mapper) stop() { syncClose(m.done) }", "func (w *worker) stop() {\n\tatomic.StoreIn...
[ "0.7372499", "0.69866097", "0.69120806", "0.6910597", "0.67642725", "0.6730798", "0.6723413", "0.67230844", "0.66535413", "0.6557976", "0.6547551", "0.6458109", "0.6292822", "0.6267955", "0.6254633", "0.62406087", "0.6202152", "0.61858034", "0.6176004", "0.61700773", "0.61688...
0.7991982
0
C returns the streaming data channel.
func (r *reducer) C() <-chan map[string]interface{} { return r.c }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Subscription) C() <-chan interface{} {\n\treturn s.channel\n}", "func (s *subscription) C() <-chan interface{} {\n\treturn s.c\n}", "func (c *dataReceivedClient) GetStream() rpcc.Stream { return c.Stream }", "func (uc *UnboundedChannel) Get() <-chan interface{} {\n\treturn uc.channel\n}", "func (l...
[ "0.6759161", "0.6602864", "0.61977434", "0.6079438", "0.6015766", "0.59815305", "0.5894958", "0.5827573", "0.5811892", "0.5789283", "0.5787107", "0.5769193", "0.5764194", "0.57620907", "0.5744001", "0.57320946", "0.5710497", "0.56509525", "0.56507605", "0.5619693", "0.5601790...
0.5659543
17
name returns the source name.
func (r *reducer) name() string { return r.stmt.Source.(*Measurement).Name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Source) Name() string {\n\treturn s.SourceName\n}", "func (s *Source) Name() string {\n\treturn \"spyse\"\n}", "func (r Source) GetName() string {\n\treturn r.Name\n}", "func (s *Source) Name() string {\n\treturn \"crtsh\"\n}", "func (e *Event) SourceName() collection.Name {\n\tif e.Source != nil ...
[ "0.78794163", "0.75167346", "0.7478469", "0.7449441", "0.7437304", "0.7387519", "0.73252875", "0.72747105", "0.7236276", "0.7090298", "0.7044449", "0.7044449", "0.6945361", "0.6810892", "0.68048626", "0.6776871", "0.6776871", "0.6724642", "0.6661173", "0.6651805", "0.6625454"...
0.64019334
28
run runs the reducer loop to read mapper output and reduce it.
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 { r.fn(k, v, r) } } // Mark the channel as complete. close(r.c) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *mapper) run() {\n\tfor m.itr.NextIterval() {\n\t\tm.fn(m.itr, m)\n\t}\n\tclose(m.c)\n}", "func (s *JsonEntryCounter) Mapper(r io.Reader, w io.Writer) error {\n\tlog.Printf(\"map_input_file %s\", os.Getenv(\"map_input_file\"))\n\twg, out := mrproto.JsonInternalOutputProtocol(w)\n\n\t// for efficient coun...
[ "0.73335505", "0.66919565", "0.66014", "0.63472444", "0.63170433", "0.6134042", "0.6113632", "0.61034", "0.6091675", "0.6070612", "0.606971", "0.60531396", "0.6034752", "0.6015037", "0.6009111", "0.6002563", "0.5961895", "0.58987963", "0.58896095", "0.5886267", "0.58567", "...
0.7995375
0
emit sends a value to the reducer's output channel.
func (r *reducer) emit(key string, value interface{}) { r.c <- map[string]interface{}{key: value} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c channelConveyor) Emit(v interface{}) error {\n\tc.outputCh <- v\n\n\treturn nil\n}", "func (m *mapper) emit(key int64, value interface{}) {\n\t// Encode the timestamp to the beginning of the key.\n\tbinary.BigEndian.PutUint64(m.key, uint64(key))\n\n\t// OPTIMIZE: Collect emit calls and flush all at once....
[ "0.7070084", "0.6710396", "0.6272342", "0.6061797", "0.59561294", "0.5938369", "0.5937713", "0.5937449", "0.58059376", "0.57770425", "0.5764841", "0.5728065", "0.57185686", "0.5700262", "0.56946415", "0.5682005", "0.5662726", "0.5661662", "0.5653689", "0.56264323", "0.5615777...
0.7351743
0
reduceSum computes the sum of values for each key.
func reduceSum(key string, values []interface{}, r *reducer) { var n float64 for _, v := range values { n += v.(float64) } r.emit(key, n) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Map) ReduceIntSum(reduce func(map[interface{}]interface{}) int) int {\n\tresult := 0\n\tsplits := m.splits\n\tfor i := 0; i < len(splits); i++ {\n\t\tresult += splits[i].reduceInt(reduce)\n\t}\n\treturn result\n}", "func (m *Map) ReduceStringSum(reduce func(map[interface{}]interface{}) string) string {\...
[ "0.6541231", "0.65324295", "0.6508142", "0.6394101", "0.6275276", "0.61889166", "0.6151819", "0.61230177", "0.6094462", "0.6012163", "0.59496427", "0.59375423", "0.58425725", "0.5835805", "0.5791891", "0.5786533", "0.57692206", "0.57538235", "0.5743269", "0.57314247", "0.5699...
0.80876577
0
newBinaryExprEvaluator returns a new instance of binaryExprEvaluator.
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), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewBinary(left Expr, op *token.T, right Expr) *Binary {\n\treturn &Binary{\n\t\tLeft: left,\n\t\tOperator: op,\n\t\tRight: right,\n\t}\n}", "func NewBinaryBooleanExpression(op OP, lE, rE Evaluator) (Evaluator, error) {\n\tswitch op {\n\tcase AND, OR:\n\t\treturn &booleanNode{\n\t\t\top: op,\n\t\t\tlS...
[ "0.7401786", "0.7397373", "0.7016201", "0.67983866", "0.6739764", "0.64406323", "0.63932383", "0.61820513", "0.6167331", "0.61307436", "0.6101428", "0.60082865", "0.5907112", "0.5907112", "0.5889629", "0.5865145", "0.5859371", "0.58282465", "0.5801955", "0.5753771", "0.571115...
0.888074
0
start begins streaming values from the lhs/rhs processors
func (e *binaryExprEvaluator) start() { e.lhs.start() e.rhs.start() go e.run() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *literalProcessor) start() { go p.run() }", "func (p *Pipe) start() {\n\tp.cancel = make(chan struct{})\n\terrcList := make([]<-chan error, 0, 1+len(p.processors)+len(p.sinks))\n\t// start pump\n\tout, errc := p.pump.run(p.cancel, p.ID(), p.provide, p.consume, p.sampleRate, p.metric)\n\terrcList = append...
[ "0.6233072", "0.6058875", "0.59076184", "0.58346933", "0.5613373", "0.55800617", "0.5572317", "0.5537268", "0.531643", "0.5313318", "0.5272919", "0.52699506", "0.52696264", "0.5269485", "0.5239846", "0.5237453", "0.5198518", "0.5177997", "0.5172955", "0.51625824", "0.5154037"...
0.6706518
0
stop stops the processor.
func (e *binaryExprEvaluator) stop() { e.lhs.stop() e.rhs.stop() syncClose(e.done) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *literalProcessor) stop() { syncClose(p.done) }", "func (r *reaper) stop() {\n\tr.stopCh <- struct{}{}\n}", "func (w *Processor) Stop() {\n\tclose(w.stop)\n}", "func (c *Controller) stop(name types.NamespacedName) {\n\tproc, ok := c.procs[name]\n\tif !ok {\n\t\treturn\n\t}\n\n\tif proc.cancelFunc == ...
[ "0.76916784", "0.76539624", "0.75390005", "0.7419075", "0.7382383", "0.734479", "0.7291145", "0.72867364", "0.71419865", "0.7018204", "0.6978908", "0.69516915", "0.69140995", "0.68218535", "0.67954063", "0.67853224", "0.677519", "0.6761666", "0.67545587", "0.67410165", "0.673...
0.0
-1
C returns the streaming data channel.
func (e *binaryExprEvaluator) C() <-chan map[string]interface{} { return e.c }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Subscription) C() <-chan interface{} {\n\treturn s.channel\n}", "func (s *subscription) C() <-chan interface{} {\n\treturn s.c\n}", "func (c *dataReceivedClient) GetStream() rpcc.Stream { return c.Stream }", "func (uc *UnboundedChannel) Get() <-chan interface{} {\n\treturn uc.channel\n}", "func (l...
[ "0.6759161", "0.6602864", "0.61977434", "0.6079438", "0.6015766", "0.59815305", "0.5894958", "0.5827573", "0.5811892", "0.5789283", "0.5787107", "0.5769193", "0.5764194", "0.57620907", "0.5744001", "0.57320946", "0.5710497", "0.5659543", "0.56507605", "0.5619693", "0.56017905...
0.56509525
18
name returns the source name.
func (e *binaryExprEvaluator) name() string { return "" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Source) Name() string {\n\treturn s.SourceName\n}", "func (s *Source) Name() string {\n\treturn \"spyse\"\n}", "func (r Source) GetName() string {\n\treturn r.Name\n}", "func (s *Source) Name() string {\n\treturn \"crtsh\"\n}", "func (e *Event) SourceName() collection.Name {\n\tif e.Source != nil ...
[ "0.78794163", "0.75167346", "0.7478469", "0.7449441", "0.7437304", "0.7387519", "0.73252875", "0.72747105", "0.7236276", "0.7090298", "0.7044449", "0.7044449", "0.6945361", "0.6810892", "0.68048626", "0.6776871", "0.6776871", "0.6724642", "0.6661173", "0.6651805", "0.6625454"...
0.0
-1
run runs the processor loop to read subprocessor output and combine it.
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 rhs { // Skip value if already processed in lhs loop. if _, ok := m[k]; ok { continue } m[k] = e.eval(float64(0), v) } // Return value. e.c <- m } // Mark the channel as complete. close(e.c) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *aggregator) Run() {\n\tgo a.submitter()\n\n\tfor m := range a.in {\n\t\tfor _, out_m := range a.process(m) {\n\t\t\ta.out <- out_m\n\t\t}\n\t}\n}", "func (p *SingleLineParser) run() {\n\tfor input := range p.inputChan {\n\t\tp.process(input)\n\t}\n\tp.lineHandler.Stop()\n}", "func (p *literalProcessor...
[ "0.6309216", "0.6276241", "0.62541133", "0.60858583", "0.59229887", "0.5826815", "0.58257556", "0.57818365", "0.57657427", "0.57529914", "0.57513297", "0.5672773", "0.5664691", "0.5659342", "0.5640284", "0.5628862", "0.5621618", "0.5619553", "0.5615171", "0.5578862", "0.55774...
0.5382721
33
eval evaluates two values using the evaluator's operation.
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 lhs.(float64) / rhs default: // TODO: Validate operation & data types. panic("invalid operation: " + e.op.String()) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func eval(binaryOp stmt.BinaryOP, left, right float64) float64 {\n\tswitch binaryOp {\n\tcase stmt.ADD:\n\t\treturn left + right\n\tcase stmt.SUB:\n\t\treturn left - right\n\tcase stmt.MUL:\n\t\treturn left * right\n\tcase stmt.DIV:\n\t\tif right == 0 {\n\t\t\treturn 0\n\t\t}\n\t\treturn left / right\n\tdefault:\n...
[ "0.71639663", "0.71103054", "0.68605703", "0.6728326", "0.67086935", "0.66818875", "0.66279435", "0.6556594", "0.65050507", "0.64583486", "0.6408754", "0.6372101", "0.63654286", "0.63654286", "0.6364129", "0.6360179", "0.626232", "0.6259256", "0.625477", "0.6253183", "0.62531...
0.7526083
0
newLiteralProcessor returns a literalProcessor for a given value.
func newLiteralProcessor(val interface{}) *literalProcessor { return &literalProcessor{ val: val, c: make(chan map[string]interface{}, 0), done: make(chan chan struct{}, 0), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewLiteral(value Object) Expression {\n\treturn &literal{value: value}\n}", "func NewProcessor(name string) *Processor {\n\tconst (\n\t\tramin = 0\n\t\tramax = 360\n\t\tdecmin = -90\n\t\tdecmax = +90\n\t\tnra = 36\n\t\tndec = 18\n\t)\n\n\treturn &Processor{\n\t\tname: name,\n\t\tmsg: logger....
[ "0.5704756", "0.5340582", "0.5268215", "0.5259007", "0.52381647", "0.5149707", "0.51186323", "0.50372", "0.49771982", "0.49668", "0.49517778", "0.49495387", "0.49202168", "0.4899631", "0.48374823", "0.48111275", "0.4775098", "0.47703588", "0.47358263", "0.47049072", "0.469465...
0.816712
0
C returns the streaming data channel.
func (p *literalProcessor) C() <-chan map[string]interface{} { return p.c }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Subscription) C() <-chan interface{} {\n\treturn s.channel\n}", "func (s *subscription) C() <-chan interface{} {\n\treturn s.c\n}", "func (c *dataReceivedClient) GetStream() rpcc.Stream { return c.Stream }", "func (uc *UnboundedChannel) Get() <-chan interface{} {\n\treturn uc.channel\n}", "func (l...
[ "0.6756691", "0.6601", "0.61970544", "0.6075765", "0.60143274", "0.59803826", "0.58934104", "0.5825283", "0.57866263", "0.5784679", "0.5767966", "0.57653207", "0.5760354", "0.57434285", "0.57309896", "0.5709145", "0.5659234", "0.56499964", "0.5649926", "0.56174", "0.56022227"...
0.58118516
8
process continually returns a literal value with a "0" key.
func (p *literalProcessor) start() { go p.run() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (sc *SafeCounter) Value(key string) int {\n\tsc.mux.Lock()\n\t// Lock so only one goroutine at a time can access the map sc.v\n\tdefer sc.mux.Unlock()\n\treturn sc.v[key]\n}", "func (p *intPool) getZero() *big.Int {\n\tif p.pool.len() > 0 {\n\t\treturn p.pool.pop().SetUint64(0)\n\t}\n\treturn new(big.Int)\n...
[ "0.5489842", "0.54571885", "0.5207902", "0.5192827", "0.515538", "0.515538", "0.5059694", "0.50570047", "0.5021366", "0.5017359", "0.50016963", "0.49647808", "0.49498284", "0.4916041", "0.48992616", "0.48711565", "0.4870216", "0.4869424", "0.4860917", "0.48558867", "0.4844697...
0.0
-1
run executes the processor loop.
func (p *literalProcessor) run() { for { select { case ch := <-p.done: close(ch) return case p.c <- map[string]interface{}{"": p.val}: } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *Executor) Run() { e.loop() }", "func (r *Runner) run() {\n\tfor {\n\t\ttask := r.rq.Pop()\n\t\tr.process(task)\n\t}\n}", "func (p *SingleLineParser) run() {\n\tfor input := range p.inputChan {\n\t\tp.process(input)\n\t}\n\tp.lineHandler.Stop()\n}", "func (s *Service) run() {\n\n\t// Create a communi...
[ "0.72341156", "0.7054074", "0.69522285", "0.69447345", "0.6864312", "0.68395716", "0.67777276", "0.6761646", "0.6760093", "0.6743983", "0.66867375", "0.66777253", "0.6674406", "0.66260815", "0.6612342", "0.65981054", "0.65792686", "0.6576595", "0.65697527", "0.65504754", "0.6...
0.712248
1
stop stops the processor from sending values.
func (p *literalProcessor) stop() { syncClose(p.done) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *reaper) stop() {\n\tr.stopCh <- struct{}{}\n}", "func (sl *ReceiverLoop) stop() {\n\tsl.cancel()\n\t<-sl.stopped\n}", "func (t *channelTransport) stop() {\n\tt.stopChan <- struct{}{}\n}", "func (d *D) stop() {\n\tclose(d.stopCh)\n}", "func (w *Processor) Stop() {\n\tclose(w.stop)\n}", "func (er ...
[ "0.7351431", "0.7231694", "0.71288663", "0.70204103", "0.69777024", "0.68193096", "0.67930245", "0.6749612", "0.6748719", "0.67416406", "0.67310125", "0.6711041", "0.6673169", "0.6668644", "0.6649103", "0.66150033", "0.6612311", "0.66082686", "0.6555046", "0.65514636", "0.652...
0.7386047
0
name returns the source name.
func (p *literalProcessor) name() string { return "" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Source) Name() string {\n\treturn s.SourceName\n}", "func (s *Source) Name() string {\n\treturn \"spyse\"\n}", "func (r Source) GetName() string {\n\treturn r.Name\n}", "func (s *Source) Name() string {\n\treturn \"crtsh\"\n}", "func (e *Event) SourceName() collection.Name {\n\tif e.Source != nil ...
[ "0.78794163", "0.75167346", "0.7478469", "0.7449441", "0.7437304", "0.7387519", "0.73252875", "0.72747105", "0.7236276", "0.7090298", "0.7044449", "0.7044449", "0.6945361", "0.6810892", "0.68048626", "0.6776871", "0.6776871", "0.6724642", "0.6661173", "0.6651805", "0.6625454"...
0.0
-1
syncClose closes a "done" channel and waits for a response.
func syncClose(done chan chan struct{}) { ch := make(chan struct{}, 0) done <- ch <-ch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Channel) Close() {\n\tclose(c.done)\n\tc.sharedDone()\n}", "func (o *Switch) CloseAsync() {\n\to.close()\n}", "func (r *SbProxy) closeDone() {\n\tr.doneOnce.Do(func() { close(r.doneCh) })\n}", "func Close() {\n\tcancelCh <- struct{}{}\n\t<-doneCh\n}", "func (a *Async) Close() {\n\ta.quit <- true\n...
[ "0.64019233", "0.6376821", "0.61740726", "0.5934891", "0.58843786", "0.5758393", "0.5754767", "0.5754767", "0.571977", "0.56921095", "0.5534144", "0.5531799", "0.5499394", "0.5489041", "0.5486152", "0.5458242", "0.54383165", "0.5437005", "0.5396349", "0.5362098", "0.5360334",...
0.8075955
0
tagsHash returns a hash of tag key/value pairs.
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() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ts *TagSet) Hash() (uint64, uint64) {\n\treturn ts.hashH, ts.hashL\n}", "func hash(ls prometheus.Tags) uint64 {\n\tlbs := make(labels.Labels, 0, len(ls))\n\tfor k, v := range ls {\n\t\tlbs = append(lbs, labels.Label{\n\t\t\tName: k,\n\t\t\tValue: v,\n\t\t})\n\t}\n\n\tsort.Slice(lbs[:], func(i, j int) bool...
[ "0.6286525", "0.6004645", "0.59311426", "0.56797147", "0.56032187", "0.5577137", "0.54982436", "0.53909326", "0.5379334", "0.53297776", "0.53186053", "0.5296071", "0.52821624", "0.52794707", "0.5247144", "0.52414274", "0.5201673", "0.51643705", "0.5162638", "0.515358", "0.514...
0.7376118
0
tagKeys returns a sorted list of tag keys.
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Measurement) TagKeys() []string {\n\tm.mu.RLock()\n\tdefer m.mu.RUnlock()\n\tkeys := make([]string, 0, len(m.seriesByTagKeyValue))\n\tfor k := range m.seriesByTagKeyValue {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\treturn keys\n}", "func (target *Target) TagKeys() []string {\n\n\tkeys :=...
[ "0.809159", "0.77590525", "0.767649", "0.76697975", "0.7639584", "0.75801903", "0.7515929", "0.72973794", "0.68380284", "0.67081636", "0.6610359", "0.6471081", "0.64383274", "0.6395813", "0.62597847", "0.62516946", "0.6238408", "0.6233503", "0.61932665", "0.6141229", "0.61276...
0.77027154
2
marshalStrings encodes an array of strings into a byte slice.
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MarshalStringSlice(item Any) []*string {\n\tvar data []*string\n\n\tswitch reflect.TypeOf(item).Kind() {\n\tcase reflect.Slice:\n\t\tval := reflect.ValueOf(item)\n\t\tmax := val.Len()\n\t\tfor i := 0; i < max; i++ {\n\t\t\ts := fmt.Sprint(val.Index(i).Interface())\n\t\t\tdata = append(data, &s)\n\t\t}\n\t}\n\...
[ "0.6619493", "0.62545997", "0.57310075", "0.56902635", "0.56827354", "0.56382436", "0.5633135", "0.5633135", "0.56282467", "0.5622973", "0.5592934", "0.5592934", "0.5557227", "0.55521715", "0.55445236", "0.55348366", "0.5509634", "0.54764235", "0.54658085", "0.5456215", "0.54...
0.78266716
0
unmarshalStrings decodes a byte slice into an array of strings.
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:] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func UnmarshalStrippedStringSlice(reader io.Reader, consumer runtime.Consumer) ([]StrippedString, error) {\n\tvar elements []json.RawMessage\n\tif err := consumer.Consume(reader, &elements); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar result []StrippedString\n\tfor _, element := range elements {\n\t\tobj, err ...
[ "0.6354693", "0.621544", "0.6198837", "0.6116478", "0.59895563", "0.59371823", "0.58865935", "0.5883952", "0.58423537", "0.5834272", "0.5758893", "0.5716716", "0.5696275", "0.5684589", "0.5683891", "0.56775504", "0.56536967", "0.5644599", "0.5643686", "0.5639748", "0.56235594...
0.7369895
0
logging a method calling information
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 := GetRequestIDFromContext(ctx) l = l.WithRequestID(requestID) l.Println("calling: " + info.FullMethod) if r, ok := req.(fmt.Stringer); ok { l.Println("Body: " + r.String()) } resp, err = handler(ctx, req) if resp != nil { if r, ok := resp.(fmt.Stringer); ok { l.Println("Body: " + r.String()) } } return resp, err } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *B) Log(args ...interface{})", "func (c *T) Log(args ...interface{})", "func Info(msg string) {\n log.Info(msg)\n}", "func (conf Configuration) OnCall(method string, cont Context, argument interface{}) {\n\tlog.Printf(\"%v %v: Called\\nContext=%# v\\nArgument=%# v\\n\\n\", conf.Name, method, p...
[ "0.67740566", "0.664917", "0.6611569", "0.6609859", "0.6541663", "0.6528878", "0.6526598", "0.6499431", "0.6489033", "0.64533347", "0.63796335", "0.63693124", "0.63527495", "0.6341607", "0.63408357", "0.63373005", "0.6324299", "0.63202775", "0.6287711", "0.62851906", "0.62477...
0.0
-1
parse exactly one level
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 err != nil { return nil, err } pkg, err := server.framePackage(r.Resource, input) pkg.ID = r.ID return pkg, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func parse(ts *TokenScanner) (*Tree, error) {\n\tvar tree *Tree\n\n\t// Insert dummy head to enable simplified recursion logic\n\ttree, _ = InitTree(Symbol{Dummy, dummyName})\n\n\tfor ts.hasNext() {\n\t\ttoken := ts.next()\n\n\t\tif chatty {\n\t\t\tfmt.Println(\"» parsing token =\", token)\n\t\t}\n\n\t\terr := ing...
[ "0.58363867", "0.57795185", "0.5726749", "0.5672688", "0.5513443", "0.54041326", "0.5377714", "0.53473246", "0.5279886", "0.52769583", "0.5236373", "0.51813304", "0.5177548", "0.5163188", "0.5162664", "0.51265293", "0.5125453", "0.51065844", "0.50366247", "0.50332594", "0.499...
0.0
-1
GetBroadcastPayload will return the object to send to all chat users.
func (e *UserDisabledEvent) GetBroadcastPayload() EventPayload { return EventPayload{ "type": ErrorUserDisabled, "id": e.ID, "timestamp": e.Timestamp, "user": e.User, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d delegate) GetBroadcasts(overhead, limit int) [][]byte { return nil }", "func (gd *GossipDelegate) GetBroadcasts(overhead, limit int) [][]byte {\n\tvar test [][]byte\n\ts1, _ := json.Marshal(gd.nodeId)\n\ts2, _ := json.Marshal(\"test_string\")\n\ttest = append(test, s1)\n\ttest = append(test, s2)\n\tretur...
[ "0.588773", "0.58685297", "0.5810341", "0.5681333", "0.5568869", "0.55119294", "0.5473713", "0.54418457", "0.54224706", "0.54075783", "0.5393018", "0.5365551", "0.53186834", "0.52261513", "0.52187634", "0.5189766", "0.5181955", "0.5167827", "0.5162568", "0.51217777", "0.51200...
0.71547204
0
CreateAlbum queries the Imgur API in order to create an anonymous album, using a client ID
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.Client{} r, _ := http.NewRequest("POST", urlStr, strings.NewReader(data.Encode())) // URL-encoded payload r.Header.Add("Authorization", "Client-ID "+clientID) r.Header.Add("Content-Type", "application/x-www-form-urlencoded") r.Header.Add("Content-Length", strconv.Itoa(len(data.Encode()))) resp, _ := client.Do(r) var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) nestedMap := result["data"] newMap, _ := nestedMap.(map[string]interface{}) albumID = newMap["id"] deleteHash = newMap["deletehash"] fmt.Println(color.GreenString("\n[+]"), "Successfully created an album with the following values:") fmt.Println(color.GreenString("albumID:"), albumID, color.GreenString("Album DeleteHash:"), deleteHash) fmt.Println(" ") return albumID, deleteHash }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Service) Create(ctx context.Context, title string) (*Album, error) {\n\treq := &photoslibrary.CreateAlbumRequest{\n\t\tAlbum: &photoslibrary.Album{Title: title},\n\t}\n\tres, err := s.photos.Create(req).Context(ctx).Do()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating album: %w\", err)\n\t}\n\ta...
[ "0.64363945", "0.62115777", "0.6173034", "0.6124928", "0.60992676", "0.5975251", "0.5954263", "0.5921158", "0.5825856", "0.5802341", "0.57515854", "0.569839", "0.567057", "0.56693417", "0.5629028", "0.549317", "0.5457849", "0.5339119", "0.5260204", "0.52040607", "0.5150722", ...
0.7381877
0
GetAlbumImages is a function that supposed to retrieve response images
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.Close() if err != nil { fmt.Println(err) } client := &http.Client{} req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } req.Header.Add("Authorization", "Client-ID "+clientID) req.Header.Set("Content-Type", writer.FormDataContentType()) res, err := client.Do(req) if err != nil { fmt.Println("[-] Error connecting:", err) } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) var results AlbumImages errr := json.Unmarshal([]byte(body), &results) if errr != nil { fmt.Println("[!] Error unmarshalling::", errr) } datavalues := results.Data if results.Success == true { for field := range datavalues { if strings.Contains(datavalues[field].Description, "response") { fmt.Println("[+] ImageID:", datavalues[field].ID) fmt.Println("[+] ImageTitle:", datavalues[field].Title) fmt.Println("[+] Description:", datavalues[field].Description) fmt.Println("[+] ImageLink:", datavalues[field].Link) fmt.Println(" ") responseURL = datavalues[field].Link } // fmt.Println("[+] Logic worked and got a response from a client: ", datavalues[field].Link) } } return responseURL }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetImagesForAlbumV1(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tuuidParam := params[\"uuid\"]\n\n\timageModels := service.CreateDefaultImageService().GetAllImagesForAlbum(uuid.MustParse(uuidParam))\n\tdata, _ := json.Marshal(imageModels)\n\t_, _ = w.Write(data)\n\n}", "func showIma...
[ "0.78062147", "0.75835025", "0.7488234", "0.7022131", "0.69949764", "0.6842922", "0.68154794", "0.66601187", "0.6651162", "0.6643078", "0.652421", "0.65002805", "0.6458088", "0.64554036", "0.6439885", "0.64233345", "0.63966346", "0.6379913", "0.6376665", "0.6360784", "0.63584...
0.7720157
1
GetLinkClient is a function is to grab the tasking link for the client
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) } client := &http.Client{} req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } req.Header.Add("Authorization", "Client-ID "+clientID) req.Header.Set("Content-Type", writer.FormDataContentType()) res, err := client.Do(req) if err != nil { fmt.Println("[-] Error connecting:", err) } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) var results AlbumImages errr := json.Unmarshal([]byte(body), &results) if errr != nil { fmt.Println("[!] Error unmarshalling::", errr) } datavalues := results.Data if results.Success == true { imageLink = datavalues[0].Link } return imageLink }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetLink(key string) (string, error) {\n\treturn RedisClient.Get(Ctx, key).Result()\n}", "func OIDCGetLink(discoveryURL, clientID, clientSecret, redirectURL string) (string, error) {\n\tctx := context.Background()\n\tprovider, err := oidc.NewProvider(ctx, discoveryURL)\n\tif err != nil {\n\t\treturn \"\", er...
[ "0.62175614", "0.6116539", "0.60092264", "0.5966208", "0.5790656", "0.5755509", "0.5704431", "0.5681741", "0.5604399", "0.560293", "0.55288225", "0.5463221", "0.544955", "0.54428774", "0.5407513", "0.5407395", "0.5405211", "0.5400451", "0.539615", "0.53931314", "0.53883725", ...
0.6794283
0
DeleteAlbum will delete a given album
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.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } req.Header.Add("Authorization", "Client-ID "+clientID) req.Header.Set("Content-Type", writer.FormDataContentType()) res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) } if strings.Contains(string(body), "200") { fmt.Println(color.GreenString("[+]"), "Delete was a success") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func deleteAlbum(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\",\"application/json\")\n\tparam := mux.Vars(r)\n\t//CQL Operation\n\tif err:= Session.Query(`DELETE FROM albumtable WHERE albname=? IF EXISTS;`,param[\"album\"]).Exec();err!=nil {\n\t\tfmt.Println(err)\n\t} else {\n\t\tfmt...
[ "0.7706165", "0.7658952", "0.75001156", "0.6861333", "0.64253026", "0.63472575", "0.6216661", "0.5676933", "0.55586964", "0.544517", "0.543593", "0.5422393", "0.52709895", "0.52666813", "0.51891136", "0.5181241", "0.5172769", "0.5160368", "0.5138855", "0.51251847", "0.5108209...
0.77250826
0
NewCreateStorageV1CSINodeOK creates CreateStorageV1CSINodeOK with default headers values
func NewCreateStorageV1CSINodeOK() *CreateStorageV1CSINodeOK { return &CreateStorageV1CSINodeOK{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateStorageV1CSINodeOK) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeOK {\n\to.Payload = payload\n\treturn o\n}", "func CreateBucket(w http.ResponseWriter, r *http.Request) *appError {\n decoder := json.NewDecoder(r.Body)\n var ecsBucket ECSBucket\n err := decoder.De...
[ "0.55036443", "0.5441542", "0.54345405", "0.53376144", "0.5327419", "0.5230142", "0.5220554", "0.51865524", "0.5161279", "0.51439565", "0.51330143", "0.5099054", "0.5083778", "0.50006616", "0.49205598", "0.49018854", "0.4880663", "0.48625007", "0.4858393", "0.48457134", "0.48...
0.6698065
0
WithPayload adds the payload to the create storage v1 c s i node o k response
func (o *CreateStorageV1CSINodeOK) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeOK { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateStorageV1CSINodeOK) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *CreateStorageV1CSINodeCreated) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *ReplaceStorageV1CSINodeCreated) SetPayload(payload *models....
[ "0.62328905", "0.61603296", "0.5820772", "0.58046573", "0.5724808", "0.56804353", "0.549075", "0.54602885", "0.5446634", "0.54446435", "0.53883576", "0.5381992", "0.53013504", "0.5258901", "0.52294034", "0.5212655", "0.5201414", "0.51650834", "0.5115418", "0.511022", "0.51075...
0.5819
3
SetPayload sets the payload to the create storage v1 c s i node o k response
func (o *CreateStorageV1CSINodeOK) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateStorageV1CSINodeCreated) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *ReplaceStorageV1CSINodeCreated) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *CreateClusterCreated) SetPayload(payload *models.Klus...
[ "0.70977515", "0.6899386", "0.68568575", "0.67074084", "0.6604878", "0.6598248", "0.65638936", "0.65335", "0.652902", "0.65217173", "0.65172774", "0.65045047", "0.64854646", "0.6482898", "0.64746904", "0.6470571", "0.64697737", "0.6460338", "0.6450474", "0.64481056", "0.64326...
0.71910954
0
WriteResponse to the client
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 } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81291586", "0.78819287", "0.77723724", "0.7772298", "0.77532965", "0.7740895", "0.7667328", "0.76388013", "0.76095575", "0.75802743", "0.75792146", "0.7567954", "0.75612247", "0.7558208", "0.7545076", "0.75431097", "0.7542526", "0.7535154", "0.75308895", "0.75206727", "0.7...
0.0
-1
NewCreateStorageV1CSINodeCreated creates CreateStorageV1CSINodeCreated with default headers values
func NewCreateStorageV1CSINodeCreated() *CreateStorageV1CSINodeCreated { return &CreateStorageV1CSINodeCreated{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCreateStorageV1CSINodeOK() *CreateStorageV1CSINodeOK {\n\n\treturn &CreateStorageV1CSINodeOK{}\n}", "func (o *CreateStorageV1CSINodeCreated) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeCreated {\n\to.Payload = payload\n\treturn o\n}", "func NewReplaceStorageV1CSINodeCre...
[ "0.63876355", "0.62214833", "0.6077855", "0.59198743", "0.56860864", "0.5582383", "0.54800385", "0.54257023", "0.5290674", "0.52353966", "0.51229566", "0.5113833", "0.51082814", "0.4998811", "0.49861813", "0.4984951", "0.4984342", "0.4967947", "0.4932291", "0.48867834", "0.48...
0.64319515
0
WithPayload adds the payload to the create storage v1 c s i node created response
func (o *CreateStorageV1CSINodeCreated) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeCreated { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateStorageV1CSINodeCreated) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *CreateStorageV1CSINodeOK) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *ReplaceStorageV1CSINodeCreated) SetPayload(payload *models....
[ "0.6338703", "0.60790515", "0.5919006", "0.58873206", "0.5695712", "0.5632205", "0.5612034", "0.55868226", "0.53464735", "0.53214085", "0.5319903", "0.531182", "0.5279762", "0.52675426", "0.5255923", "0.5247841", "0.5237737", "0.5233633", "0.5189792", "0.5189389", "0.51761854...
0.6029008
2
SetPayload sets the payload to the create storage v1 c s i node created response
func (o *CreateStorageV1CSINodeCreated) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateStorageV1CSINodeOK) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *ReplaceStorageV1CSINodeCreated) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *CreateClusterCreated) SetPayload(payload *models.Kluster) ...
[ "0.6970405", "0.689244", "0.66865474", "0.6685111", "0.6621812", "0.64798963", "0.6440759", "0.6422618", "0.64157015", "0.6409855", "0.63932294", "0.63880134", "0.6366237", "0.63556445", "0.63401204", "0.6314925", "0.63056827", "0.6305267", "0.6303207", "0.6301179", "0.629590...
0.71794635
0
WriteResponse to the client
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 } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81291586", "0.78819287", "0.77723724", "0.7772298", "0.77532965", "0.7740895", "0.7667328", "0.76388013", "0.76095575", "0.75802743", "0.75792146", "0.7567954", "0.75612247", "0.7558208", "0.7545076", "0.75431097", "0.7542526", "0.7535154", "0.75308895", "0.75206727", "0.7...
0.0
-1
NewCreateStorageV1CSINodeAccepted creates CreateStorageV1CSINodeAccepted with default headers values
func NewCreateStorageV1CSINodeAccepted() *CreateStorageV1CSINodeAccepted { return &CreateStorageV1CSINodeAccepted{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateStorageV1CSINodeAccepted) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeAccepted {\n\to.Payload = payload\n\treturn o\n}", "func NewCreateStorageV1CSINodeOK() *CreateStorageV1CSINodeOK {\n\n\treturn &CreateStorageV1CSINodeOK{}\n}", "func (o *CreateStorageV1CSINodeC...
[ "0.6550843", "0.55447596", "0.51314604", "0.51048374", "0.5060699", "0.49805027", "0.49471223", "0.48731118", "0.48619592", "0.48555326", "0.48495626", "0.46945184", "0.46536338", "0.46142438", "0.46005222", "0.45983022", "0.45870212", "0.45816574", "0.45782784", "0.4557088", ...
0.7195267
0
WithPayload adds the payload to the create storage v1 c s i node accepted response
func (o *CreateStorageV1CSINodeAccepted) WithPayload(payload *models.IoK8sAPIStorageV1CSINode) *CreateStorageV1CSINodeAccepted { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateStorageV1CSINodeOK) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *CreateStorageV1CSINodeAccepted) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *CreateStorageV1CSINodeCreated) SetPayload(payload *models....
[ "0.627085", "0.6215604", "0.61715865", "0.59497446", "0.57963955", "0.56648123", "0.56416273", "0.5595874", "0.5580302", "0.5535439", "0.5465944", "0.5458563", "0.54470605", "0.541537", "0.5410048", "0.54049134", "0.53622574", "0.53558326", "0.5351057", "0.5330016", "0.531184...
0.5685385
5
SetPayload sets the payload to the create storage v1 c s i node accepted response
func (o *CreateStorageV1CSINodeAccepted) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateStorageV1CSINodeOK) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *CreateStorageV1CSINodeCreated) SetPayload(payload *models.IoK8sAPIStorageV1CSINode) {\n\to.Payload = payload\n}", "func (o *ReplaceStorageV1CSINodeCreated) SetPayload(payload *models....
[ "0.7258962", "0.7145782", "0.70588064", "0.6841116", "0.68142986", "0.6806926", "0.6750216", "0.6683009", "0.6675377", "0.6666445", "0.666559", "0.6665555", "0.66296804", "0.6620157", "0.65994805", "0.65844", "0.658369", "0.6582246", "0.65736467", "0.65595233", "0.6543955", ...
0.6972805
3
WriteResponse to the client
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 } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81291586", "0.78819287", "0.77723724", "0.7772298", "0.77532965", "0.7740895", "0.7667328", "0.76388013", "0.76095575", "0.75802743", "0.75792146", "0.7567954", "0.75612247", "0.7558208", "0.7545076", "0.75431097", "0.7542526", "0.7535154", "0.75308895", "0.75206727", "0.7...
0.0
-1
NewCreateStorageV1CSINodeUnauthorized creates CreateStorageV1CSINodeUnauthorized with default headers values
func NewCreateStorageV1CSINodeUnauthorized() *CreateStorageV1CSINodeUnauthorized { return &CreateStorageV1CSINodeUnauthorized{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewReplaceStorageV1CSINodeUnauthorized() *ReplaceStorageV1CSINodeUnauthorized {\n\n\treturn &ReplaceStorageV1CSINodeUnauthorized{}\n}", "func NewReplaceStorageV1CSINodeUnauthorized() *ReplaceStorageV1CSINodeUnauthorized {\n\treturn &ReplaceStorageV1CSINodeUnauthorized{}\n}", "func NewWatchStorageV1CSINode...
[ "0.6248607", "0.6122658", "0.61036927", "0.55000645", "0.53274125", "0.52621156", "0.5260533", "0.51208663", "0.50959045", "0.504985", "0.5015619", "0.49926725", "0.49710575", "0.4961555", "0.4877436", "0.48435402", "0.48254943", "0.47950625", "0.4785675", "0.47426367", "0.47...
0.71874326
0
WriteResponse to the client
func (o *CreateStorageV1CSINodeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses rw.WriteHeader(401) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81303823", "0.7882039", "0.77722245", "0.7771901", "0.7753117", "0.7740585", "0.76670325", "0.7638451", "0.76095873", "0.75798", "0.7579178", "0.7567389", "0.7560546", "0.75579476", "0.75447774", "0.7542929", "0.75416607", "0.753386", "0.7531158", "0.75192654", "0.75191355...
0.0
-1
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) Descriptor() ([]byte, []int) { return file_proto_sample_proto_rawDescGZIP(), []int{0} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*HelloRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_hello_proto_rawDescGZIP(), []int{0}\n}", "func (*HelloRequest) Descriptor() ([]byte, []int) {\n\treturn file_helloworld_helloworld_proto_rawDescGZIP(), []int{0}\n}", "func (*HelloRequest) Descriptor() ([]byte, []int) {\n\treturn file_hell...
[ "0.7447499", "0.7389765", "0.7389765", "0.7376233", "0.73273814", "0.7258341", "0.72158563", "0.7211136", "0.7184502", "0.71610767", "0.71385276", "0.7132852", "0.7113669", "0.6983269", "0.69459534", "0.6927341", "0.67780125", "0.6756823", "0.6741548", "0.67001593", "0.667088...
0.7184086
9
Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
func (*HelloResponse) Descriptor() ([]byte, []int) { return file_proto_sample_proto_rawDescGZIP(), []int{1} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*HelloResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_hello_proto_rawDescGZIP(), []int{1}\n}", "func (*SayHelloResponse) Descriptor() ([]byte, []int) {\n\treturn file_helloworld_proto_rawDescGZIP(), []int{1}\n}", "func (*SayHelloResponse) Descriptor() ([]byte, []int) {\n\treturn file_runtim...
[ "0.7270073", "0.7144889", "0.7027907", "0.69991654", "0.68775064", "0.68553793", "0.6839564", "0.6839564", "0.68357813", "0.682933", "0.68044037", "0.68022704", "0.6790483", "0.6787987", "0.6772483", "0.67659074", "0.67601085", "0.67564195", "0.67393154", "0.671657", "0.67092...
0.702858
2
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) Descriptor() ([]byte, []int) { return file_proto_sample_proto_rawDescGZIP(), []int{2} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*CreateUserRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_user_service_proto_rawDescGZIP(), []int{9}\n}", "func (*CreateUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_user_proto_rawDescGZIP(), []int{6}\n}", "func (*CreateUserRequest) Descriptor() ([]byte, []in...
[ "0.79096454", "0.788088", "0.7824297", "0.7808451", "0.77528954", "0.7738215", "0.7722104", "0.7667685", "0.76562274", "0.7611232", "0.7585692", "0.74919266", "0.74665475", "0.7440994", "0.7440994", "0.7429693", "0.7428761", "0.7415253", "0.7392637", "0.7294176", "0.7281565",...
0.7592327
10
Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) Descriptor() ([]byte, []int) { return file_proto_sample_proto_rawDescGZIP(), []int{3} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*CreateUserResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{3}\n}", "func (*CreateUserResponse) Descriptor() ([]byte, []int) {\n\treturn file_protob_user_service_proto_rawDescGZIP(), []int{6}\n}", "func (*CreateUserRequest) Descriptor() ([]byte, []int) {\n\tre...
[ "0.7710605", "0.7689471", "0.7646486", "0.7620154", "0.760239", "0.75994676", "0.75860673", "0.75829166", "0.7570726", "0.75582385", "0.7552537", "0.7528463", "0.7508784", "0.7497497", "0.7491163", "0.74756175", "0.7465579", "0.7414428", "0.73890996", "0.7377724", "0.7337647"...
0.74742067
16
Deprecated: Use ProxyRequest.ProtoReflect.Descriptor instead.
func (*ProxyRequest) Descriptor() ([]byte, []int) { return file_proto_sample_proto_rawDescGZIP(), []int{4} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*ProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_url_proto_rawDescGZIP(), []int{5}\n}", "func (*UpdateReverseProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_reverse_proxy_proto_rawDescGZIP(), []int{9}\n}", "func (*ListenRequest) Descriptor() ([]byte, []int) {\n\tretu...
[ "0.7247715", "0.6779651", "0.6682698", "0.666076", "0.6614722", "0.66008824", "0.6595267", "0.6572151", "0.65490466", "0.65459406", "0.6542178", "0.65279186", "0.6515722", "0.6475382", "0.64694345", "0.6464632", "0.6456122", "0.64516634", "0.6447801", "0.6447006", "0.6446291"...
0.7129833
1
Deprecated: Use ProxyResponse.ProtoReflect.Descriptor instead.
func (*ProxyResponse) Descriptor() ([]byte, []int) { return file_proto_sample_proto_rawDescGZIP(), []int{5} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*ProxyResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_url_proto_rawDescGZIP(), []int{6}\n}", "func (*ListenResponse) Descriptor() ([]byte, []int) {\n\treturn file_faultinjector_proto_rawDescGZIP(), []int{9}\n}", "func (*AddPeerResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_c...
[ "0.7105832", "0.67619485", "0.66736144", "0.6664114", "0.6658084", "0.66193265", "0.6603035", "0.65962255", "0.6588789", "0.6581428", "0.65801454", "0.6566071", "0.65583223", "0.6553807", "0.654606", "0.6514046", "0.6500954", "0.6491214", "0.64790255", "0.64641875", "0.644789...
0.6940781
1
Native returns a pointer to the underlying PangoLayout.
func (v *Context) Native() uintptr { return uintptr(unsafe.Pointer(v.native())) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (tv *TextView) ParentLayout() *gi.Layout {\n\tif tv.Par == nil {\n\t\treturn nil\n\t}\n\tpari, _ := gi.KiToNode2D(tv.Par)\n\treturn pari.AsLayout2D()\n}", "func (w *WidgetImplement) Layout() Layout {\n\treturn w.layout\n}", "func (obj *GenericMeasure) GetLayoutRaw(ctx context.Context) (json.RawMessage, er...
[ "0.539174", "0.52555996", "0.52151483", "0.52117836", "0.51357627", "0.5078264", "0.5049439", "0.49843845", "0.49271524", "0.4918036", "0.48844993", "0.48744643", "0.48683408", "0.4788148", "0.4753523", "0.4732755", "0.46843067", "0.4650018", "0.46077663", "0.45780843", "0.45...
0.417509
66
Fields of the UnitOfMedicine.
func (UnitOfMedicine) Fields() []ent.Field { return []ent.Field{ field.String("name"), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (Medicalfile) Fields() []ent.Field {\n return []ent.Field{\n\t\tfield.String(\"detail\").NotEmpty(),\n\t\tfield.Time(\"added_time\"),\n }\n}", "func (m *ShowMeasurementsMapper) Fields() []string { return []string{\"name\"} }", "func (Medicaltreatmentrights) Fields() []ent.Field {\n\treturn nil\n}", ...
[ "0.6509575", "0.6264373", "0.6188049", "0.6157899", "0.6049675", "0.60006136", "0.5949632", "0.58961743", "0.58914924", "0.58752203", "0.5866089", "0.58512133", "0.5821629", "0.58048886", "0.57917094", "0.5787944", "0.5744302", "0.5719868", "0.57150173", "0.568302", "0.566609...
0.81105506
0
Edges of the UnitOfMedicine.
func (UnitOfMedicine) Edges() []ent.Edge { return []ent.Edge{ edge.To("Medicine", Medicine.Type), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (Physician) Edges() []ent.Edge {\n return []ent.Edge{\n edge.To(\"Physician\", Patientofphysician.Type),\n \n }\n}", "func (LevelOfDangerous) Edges() []ent.Edge {\r\n\treturn []ent.Edge{\r\n\t\tedge.To(\"Medicine\", Medicine.Type),\r\n\t}\r\n}", "func (Medicalfile) Edges() []ent.Edge {...
[ "0.5982618", "0.5862496", "0.56688166", "0.54881394", "0.54257953", "0.53255206", "0.52897364", "0.5236274", "0.5192016", "0.51388514", "0.51366216", "0.512988", "0.5058522", "0.50200945", "0.5015581", "0.5001819", "0.4978672", "0.4976712", "0.49593082", "0.4959274", "0.49556...
0.7619897
0
New creates a new DB wrapper around LMDB
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 != nil { return nil, errors.Wrap(err, "map size failed") } if err = env.SetFlags(cfg.EnvFlags); err != nil { return nil, errors.Wrap(err, "set flag") } os.MkdirAll(folder, os.ModePerm) err = env.Open(folder, 0, cfg.Mode) if err != nil { return nil, errors.Wrap(err, "open env") } var staleReaders int if staleReaders, err = env.ReaderCheck(); err != nil { return nil, errors.Wrap(err, "reader check") } if staleReaders > 0 { log.Printf("cleared %d reader slots from dead processes", staleReaders) } var dbi lmdb.DBI err = env.Update(func(txn *lmdb.Txn) (err error) { dbi, err = txn.CreateDBI("agg") return err }) if err != nil { return nil, errors.Wrap(err, "create DB") } return &DB{env, dbi}, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func dbNew() *DB {\n\treturn &DB{\n\t\tdata: make(map[string]string),\n\t}\n}", "func New(ctx context.Context, ng engine.Engine) (*DB, error) {\n\treturn newDatabase(ctx, ng, database.Options{Codec: msgpack.NewCodec()})\n}", "func New(tb testing.TB, dir string, ver string, logger func(string)) (*DB, error) {\n...
[ "0.7543629", "0.74328727", "0.73548853", "0.7302741", "0.72663367", "0.7214843", "0.7162632", "0.7141212", "0.7136986", "0.7118748", "0.70599926", "0.70599926", "0.6947913", "0.6931758", "0.687707", "0.68690205", "0.6860632", "0.6831759", "0.6822207", "0.6798072", "0.6788559"...
0.66963005
28
NewConnection creates a new PGSQLConnection by using the URL found in the DATABASE_URL environment variable
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewConnection(cfg config.PostgresConfig) (client *sqlt.DB, err error) {\n\tDSN := fmt.Sprintf(\"host=%s port=5432 dbname=%s user=%s password=%s sslmode=disable\", cfg.Host, cfg.Name, cfg.User, cfg.Password)\n\n\tclient, err = sqlt.Open(\"postgres\", DSN)\n\tif err != nil {\n\t\treturn\n\t}\n\tclient.SetMaxOpe...
[ "0.7518975", "0.74835324", "0.73841846", "0.71606356", "0.7159095", "0.7137663", "0.7134973", "0.7128595", "0.70870835", "0.7032927", "0.6934409", "0.6895356", "0.6789603", "0.67831814", "0.6710152", "0.6689289", "0.6680991", "0.66804385", "0.6673196", "0.665048", "0.6578278"...
0.7736596
0
GetCluster retrieves the cluster associated with clusterName
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *ClusterProvider) GetCluster(ctx context.Context, clusterName string) (*ekstypes.Cluster, error) {\n\tinput := &awseks.DescribeClusterInput{\n\t\tName: &clusterName,\n\t}\n\n\toutput, err := c.AWSProvider.EKS().DescribeCluster(ctx, input)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to de...
[ "0.73472095", "0.7320279", "0.7242377", "0.72404385", "0.7170976", "0.7071498", "0.70645136", "0.70029813", "0.69894564", "0.6943833", "0.6940147", "0.6904284", "0.6854848", "0.6852869", "0.68033123", "0.6754213", "0.6730921", "0.6670034", "0.6630054", "0.66086984", "0.660349...
0.6456914
27
UpdateCluster updates a clusters color in the database
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() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func UpdateCluster(c *gin.Context) {\n\n\tbanzaiUtils.LogInfo(banzaiConstants.TagGetClusterInfo, \"Bind json into UpdateClusterRequest struct\")\n\n\t// bind request body to UpdateClusterRequest struct\n\tvar updateRequest banzaiTypes.UpdateClusterRequest\n\tif err := c.BindJSON(&updateRequest); err != nil {\n\t\t...
[ "0.7014352", "0.6270054", "0.62487537", "0.6182928", "0.60382164", "0.6028397", "0.60236835", "0.5977827", "0.5935069", "0.5872368", "0.58574164", "0.5826638", "0.5802612", "0.58015263", "0.57943857", "0.5768504", "0.57651097", "0.5699339", "0.5636026", "0.56122804", "0.55858...
0.7731305
0
GetAllClusters retrieves all clusters in database
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (us *ClusterStore) GetAll() ([]model.Cluster, error) {\n\tvar cs []model.Cluster\n\tif err := us.db.Preload(clause.Associations).Find(&cs).Error; err != nil {\n\t\tif errors.Is(err, gorm.ErrRecordNotFound) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn cs, nil\n}", "func ListAllClusters...
[ "0.7434148", "0.74044824", "0.73684704", "0.7240104", "0.7201324", "0.69922847", "0.6839233", "0.68016887", "0.67140263", "0.6702199", "0.66942024", "0.6630261", "0.6588179", "0.655754", "0.65555376", "0.6553293", "0.65469146", "0.6503564", "0.64957535", "0.6469443", "0.64679...
0.78800476
0
CreateCluster inserts a new cluster into the database
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() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateCluster(request *restful.Request, response *restful.Response) {\n\tstart := time.Now()\n\n\tform := CreateClusterForm{}\n\t_ = request.ReadEntity(&form)\n\n\terr := utils.Validate.Struct(&form)\n\tif err != nil {\n\t\tmetrics.ReportRequestAPIMetrics(\"CreateCluster\", request.Request.Method, metrics.Err...
[ "0.8185021", "0.78084165", "0.7425226", "0.7330281", "0.7253956", "0.723301", "0.7183776", "0.71564835", "0.7125142", "0.70509756", "0.7045551", "0.7010462", "0.69699454", "0.69615054", "0.69457465", "0.68583614", "0.68540156", "0.6843783", "0.6820751", "0.68091303", "0.68073...
0.7769736
2
DeleteCluster deletes the cluster from the database
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() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *client) DeleteCluster() error {\n\t_, err := c.runCmd(\"cluster\", \"delete\", c.clusterName)\n\treturn err\n}", "func DeleteCluster(c *gin.Context) {\n\n\tbanzaiUtils.LogInfo(banzaiConstants.TagDeleteCluster, \"Delete cluster start\")\n\n\tcl, err := cloud.GetClusterFromDB(c)\n\tif err != nil {\n\t\tre...
[ "0.77345514", "0.7503085", "0.74316007", "0.73912096", "0.7315511", "0.72915375", "0.72617304", "0.72506875", "0.71797746", "0.71408546", "0.71262103", "0.70984936", "0.70816237", "0.6998919", "0.69962054", "0.69699913", "0.6955641", "0.6786505", "0.67715704", "0.6723802", "0...
0.7714795
1
GenCerts generate a CA cert or a server cert signed by CA cert if isCA is true, the outfile will be a CA cert/key named as cacert.pem/cakey.pem if isCA is false, the outfile will be named as is, for example, outfilecert.pem, outfilekey.pem
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"}, }, NotBefore: time.Now(), NotAfter: time.Now().Add(time.Hour * 24 * 3650), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, BasicConstraintsValid: true, } var ( cakey *ecdsa.PrivateKey cacrt *x509.Certificate derBytes []byte ) // valid for these names if isCA { template.IsCA = true template.KeyUsage |= x509.KeyUsageCertSign outname = "ca" derBytes, err = x509.CreateCertificate(rand.Reader, &template, &template, publicKey(priv), priv) if err != nil { return fmt.Errorf("Failed to create certificate: %v", err) } } else { for _, h := range hosts { if ip := net.ParseIP(h); ip != nil { template.IPAddresses = append(template.IPAddresses, ip) } else { template.DNSNames = append(template.DNSNames, h) } } // ca key file ca_data, err := os.ReadFile("ca-key.pem") if err != nil { return fmt.Errorf("Read ca-key.pem: %v", err) } block, _ := pem.Decode(ca_data) cakey, _ = x509.ParseECPrivateKey(block.Bytes) // ca cert file ca_data, err = os.ReadFile("ca-cert.pem") if err != nil { return fmt.Errorf("Read ca-cert.pem: %v", err) } block, _ = pem.Decode(ca_data) cacrt, _ = x509.ParseCertificate(block.Bytes) // generate C2 server certificate, signed by our CA derBytes, err = x509.CreateCertificate(rand.Reader, &template, cacrt, publicKey(priv), cakey) if err != nil { return fmt.Errorf("Failed to create certificate: %v", err) } } // output to pem files out := &bytes.Buffer{} outcert := fmt.Sprintf("%s-cert.pem", outname) outkey := fmt.Sprintf("%s-key.pem", outname) // cert pem.Encode(out, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}) err = os.WriteFile(outcert, out.Bytes(), 0600) if err != nil { return fmt.Errorf("Write %s: %v", outcert, err) } out.Reset() // key pem.Encode(out, pemBlockForKey(priv)) err = os.WriteFile(outkey, out.Bytes(), 0600) if err != nil { return fmt.Errorf("Write %s: %v", outkey, err) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func genCerts(date time.Time) ([]byte, []byte, error) {\n\t// Create ca signing key\n\tca := &x509.Certificate{\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{\"I Can Haz Expired Certs\"},\n\t\t},\n\t\tSerialNumber: big.NewInt(42),\n\t\tNotBefore: date.Truncate(8760 * time.Hour),\n\t\t...
[ "0.68635654", "0.65385413", "0.6529925", "0.65109557", "0.6504905", "0.64903206", "0.6441566", "0.6328878", "0.61755025", "0.60668045", "0.6039149", "0.5986134", "0.58960557", "0.5793944", "0.57730484", "0.57411814", "0.5688312", "0.5682993", "0.567077", "0.5652689", "0.56006...
0.7780582
0
NamesInCert find domain names and IPs in server certificate
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 = append(names, domain) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getNameservers(resolvConf []byte) []string {\n\tnameservers := []string{}\n\tfor _, line := range getLines(resolvConf) {\n\t\tns := nsRegexp.FindSubmatch(line)\n\t\tif len(ns) > 0 {\n\t\t\tnameservers = append(nameservers, string(ns[1]))\n\t\t}\n\t}\n\treturn nameservers\n}", "func GetNameservers(resolvConf...
[ "0.66689825", "0.63112724", "0.6159213", "0.6148023", "0.6127139", "0.6075504", "0.6012741", "0.59553957", "0.5781968", "0.5766072", "0.5753809", "0.5711643", "0.57008517", "0.5689711", "0.56568915", "0.5643009", "0.5611596", "0.5599547", "0.5524786", "0.5524786", "0.55241066...
0.75606513
0
ParseCertPemFile read from PEM file and return parsed cert
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) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func parseCertificate(path string) (cert *x509.Certificate, err error) {\n var pemData []byte\n\n pemData, err = ioutil.ReadFile(path)\n if err != nil {\n return\n }\n block, rest := pem.Decode(pemData)\n if block == nil || len(rest) != 0 {\n err = errors.New(\"Failed to decode the ...
[ "0.77496916", "0.75687236", "0.75398403", "0.7404843", "0.7188307", "0.70729065", "0.70729065", "0.7034357", "0.695529", "0.6716552", "0.6715112", "0.66574687", "0.6649889", "0.65145785", "0.65145785", "0.6448182", "0.64413345", "0.6420031", "0.64128685", "0.6380914", "0.6328...
0.85923237
0
GetFingerprint return SHA256 fingerprint of a cert
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) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Fingerprint(certificate []byte) FingerprintBytes {\n\treturn sha256.Sum256(certificate)\n}", "func (c *CertInfo) Fingerprint() string {\n\tfingerprint, err := CertFingerprintStr(string(c.PublicKey()))\n\t// Parsing should never fail, since we generated the cert ourselves,\n\t// but let's check the error for...
[ "0.7413812", "0.67597044", "0.6694062", "0.66871536", "0.66629297", "0.6651699", "0.6395457", "0.62573737", "0.6215708", "0.6189705", "0.61763316", "0.61329055", "0.61223704", "0.60440844", "0.60190755", "0.5937564", "0.58921087", "0.58856016", "0.5885489", "0.5769462", "0.57...
0.7799496
0
RequestBindIPToNatgateway in aliyun don't need to check eip again which is different from SManagerResongDriver. RequestBindIPToNatgateway because func ieip.Associate will fail if eip has been associate
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 } lockman.LockObject(ctx, model) defer lockman.ReleaseObject(ctx, model) eip := model.(*models.SElasticip) iregion, err := natgateway.GetIRegion() if err != nil { return nil, err } ieip, err := iregion.GetIEipById(eip.GetExternalId()) if err != nil { return nil, errors.Wrap(err, "fetch eip failed") } conf := &cloudprovider.AssociateConfig{ InstanceId: natgateway.GetExternalId(), Bandwidth: eip.Bandwidth, AssociateType: api.EIP_ASSOCIATE_TYPE_NAT_GATEWAY, } err = ieip.Associate(conf) if err != nil { return nil, errors.Wrap(err, "fail to bind eip to natgateway") } err = cloudprovider.WaitStatus(ieip, api.EIP_STATUS_READY, 5*time.Second, 100*time.Second) if err != nil { return nil, err } // database _, err = db.Update(eip, func() error { eip.AssociateType = api.EIP_ASSOCIATE_TYPE_NAT_GATEWAY eip.AssociateId = natgateway.GetId() return nil }) if err != nil { return nil, errors.Wrapf(err, "fail to update eip '%s' in database", eip.Id) } return nil, nil }) return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (service *HTTPRestService) reserveIPAddress(w http.ResponseWriter, r *http.Request) {\n\tlog.Printf(\"[Azure CNS] reserveIPAddress\")\n\n\tvar req cns.ReserveIPAddressRequest\n\treturnMessage := \"\"\n\treturnCode := 0\n\taddr := \"\"\n\taddress := \"\"\n\terr := service.Listener.Decode(w, r, &req)\n\n\tlog.R...
[ "0.57944995", "0.5638535", "0.5593906", "0.5586777", "0.55479777", "0.5546608", "0.54761577", "0.5467055", "0.5434431", "0.5379", "0.5344696", "0.53415555", "0.5334797", "0.53240156", "0.53156394", "0.53124017", "0.5250295", "0.52484107", "0.5246646", "0.5243997", "0.5241883"...
0.8086484
0
NewGobEncoderLight returns a new lockfree encoder
func NewGobEncoderLight() *GobEncoderLight { ret := &GobEncoderLight{ bytes: &bytes.Buffer{}, } ret.encoder = gob.NewEncoder(ret.bytes) return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewGobDecoderLight() *GobDecoderLight {\n\tret := &GobDecoderLight{\n\t\tbytes: &bytes.Buffer{},\n\t}\n\tret.decoder = gob.NewDecoder(ret.bytes)\n\treturn ret\n}", "func NewGOBCodec() *GOBCodec {\n\tr := GOBCodec(0)\n\treturn &r\n}", "func NewGobTranscoder() *GobTranscoder {\n\tret := &GobTranscoder{\n\t\...
[ "0.70255053", "0.62390405", "0.6189565", "0.6124616", "0.59634024", "0.5905049", "0.589319", "0.5539999", "0.5469765", "0.5434318", "0.5348389", "0.533494", "0.53337526", "0.52019095", "0.5191129", "0.51703334", "0.51524764", "0.51320297", "0.5115051", "0.5044243", "0.5037294...
0.78135526
0
NewGobDecoderLight returns a new lockfree decoder
func NewGobDecoderLight() *GobDecoderLight { ret := &GobDecoderLight{ bytes: &bytes.Buffer{}, } ret.decoder = gob.NewDecoder(ret.bytes) return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewGobEncoderLight() *GobEncoderLight {\n\tret := &GobEncoderLight{\n\t\tbytes: &bytes.Buffer{},\n\t}\n\tret.encoder = gob.NewEncoder(ret.bytes)\n\treturn ret\n}", "func NewDecoder(data unsafe.Pointer, length C.int) *FLBDecoder {\n\tvar b []byte\n\n\tdec := new(FLBDecoder)\n\tdec.handle = new(codec.MsgpackH...
[ "0.694183", "0.58746696", "0.5644927", "0.5483799", "0.54688776", "0.5439269", "0.5437573", "0.5433669", "0.5406622", "0.5392829", "0.538944", "0.53797585", "0.5357301", "0.52865094", "0.5255565", "0.52430403", "0.524038", "0.51871175", "0.5151889", "0.50871867", "0.50789195"...
0.8035107
0
NewGobTranscoder will return a newly initialised transcoder to help with the mundane encoding/decoding operations
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewGobCode(conn io.ReadWriteCloser) Codec {\n\tbuf := bufio.NewWriter(conn)\n\treturn &GobCodec{conn: conn, buf: buf, dec: gob.NewDecoder(conn), enc: gob.NewEncoder(buf)}\n}", "func NewGOBCodec() *GOBCodec {\n\tr := GOBCodec(0)\n\treturn &r\n}", "func FromGob(data []byte, dst interface{}) error {\n\tretur...
[ "0.68015623", "0.6645202", "0.63813996", "0.6066566", "0.5844885", "0.5745243", "0.5729538", "0.56793123", "0.5636251", "0.5586641", "0.55709475", "0.5561647", "0.55515313", "0.5542255", "0.5485858", "0.5476409", "0.5442238", "0.5441508", "0.5416794", "0.5413589", "0.53800493...
0.83728933
0
EncodeType will convert give given pointer into a gob encoded byte set, and return them
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t Type) GobEncode() ([]byte, error) {\n\tbuf := &bytes.Buffer{}\n\tenc := gob.NewEncoder(buf)\n\n\tgt := gobType{\n\t\tVersion: 0,\n\t\tImpl: t.typeImpl,\n\t}\n\n\terr := enc.Encode(gt)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error encoding cty.Type: %s\", err)\n\t}\n\n\treturn buf.Bytes(), nil\n...
[ "0.6781096", "0.6659338", "0.64719117", "0.63125616", "0.61463565", "0.6085887", "0.6061027", "0.59845275", "0.5943138", "0.58399534", "0.57951427", "0.57240325", "0.5702898", "0.5651715", "0.5639708", "0.5628176", "0.5625311", "0.56052095", "0.5578742", "0.55714303", "0.5569...
0.61903644
4
EncodeType will convert give given pointer into a gob encoded byte set, and return them
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t Type) GobEncode() ([]byte, error) {\n\tbuf := &bytes.Buffer{}\n\tenc := gob.NewEncoder(buf)\n\n\tgt := gobType{\n\t\tVersion: 0,\n\t\tImpl: t.typeImpl,\n\t}\n\n\terr := enc.Encode(gt)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error encoding cty.Type: %s\", err)\n\t}\n\n\treturn buf.Bytes(), nil\n...
[ "0.6781423", "0.6659542", "0.6471993", "0.61916727", "0.6146297", "0.6085416", "0.60611904", "0.59847766", "0.5941497", "0.5839333", "0.5795199", "0.5722494", "0.57033974", "0.5649842", "0.5639476", "0.5628993", "0.5625364", "0.56061196", "0.55789036", "0.557128", "0.5569147"...
0.6314191
3
DecodeType will attempt to decode the buffer into the pointer outT
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) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (g *GobDecoderLight) DecodeType(buf []byte, outT interface{}) error {\n\tdefer func() {\n\t\tg.bytes.Reset()\n\t}()\n\treader := bytes.NewReader(buf)\n\tif _, err := io.Copy(g.bytes, reader); err != nil {\n\t\treturn err\n\t}\n\treturn g.decoder.Decode(outT)\n}", "func (dec *Decoder) decodeType(isInterface ...
[ "0.68913203", "0.66737515", "0.6513736", "0.6163966", "0.5928105", "0.5928105", "0.5900145", "0.58706284", "0.5865244", "0.57236636", "0.5708626", "0.5692009", "0.5692009", "0.5660723", "0.56320024", "0.56186193", "0.5612395", "0.5568661", "0.5550775", "0.5543029", "0.5517067...
0.6807437
1
DecodeType will attempt to decode the buffer into the pointer outT
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) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (g *GobTranscoder) DecodeType(buf []byte, outT interface{}) error {\n\tg.decoderMut.Lock()\n\tdefer func() {\n\t\tg.inBytes.Reset()\n\t\tg.decoderMut.Unlock()\n\t}()\n\treader := bytes.NewReader(buf)\n\tif _, err := io.Copy(g.inBytes, reader); err != nil {\n\t\treturn err\n\t}\n\treturn g.decoder.Decode(outT)...
[ "0.68078977", "0.6675602", "0.6515179", "0.61647207", "0.59279156", "0.59279156", "0.5900919", "0.5871402", "0.58649015", "0.5724581", "0.57092345", "0.56915516", "0.56915516", "0.5660723", "0.5632208", "0.5619711", "0.56132174", "0.5569318", "0.5551497", "0.5543591", "0.5518...
0.6891714
0
check token expiration; used in middleware for protected routes
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Manager) isTokenExpired(token *Token) bool {\n\tif !m.bearerAuth {\n\t\treturn false\n\t}\n\tunixTime := time.Now().Unix()\n\treturn token.Expires < unixTime\n}", "func (t TToken) checkExpired() error {\n\texp, err := t.getExpiry()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif secondsPassed := time.Sinc...
[ "0.7342315", "0.730334", "0.7238402", "0.69408375", "0.6927644", "0.68055797", "0.67880195", "0.67240477", "0.669694", "0.66420776", "0.65723866", "0.6530594", "0.6482227", "0.64696825", "0.6413906", "0.6362124", "0.63578933", "0.6346317", "0.62503326", "0.62242067", "0.62214...
0.0
-1
InitDB removes existing db file and creates a new DB and table for IP
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); ` _, err = db.Exec(createCmd) if err != nil { log.Fatal("Error creating DB table", err) return } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (i *API) InitDB(purge bool) error {\n\tif purge {\n\t\ti.purgeDB()\n\t}\n\treturn i.openDB()\n}", "func InitDatabase(dbName *string, dst ...interface{}) {\n\tlog.Info().Msgf(\"Loading database %v\", *dbName)\n\tvar err error\n\tdbFile = sqlite.Open(fmt.Sprintf(\"%v.db\", *dbName))\n\tdatastore, err = gorm.O...
[ "0.70847756", "0.7069799", "0.7032143", "0.70092875", "0.6844531", "0.684309", "0.6831744", "0.68244797", "0.68110096", "0.67675555", "0.6757469", "0.67567056", "0.674744", "0.6733488", "0.67181665", "0.6714626", "0.6713455", "0.6654968", "0.6650416", "0.6645018", "0.6631553"...
0.7566985
0
SaveIp writes a model.IP to the database or updates it if already exists
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())) } _, err = upsert.Exec(ip.IPAddress, ip.UUID, ip.CreatedAt, ip.UpdatedAt, ip.ResponseCode) if err != nil { return errors.New(fmt.Sprint("ERROR executing DB insert:", err.Error())) } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func SaveIPAddr(ipaddr string, amount int, ref db.DBClient) {\n\tjst, _ := time.LoadLocation(\"Asia/Tokyo\")\n\tnow := time.Now().In(jst).Format(\"2006-01-02 15:04:05 -0700 MST\")\n\tuser := User{\n\t\tIPAddr: ipaddr,\n\t\tTime: now,\n\t\tAmount: amount,\n\t}\n\terr := ref.Push(user)\n\tif err != nil {\n\t\tlog....
[ "0.68685144", "0.6585625", "0.62615025", "0.6082222", "0.6036351", "0.60349107", "0.6005871", "0.5975198", "0.5974457", "0.5963693", "0.58368796", "0.57715946", "0.5694154", "0.5694154", "0.5683421", "0.565358", "0.56393373", "0.56249624", "0.55932415", "0.5569949", "0.554892...
0.83904064
0
GetIp returns a model.IP if record is stored in the database or nil if not exists
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 { return nil, err } } return &ip, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (test *Test) GetIP(projectName string, ip string) (models.IP, error) {\n\treturn tests.NormalIPs[0], nil\n}", "func (d *Driver) GetIP() (string, error) {\n\td.connectAPI()\n\treturn d.driver.GetEth0IPv4(d.Node, d.VMID)\n}", "func (st *Store) GetIP(host string) string {\n\tfor ip, hosts := range st.Records...
[ "0.6942995", "0.6917147", "0.6873968", "0.68166244", "0.67154366", "0.66841614", "0.6684137", "0.6615601", "0.6578332", "0.6521607", "0.6519366", "0.64663374", "0.6433581", "0.6413792", "0.6356611", "0.6311986", "0.63093966", "0.62835115", "0.62776005", "0.6260319", "0.623519...
0.7603416
0
formatUnix formats a unix timestamp into a human readable string that is formatted according to the timeFormat global variable.
func formatUnix(unixTime int64) string { t := time.Unix(unixTime, 0) return t.Format(timeFormat) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func formatUnixTime(dt int64, timezone string) (string, string, error) {\n\tt := time.Unix(dt, 0)\n\n\tloc, err := time.LoadLocation(timezone)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to load location\")\n\t\treturn \"\", \"\", errors.New(\"Unable to load timezone location\")\n\t}\n\n\tt = t.In(loc)\n\n\treturn...
[ "0.76288587", "0.6761688", "0.6435162", "0.622314", "0.6068956", "0.60416585", "0.5949711", "0.5738175", "0.56880945", "0.567122", "0.5648008", "0.5590446", "0.55742025", "0.55638146", "0.55632454", "0.55522686", "0.55406225", "0.55078954", "0.5498698", "0.54594755", "0.54371...
0.8631524
0
PrepayBalanceKey turn an address to key used to get prepaid balance from the sds store
func PrepayBalanceKey(acc []byte) []byte { return append(PrepayBalancePrefix, acc...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func initStateKeyAddr(\n\taccountState AccountState,\n\tprivateKey crypto.PrivateKey,\n\tinitBalance *big.Int,\n\tbc blockchain.Blockchain,\n\tsf factory.Factory,\n) (crypto.PrivateKey, string, error) {\n\tretKey := privateKey\n\tretAddr := \"\"\n\tswitch accountState {\n\tcase AcntCreate:\n\t\taddr := retKey.Publ...
[ "0.564435", "0.5613641", "0.5389401", "0.5386682", "0.53690535", "0.5327332", "0.5317667", "0.5300769", "0.5269204", "0.5228631", "0.5193929", "0.5192163", "0.5190385", "0.5186733", "0.51589626", "0.51504695", "0.5146894", "0.5137371", "0.5123204", "0.5114298", "0.50923884", ...
0.7228061
0
FileStoreKey turn an address to key used to get it from the account store
func FileStoreKey(sender []byte) []byte { return append(FileStoreKeyPrefix, sender...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func AddressStoreKey(addr sdk.AccAddress) []byte {\n\treturn append(AddressStoreKeyPrefix, addr.Bytes()...)\n}", "func KeyByFilename(keyFname string) (*[32]byte, error) {\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfp := filepath.Join(cwd, keyFname)\n\tb, err := ioutil.ReadFile(fp...
[ "0.63449895", "0.61992145", "0.60549915", "0.5879409", "0.5833465", "0.58311737", "0.5829052", "0.57962936", "0.57795167", "0.5744459", "0.573525", "0.5691633", "0.56843644", "0.56740224", "0.5651475", "0.5645965", "0.5644781", "0.5644164", "0.5636174", "0.56352246", "0.56232...
0.6400484
0
skip gitInformation or gitStatus, git gitInformation is not cheap, we may want to avoid this in some case, eg. Chromium.
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 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func HugoNoGitInfo() error {\n\tldflags = noGitLdflags\n\treturn Hugo()\n}", "func (r *Repo) AssertNotTracked() error {\n\tplatCfg, err := config.Platform()\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\tremote, err := platCfg.GitRemoteName()\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\...
[ "0.607692", "0.56856716", "0.5637586", "0.5620896", "0.56051344", "0.5575217", "0.5547749", "0.5355762", "0.5312566", "0.5303206", "0.53025454", "0.5283581", "0.52761084", "0.52436495", "0.52291006", "0.52157104", "0.51697", "0.5164014", "0.5152997", "0.51269424", "0.5113547"...
0.0
-1
SetStatistics set the container statistics
func (cs *Stats) SetStatistics(s StatsEntry) { cs.mutex.Lock() defer cs.mutex.Unlock() s.Container = cs.Container cs.StatsEntry = s }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Cluster) SetStatistics(v []*KeyValuePair) *Cluster {\n\ts.Statistics = v\n\treturn s\n}", "func (s *BotRecommendationResults) SetStatistics(v *BotRecommendationResultStatistics) *BotRecommendationResults {\n\ts.Statistics = v\n\treturn s\n}", "func (s *DriftCheckModelQuality) SetStatistics(v *MetricsS...
[ "0.6701678", "0.57483083", "0.55879396", "0.55502206", "0.55451113", "0.551975", "0.5456196", "0.54074156", "0.5349192", "0.52138686", "0.52063566", "0.5174852", "0.5165561", "0.51111734", "0.50242907", "0.5015697", "0.49920654", "0.49733508", "0.49718073", "0.49158075", "0.4...
0.7775303
0
GetStatistics returns container statistics with other meta data such as the container name
func (cs *Stats) GetStatistics() StatsEntry { cs.mutex.Lock() defer cs.mutex.Unlock() return cs.StatsEntry }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (container *container) Statistics() (Statistics, error) {\r\n\tproperties, err := container.system.Properties(context.Background(), schema1.PropertyTypeStatistics)\r\n\tif err != nil {\r\n\t\treturn Statistics{}, convertSystemError(err, container)\r\n\t}\r\n\r\n\treturn properties.Statistics, nil\r\n}", "fu...
[ "0.7228869", "0.6948396", "0.68941295", "0.6769662", "0.67652166", "0.6666272", "0.6609697", "0.6449724", "0.6334005", "0.6292268", "0.6249015", "0.61238223", "0.60853606", "0.60837454", "0.6057728", "0.60456675", "0.6023461", "0.60232055", "0.6010118", "0.5982012", "0.595486...
0.5097511
87
NewStatsFormat returns a format for rendering an CStatsContext
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(autoRangeStatsTableFormat) } return formatter.Format(source) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func statsFormatWrite(ctx formatter.Context, Stats []StatsEntry, osType string, trunc bool) error {\n\trender := func(format func(subContext formatter.SubContext) error) error {\n\t\tfor _, cstats := range Stats {\n\t\t\tstatsCtx := &statsContext{\n\t\t\t\ts: cstats,\n\t\t\t\tos: osType,\n\t\t\t\ttrunc: tru...
[ "0.615135", "0.58909744", "0.564853", "0.5477506", "0.53987473", "0.5379427", "0.5373916", "0.5269798", "0.5267023", "0.525883", "0.52573013", "0.52511203", "0.52503246", "0.52026254", "0.5195151", "0.5113169", "0.5079528", "0.5066979", "0.5062811", "0.5025183", "0.5025183", ...
0.7449207
0
NewStats returns a new Stats entity and sets in it the given name
func NewStats(container string) *Stats { return &Stats{StatsEntry: StatsEntry{Container: container}} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewStats() *Stats {\n\tcs := new(Stats)\n\tcs.statMap = make(map[string]*FuncStat)\n\n\treturn cs\n}", "func NewEntityStats(name string, life int) *EntityStats {\n\tengosdl.Logger.Trace().Str(\"component\", \"entity-stats\").Str(\"entity-stats\", name).Msg(\"new entity-stats\")\n\tresult := &EntityStats{\n\...
[ "0.63536394", "0.6279233", "0.6245355", "0.60528356", "0.6045652", "0.6042904", "0.59604484", "0.58574194", "0.57866055", "0.57197595", "0.56906897", "0.5679827", "0.5489235", "0.5416266", "0.53946114", "0.5381432", "0.53164285", "0.5296165", "0.5270525", "0.52274466", "0.522...
0.6431501
0
statsFormatWrite renders the context for a list of containers statistics
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(statsCtx); err != nil { return err } } return nil } memUsage := memUseHeader if osType == winOSType { memUsage = winMemUseHeader } statsCtx := statsContext{} statsCtx.Header = formatter.SubHeaderContext{ "Container": containerHeader, "Name": formatter.NameHeader, "ID": formatter.ContainerIDHeader, "CPUPerc": cpuPercHeader, "MemUsage": memUsage, "MemPerc": memPercHeader, "NetIO": netIOHeader, "BlockIO": blockIOHeader, "PIDs": pidsHeader, "CurrentMemoryMin": currentMemoryMinHeader, "CurrentMemoryMax": currentMemoryMaxHeader, "OptiMemoryMin": optiMemoryMinHeader, "OptiMemoryMax": optiMemoryMaxHeader, "OptiCPUNumber": optiCPUNumberHeader, "UsedCPUPerc": usedCPUPercHeader, "OptiCPUTime": optiCPUTimeHeader, } statsCtx.os = osType return ctx.Write(&statsCtx, render) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *ContainerCtl) Stats(ctx context.Context) {\n\tvar id string\n\tid = ctx.Params().Get(\"id\")\n\n\tcli := GetDockerClient()\n\tresp, err := cli.ContainerStats(stdContext.Background(), id, true)\n\tif err != nil {\n\t\tlog.Println(\"ContainerExport err:\", err.Error())\n\t\tthis.ReturnJSon(ctx, http.Stat...
[ "0.61173224", "0.6038604", "0.5830485", "0.57845944", "0.5730382", "0.5693483", "0.56528944", "0.5436239", "0.5433749", "0.53959244", "0.5391447", "0.53292865", "0.5329039", "0.53219116", "0.5286652", "0.5284806", "0.52831936", "0.52702236", "0.52642286", "0.526065", "0.52551...
0.75491524
0