text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (l *GroupLookup) Delete(key flux.GroupKey) (v interface{}, found bool) {
if key == nil {
return
}
group := l.lookupGroup(key)
if group == -1 {
return nil, false
}
kg := l.groups[group]
i := kg.Index(key)
if i == -1 {
return nil, false
}
v = kg.At(i)
kg.delete(i)
if len(kg.elements) == kg.delete... | [
-0.9422621130943298,
0.4673042297363281,
0.7726497650146484,
-0.08810882270336151,
-0.43700677156448364,
-0.10863254964351654,
0.8475199937820435,
-0.5211189389228821,
0.06237577646970749,
0.7271217703819275,
0.16512475907802582,
-0.2742999196052551,
-1.4144601821899414,
-0.159200295805931... |
func (l *GroupLookup) Range(f func(key flux.GroupKey, value interface{})) {
for i := 0; i < len(l.groups); {
kg := l.groups[i]
for j := 0; j < len(kg.elements); j++ {
entry := kg.elements[j]
if entry.deleted {
continue
}
f(entry.key, entry.value)
}
if i < len(l.groups) && l.groups[i].id == kg.i... | [
-1.4584213495254517,
0.09561184793710709,
0.5081788301467896,
0.5833152532577515,
0.04656059294939041,
-0.6403079628944397,
0.6051101088523865,
-0.013112944550812244,
-0.78079754114151,
0.11593912541866302,
0.5021186470985413,
0.40872490406036377,
-0.06236226484179497,
-0.1650453805923462,... |
func NewRandomAccessGroupLookup() *RandomAccessGroupLookup {
return &RandomAccessGroupLookup{
index: make(map[string]*groupLookupElement),
}
} | [
-0.4374045133590698,
0.14120475947856903,
0.06599793583154678,
-0.6223214268684387,
-1.4485721588134766,
-0.4136798679828644,
0.31614920496940613,
-0.3399452865123749,
0.0938783809542656,
0.016721393913030624,
0.7205500602722168,
0.014288259670138359,
-0.11395297199487686,
-0.0645716488361... |
func (l *RandomAccessGroupLookup) Lookup(key flux.GroupKey) (interface{}, bool) {
id := l.idForKey(key)
e, ok := l.index[string(id)]
if !ok || e.Deleted {
return nil, false
}
return e.Value, true
} | [
-1.2885311841964722,
0.6662853360176086,
0.4916849434375763,
-0.5638473629951477,
-0.7795562744140625,
-0.6398770213127136,
0.3797071576118469,
-0.4835071861743927,
0.5673403143882751,
0.9097577929496765,
0.11015322804450989,
-0.2683904767036438,
-0.7031825184822083,
-0.33626359701156616,
... |
func (l *RandomAccessGroupLookup) LookupOrCreate(key flux.GroupKey, fn func() interface{}) interface{} {
value, ok := l.Lookup(key)
if !ok {
value = fn()
l.Set(key, value)
}
return value
} | [
-0.7625494003295898,
0.6941258311271667,
0.3288426399230957,
-0.28659284114837646,
-0.25275006890296936,
-0.8695266246795654,
-0.13989688456058502,
-0.4560379385948181,
-0.28879213333129883,
-0.08512338995933533,
0.729998767375946,
-1.1455241441726685,
0.3278224766254425,
-0.34095987677574... |
func (l *RandomAccessGroupLookup) Set(key flux.GroupKey, value interface{}) {
id := l.idForKey(key)
e, ok := l.index[string(id)]
if !ok {
e = &groupLookupElement{
Key: key,
}
l.index[string(id)] = e
l.elements = append(l.elements, e)
}
e.Value = value
e.Deleted = false
} | [
-1.6210781335830688,
0.4171255826950073,
0.270699143409729,
-0.6722519993782043,
-0.226563960313797,
0.2838963270187378,
0.3718927800655365,
-0.42193469405174255,
-0.008367874659597874,
0.3695955276489258,
0.17127542197704315,
0.062286023050546646,
-0.319379985332489,
0.1010952964425087,
... |
func (l *RandomAccessGroupLookup) Clear() {
l.elements = nil
l.index = make(map[string]*groupLookupElement)
} | [
-1.658757209777832,
0.4007546603679657,
0.1733010709285736,
-0.5568978786468506,
-0.2661953866481781,
1.0115540027618408,
0.5993596911430359,
-0.6984149217605591,
0.20071829855442047,
-0.14423435926437378,
0.8191962838172913,
0.3850362002849579,
0.1521175056695938,
-0.07120586931705475,
... |
func (l *RandomAccessGroupLookup) Delete(key flux.GroupKey) (v interface{}, found bool) {
if key == nil {
return
}
id := l.idForKey(key)
e, ok := l.index[string(id)]
if !ok || e.Deleted {
return nil, false
}
e.Deleted = true
return e.Value, true
} | [
-0.8169624209403992,
0.5142928957939148,
0.46102404594421387,
-0.009769247844815254,
-0.1787843406200409,
-0.2378946840763092,
0.6702631115913391,
-0.5399739146232605,
0.37241047620773315,
0.7914497256278992,
0.24315239489078522,
-0.3565315306186676,
-1.159206509590149,
-0.0840814262628555... |
func (l *RandomAccessGroupLookup) Range(f func(key flux.GroupKey, value interface{})) {
for _, e := range l.elements {
if e.Deleted {
continue
}
f(e.Key, e.Value)
}
} | [
-1.0546669960021973,
0.12217037379741669,
0.33995434641838074,
0.343723863363266,
0.16927647590637207,
-0.3018714487552643,
0.5780447721481323,
0.3435528576374054,
-0.16535599529743195,
-0.1331082135438919,
0.7585886716842651,
0.41169509291648865,
0.4680045545101166,
-0.07346180826425552,
... |
func Register(scheme string, creator econf.DataSource) {
registry[scheme] = creator
} | [
-0.44039541482925415,
1.0643936395645142,
-0.08211331814527512,
-0.7605639696121216,
0.42213690280914307,
-0.6336762309074402,
-0.3473988175392151,
0.6433714628219604,
-0.27846068143844604,
-0.6573684811592102,
-1.3103764057159424,
0.6339039206504822,
1.3343664407730103,
0.0183216016739606... |
func HandleDelay(handlers ...func(delay time.Duration)) func() {
start := time.Now()
return func() {
delay := time.Since(start)
for _, handler := range handlers {
handler(delay)
}
}
} | [
0.0799994170665741,
0.1198187991976738,
0.6132206916809082,
1.1425198316574097,
0.07197531312704086,
0.4948052167892456,
0.35239169001579285,
0.2722856402397156,
-0.5922443270683289,
-1.6298699378967285,
-0.3500441312789917,
-0.28894180059432983,
0.6741824746131897,
-0.29616332054138184,
... |
func (d *Daemon) buildChecks() {
for _, c := range d.Data.Checks {
check, ok := c.(map[string]interface{})
if !ok {
continue
}
dc, ok := check["dc"].(string)
if !ok {
continue
}
name, ok := check["name"].(string)
if !ok {
continue
}
check["_id"] = fmt.Sprintf("%s/%s", dc, name)
}
} | [
-1.0403778553009033,
-0.7565885782241821,
0.3699892461299896,
-0.4660486876964569,
0.3678800165653229,
0.357271671295166,
-0.34459662437438965,
0.08652569353580475,
-0.4233792722225189,
-0.9395924210548401,
0.33018824458122253,
0.07621827721595764,
0.12052172422409058,
0.6358283162117004,
... |
func (d dynamo) Get(date time.Time, mealType string, details bool) (Meal, error) {
sess, err := session.NewSession(&aws.Config{Region: aws.String(region)})
if err != nil {
fmt.Println("Error creating AWS session")
return Meal{}, err
}
svc := dynamodb.New(sess)
result, err := svc.GetItem(&dynamodb.GetItemInput{... | [
-0.2962604761123657,
-0.21679632365703583,
0.8123633861541748,
-0.5833514332771301,
0.24679355323314667,
0.36649492383003235,
-1.2460256814956665,
-0.015555674210190773,
-0.36868762969970703,
-0.3889177143573761,
0.36520758271217346,
1.1172939538955688,
-0.16381722688674927,
0.519074797630... |
func (d dynamo) Update(meals []*Meal) error {
fmt.Println("Updating DB")
sess, err := session.NewSession(&aws.Config{Region: aws.String(region)})
if err != nil {
fmt.Println("Error creating AWS session: ", err)
return err
}
svc := dynamodb.New(sess)
for _, meal := range meals {
exists, err := ac.backend.Get... | [
-0.6616544127464294,
-0.49278736114501953,
0.6769016981124878,
-0.14475734531879425,
0.04405087232589722,
0.8428172469139099,
-0.67200767993927,
0.3466816842556,
-0.4487079083919525,
0.4185418486595154,
0.021517468616366386,
0.17489761114120483,
-0.4767208695411682,
0.9911854267120361,
-... |
func (c *stream) writeChunks(b []byte) (int, error) {
totalN := 0
for {
toWrite := b
last := true
if len(b) > MaxDataLen {
toWrite = b[:MaxDataLen]
b = b[MaxDataLen:]
last = false
}
n, err := c.Write(toWrite)
totalN += n
if last || err != nil {
return totalN, err
}
}
} | [
-1.1161348819732666,
0.33333104848861694,
0.7343558669090271,
-0.21242216229438782,
0.3762682378292084,
-0.7651606798171997,
0.6447513699531555,
0.20119689404964447,
-0.7774085402488708,
0.0649232491850853,
-0.4905259311199188,
0.38657328486442566,
-0.5864471197128296,
0.3573567569255829,
... |
func Index(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
} | [
0.18229663372039795,
-0.04975457116961479,
0.30649006366729736,
-0.243186354637146,
-0.05992652475833893,
0.34592267870903015,
0.5469752550125122,
0.5834438800811768,
-0.7482638359069824,
-0.2031855583190918,
0.3825404644012451,
0.5936676859855652,
0.21063017845153809,
-0.40636858344078064... |
func NewGenesisState(
params Params, signingInfos []SigningInfo,
) *GenesisState {
return &GenesisState{
Params: params,
SigningInfos: signingInfos,
}
} | [
-0.47010505199432373,
-0.6168212294578552,
0.027846956625580788,
0.406250923871994,
-1.2362853288650513,
0.012379450723528862,
-0.8332870602607727,
0.22943533957004547,
-0.5580314993858337,
-0.4718135595321655,
-0.21398834884166718,
-0.4747932553291321,
-0.32046085596084595,
0.141539171338... |
func DefaultGenesisState() *GenesisState {
return &GenesisState{
Params: DefaultParams(),
SigningInfos: []SigningInfo{},
}
} | [
-0.5726770162582397,
0.20918960869312286,
0.15946917235851288,
0.28007379174232483,
-0.454509437084198,
0.09445913136005402,
-0.5487599968910217,
-0.09120143949985504,
-0.8915440440177917,
-1.1743425130844116,
-0.625558614730835,
-1.1881868839263916,
-0.5155330300331116,
0.4313581585884094... |
func ValidateGenesis(data GenesisState) error {
downtimeInactive := data.Params.DowntimeInactiveDuration
if downtimeInactive < 1*time.Minute {
return fmt.Errorf("downtime unblond duration must be at least 1 minute, is %s", downtimeInactive.String())
}
return nil
} | [
-0.883359432220459,
0.15448248386383057,
0.472103476524353,
0.0670849159359932,
-0.13323237001895905,
0.8138611912727356,
0.49519243836402893,
-0.5328469276428223,
-1.0805851221084595,
0.24341996014118195,
0.45747801661491394,
-0.02942737378180027,
-0.6529213786125183,
0.7641169428825378,
... |
func Register(factory Factory) {
factories = append(factories, factory)
} | [
-1.3543401956558228,
0.5601450204849243,
0.1098681390285492,
0.4208628237247467,
0.8279440999031067,
-0.07575888186693192,
-0.6176009178161621,
-0.08504337817430496,
-0.10896508395671844,
-1.0748114585876465,
-0.9895642399787903,
0.408191055059433,
0.4413547217845917,
0.5199109315872192,
... |
func NewReader(charset string, r io.Reader) (io.Reader, error) {
tr, err := TranslatorFrom(charset)
if err != nil {
return nil, err
}
return NewTranslatingReader(r, tr), nil
} | [
0.22742553055286407,
-0.5099611282348633,
0.18026795983314514,
-0.06917513161897659,
-1.231255292892456,
-0.49106141924858093,
-1.3328465223312378,
-0.10595601797103882,
-0.2534690797328949,
0.2134156972169876,
0.616826593875885,
0.10322267562150955,
0.05397820472717285,
-0.674773335456848... |
func NewWriter(charset string, w io.Writer) (io.WriteCloser, error) {
tr, err := TranslatorTo(charset)
if err != nil {
return nil, err
}
return NewTranslatingWriter(w, tr), nil
} | [
-0.17683185636997223,
0.33354651927948,
0.3038945496082306,
0.2829057574272156,
-0.8903326392173767,
-0.7261548042297363,
-0.41011136770248413,
-0.15840716660022736,
-0.7480270266532898,
0.5186956524848938,
0.4074402451515198,
-0.08808231353759766,
0.33714520931243896,
-0.15488949418067932... |
func Info(name string) *Charset {
for _, f := range factories {
if info := f.Info(name); info != nil {
return info
}
}
return nil
} | [
0.02258388325572014,
0.09761340916156769,
0.3312535583972931,
-0.10475783795118332,
-0.666959285736084,
-1.1887178421020508,
-0.15219427645206451,
-1.2925493717193604,
-1.458522081375122,
-0.13629931211471558,
0.17389535903930664,
0.10906025022268295,
0.620488703250885,
0.35059866309165955... |
func Names() []string {
// TODO eliminate duplicates
var names []string
for _, f := range factories {
names = append(names, f.Names()...)
}
return names
} | [
-1.5893032550811768,
-0.21231067180633545,
0.47618287801742554,
0.22753779590129852,
-0.0650743916630745,
0.007629182189702988,
-0.3126367926597595,
-1.1607087850570679,
-0.12202819436788559,
0.1599079817533493,
-0.23782841861248016,
-0.03984355181455612,
0.9373632669448853,
0.984217941761... |
func TranslatorFrom(charset string) (Translator, error) {
var err error
var tr Translator
for _, f := range factories {
tr, err = f.TranslatorFrom(charset)
if err == nil {
break
}
}
if tr == nil {
return nil, err
}
return tr, nil
} | [
-0.6091277599334717,
0.19975854456424713,
0.2843976616859436,
-0.031146802008152008,
-0.7586969137191772,
-0.951465368270874,
0.07829678803682327,
-0.3143066167831421,
-0.19325010478496552,
-0.5245732665061951,
0.153761088848114,
-0.5723714232444763,
0.35513514280319214,
-0.008194872178137... |
func TranslatorTo(charset string) (Translator, error) {
var err error
var tr Translator
for _, f := range factories {
tr, err = f.TranslatorTo(charset)
if err == nil {
break
}
}
if tr == nil {
return nil, err
}
return tr, nil
} | [
-1.1138719320297241,
0.68848717212677,
0.4561813473701477,
-0.9167291522026062,
0.12281163781881332,
-1.1180150508880615,
0.2493939846754074,
-0.5938966274261475,
-0.7016010284423828,
-0.2814871370792389,
-0.3511126935482025,
-0.01965448446571827,
0.2758629322052002,
-0.22390703856945038,
... |
func NormalizedName(s string) string {
return strings.Map(normalizedChar, s)
} | [
0.24786214530467987,
-1.0051859617233276,
0.39811259508132935,
-0.46746504306793213,
-1.4502594470977783,
0.03260047733783722,
-0.5126707553863525,
0.11899814009666443,
0.9214373826980591,
0.2520366907119751,
-1.1126604080200195,
-0.035450395196676254,
0.033297374844551086,
-0.747075259685... |
func NewTranslatingWriter(w io.Writer, tr Translator) io.WriteCloser {
return &translatingWriter{w: w, tr: tr}
} | [
-0.17114245891571045,
-0.0403393916785717,
0.15396468341350555,
0.43084487318992615,
-1.6022058725357056,
-0.3995662331581116,
-0.7562988996505737,
0.14519181847572327,
-1.1293081045150757,
0.2523406744003296,
0.4486953318119049,
-0.95419842004776,
0.3665529489517212,
0.07129518687725067,
... |
func NewTranslatingReader(r io.Reader, tr Translator) io.Reader {
return &translatingReader{r: r, tr: tr}
} | [
0.09649574011564255,
-0.03422632813453674,
0.10792446881532669,
-0.3961459994316101,
-1.4657132625579834,
-0.35150158405303955,
-1.523681402206421,
0.11557793617248535,
-0.8057774305343628,
-0.16304229199886322,
0.3033832609653473,
-0.6169478297233582,
0.282826691865921,
-0.682393372058868... |
func ensureCap(s []byte, n int) []byte {
if n <= cap(s) {
return s
}
// logic adapted from appendslice1 in runtime
m := cap(s)
if m == 0 {
m = n
} else {
for {
if m < 1024 {
m += m
} else {
m += m / 4
}
if m >= n {
break
}
}
}
t := make([]byte, len(s), m)
copy(t, s)
return t... | [
0.368343323469162,
0.22579322755336761,
0.585823118686676,
0.8397549390792847,
-0.26460084319114685,
-0.5779547095298767,
-0.8608099818229675,
-1.464959740638733,
0.7926317453384399,
0.3350835144519806,
0.2692633867263794,
0.023197956383228302,
0.39847397804260254,
0.1682112216949463,
0.... |
func NewProject(path string, flagVCFG *vcfg.VCFG, logger elog.View) error {
logger.Printf("Creating project at '%s'", path)
vcfgPath := filepath.Join(path, "default.vcfg")
projectPath := filepath.Join(path, ".vorteilproject")
err := createVCFGFile(vcfgPath, flagVCFG)
if err != nil {
return err
}
err = creat... | [
0.8033033609390259,
0.2757890522480011,
0.278690904378891,
0.6389656066894531,
0.6119105219841003,
0.26049917936325073,
-0.16056731343269348,
-0.04194953292608261,
-0.684431254863739,
0.727859616279602,
-0.37694957852363586,
-0.09856808185577393,
-0.7238104343414307,
-0.007261650171130896,... |
func DocToJson(doc string, recast ...bool) (string, error) {
var r bool
if len(recast) == 1 {
r = recast[0]
}
m, merr := DocToMap(doc, r)
if m == nil || merr != nil {
return "", merr
}
b, berr := json.Marshal(m)
if berr != nil {
return "", berr
}
// NOTE: don't have to worry about safe JSON marshaling... | [
-0.7074205279350281,
-0.3744497299194336,
0.4655364453792572,
0.16201727092266083,
-1.3259555101394653,
-0.2328650802373886,
0.402946412563324,
-0.13225775957107544,
0.7563375234603882,
-0.010240819305181503,
-0.29650819301605225,
1.0690381526947021,
-0.028539396822452545,
0.42036664485931... |
func DocToJsonIndent(doc string, recast ...bool) (string, error) {
var r bool
if len(recast) == 1 {
r = recast[0]
}
m, merr := DocToMap(doc, r)
if m == nil || merr != nil {
return "", merr
}
b, berr := json.MarshalIndent(m, "", " ")
if berr != nil {
return "", berr
}
// NOTE: don't have to worry abou... | [
-0.5767776370048523,
-0.5528359413146973,
0.5784068703651428,
-0.4166659712791443,
-0.8818113207817078,
-0.3525453805923462,
-0.10558490455150604,
-0.22891029715538025,
0.2713785469532013,
0.19818146526813507,
-0.6841030120849609,
1.3107765913009644,
-0.6327407360076904,
0.2477957457304000... |
func DocToTree(doc string) (*Node, error) {
// xml.Decoder doesn't properly handle whitespace in some doc
// see songTextString.xml test case ...
reg, _ := regexp.Compile("[ \t\n\r]*<")
doc = reg.ReplaceAllString(doc, "<")
b := bytes.NewBufferString(doc)
p := xml.NewDecoder(b)
n, berr := xmlToTree("", nil, p)
... | [
0.49744802713394165,
0.30502188205718994,
0.5654199123382568,
-0.6413642764091492,
-0.9750950336456299,
0.02352157048881054,
0.28718122839927673,
-0.348154753446579,
0.4182446002960205,
-0.13081996142864227,
-0.5250632762908936,
0.16619059443473816,
-0.6756916642189026,
0.12292948365211487... |
func (n *Node) WriteTree(padding ...int) string {
var indent int
if len(padding) == 1 {
indent = padding[0]
}
var s string
if n.val != "" {
for i := 0; i < indent; i++ {
s += " "
}
s += n.key + " : " + n.val + "\n"
} else {
for i := 0; i < indent; i++ {
s += " "
}
s += n.key + " :" + "\n"
... | [
-0.9172571301460266,
0.3410229980945587,
0.8090366721153259,
-0.7100309729576111,
-0.0584840402007103,
0.2654208242893219,
-0.882369875907898,
0.08731333166360855,
-1.1174546480178833,
0.23639319837093353,
0.49510037899017334,
-0.17535439133644104,
-0.5197598934173584,
1.2598334550857544,
... |
func (n *Node) Get(key string) *Node {
for _, node := range n.nodes {
if node.key == key {
return node
}
}
return nil
} | [
-0.6828269362449646,
0.22146691381931305,
0.11332719027996063,
-0.608231782913208,
0.14018124341964722,
-0.643059492111206,
-1.0411851406097412,
-0.3308247923851013,
-0.8368165493011475,
0.7506862878799438,
0.24369987845420837,
1.0932362079620361,
-0.4606914520263672,
-0.30182892084121704,... |
func xmlToTree(skey string, a []xml.Attr, p *xml.Decoder) (*Node, error) {
n := new(Node)
n.nodes = make([]*Node, 0)
if skey != "" {
n.key = skey
if len(a) > 0 {
for _, v := range a {
na := new(Node)
na.attr = true
na.key = v.Name.Local
na.val = v.Value
n.nodes = append(n.nodes, na)
}
... | [
-0.3417925238609314,
0.03118101879954338,
0.7805792689323425,
-0.6371690034866333,
-0.9928221702575684,
-0.6547307372093201,
-0.5105928778648376,
0.14040258526802063,
0.11105543375015259,
0.6791064143180847,
-0.040807828307151794,
0.11319423466920853,
-0.340150386095047,
0.6113075613975525... |
func DocValue(doc, path string, attrs ...string) (interface{}, error) {
n, err := DocToTree(doc)
if err != nil {
return nil, err
}
m := make(map[string]interface{})
m[n.key] = n.treeToMap(false)
a, aerr := NewAttributeMap(attrs...)
if aerr != nil {
return nil, aerr
}
v, verr := MapValue(m, path, a)
if v... | [
-0.29404956102371216,
-0.007115393411368132,
0.7676814794540405,
0.19124384224414825,
-1.39565908908844,
0.12608648836612701,
0.019978756085038185,
0.4348689615726471,
-0.6686513423919678,
-0.19173932075500488,
0.35500088334083557,
0.15286599099636078,
0.6080866456031799,
0.337615311145782... |
func MapValue(m map[string]interface{}, path string, attr map[string]interface{}, r ...bool) (interface{}, error) {
// attribute values may have been recasted during map construction; default is 'false'.
if len(r) == 1 && r[0] == true {
for k, v := range attr {
attr[k] = recast(v.(string), true)
}
}
// pars... | [
-0.1948123276233673,
-0.6943286657333374,
1.1322317123413086,
0.08002439886331558,
-1.590694785118103,
-0.4044293165206909,
-0.04737125337123871,
0.4573958218097687,
0.2508610188961029,
0.48094791173934937,
1.1397556066513062,
0.10475075989961624,
0.41386547684669495,
0.22829870879650116,
... |
func NewAttributeMap(kv ...string) (map[string]interface{}, error) {
m := make(map[string]interface{}, 0)
for _, v := range kv {
vv := strings.Split(v, ":")
if len(vv) != 2 {
return nil, errors.New("attribute not \"name:value\" pair: " + v)
}
// attributes are stored as keys prepended with hyphen
m["-"+v... | [
-1.4063652753829956,
-1.007419228553772,
0.6368953585624695,
0.35629063844680786,
-0.7190456390380859,
0.11199627071619034,
-0.28903624415397644,
0.5451768636703491,
-0.1487049013376236,
0.9219003915786743,
-0.4288821816444397,
-0.41602176427841187,
0.6031479239463806,
0.3699639141559601,
... |
func ValuesForTag(doc, tag string) ([]interface{}, error) {
n, err := DocToTree(doc)
if err != nil {
return nil, err
}
m := make(map[string]interface{})
m[n.key] = n.treeToMap(false)
return ValuesForKey(m, tag), nil
} | [
-0.1256779581308365,
0.39668744802474976,
0.45905765891075134,
-0.3235176205635071,
0.3581966459751129,
-0.060805536806583405,
-0.8735696077346802,
0.14685866236686707,
-1.3936269283294678,
-0.08498888462781906,
-0.20024524629116058,
-0.08164030313491821,
0.23866985738277435,
1.64657831192... |
func ValuesForKey(m map[string]interface{}, key string) []interface{} {
ret := make([]interface{}, 0)
hasKey(m, key, &ret)
if len(ret) > 0 {
return ret
}
return nil
} | [
0.026913383975625038,
0.6453912258148193,
0.6160014867782593,
0.5319982767105103,
0.4399721622467041,
-0.5068185925483704,
-1.1601133346557617,
0.40142878890037537,
-1.0009386539459229,
0.11528144776821136,
0.4493078887462616,
-0.6600897312164307,
-0.038035452365875244,
1.7341951131820679,... |
func hasKey(iv interface{}, key string, ret *[]interface{}) {
switch iv.(type) {
case map[string]interface{}:
vv := iv.(map[string]interface{})
if v, ok := vv[key]; ok {
*ret = append(*ret, v)
}
for _, v := range iv.(map[string]interface{}) {
hasKey(v, key, ret)
}
case []interface{}:
for _, v := ra... | [
0.005080389324575663,
-0.11997668445110321,
0.7496165633201599,
1.2097666263580322,
0.4257597327232361,
-0.3429310917854309,
0.05737510696053505,
0.42509782314300537,
0.1797589808702469,
0.7627055644989014,
-0.10096520930528641,
-0.14474284648895264,
-0.4286574721336365,
0.6046172380447388... |
func PrintString() {
fmt.Println("I am an exported method")
packscope(10)
} | [
-0.006756884977221489,
0.2164786458015442,
0.5872758030891418,
0.3898843228816986,
0.21381576359272003,
-0.1391337513923645,
0.4138904809951782,
-0.4793371558189392,
0.8665575981140137,
0.15279147028923035,
0.1847018599510193,
0.810102105140686,
-0.058130376040935516,
0.4719531536102295,
... |
func (in *DnsDomain) DeepCopyInto(out *DnsDomain) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
} | [
-0.08303568512201309,
0.4433494210243225,
0.3302621841430664,
-0.010008846409618855,
-0.7163853049278259,
0.1590442657470703,
-0.11795861274003983,
0.07067268341779709,
-1.0359941720962524,
-0.6151328086853027,
-1.252866268157959,
1.6020569801330566,
0.22974854707717896,
-0.204344406723976... |
func (in *DnsDomain) DeepCopy() *DnsDomain {
if in == nil {
return nil
}
out := new(DnsDomain)
in.DeepCopyInto(out)
return out
} | [
-1.240216851234436,
1.6022144556045532,
-0.264397531747818,
0.5901035070419312,
-0.28233736753463745,
-0.30399730801582336,
-0.37719517946243286,
-0.8875307440757751,
0.1006883755326271,
-0.5538462400436401,
-1.1470261812210083,
0.9908679127693176,
-0.823371171951294,
-0.3000529110431671,
... |
func (in *DnsDomain) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.7991616725921631,
0.6512298583984375,
0.4392385482788086,
0.24965159595012665,
-0.6256186962127686,
0.5280836820602417,
0.6712968945503235,
-0.157875195145607,
-0.19931471347808838,
-0.9288758039474487,
-0.908223032951355,
0.5133067965507507,
0.14430484175682068,
-0.3976842164993286,
... |
func (in *DnsDomainList) DeepCopyInto(out *DnsDomainList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]DnsDomain, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
-0.5857864618301392,
0.5587756633758545,
0.5424851179122925,
0.47776293754577637,
-0.6137110590934753,
0.10836613178253174,
-0.3154500126838684,
0.6346961259841919,
-0.5070421099662781,
0.0696989893913269,
-1.4685323238372803,
0.7431971430778503,
0.030851220712065697,
0.11724435538053513,
... |
func (in *DnsDomainList) DeepCopy() *DnsDomainList {
if in == nil {
return nil
}
out := new(DnsDomainList)
in.DeepCopyInto(out)
return out
} | [
-1.2768667936325073,
0.8909091949462891,
-0.09695935994386673,
0.9438506960868835,
-0.42563655972480774,
-0.18345192074775696,
-0.4211101531982422,
-0.043420497328042984,
0.3771232068538666,
0.3213711380958557,
-1.4622811079025269,
-0.07325440645217896,
-0.28993040323257446,
0.211066052317... |
func (in *DnsDomainList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-1.0346354246139526,
0.37107956409454346,
0.472635954618454,
0.4824056029319763,
-0.509503960609436,
0.4541282653808594,
0.5438663959503174,
0.38035187125205994,
-0.1381322741508484,
-0.3246382474899292,
-1.4675004482269287,
-0.06547151505947113,
0.16959938406944275,
0.2957991659641266,
... |
func (in *DnsDomainSpec) DeepCopyInto(out *DnsDomainSpec) {
*out = *in
return
} | [
0.651384711265564,
0.6263081431388855,
0.20190994441509247,
-0.44392091035842896,
-0.5731077790260315,
0.38961049914360046,
0.16916523873806,
0.38388946652412415,
-0.9257726669311523,
-0.12952731549739838,
-0.7863715887069702,
1.0565152168273926,
0.7438851594924927,
-0.3241177201271057,
... |
func (in *DnsDomainSpec) DeepCopy() *DnsDomainSpec {
if in == nil {
return nil
}
out := new(DnsDomainSpec)
in.DeepCopyInto(out)
return out
} | [
-0.3031274676322937,
1.0080140829086304,
-0.3434576988220215,
-0.25923269987106323,
-0.4128163158893585,
-0.060304395854473114,
0.12025275826454163,
-0.46257054805755615,
0.026579169556498528,
0.6018497347831726,
-0.5655559301376343,
0.30364635586738586,
0.3333231508731842,
-0.204731196165... |
func (in *DnsDomainStatus) DeepCopyInto(out *DnsDomainStatus) {
*out = *in
if in.InstanceStatuses != nil {
in, out := &in.InstanceStatuses, &out.InstanceStatuses
*out = make(map[string]InstanceStatus, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
return
} | [
0.15748699009418488,
0.3815835118293762,
0.34116649627685547,
-0.4722004532814026,
-0.9465689659118652,
0.38268667459487915,
-0.48905813694000244,
0.7749193906784058,
-0.8326637744903564,
-0.36983177065849304,
-0.7770566344261169,
1.006333589553833,
0.31782981753349304,
-0.4346722364425659... |
func (in *DnsDomainStatus) DeepCopy() *DnsDomainStatus {
if in == nil {
return nil
}
out := new(DnsDomainStatus)
in.DeepCopyInto(out)
return out
} | [
-0.7968777418136597,
0.9394332766532898,
-0.5401609539985657,
-0.22101742029190063,
-0.5544010996818542,
-0.2914278507232666,
-0.571539044380188,
-0.5367458462715149,
0.2099745273590088,
-0.15491162240505219,
-1.331872582435608,
0.3526354134082794,
-0.24264250695705414,
-0.1137027218937873... |
func (in *DnsRule) DeepCopyInto(out *DnsRule) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
return
} | [
0.5482305288314819,
0.7176121473312378,
0.3961651921272278,
-0.3243755102157593,
-0.26860475540161133,
0.5541897416114807,
-0.565436601638794,
0.7479100227355957,
-1.5712168216705322,
-0.2458866387605667,
-0.8277594447135925,
1.2008692026138306,
0.24813182651996613,
-0.21162492036819458,
... |
func (in *DnsRule) DeepCopy() *DnsRule {
if in == nil {
return nil
}
out := new(DnsRule)
in.DeepCopyInto(out)
return out
} | [
-0.043118227273225784,
1.8192428350448608,
-0.17864403128623962,
0.27402326464653015,
0.12086161226034164,
0.3907080888748169,
-0.8736346364021301,
-0.19151423871517181,
-0.6215783953666687,
-0.22860106825828552,
-0.5076344609260559,
0.4606049060821533,
-0.8840452432632446,
-0.187050521373... |
func (in *DnsRule) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.14693930745124817,
0.807299017906189,
0.38773855566978455,
-0.15556153655052185,
-0.11713425070047379,
0.8104937672615051,
0.38137391209602356,
0.3747190833091736,
-0.7163889408111572,
-0.5244856476783752,
-0.4857965409755707,
0.010968192480504513,
-0.03810005635023117,
-0.1380424797534... |
func (in *DnsRuleList) DeepCopyInto(out *DnsRuleList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]DnsRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
-0.12005428224802017,
0.957504153251648,
0.5288758873939514,
0.19604267179965973,
0.17632508277893066,
0.354299396276474,
-0.7644060850143433,
0.8187099695205688,
-1.2365961074829102,
0.5539132952690125,
-1.1002622842788696,
0.7464190721511841,
-0.1816328465938568,
-0.11805754154920578,
... |
func (in *DnsRuleList) DeepCopy() *DnsRuleList {
if in == nil {
return nil
}
out := new(DnsRuleList)
in.DeepCopyInto(out)
return out
} | [
-1.0396596193313599,
1.4815431833267212,
-0.0820789635181427,
0.6857006549835205,
0.6048139929771423,
0.3699930012226105,
-0.9016844630241394,
0.004016687162220478,
-0.33943676948547363,
0.6464630365371704,
-1.1043857336044312,
0.3457823693752289,
-0.2768562436103821,
-0.23715190589427948,... |
func (in *DnsRuleList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.6426924467086792,
0.7475084662437439,
0.4763156771659851,
0.24127385020256042,
0.0889614149928093,
0.7886638641357422,
0.2917148470878601,
0.5756261348724365,
-0.6155004501342773,
0.020235564559698105,
-1.0517091751098633,
-0.07692521810531616,
-0.008075475692749023,
0.06758512556552887... |
func (in *DnsRuleSpec) DeepCopyInto(out *DnsRuleSpec) {
*out = *in
return
} | [
0.846178412437439,
1.1398022174835205,
0.1179620772600174,
-0.47576549649238586,
-0.016676735132932663,
0.7162342667579651,
-0.08636079728603363,
0.7671828269958496,
-1.6542010307312012,
0.37660282850265503,
-0.7417188286781311,
1.2400072813034058,
0.45373332500457764,
-0.6195058822631836,... |
func (in *DnsRuleSpec) DeepCopy() *DnsRuleSpec {
if in == nil {
return nil
}
out := new(DnsRuleSpec)
in.DeepCopyInto(out)
return out
} | [
0.06665105372667313,
1.5388611555099487,
-0.43604668974876404,
-0.19675463438034058,
0.12705397605895996,
0.3990117311477661,
-0.2203723043203354,
-0.22751963138580322,
-0.7212816476821899,
0.8891898989677429,
-0.30998072028160095,
0.4877239465713501,
0.270352303981781,
-0.7226473093032837... |
func (in *DnsRuleStatus) DeepCopyInto(out *DnsRuleStatus) {
*out = *in
return
} | [
0.6447421908378601,
0.8641634583473206,
-0.01833847165107727,
-0.6678609251976013,
-0.03133402392268181,
0.5482568144798279,
-0.8311284184455872,
0.805896520614624,
-1.4429024457931519,
0.011025519110262394,
-1.4078198671340942,
1.189509391784668,
0.34386682510375977,
-0.5000526309013367,
... |
func (in *DnsRuleStatus) DeepCopy() *DnsRuleStatus {
if in == nil {
return nil
}
out := new(DnsRuleStatus)
in.DeepCopyInto(out)
return out
} | [
-0.43775737285614014,
1.2277110815048218,
-0.6958574652671814,
-0.5226324796676636,
0.2648419141769409,
0.014039471745491028,
-1.2349584102630615,
-0.11963130533695221,
-0.5145747065544128,
0.25436344742774963,
-1.2700560092926025,
0.4618109166622162,
-0.10817696154117584,
-0.2263849079608... |
func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus) {
*out = *in
return
} | [
0.4290044605731964,
-0.39402827620506287,
0.30799081921577454,
-0.08896324038505554,
-0.8654502034187317,
0.9077817797660828,
-0.5256476402282715,
0.9271432161331177,
-1.05057692527771,
-0.22793157398700714,
-1.0618022680282593,
1.5761502981185913,
0.21222005784511566,
-0.7028982639312744,... |
func (in *InstanceStatus) DeepCopy() *InstanceStatus {
if in == nil {
return nil
}
out := new(InstanceStatus)
in.DeepCopyInto(out)
return out
} | [
-0.1867850124835968,
-0.23367901146411896,
-0.19726194441318512,
0.05956578999757767,
-0.8593798875808716,
0.3864537179470062,
-0.5089228749275208,
0.07260069996118546,
-0.20171789824962616,
-0.32172533869743347,
-0.6196780204772949,
0.7913598418235779,
-0.8886433243751526,
-0.552935719490... |
func fileExists(filename string) bool {
_, err := os.Stat(filename)
if err == nil || !os.IsNotExist(err) {
return true
}
return false
} | [
-0.6477662920951843,
-0.21588534116744995,
0.5989327430725098,
-0.19100329279899597,
1.4750152826309204,
0.9901079535484314,
-0.5306180715560913,
0.7164552807807922,
-0.8743975162506104,
-0.392100065946579,
-0.04542270675301552,
-0.7599936723709106,
0.1661807745695114,
0.7843732833862305,
... |
func renameFile(oldName string, newName string) bool {
err := os.Rename(oldName, newName)
if err != nil {
_ = os.Remove(oldName)
log.Println("Failed to rename file")
return false
}
return true
} | [
0.06425320357084274,
-0.14904649555683136,
0.8766493797302246,
0.042612604796886444,
0.10328863561153412,
0.8624389171600342,
-0.47184106707572937,
0.4004109501838684,
-1.119104027748108,
0.6526992321014404,
0.21000754833221436,
-0.11471422761678696,
-0.4738430082798004,
-0.220504328608512... |
func createTmpFile(pattern string) (*os.File, bool) {
file, err := ioutil.TempFile("", "tmp-"+pattern+"-*")
if err != nil {
log.Println("Error creating temp file.")
return nil, false
}
return file, true
} | [
0.14468839764595032,
0.2843540906906128,
0.6180206537246704,
-0.8544182777404785,
0.5611844062805176,
0.8078011870384216,
-0.2757924199104309,
-0.12023460865020752,
-0.47713401913642883,
0.5966075658798218,
-0.6081475019454956,
-1.340211272239685,
-0.737391471862793,
-0.13131733238697052,
... |
func Routes(clientset *kubernetes.Clientset) *chi.Mux {
router := chi.NewRouter()
router.Use(
middleware.Logger,
// Redirect slashes to the correct endpoint
middleware.RedirectSlashes,
// Allow recovery from failed middleware
middleware.Recoverer,
// Set request header content type Json
render.SetC... | [
-0.26976779103279114,
-0.30058759450912476,
0.8377372622489929,
-0.07839516550302505,
-0.43921077251434326,
-0.1917593628168106,
-0.8169048428535461,
-0.16193264722824097,
0.27172914147377014,
0.2602367401123047,
0.5323379039764404,
0.4465535581111908,
0.09093145281076431,
0.12484076619148... |
func ReviewQuery(ctx context.Context, cfg *config.Config, urlQuery url.Values) (SearchURLParams, error) {
var validatedQueryParams SearchURLParams
validatedQueryParams.Query = urlQuery.Get("q")
err := reviewPagination(ctx, cfg, urlQuery, &validatedQueryParams)
if err != nil {
log.Event(ctx, "unable to review pa... | [
-0.41809824109077454,
-0.18879681825637817,
0.4718993604183197,
-0.10574851185083389,
-0.2657501995563507,
0.07428288459777832,
-0.7986433506011963,
-0.12032768130302429,
0.028218548744916916,
-0.04637908190488815,
0.5196633338928223,
0.6273010969161987,
-0.3183757960796356,
0.712678253650... |
func GetSearchAPIQuery(validatedQueryParams SearchURLParams) url.Values {
apiQuery := createSearchAPIQuery(validatedQueryParams)
// update content_type query (filters) with sub filters
updateQueryWithAPIFilters(apiQuery)
return apiQuery
} | [
-0.29248860478401184,
-0.8134971261024475,
0.38595205545425415,
0.8654599785804749,
0.507777750492096,
-0.06506434082984924,
-0.6493843197822571,
0.156398743391037,
-0.3427802622318268,
0.26320475339889526,
-0.19271254539489746,
0.8179430365562439,
-0.5010359883308411,
0.17157521843910217,... |
func MeasureWorker(channel chan Measurement, adc adcpi.Interface, flexingChannel byte, extendingChannel byte,
speedChannel byte, speed int, interval float64) {
// Measure data and write it to the channel
// Passing true to the for loop creates an infinite loop that never stops, unless
// The program is... | [
0.3815194368362427,
-0.1518307626247406,
0.7937106490135193,
-0.45716771483421326,
0.13507798314094543,
0.35474637150764465,
-0.9674364924430847,
0.25240859389305115,
-0.7150242924690247,
-0.13161601126194,
-0.36079472303390503,
0.2873888909816742,
-0.8467186689376831,
0.6834954619407654,
... |
func (this *MsSql) GenSelect(da *entity.DbData) string {
if da == nil {
return ``
}
s := make([]string, 0)
s = append(s, "SELECT ")
fields := strings.Split(da.Fields, ",")
for _, field := range fields {
s = append(s, entity.DbMapLeft[da.DbType])
s = append(s, field)
s = append(s, entity.DbMapRight[da.DbT... | [
-0.5035397410392761,
-0.07443513721227646,
0.9379291534423828,
-0.5593346953392029,
-0.7833837270736694,
-0.1318121999502182,
-0.050572168081998825,
-0.37542903423309326,
0.2109033167362213,
0.36297106742858887,
-0.3900212049484253,
-0.14846812188625336,
0.8414578437805176,
0.0085336090996... |
func (p *Package) InitPackage(repo abaputils.Repository, conn abapbuild.Connector) {
p.Connector = conn
p.ComponentName = repo.Name
p.VersionYAML = repo.VersionYAML
p.PackageName = repo.PackageName
p.Status = PackageStatus(repo.Status)
} | [
-0.06583509594202042,
-0.2627182602882385,
0.40239956974983215,
-0.12127082794904709,
0.894101083278656,
-0.09696453809738159,
-0.22122198343276978,
1.4454492330551147,
0.4855189323425293,
-0.3552163243293762,
-0.6358088254928589,
-0.0869409367442131,
0.3167615532875061,
0.721114993095398,... |
func (p *Package) CopyFieldsToRepo(initialRepo *abaputils.Repository) {
initialRepo.PackageName = p.PackageName
initialRepo.PackageType = p.Type
initialRepo.PredecessorCommitID = p.PredecessorCommitID
initialRepo.Status = string(p.Status)
initialRepo.Namespace = p.Namespace
} | [
-0.11768301576375961,
0.25767940282821655,
0.1991431564092636,
-1.2262893915176392,
-0.24873819947242737,
0.2100779414176941,
-0.2864817678928375,
0.25508731603622437,
0.047391679137945175,
0.2959859371185303,
-1.0329840183258057,
-0.29552555084228516,
0.13954579830169678,
-0.4600457549095... |
func (p *Package) ReserveNext() error {
if p.ComponentName == "" || p.VersionYAML == "" {
return errors.New("Parameters missing. Please provide the name and version of the component")
}
log.Entry().Infof("... determining package name and attributes for software component %s version %s", p.ComponentName, p.VersionY... | [
-0.5726175308227539,
0.17087030410766602,
0.5384063720703125,
-0.08520948141813278,
-0.10295048356056213,
-0.5578075051307678,
-0.6830325126647949,
0.0304420068860054,
0.5909019708633423,
0.3114314675331116,
0.030119139701128006,
0.6027558445930481,
-0.07387888431549072,
0.4301072657108307... |
func (p *Package) GetPackageAndNamespace() error {
appendum := "/odata/aas_ocs_package/OcsPackageSet('" + url.QueryEscape(p.PackageName) + "')"
body, err := p.Connector.Get(appendum)
if err != nil {
return err
}
var jPck jsonPackage
if err := json.Unmarshal(body, &jPck); err != nil {
return errors.Wrap(err, ... | [
-0.7779017090797424,
0.1277494877576828,
0.4732978641986847,
-0.7615048289299011,
0.014902983792126179,
-0.4649142026901245,
-0.5555975437164307,
-0.48291364312171936,
1.5210225582122803,
0.001814728369936347,
0.7948519587516785,
0.40633973479270935,
0.29195430874824524,
1.0578868389129639... |
func (p *Package) ChangeStatus(initialRepo *abaputils.Repository) {
initialRepo.Status = string(p.Status)
} | [
-0.06134622544050217,
-0.23870928585529327,
0.03895335644483566,
-1.0276426076889038,
0.8206519484519958,
0.6183909773826599,
-0.6751152276992798,
1.7725310325622559,
0.12522126734256744,
0.40787431597709656,
-0.6400787234306335,
1.4159116744995117,
0.4442076086997986,
1.0529730319976807,
... |
func (p *Package) Register() error {
if p.PackageName == "" {
return errors.New("Parameter missing. Please provide the name of the package which should be registered")
}
log.Entry().Infof("Register package %s", p.PackageName)
p.Connector.GetToken("/odata/aas_ocs_package")
appendum := "/odata/aas_ocs_package/Regi... | [
-1.661486268043518,
0.9098465442657471,
0.5991131067276001,
-0.43789103627204895,
1.0399936437606812,
-0.6891597509384155,
-0.43333330750465393,
-0.2690795063972473,
0.048793017864227295,
0.07001609355211258,
-0.053004078567028046,
0.3029228150844574,
0.18062101304531097,
0.397639632225036... |
func (p *Package) Release() error {
var body []byte
var err error
log.Entry().Infof("Release package %s", p.PackageName)
p.Connector.GetToken("/odata/aas_ocs_package")
appendum := "/odata/aas_ocs_package/ReleasePackage?Name='" + url.QueryEscape(p.PackageName) + "'"
body, err = p.Connector.Post(appendum, "")
if e... | [
-1.7173774242401123,
0.7432586550712585,
0.4665061831474304,
-0.5981276631355286,
0.43067389726638794,
-0.768054723739624,
-0.3675249218940735,
-0.625533401966095,
0.49837255477905273,
0.36354824900627136,
0.1640716791152954,
0.4544781446456909,
-0.2197791188955307,
0.1041676327586174,
0... |
func (w *Worker) Name() string {
w.mu.RLock()
defer w.mu.RUnlock()
return w.wr.name
} | [
-0.6793031692504883,
-0.17171990871429443,
0.4711027145385742,
0.3398614227771759,
-0.750543475151062,
0.33762699365615845,
0.603152334690094,
-0.8276979923248291,
-0.8114138841629028,
0.6690264940261841,
-0.2532501220703125,
-0.28894495964050293,
-1.1144415140151978,
0.4513743221759796,
... |
func (w *Worker) SetName(n string) {
w.mu.Lock()
defer w.mu.Unlock()
w.wr.name = n
} | [
-0.8853074312210083,
0.5916795134544373,
0.463127076625824,
0.21115544438362122,
-0.15148858726024628,
-0.09043524414300919,
-0.06637623906135559,
-0.4078187644481659,
-0.8825297355651855,
0.6968932151794434,
-1.115067720413208,
-0.24417556822299957,
-1.1600828170776367,
0.9149597883224487... |
func (w *Worker) Parent() *Client {
w.mu.RLock()
defer w.mu.RUnlock()
return w.wr.parent
} | [
0.4749637544155121,
0.11340229213237762,
0.39141345024108887,
-0.17340685427188873,
-0.7106279730796814,
0.2157420665025711,
1.5649056434631348,
-1.407478928565979,
-0.9515502452850342,
-0.743927538394928,
0.700869083404541,
0.34963807463645935,
-1.8648585081100464,
-0.1747945249080658,
... |
func (w *Worker) SetParent(p *Client) {
w.mu.Lock()
defer w.mu.Unlock()
w.wr.parent = p
} | [
0.016191251575946808,
0.555885910987854,
0.25817057490348816,
-0.3482581675052643,
-0.5130060315132141,
0.877558171749115,
0.9941108822822571,
-0.9017824530601501,
-0.8458461165428162,
-0.10167592018842697,
-0.4691236615180969,
0.5090922713279724,
-1.675524115562439,
0.146581768989563,
-... |
func (w *Worker) Session() *Session {
w.mu.RLock()
defer w.mu.RUnlock()
return w.s
} | [
-0.609426736831665,
-0.6496450901031494,
0.32090964913368225,
0.3868628740310669,
-0.32203420996665955,
0.018119871616363525,
1.5776252746582031,
-1.1593971252441406,
0.9681858420372009,
-1.1984258890151978,
0.0632006898522377,
0.5116947293281555,
-1.1847556829452515,
-0.3026896119117737,
... |
func (w *Worker) SetSession(s *Session) {
w.mu.Lock()
defer w.mu.Unlock()
w.s = s
} | [
-0.5347056984901428,
-0.4942839741706848,
0.14991876482963562,
0.6120913028717041,
0.0834028571844101,
0.05235176533460617,
1.0559625625610352,
-0.17196111381053925,
0.799872875213623,
-0.4457113444805145,
-1.391772985458374,
0.8157193064689636,
-0.5378021597862244,
0.05472303554415703,
... |
func (w *Worker) IncrementShares(sessionDifficulty float64, reward float64) {
p := w.s.Client.pool
cbid := p.cs.CurrentBlock().ID()
blockTarget, _ := p.cs.ChildTarget(cbid)
blockDifficulty, _ := blockTarget.Difficulty().Uint64()
sessionTarget, _ := difficultyToTarget(sessionDifficulty)
siaSessionDifficulty, _ :=... | [
-0.10971780121326447,
-0.0598481148481369,
0.792291522026062,
0.043662458658218384,
-0.05489927902817726,
0.36461347341537476,
0.8409597873687744,
-0.10220406949520111,
0.4757622182369232,
-0.2688188850879669,
-0.1923806220293045,
0.4399409592151642,
-0.5790190696716309,
-0.094598211348056... |
func (w *Worker) IncrementInvalidShares() {
w.s.Shift().IncrementInvalid()
} | [
0.0012510981177911162,
-0.3171755075454712,
0.45387476682662964,
1.0596054792404175,
-0.1167113184928894,
1.090569019317627,
0.6542112231254578,
0.23491807281970978,
0.052967023104429245,
-1.3250882625579834,
0.46247684955596924,
0.12622524797916412,
-0.6164135336875916,
0.3417472839355469... |
func (w *Worker) SetLastShareTime(t time.Time) {
w.s.Shift().SetLastShareTime(t)
} | [
-0.21086959540843964,
-0.42906615138053894,
0.5384309887886047,
-0.06870756298303604,
-0.02327442541718483,
0.6236763000488281,
0.11965388059616089,
-0.3770168125629425,
0.0110063087195158,
0.7588502168655396,
-0.9156813621520996,
-0.9440605044364929,
-0.5078704357147217,
0.945351243019104... |
func (w *Worker) LastShareTime() time.Time {
return w.s.Shift().LastShareTime()
} | [
0.13539493083953857,
-0.25374314188957214,
0.5956111550331116,
-0.06370621174573898,
-0.15661755204200745,
-0.18814024329185486,
0.14595089852809906,
-0.2997698187828064,
0.14716361463069916,
0.7080676555633545,
-0.5380859375,
-0.8570469617843628,
-1.0206838846206665,
0.4634001553058624,
... |
func (w *Worker) CurrentDifficulty() float64 {
pool := w.wr.parent.Pool()
d := pool.dispatcher
d.mu.Lock()
defer d.mu.Unlock()
workerCount := uint64(0)
currentDiff := float64(0.0)
for _, h := range d.handlers {
if h.s.Client != nil && h.s.Client.Name() == w.Parent().Name() && h.s.CurrentWorker.Name() == w.Name... | [
-0.1334458589553833,
-0.7300975322723389,
0.6636159420013428,
-0.25603100657463074,
-0.01786884106695652,
0.9161434769630432,
1.5178714990615845,
-0.3977552354335785,
-0.5676265954971313,
-0.3302317261695862,
0.07679598778486252,
0.5817047357559204,
-0.37038323283195496,
1.2993834018707275... |
func (w *Worker) Online() bool {
return w.s != nil
} | [
-0.14879143238067627,
-0.5800971984863281,
0.4571796953678131,
1.0785373449325562,
-0.20426952838897705,
0.013141836039721966,
-1.0646439790725708,
1.166266679763794,
-0.8365122675895691,
-0.01878315769135952,
-1.216526985168457,
-0.6782174110412598,
-0.6377918124198914,
0.0116259595379233... |
func (p *SpecificDeriver) DeriveLvl1(meta Lvl1Meta, key Key) (Key, error) {
len := inputDeriveLvl1(p.buf[:], meta)
outKey, err := deriveKey(p.buf[:], len, key)
return outKey, err
} | [
0.037886351346969604,
-0.34352952241897583,
0.59848952293396,
0.8772287964820862,
-0.8873387575149536,
0.5827950239181519,
0.10718930512666702,
0.44162729382514954,
-0.3360271453857422,
1.0033892393112183,
-0.20522981882095337,
0.573734700679779,
-0.3816295564174652,
0.5382183790206909,
... |
func (p *SpecificDeriver) DeriveASHost(meta ASHostMeta, key Key) (Key, error) {
host, err := packtoHostAddr(meta.DstHost)
if err != nil {
return Key{}, serrors.WrapStr("parsing dst host", err)
}
len := p.inputDeriveLvl2(p.buf[:], asToHost, host)
outKey, err := deriveKey(p.buf[:], len, key)
return outKey, err
} | [
-0.3456835150718689,
0.5187712907791138,
0.6045050024986267,
0.40750858187675476,
-0.7271475791931152,
-0.6004647016525269,
0.15304672718048096,
0.5453789830207825,
-0.631060779094696,
0.5365824103355408,
-0.851237952709198,
0.5140724182128906,
0.48233065009117126,
0.38637611269950867,
0... |
func (p *SpecificDeriver) DeriveHostAS(meta HostASMeta, key Key) (Key, error) {
host, err := packtoHostAddr(meta.SrcHost)
if err != nil {
return Key{}, serrors.WrapStr("parsing src host", err)
}
len := p.inputDeriveLvl2(p.buf[:], hostToAS, host)
outKey, err := deriveKey(p.buf[:], len, key)
return outKey, err
} | [
-0.9483985304832458,
0.2879024147987366,
0.3688836693763733,
-0.0003353161446284503,
-0.6870996356010437,
-0.2246204912662506,
0.27644845843315125,
-0.06320417672395706,
-0.0633625015616417,
0.13670223951339722,
-0.5579851865768433,
0.41982296109199524,
0.5141496062278748,
0.66192060708999... |
func (p *SpecificDeriver) DeriveHostToHost(dstHost string, key Key) (Key, error) {
host, err := packtoHostAddr(dstHost)
if err != nil {
return Key{}, serrors.WrapStr("deriving input H2H", err)
}
len := inputDeriveHostToHost(p.buf[:], host)
outKey, err := deriveKey(p.buf[:], len, key)
return outKey, err
} | [
-0.3773297667503357,
0.2761121988296509,
0.5023682117462158,
-0.042391337454319,
-0.3900034427642822,
0.024355262517929077,
0.3653877377510071,
0.4764785170555115,
-1.0408751964569092,
0.10600627213716507,
-0.5985281467437744,
0.6867496371269226,
0.16664087772369385,
0.22140681743621826,
... |
func NewCover(upstream, policyPath string) (*KubeCover, error) {
// step: parse and validate the upstreams
location, err := url.Parse(upstream)
if err != nil {
return nil, fmt.Errorf("invalid upstrem url, %s", err)
}
service := new(KubeCover)
service.upstream = location
glog.Infof("kubernetes api: %s", servi... | [
-0.1619553565979004,
-0.5643712878227234,
0.7549857497215271,
0.21679435670375824,
-0.21132312715053558,
-0.016954855993390083,
-0.3783838152885437,
-0.06669440865516663,
0.2589779198169708,
0.4081473648548126,
-0.057633012533187866,
0.5960899591445923,
-1.018880844116211,
0.16795146465301... |
func (r *KubeCover) decodeInput(req *http.Request, data interface{}) (string, error) {
// step: read in the content payload
content, err := ioutil.ReadAll(req.Body)
if err != nil {
glog.Errorf("unable to read in the content, error: %s", err)
return "", err
}
defer func() {
// we need to set the content back
... | [
-0.5200321674346924,
-0.616010844707489,
0.8245100975036621,
-0.33678773045539856,
-0.9175746440887451,
0.523273766040802,
-0.706677258014679,
-0.40786007046699524,
0.11691942065954208,
0.0546196848154068,
0.2905169427394867,
0.45441752672195435,
-0.9150142073631287,
-0.22056598961353302,
... |
func (r *KubeCover) Run(address, certFile, privateFile string) error {
if err := r.engine.RunTLS(address, certFile, privateFile); err != nil {
return err
}
return nil
} | [
-0.08088018000125885,
-0.2953282296657562,
0.4940066635608673,
-0.013112802058458328,
-0.4378606677055359,
0.6773500442504883,
-0.4456694722175598,
0.1410311460494995,
-0.519615650177002,
0.4382674992084503,
-0.22378097474575043,
0.21905210614204407,
-0.13338620960712433,
0.129963219165802... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.