text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func RunServerWithConfig(configFile string) (srv *gnatsd.Server, opts *gnatsd.Options) {
opts = LoadConfig(configFile)
srv = RunServer(opts)
return
} | [
-1.0732139348983765,
-0.8057794570922852,
0.4068063497543335,
-0.03795885294675827,
-0.488717257976532,
0.7257416248321533,
-0.23850767314434052,
-0.019619906321167946,
-0.037532661110162735,
-0.068470299243927,
-0.682922899723053,
0.15152636170387268,
0.07888377457857132,
0.88760256767272... |
func (c *Client) EvaluateMappingTemplate(ctx context.Context, params *EvaluateMappingTemplateInput, optFns ...func(*Options)) (*EvaluateMappingTemplateOutput, error) {
if params == nil {
params = &EvaluateMappingTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "EvaluateMappingTemplate", params, o... | [
-1.9351171255111694,
0.5727372169494629,
0.7456766963005066,
-0.4260457456111908,
-0.38547298312187195,
-0.5074812173843384,
0.5428463220596313,
-0.2594856321811676,
0.5691965818405151,
0.25640028715133667,
-0.5523489713668823,
0.35321494936943054,
-0.6461927890777588,
-0.7516435384750366,... |
func (g *GDB) Init() dbgp.InitResponse {
g.consumeLines(g.stdout, defaultWait)
fileName, lang, _ := g.currentFilenameAndLang()
g.features.Language_name = lang
return dbgp.InitResponse{
AppID: "gdbproxy",
IDeKey: g.ideKey,
Session: g.session,
Thread: "1",
Language: lang,
FileURI: "file://" + fi... | [
0.1962975412607193,
-0.4087967872619629,
0.5186649560928345,
-0.9873164296150208,
0.08404743671417236,
-0.15524350106716156,
-0.10534141957759857,
-0.47198399901390076,
-1.2213250398635864,
0.026935158297419548,
0.23971793055534363,
0.19380773603916168,
-1.3355618715286255,
0.8988155126571... |
func New(target, ideKey, session string) (*GDB, error) {
cmd := exec.Command("gdb", target)
stdout, err := cmd.StdoutPipe()
if err != nil {
return nil, err
}
stderr, err := cmd.StderrPipe()
if err != nil {
return nil, err
}
stdin, err := cmd.StdinPipe()
if err != nil {
return nil, err
}
if err := cmd.S... | [
-0.36207571625709534,
-0.34181368350982666,
0.7326931357383728,
0.1662604808807373,
-0.5331698656082153,
0.11735772341489792,
0.03733471408486366,
-0.9640359878540039,
-0.8559525012969971,
0.31150755286216736,
0.22649821639060974,
0.25799861550331116,
-0.2629128098487854,
0.635704100131988... |
func (g *GDB) getType(symbol string) string {
g.stdin <- "ptype " + symbol
typeInfo := g.stdoutLines()
if len(typeInfo) == 0 {
return "unknown"
}
ti := typeInfo[0]
ti = strings.Replace(ti, "type = struct ", "", 1)
ti = strings.Replace(ti, " {", "", 1)
return ti
} | [
-0.09117858856916428,
0.8291597366333008,
0.635643720626831,
0.25064152479171753,
0.5250681638717651,
-0.2153782993555069,
0.8517074584960938,
-1.5846575498580933,
-0.32050079107284546,
0.7755269408226013,
-0.11413649469614029,
0.22525492310523987,
-0.9772890210151672,
0.16258248686790466,... |
func (g *GDB) currentFilenameAndLang() (lineNumber, lang string, err error) {
//go io.Copy(g.stdin, os.Stdin) // @todo consider user stdin
g.stdin <- "list 1"
// not interested in list output, needed for "info source"
g.stdoutLines()
g.stdin <- "info source"
sourceInfo := g.stdoutLines()
info := strings.Join(so... | [
0.11124034970998764,
-1.481877326965332,
0.6426711678504944,
-0.35082995891571045,
-0.9619231820106506,
-0.05093683302402496,
0.4060962498188019,
0.24209606647491455,
-0.6544765830039978,
0.1351373940706253,
-0.1804649978876114,
-0.1376296728849411,
-0.13586586713790894,
1.042583703994751,... |
func (g *GDB) currentLineNumber() (int, error) {
//go io.Copy(g.stdin, os.Stdin) // @todo consider user stdin
g.stdin <- "where"
lineInfo := g.stdoutLines()
parts := strings.Join(lineInfo, "\n")
whereRe := regexp.MustCompile("at (.+):([0-9]+)")
matches := whereRe.FindStringSubmatch(parts)
if len(matches) != 3... | [
-0.07630879431962967,
-1.2592926025390625,
0.5340929627418518,
0.10793151706457138,
-0.7308958172798157,
-0.2874331474304199,
0.30872562527656555,
0.2596267759799957,
-1.0841156244277954,
-0.39277005195617676,
-0.15486975014209747,
0.004542053677141666,
0.05341183766722679,
0.1033169850707... |
func (g *GDB) stdoutLines() []string {
result := g.consumeLines(g.stdout, defaultWait)
for i, l := range result {
result[i] = strings.Replace(l, "(gdb) ", "", 1)
}
return result
} | [
0.38842880725860596,
-0.08388926088809967,
0.5642498135566711,
-0.06351939588785172,
-0.25879061222076416,
0.3227567672729492,
-0.8445125222206116,
-1.4024099111557007,
-0.4734950661659241,
1.2426003217697144,
-0.1724153310060501,
-0.0988713949918747,
-1.1577603816986084,
0.491927415132522... |
func (g *GDB) consumeLines(c <-chan string, maxWait time.Duration) []string {
result := make([]string, 0, 10)
for {
select {
case line := <-c:
result = append(result, line)
glog.V(2).Infoln("(gdb) ", line)
case err := <-g.errChan:
glog.Warningln("error while consuming:", err)
case <-time.After(maxWai... | [
0.6034732460975647,
0.04878350347280502,
0.5283640027046204,
-0.2647639214992523,
0.5329503417015076,
0.3213815689086914,
-1.055574655532837,
-0.47723186016082764,
-0.2668159008026123,
0.901016891002655,
0.2612609267234802,
-0.3434312045574188,
-0.394999623298645,
1.0008784532546997,
0.4... |
func scanReaderToan(r io.Reader, errChan chan<- error) <-chan string {
c := make(chan string)
scanner := bufio.NewScanner(r)
go func() {
for scanner.Scan() {
c <- scanner.Text()
}
if err := scanner.Err(); err != nil {
errChan <- err
}
}()
return c
} | [
-0.39056453108787537,
-1.0486661195755005,
0.7015332579612732,
-0.6507340669631958,
-1.0796101093292236,
-0.035208363085985184,
0.09769053012132645,
-0.8600917458534241,
-0.022698070853948593,
-0.5659030079841614,
0.056909069418907166,
-0.12940315902233124,
0.10077129304409027,
-0.33805009... |
func stringanToWriter(w io.Writer, errChan chan<- error) chan<- string {
c := make(chan string)
bw := bufio.NewWriter(w)
go func() {
for {
s := <-c
_, err := bw.WriteString(s)
if err != nil {
errChan <- err
}
_, err = bw.WriteString("\n")
if err != nil {
errChan <- err
}
glog.V(1).I... | [
0.09098631143569946,
-0.9431907534599304,
0.4399559795856476,
-0.8300503492355347,
0.11442166566848755,
-0.160734623670578,
0.384093701839447,
-0.9339241981506348,
-0.7048519849777222,
0.11191030591726303,
0.006464148871600628,
0.24693405628204346,
0.2587125897407532,
-0.13449744880199432,... |
func stripAbsFilePrefix(lineNumber string) string {
return strings.TrimPrefix(lineNumber, "file://")
} | [
0.5446292161941528,
-0.9264271259307861,
0.4706171452999115,
-1.3989733457565308,
-0.46204251050949097,
0.8470724821090698,
0.08275113999843597,
0.5217835307121277,
0.06982651352882385,
0.39335888624191284,
0.40220460295677185,
-0.6051136255264282,
1.0730164051055908,
-0.2843347191810608,
... |
func reExtract(regex, target string, matchGroup ...int) ([]string, error) {
results := make([]string, 0)
matches := regexp.MustCompile(regex).FindStringSubmatch(target)
for _, mg := range matchGroup {
if mg > len(matches)-1 {
return nil, fmt.Errorf("not enough matches")
}
results = append(results, matches[m... | [
-0.9507846236228943,
0.22522857785224915,
0.7673145532608032,
0.3658352792263031,
0.03647914528846741,
-0.9885344505310059,
-0.006266759242862463,
-0.11463439464569092,
-0.4907069802284241,
0.5945231318473816,
0.21824124455451965,
0.3081473112106323,
-0.9417473673820496,
-0.620326638221740... |
func ValidateServiceBody(c *routing.Context) (service.Service, error) {
var s service.Service
err := json.Unmarshal(c.Request.Body(), &s)
if s.Name == "" || len(s.Hosts) == 0 || s.MatchingURI == "" || s.ToURI == "" || s.APIDocumentation == "" {
return service.Service{}, errors.New("Missing body parameters")
}
i... | [
-0.7593483924865723,
-0.3624655306339264,
0.6001470685005188,
0.14801998436450958,
0.0027499953284859657,
0.41252654790878296,
-0.05018433928489685,
-0.884710431098938,
0.36381974816322327,
-0.1552255004644394,
0.48711133003234863,
0.38832610845565796,
-0.9523757696151733,
0.88097470998764... |
func ValidateServiceExists(s service.Service) (service.Service, error) {
sd := GetInternalServiceDiscoveryObject()
ser, err := sd.FindService(s)
if err != nil {
return service.Service{}, errors.New(`Service not found`)
}
return ser, nil
} | [
-0.6974689960479736,
-1.1241556406021118,
0.2514894902706146,
0.264516681432724,
0.39882567524909973,
0.17047859728336334,
0.14140547811985016,
-0.8493219017982483,
0.570168137550354,
-0.5273407101631165,
0.22090736031532288,
0.5809879302978516,
-0.22884728014469147,
0.34787386655807495,
... |
func ValidateServiceBodyAndServiceExists(c *routing.Context, serviceID string) (service.Service, int, error) {
s, err := ValidateServiceBody(c)
if err != nil {
return service.Service{}, 400, err
}
if serviceID != "" {
s.Id = bson.ObjectIdHex(serviceID)
}
_, err = ValidateServiceExists(s)
if err != nil {
... | [
-1.1651569604873657,
-1.519835352897644,
0.6603683233261108,
-0.025846263393759727,
0.0098792789503932,
0.6781819462776184,
0.07501993328332901,
0.0015124425990507007,
0.9119617938995361,
-0.18276119232177734,
-0.2470511645078659,
1.125878930091858,
-0.17146113514900208,
1.4113489389419556... |
func FromRawUserToLoginUser(user user.User) UserLoginDTO {
return UserLoginDTO{
ID: user.GetID(),
Name: user.GetName(),
Lastname: user.GetLastname(),
Email: user.GetEmail(),
EmailVerified: user.HasEmailVerified(),
Admin: user.IsAdmin(),
}
} | [
-0.8073405623435974,
-0.6356984376907349,
0.5544182062149048,
-0.2661798298358917,
-1.9553978443145752,
0.5253233909606934,
-0.005610407330095768,
-0.17736409604549408,
0.2196357399225235,
-0.6696859002113342,
-1.2716991901397705,
0.6407470703125,
0.30722376704216003,
-0.7880761027336121,
... |
func (us *userService) Authenticate(email,password string) (*User, error){
foundUser, err := us.ByEmail(email)
if err != nil{
return nil, err
}
err = bcrypt.CompareHashAndPassword([]byte(foundUser.PasswordHash),[]byte(password + us.pepper))
if err != nil{
switch err {
case bcrypt.ErrMismatchedHashAndPasswor... | [
0.35416337847709656,
0.18254952132701874,
0.6368519067764282,
0.7443380355834961,
0.18888044357299805,
-0.17591418325901031,
-0.356074720621109,
-0.5743468403816223,
0.33067843317985535,
0.38842836022377014,
0.1435425728559494,
0.7255266308784485,
-0.8164511919021606,
-0.33457204699516296,... |
func (uv *userValidator) ByEmail(email string) (*User, error){
user := User{
Email: email,
}
if err := runUserValidatorFunction(&user, uv.normalizeEmail); err!=nil{
return nil, err
}
return uv.UserDB.ByEmail(user.Email)
} | [
-0.5295385122299194,
1.073748230934143,
0.37892866134643555,
0.10911870747804642,
-0.48072242736816406,
0.5869961380958557,
0.48777925968170166,
-0.2568565011024475,
0.012398370541632175,
-0.5480064153671265,
-0.2007155567407608,
0.5925496816635132,
-0.133064866065979,
-0.4026707410812378,... |
func (uv *userValidator) ByRemember(token string) (*User, error){
var user = User{
Remember: token,
}
if err := runUserValidatorFunction(&user, uv.hmacRemember); err!=nil{
return nil, err
}
return uv.UserDB.ByRemember(user.RememberHash)
} | [
0.4202330410480499,
0.31866759061813354,
0.39175987243652344,
0.6672999858856201,
-0.468257874250412,
-0.10754755139350891,
0.3190176784992218,
-0.9410098791122437,
0.024889489635825157,
-0.2529001235961914,
-0.7179747819900513,
0.06581088155508041,
-0.8967049717903137,
0.4129897356033325,... |
func (uv *userValidator) Create(user *User) error{
if err:=runUserValidatorFunction(user,
uv.passwordRequired,
uv.passwordMinLength,
uv.bcryptPassword,
uv.passwordHashRequired,
uv.setRememberIfUnset,
uv.rememberMinBytes,
uv.hmacRemember,
uv.rememberHashRequired,
uv.normalizeEmail,
uv.requireEmail... | [
-0.47626131772994995,
0.6869667768478394,
0.30548954010009766,
0.957420289516449,
-0.27681127190589905,
1.0668343305587769,
0.17105776071548462,
0.006819738075137138,
-0.24971432983875275,
-0.25744807720184326,
-0.33036327362060547,
-0.4782567322254181,
-0.834938108921051,
0.93104124069213... |
func (uv *userValidator) Delete(id uint) error{
var user User
user.ID = id
err := runUserValidatorFunction(&user, uv.idGreaterThan(0))
if err != nil{
return err
}
return uv.UserDB.Delete(id)
} | [
-0.15867677330970764,
0.49621090292930603,
0.37365207076072693,
1.5007755756378174,
-0.09501877427101135,
0.7870864868164062,
0.6352373361587524,
-0.15472471714019775,
0.18133708834648132,
-0.47123953700065613,
-0.2780653238296509,
-0.06151333078742027,
-0.7584659457206726,
0.4485028386116... |
func (uv *userValidator) bcryptPassword(user *User) error{
if user.Password == ""{
return nil
}
pwBytes := []byte(user.Password + uv.pepper)
hashedBytes,err := bcrypt.GenerateFromPassword(pwBytes, bcrypt.DefaultCost)
if err!=nil{
return err
}
user.PasswordHash = string(hashedBytes)
user.Password = ""
retur... | [
0.8530957102775574,
0.6150716543197632,
0.4884287416934967,
1.0513379573822021,
0.6800796389579773,
-0.014684478752315044,
0.330551415681839,
0.620478093624115,
0.32613444328308105,
0.34315186738967896,
-0.7490725517272949,
0.267352432012558,
-0.4885109066963196,
0.39763352274894714,
-0.... |
func (ug *userGorm) ByID(id uint) (*User,error){
var user User
db := ug.db.Where("id=?",id)
err := first(db,&user)
return &user, err
} | [
0.8381468653678894,
-0.06770812720060349,
0.20204173028469086,
-0.2458859086036682,
0.41019684076309204,
0.05210593342781067,
0.6162774562835693,
-0.40741556882858276,
0.19142037630081177,
0.20360539853572845,
-0.10103552043437958,
0.6172717809677124,
-0.09676992893218994,
-0.2350372523069... |
func (ug *userGorm) ByEmail(email string) (*User,error){
var user User
db := ug.db.Where("email=?",email)
err := first(db,&user)
return &user, err
} | [
0.1259446144104004,
1.033355712890625,
0.4080984592437744,
-0.41700977087020874,
0.7230929732322693,
-0.21083982288837433,
0.15233592689037323,
-0.28820502758026123,
-0.3042008876800537,
-0.03916161134839058,
0.07323843985795975,
0.9529526829719543,
0.0972941443324089,
-0.6856557130813599,... |
func (ug *userGorm) ByRemember(rememberHash string) (*User, error){
var user User
err := first(ug.db.Where("remember_hash = ?", rememberHash),&user)
if err != nil{
return nil, err
}
return &user, nil
} | [
1.1949058771133423,
0.21262015402317047,
0.40672576427459717,
0.7395327687263489,
0.09696255624294281,
-0.466558575630188,
0.2640232443809509,
-0.8460907936096191,
0.029276544228196144,
0.1077868714928627,
-0.21876806020736694,
-0.006056326441466808,
-1.0616843700408936,
0.5182751417160034... |
func (ug *userGorm) Create(user *User) error{
return ug.db.Create(user).Error
} | [
0.05153833329677582,
1.1082514524459839,
0.073529452085495,
1.0220589637756348,
0.5668222904205322,
0.8024733662605286,
0.6032249331474304,
-0.4864313304424286,
-0.9507349729537964,
-0.11103671789169312,
-0.40899282693862915,
-0.5381714105606079,
-0.190412238240242,
0.6284254789352417,
0... |
func (ug *userGorm) Update(user *User) error{
return ug.db.Save(user).Error
} | [
-0.5615556836128235,
0.20291224122047424,
0.1302841603755951,
0.4596177637577057,
0.20956699550151825,
0.7185755968093872,
0.6499025821685791,
-0.12527933716773987,
-0.3326416015625,
0.10117360204458237,
-0.7168655395507812,
-0.041283752769231796,
-0.515522301197052,
0.0255261342972517,
... |
func (ug *userGorm) Delete(id uint) error{
user :=User{Model:gorm.Model{ID:id}}
return ug.db.Delete(&user).Error
} | [
0.22996002435684204,
0.7994016408920288,
0.3297792375087738,
1.0628684759140015,
0.8153878450393677,
0.48310592770576477,
0.39993152022361755,
-0.14783690869808197,
-0.3399488031864166,
0.17992442846298218,
-0.514224648475647,
0.04282498359680176,
-0.6573142409324646,
0.16696126759052277,
... |
func GetInsurances(w http.ResponseWriter, req *http.Request) {
userID := mux.Vars(req)["userID"]
log.Printf("Consultando seguros contratados para usuario %s", userID)
resp.SendResponse(w, []string{"Hogar", "Vida"})
} | [
-0.1632734090089798,
0.42905333638191223,
0.492014080286026,
0.880552351474762,
-0.3458293676376343,
0.32024359703063965,
-0.6129022836685181,
-0.8866682648658752,
-0.18331769108772278,
0.21949200332164764,
0.8909574747085571,
0.33565518260002136,
-0.5780367851257324,
0.0861055999994278,
... |
func (sd *ScanDiapasons) NotifyDpnsTask(ctx context.Context) ([]byte, error) {
request, err := http.NewRequest("POST", sd.client.Server+"/api/v1.0/ScanDiapasons.NotifyDpnsTask", nil)
if err != nil {
return nil, err
}
raw, err := sd.client.Do(ctx, request, nil)
return raw, err
} | [
-0.9490960240364075,
0.8272271752357483,
0.38254979252815247,
0.9443331360816956,
-1.0807386636734009,
-0.4602755308151245,
0.11590322107076645,
-0.46923235058784485,
0.44139671325683594,
0.20023666322231293,
-1.9412331581115723,
0.8234666585922241,
0.5061421394348145,
0.43873801827430725,... |
func (sd *ScanDiapasons) GetDiapasons(ctx context.Context, params DiapasonsParams) (*PxgValStr, []byte, error) {
postData, err := json.Marshal(params)
if err != nil {
return nil, nil, err
}
request, err := http.NewRequest("POST", sd.client.Server+"/api/v1.0/ScanDiapasons.GetDiapasons", bytes.NewBuffer(postData))... | [
-1.6949092149734497,
0.7686121463775635,
0.6940822005271912,
0.35885781049728394,
-1.2656359672546387,
-0.0707220584154129,
0.07958857715129852,
-0.8788936138153076,
1.0856873989105225,
0.03402663394808769,
-0.8192102909088135,
0.5226982831954956,
-0.5569024682044983,
0.19303350150585175,
... |
func (sd *ScanDiapasons) GetDiapason(ctx context.Context, params DiapasonParams) (*DiapasonAttributes, []byte, error) {
postData, err := json.Marshal(params)
if err != nil {
return nil, nil, err
}
request, err := http.NewRequest("POST", sd.client.Server+"/api/v1.0/ScanDiapasons.GetDiapason", bytes.NewBuffer(post... | [
-1.7699894905090332,
0.04847120866179466,
0.6783715486526489,
0.47600552439689636,
-0.9352821111679077,
-0.14321404695510864,
0.2919740080833435,
-0.007923911325633526,
0.8891739845275879,
-0.41633352637290955,
-0.9675453305244446,
0.34812986850738525,
-0.8092007040977478,
0.02470311149954... |
func (sd *ScanDiapasons) RemoveDiapason(ctx context.Context, idDiapason int64) ([]byte, error) {
postData := []byte(fmt.Sprintf(`{"idDiapason": %d}`, idDiapason))
request, err := http.NewRequest("POST", sd.client.Server+"/api/v1.0/ScanDiapasons.RemoveDiapason", bytes.NewBuffer(postData))
if err != nil {
return nil... | [
-1.4189916849136353,
0.08609748631715775,
0.5234613418579102,
-0.18326948583126068,
-1.4459284543991089,
-0.025492889806628227,
0.7710026502609253,
0.306835800409317,
1.5383597612380981,
0.2624329924583435,
-1.4522560834884644,
-0.11798810958862305,
-1.1400096416473389,
-0.2539629340171814... |
func (sd *ScanDiapasons) UpdateDiapason(ctx context.Context, params UpdateDiapasonParams) (*UpdateDiapasonRespond, []byte, error) {
postData, err := json.Marshal(params)
if err != nil {
return nil, nil, err
}
request, err := http.NewRequest("POST", sd.client.Server+"/api/v1.0/ScanDiapasons.UpdateDiapason", bytes... | [
-2.003842830657959,
-0.8164811134338379,
0.662616491317749,
0.16193969547748566,
-1.437152624130249,
0.1975405067205429,
0.687724769115448,
0.16792888939380646,
1.3054639101028442,
0.4575161933898926,
-1.174408197402954,
0.2737996578216553,
-0.9794246554374695,
-0.23485074937343597,
0.90... |
func emitLiteral(dst *tokens, lit []byte) {
ol := int(dst.n)
for i, v := range lit {
dst.tokens[(i+ol)&maxStoreBlockSize] = token(v)
}
dst.n += uint16(len(lit))
} | [
-0.36169177293777466,
0.3184024393558502,
0.32858794927597046,
-1.121131181716919,
-0.1711633801460266,
0.18286126852035522,
-0.9697827696800232,
0.5315998196601868,
0.12800109386444092,
0.7664280533790588,
-0.7449166178703308,
0.6593520641326904,
-0.16779042780399323,
-0.4098452031612396,... |
func emitCopy(dst *tokens, offset, length int) {
dst.tokens[dst.n] = matchToken(uint32(length-3), uint32(offset-minOffsetSize))
dst.n++
} | [
-1.0462993383407593,
-0.19094650447368622,
0.3331998586654663,
-1.0907100439071655,
-1.124050259590149,
0.2075413167476654,
-0.621163547039032,
0.6011999845504761,
0.10916471481323242,
0.5644678473472595,
-1.091110348701477,
1.2884809970855713,
0.7626397609710693,
-1.3234484195709229,
0.... |
func (e *snappyL2) Encode(dst *tokens, src []byte) {
const (
inputMargin = 8 - 1
minNonLiteralBlockSize = 1 + 1 + inputMargin
)
// Protect against e.cur wraparound.
if e.cur > 1<<30 {
for i := range e.table[:] {
e.table[i] = tableEntry{}
}
e.cur = maxStoreBlockSize
}
// This check isn't ... | [
-0.19138884544372559,
0.6526308655738831,
0.7985275387763977,
-0.09828348457813263,
-1.712863802909851,
-0.5638386011123657,
0.051545150578022,
-0.41495412588119507,
0.12944160401821136,
0.1137838140130043,
-0.43478456139564514,
0.3022851049900055,
0.214808389544487,
0.07376056909561157,
... |
func (e *snappyL3) Encode(dst *tokens, src []byte) {
const (
inputMargin = 8 - 1
minNonLiteralBlockSize = 1 + 1 + inputMargin
)
// Protect against e.cur wraparound.
if e.cur > 1<<30 {
for i := range e.table[:] {
e.table[i] = tableEntryPrev{}
}
e.snappyGen = snappyGen{cur: maxStoreBlockSize,... | [
-0.16292600333690643,
0.813194990158081,
0.8000836372375488,
-0.12679848074913025,
-1.601751685142517,
-0.39491498470306396,
0.07371620088815689,
-0.3025391101837158,
0.3593508303165436,
0.2028511017560959,
-0.3434727191925049,
0.18225304782390594,
0.07520882785320282,
-0.07957805693149567... |
func (e *snappyL4) Encode(dst *tokens, src []byte) {
const (
inputMargin = 8 - 3
minNonLiteralBlockSize = 1 + 1 + inputMargin
matchLenGood = 12
)
// Protect against e.cur wraparound.
if e.cur > 1<<30 {
for i := range e.table[:] {
e.table[i] = tableEntryPrev{}
}
e.snappyGen = sna... | [
-0.22814591228961945,
0.669004499912262,
0.7757408618927002,
-0.16626524925231934,
-1.4949995279312134,
-0.5713450312614441,
0.17334872484207153,
-0.37429526448249817,
0.21503731608390808,
0.07407291978597641,
-0.29819348454475403,
0.16747407615184784,
0.01831493340432644,
0.05354956537485... |
func (e *snappyGen) Reset() {
e.prev = e.prev[:0]
e.cur += maxMatchOffset
} | [
-0.8772590160369873,
0.1850709468126297,
0.31353631615638733,
-0.1468852013349533,
0.12150489538908005,
0.25418102741241455,
1.519275188446045,
0.42894262075424194,
-0.5711507201194763,
-0.23084405064582825,
-0.08523888140916824,
0.04871696978807449,
0.2015651911497116,
-0.6778550148010254... |
func RegisterListen(network string, listenFunc ListenFunc) {
listenFuncs[network] = listenFunc
} | [
0.38895106315612793,
0.038609351962804794,
0.2999151349067688,
-0.20998600125312805,
0.5258262157440186,
-0.08348781615495682,
-0.6175710558891296,
0.8091880679130554,
-0.6525221467018127,
-0.6045641303062439,
-1.4084872007369995,
0.26350337266921997,
0.3103424608707428,
-0.380862981081008... |
func RegisteredListenNetworks() []string {
networks := []string{}
for network := range listenFuncs {
networks = append(networks, network)
}
return networks
} | [
-0.7002497911453247,
-0.33164533972740173,
0.38327059149742126,
-0.44936180114746094,
0.9153083562850952,
0.4526124596595764,
0.045831333845853806,
-0.7208019495010376,
0.25741681456565857,
-0.37068185210227966,
-1.2447454929351807,
0.009193139150738716,
0.4419023394584656,
0.5840836763381... |
func Listen(network, address string, options ...value.Option) (net.Listener, error) {
o := &value.Options{}
for _, option := range options {
if option == nil {
continue
}
if err := option(o); err != nil {
return nil, err
}
}
listenFunc, ok := listenFuncs[network]
if ok {
return listenFunc(address,... | [
1.1433905363082886,
-0.3616640269756317,
0.5219738483428955,
-0.32510891556739807,
0.07577105611562729,
0.18049626052379608,
-0.07710105180740356,
0.34492227435112,
0.5808610320091248,
0.3101872503757477,
0.1506894826889038,
-0.06833253800868988,
-0.14227427542209625,
-0.06476085633039474,... |
func runSeed(c *cli.Context) error {
m := c.App.Metadata["config"].(*metadata)
name, owner, err := checkOwnerWithPasswordPrompt(c.GlobalString("identity"), m.config, c)
if nil != err {
return err
}
phrase, err := account.Base58EncodedSeedToPhrase(owner.Seed)
if nil != err {
return err
}
if c.Bool("recov... | [
-0.4635506272315979,
-0.5861832499504089,
0.7477405667304993,
0.07590953260660172,
-0.03438248112797737,
0.5435649752616882,
0.05742018297314644,
-0.12138550728559494,
0.5482706427574158,
0.004657730460166931,
0.11593833565711975,
1.193933367729187,
-0.6108067631721497,
-0.1614748239517212... |
func prettyPhrase(phrase []string) string {
var builder strings.Builder
for i, p := range phrase {
builder.WriteString(p)
breakline := (i+1)%6 == 0
if breakline {
builder.WriteString("\n")
} else if i < len(phrase)-1 {
builder.WriteString(" ")
}
}
return builder.String()
} | [
-0.18373756110668182,
0.009123028255999088,
0.675363302230835,
-0.48257794976234436,
-0.36049771308898926,
0.2019653618335724,
-0.5828199982643127,
-0.3196621537208557,
0.6627659797668457,
0.6049869656562805,
0.5460057258605957,
-0.92229163646698,
-1.079726219177246,
0.27229011058807373,
... |
func NewNoQuoteEntries(symbol string) *NoQuoteEntries {
var m NoQuoteEntries
m.SetSymbol(symbol)
return &m
} | [
-0.10413423925638199,
0.43965113162994385,
-0.28409695625305176,
-0.5168540477752686,
-0.08842526376247406,
-0.9563378691673279,
0.44286587834358215,
-0.8461693525314331,
-0.08342962712049484,
-0.6976980566978455,
-0.539461612701416,
0.3591887652873993,
-0.6831886768341064,
1.0444020032882... |
func (m Message) Marshal() quickfix.Message { return quickfix.Marshal(m) } | [
1.538981556892395,
-0.28063270449638367,
0.028094252571463585,
-0.19832439720630646,
0.16589289903640747,
0.23293150961399078,
-0.5139941573143005,
-0.3218190670013428,
0.06994449347257614,
-2.373028516769409,
0.4999852776527405,
1.1027671098709106,
-0.5228840708732605,
0.9439477920532227,... |
func New(quoteid string, quotecanceltype int, noquoteentries []NoQuoteEntries) *Message {
var m Message
m.SetQuoteID(quoteid)
m.SetQuoteCancelType(quotecanceltype)
m.SetNoQuoteEntries(noquoteentries)
return &m
} | [
0.35270240902900696,
-0.4706836938858032,
0.17147809267044067,
-0.4576796591281891,
0.27592697739601135,
-0.41725096106529236,
-0.7944610714912415,
-0.1676858365535736,
0.01466085109859705,
0.39777982234954834,
0.3068029582500458,
0.5136935710906982,
-0.2974342107772827,
1.2350887060165405... |
func Route(router RouteOut) (string, string, quickfix.MessageRoute) {
r := func(msg quickfix.Message, sessionID quickfix.SessionID) quickfix.MessageRejectError {
m := new(Message)
if err := quickfix.Unmarshal(msg, m); err != nil {
return err
}
return router(*m, sessionID)
}
return enum.BeginStringFIX42, "... | [
0.2392406165599823,
-0.35099732875823975,
0.1863412708044052,
-0.1985962837934494,
-0.7309600114822388,
-1.0102686882019043,
0.3057537078857422,
-0.48168811202049255,
0.22574493288993835,
-0.5417883992195129,
-0.003530445508658886,
0.7334704399108887,
-0.42050111293792725,
0.22191372513771... |
func main() {
fmt.Printf("true && true\t %v\n", true && true) //true and true both must match
fmt.Printf("true && false\t %v\n", true && false) // true and false, both must match
fmt.Printf("true or true\t %v\n", true || true) //true or true either must match
fmt.Printf("true or false\t %v\n", true || false) //... | [
-0.3525099754333496,
-0.9162893295288086,
0.9989437460899353,
0.12962934374809265,
-0.7058276534080505,
0.8071805238723755,
-0.27446940541267395,
0.5991700887680054,
-0.6032706499099731,
-0.09889372438192368,
-0.13792899250984192,
-0.2753095030784607,
-0.3693426549434662,
0.160882622003555... |
func New(ctx context.Context, cb func([]*Item) interface{}, opts ...Option) (*Batch, error) {
ctx, cancelFunc := context.WithCancel(ctx)
b := &Batch{
callback: cb,
interval: time.Millisecond * 100, // default interval
ctx: ctx,
done: make(chan struct{}),
cancelFunc: cancelFunc,
}
// Apply ... | [
0.21921482682228088,
-0.19405610859394073,
0.7395118474960327,
0.6128145456314087,
-0.32154956459999084,
-0.050629861652851105,
-0.5099833011627197,
-0.14622852206230164,
-0.23640583455562592,
-0.1656034141778946,
-0.2453353852033615,
0.4604359269142151,
0.28911638259887695,
0.299270093441... |
func (b *Batch) Push(item interface{}) chan interface{} {
b.mu.Lock()
defer b.mu.Unlock()
newItem := &Item{
CallbackChannel: make(chan interface{}),
Item: item,
}
b.items = append(b.items, newItem)
return newItem.CallbackChannel
} | [
0.04388723522424698,
0.170959010720253,
0.5849252343177795,
0.18225382268428802,
0.05933814495801926,
0.039655283093452454,
-0.19917429983615875,
-1.0153194665908813,
0.454072505235672,
0.2793196141719818,
-0.17987002432346344,
1.0988863706588745,
-0.752202570438385,
0.19258780777454376,
... |
func (b *Batch) run(ctx context.Context) {
ticker := time.NewTicker(b.interval)
defer ticker.Stop() // Stop the ticker
for {
select {
case <-ctx.Done():
b.clearItems()
close(b.done)
return
case <-ticker.C:
b.flushItems()
}
}
} | [
-0.6000334024429321,
-0.10646375268697739,
0.423463374376297,
0.18410706520080566,
0.21160872280597687,
0.8604755997657776,
0.3370777666568756,
-0.5476763844490051,
-0.7575664520263672,
-0.13161687552928925,
-0.6558805108070374,
-0.031212426722049713,
-0.7639557123184204,
0.192198529839515... |
func (b *Batch) Stop() {
b.cancelFunc()
} | [
0.31929391622543335,
-0.4808655381202698,
0.040060970932245255,
0.852607250213623,
0.2657269835472107,
0.519406795501709,
0.155206561088562,
1.196201205253601,
-1.3836950063705444,
0.0825439989566803,
-0.4978940784931183,
0.656870424747467,
-0.1828274428844452,
-0.3121929168701172,
-0.40... |
func InteractiveExec(name string, args ...string) ProcessContext {
res := &processContext{}
res.proc = exec.Command(name, args...)
res.stdout = newStdio()
res.stderr = newStdio()
res.stdin = newStdio()
res.cancel = make(chan struct{}, 1)
res.proc.Stdout = res.stdout
res.proc.Stderr = res.stderr
res.proc.Stdin... | [
1.1322370767593384,
-0.7945067286491394,
0.6305984258651733,
-0.030373817309737206,
-0.4318988025188446,
-0.2104099541902542,
-0.24567319452762604,
-0.4371795654296875,
-0.6212443709373474,
-0.11453709751367569,
-0.27618566155433655,
0.2967849373817444,
-0.35987111926078796,
-0.46672278642... |
func (p *processContext) Receive(stdReader Reader, timeout time.Duration) {
t := time.Now()
deadline := t.Add(timeout)
stop := false
for {
select {
case <-time.After(timeout):
if stdReader != nil {
stdReader.OnTimeout()
}
stop = true
case <-p.stdout.ready:
if b := p.stdout.readAll(); len(b) >... | [
0.03928574547171593,
-0.9882606267929077,
0.8622511029243469,
-0.4809209108352661,
-0.8863551616668701,
-0.4266941547393799,
-0.8432561159133911,
0.4981625974178314,
-0.47415682673454285,
0.6538397669792175,
0.39105311036109924,
0.17953944206237793,
-0.1515556126832962,
-0.1313486993312835... |
func (p *processContext) Stop() error {
return p.proc.Process.Kill()
} | [
0.19433873891830444,
-1.2315759658813477,
0.3539469540119171,
-0.14048948884010315,
0.49213817715644836,
0.8582278490066528,
-0.49904370307922363,
-0.294721394777298,
-0.4287133812904358,
0.3744569420814514,
0.008027641102671623,
0.44479650259017944,
-0.28627797961235046,
-0.59905022382736... |
func (p *processContext) Send(s string) error {
if _, err := p.stdin.buf.Write([]byte(s)); err != nil {
return err
} else {
p.stdin.ready <- err
}
return nil
} | [
0.021374812349677086,
-0.15872840583324432,
0.5338413715362549,
0.35731247067451477,
-0.17703548073768616,
0.297721803188324,
-0.24203947186470032,
-0.9404290318489075,
-0.03077690489590168,
0.16136948764324188,
-0.7827802300453186,
0.4746219217777252,
-0.7033611536026001,
-0.1037212088704... |
func (p *stdio) Read(b []byte) (n int, err error) {
n, err = p.buf.Read(b)
if err == io.EOF {
return n, nil
}
return n, err
} | [
-0.19295261800289154,
0.3714531660079956,
0.6470372676849365,
0.8470224142074585,
-0.45579323172569275,
0.5499337911605835,
0.8162243366241455,
-0.6230562925338745,
-0.6097212433815002,
-0.1985345035791397,
-0.751751184463501,
-0.050699975341558456,
-0.8195100426673889,
0.32712236046791077... |
func NewFromConfig(cfg *config.Config) (logr.Logger, io.Writer, io.Writer, error) {
errW, err := newWriter(cfg.Logs.Error, cfg.IsVerbose(), os.Stderr)
if err != nil {
return nil, nil, nil, fmt.Errorf("failed creating error log: %s", err)
}
outW, err := newWriter(cfg.Logs.Info, cfg.IsVerbose(), os.Stdout)
if err... | [
0.8883654475212097,
-1.0376298427581787,
0.3820573389530182,
-0.08005201816558838,
-0.8415713906288147,
-0.24603649973869324,
0.07880228012800217,
-0.3267897367477417,
-0.8678314685821533,
0.2819567322731018,
-0.23490817844867706,
-0.4704253673553467,
0.33397620916366577,
1.023133635520935... |
func newWriter(filename string, verbose bool, out io.Writer) (io.Writer, error) {
writers := make([]io.Writer, 0)
if len(filename) > 0 || !verbose {
file, err := os.OpenFile(filename, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0660)
if err != nil {
return nil, err
}
writers = append(writers, file)
}
if verbos... | [
0.030621295794844627,
0.44403210282325745,
0.5033227801322937,
1.2629718780517578,
0.07101640105247498,
-0.6810509562492371,
0.15861834585666656,
1.1936110258102417,
-0.27061960101127625,
0.9971325993537903,
0.3417840301990509,
-0.12107029557228088,
-0.15972338616847992,
0.3968839347362518... |
func New() *AuthContext {
return &AuthContext{}
} | [
-0.14987532794475555,
-1.1692419052124023,
-0.05790897086262703,
-0.09209539741277695,
-1.2703102827072144,
-0.0709567740559578,
-0.2513639032840729,
-0.6113631725311279,
0.49225637316703796,
-0.7715227603912354,
-0.33402958512306213,
0.6848368644714355,
0.9072301983833313,
0.0185877736657... |
func (s *AuthContext) UseJWTAuth(signingKey string, tokenString string, audience string) error {
key, err := jwk.New([]byte(signingKey))
if err != nil {
return err
}
token, err := jwt.Parse([]byte(tokenString), jwt.WithVerify(jwa.HS256, key), jwt.WithAudience(audience), jwt.WithValidate(true))
if err != nil {
... | [
-0.13743557035923004,
-0.4127444922924042,
0.7161495685577393,
-0.17090363800525665,
-0.7004739046096802,
-0.5799087882041931,
0.32439497113227844,
0.026105517521500587,
-0.06688890606164932,
0.8041413426399231,
-0.7860916256904602,
0.5714742541313171,
0.09648407995700836,
0.35018008947372... |
func (s *AuthContext) ValidClaims() bool {
if s.Claims == nil {
return false
}
if len(s.Claims.Subject) == 0 {
return false
}
if s.Claims.ExpiresAt < time.Now().Unix() {
return false
}
switch utils.GetClaimsType(s.Claims) {
case utils.UserClaimType:
return s.Claims.GetUserClaims() != nil && len(s.Clai... | [
0.11204309016466141,
-0.46562641859054565,
0.5399606823921204,
-0.3929401934146881,
0.06787619739770889,
0.6528966426849365,
-0.9977848529815674,
-0.28294146060943604,
0.9052674770355225,
-0.8531382083892822,
0.615385890007019,
0.8660864233970642,
0.10158739238977432,
0.4900432527065277,
... |
func NewContext(ctx context.Context, s *AuthContext) context.Context {
return context.WithValue(ctx, authContextKey{}, s)
} | [
-0.08106545358896255,
-0.10658284276723862,
0.22661583125591278,
0.3167465925216675,
-1.0051783323287964,
0.002080284059047699,
-0.9140843749046326,
-0.7107979655265808,
2.1131703853607178,
0.05047379061579704,
0.10900811105966568,
0.757809042930603,
0.7150142788887024,
-0.901059627532959,... |
func FromContext(ctx context.Context) (*AuthContext, error) {
s, ok := ctx.Value(authContextKey{}).(*AuthContext)
if !ok {
return nil, errors.New("failed to get auth info from context")
}
return s, nil
} | [
-0.259298712015152,
0.04292136803269386,
0.30141711235046387,
-0.021282706409692764,
-1.285888433456421,
0.08707205951213837,
-0.7474607825279236,
-1.0036077499389648,
1.2522095441818237,
0.04297309368848801,
-0.5278925895690918,
0.42922836542129517,
0.2193405032157898,
0.0532107912003994,... |
func NewLogger(configuration config.Log) Logger {
conf = configuration
if loggerInstance == nil {
loggerInstance = logrus.New()
if config.IsSet("log") {
// file log with rotation
rfh, err := rotatefilehook.NewRotateFileHook(rotatefilehook.RotateFileConfig{
Filename: path.Join(conf.Path, conf.Filename... | [
-0.4260730743408203,
-0.9300479292869568,
0.7546335458755493,
-0.2791471779346466,
-0.4775438606739044,
0.03572465106844902,
-0.11873698979616165,
0.6072119474411011,
-0.03723939508199692,
-0.09521238505840302,
-0.2218392789363861,
-0.330247163772583,
-0.3394559919834137,
1.471436262130737... |
func GetAllHandler(svc ServiceModel) *http.Server {
return http.NewServer(
makeGetAllEndpoint(svc),
decodeGetAllRequest,
http.EncodeJSONResponse,
)
} | [
-0.10562685877084732,
-0.23004232347011566,
0.6425387263298035,
0.3056785464286804,
-0.6243663430213928,
0.37601256370544434,
-1.0527067184448242,
0.10831861197948456,
0.3970012068748474,
-0.9444952607154846,
-0.31225916743278503,
0.6410474181175232,
-0.40811580419540405,
0.167150497436523... |
func GetByListingIDHandler(svc ServiceModel) *http.Server {
return http.NewServer(
makeGetByListingIDEndpoint(svc),
decodeGetByListingIDRequest,
http.EncodeJSONResponse,
)
} | [
-0.45891737937927246,
-0.19312366843223572,
0.32193365693092346,
0.06261352449655533,
-0.6264602541923523,
-0.01618233323097229,
0.14904901385307312,
0.05757514759898186,
0.1358271837234497,
-0.21972939372062683,
-0.4289965331554413,
1.1075260639190674,
-0.6339494585990906,
-0.031127531081... |
func CreateHandler(svc ServiceModel) *http.Server {
return http.NewServer(
makeCreateEndpoint(svc),
decodeCreateRequest,
http.EncodeJSONResponse,
)
} | [
-0.1677837371826172,
-0.42275533080101013,
0.3430730700492859,
-0.022110382094979286,
0.10982411354780197,
0.8814127445220947,
-0.36875659227371216,
-0.3140227794647217,
-0.2553533613681793,
-0.36494922637939453,
0.17041918635368347,
-0.50358647108078,
-0.5933194756507874,
0.21805378794670... |
func createQueue() *Queue {
return &Queue{
values: make([]int, 0),
}
} | [
0.14849050343036652,
-0.8366705179214478,
0.4300122559070587,
0.3799903988838196,
0.9199576377868652,
-0.07346661388874054,
-0.6649680733680725,
-0.28933271765708923,
-0.1837969571352005,
-0.8669312000274658,
0.15795360505580902,
-0.24625103175640106,
-0.4537561237812042,
0.790553689002990... |
func (q *Queue) enqueue(value int) {
q.values = append(q.values, value)
} | [
0.06947454810142517,
0.7544431090354919,
0.30652835965156555,
-0.5373188853263855,
0.09141406416893005,
0.5174551606178284,
-0.8399043083190918,
-0.5468249320983887,
-0.22479356825351715,
-0.3889883756637573,
-0.2576129138469696,
0.5791844129562378,
-0.2339397668838501,
1.4479622840881348,... |
func (q *Queue) dequeue() int {
if q.isEmpty() {
fmt.Println("Queue empty")
return -1
}
value := q.values[0]
q.values = q.values[1:]
return value
} | [
-0.22382690012454987,
0.3845057189464569,
0.8411761522293091,
-0.38649213314056396,
0.0918649286031723,
-0.7682367563247681,
-0.06275975704193115,
0.628921627998352,
-0.6371750831604004,
-0.6151393055915833,
-0.2462979555130005,
0.8129935264587402,
-1.1155866384506226,
1.2629728317260742,
... |
func (q *Queue) isEmpty() bool {
if len(q.values) == 0 {
return true
}
return false
} | [
-1.1835050582885742,
-0.3333584666252136,
0.303352028131485,
-0.014648529700934887,
1.0285308361053467,
0.2701821029186249,
-1.0539556741714478,
-0.19274969398975372,
-0.4127602279186249,
0.02247016318142414,
-0.5985022187232971,
0.823103129863739,
-0.30962708592414856,
1.0505167245864868,... |
func printQueue(q *Queue) {
fmt.Println(q.values)
} | [
-0.07339614629745483,
-0.5970978140830994,
0.2429742068052292,
-0.48776572942733765,
0.2694145739078522,
0.2817128002643585,
-1.34485924243927,
-0.31223490834236145,
-0.14787213504314423,
-0.6679412722587585,
0.15573066473007202,
1.4371141195297241,
0.06999657303094864,
2.0745022296905518,... |
func (_m *ContainerIface) Ctime() time.Time {
ret := _m.Called()
var r0 time.Time
if rf, ok := ret.Get(0).(func() time.Time); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(time.Time)
}
return r0
} | [
-0.47895440459251404,
0.32569441199302673,
0.745039165019989,
0.6361826658248901,
0.5301262736320496,
-0.16799195110797882,
0.34972310066223145,
0.5675011277198792,
-0.2897140085697174,
1.1208852529525757,
-0.37450864911079407,
-0.675916314125061,
-0.3291448950767517,
0.7553081512451172,
... |
func (_m *ContainerIface) Data(path string, name string) (string, bool) {
ret := _m.Called(path, name)
var r0 string
if rf, ok := ret.Get(0).(func(string, string) string); ok {
r0 = rf(path, name)
} else {
r0 = ret.Get(0).(string)
}
var r1 bool
if rf, ok := ret.Get(1).(func(string, string) bool); ok {
r1... | [
-0.7750410437583923,
-0.4295262098312378,
0.5863085389137268,
0.2598423361778259,
-0.4616720974445343,
0.34467050433158875,
0.3462679386138916,
0.10253188759088516,
-0.5608245134353638,
-0.1597500890493393,
-0.5137340426445007,
0.21710069477558136,
0.19698622822761536,
0.3544839322566986,
... |
func (_m *ContainerIface) GID() uint32 {
ret := _m.Called()
var r0 uint32
if rf, ok := ret.Get(0).(func() uint32); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint32)
}
return r0
} | [
0.2084944248199463,
0.14273710548877716,
0.45574530959129333,
-0.11145935952663422,
0.7700918912887573,
0.7432910203933716,
0.9364169836044312,
0.26446056365966797,
0.10820046067237854,
0.19182302057743073,
0.4785391092300415,
0.9070400595664978,
-0.29486820101737976,
0.9362814426422119,
... |
func (_m *ContainerIface) ID() string {
ret := _m.Called()
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
} | [
-0.03823184594511986,
-0.660327136516571,
0.32440224289894104,
0.5054290890693665,
0.36615681648254395,
-0.10991036891937256,
0.4891369938850403,
0.3254065215587616,
0.7483960390090942,
0.11221428215503693,
-0.2258298397064209,
0.3392455279827118,
-0.16922776401042938,
0.22057056427001953,... |
func (_m *ContainerIface) InitPid() uint32 {
ret := _m.Called()
var r0 uint32
if rf, ok := ret.Get(0).(func() uint32); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint32)
}
return r0
} | [
0.44387173652648926,
-0.259115606546402,
0.6301536560058594,
0.23421980440616608,
0.24113231897354126,
0.32098811864852905,
0.6487104892730713,
0.40827807784080505,
0.3643935024738312,
-0.09690598398447037,
-0.015188615769147873,
-0.16378715634346008,
-0.5387282371520996,
-0.28105109930038... |
func (_m *ContainerIface) InitProc() domain.ProcessIface {
ret := _m.Called()
var r0 domain.ProcessIface
if rf, ok := ret.Get(0).(func() domain.ProcessIface); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(domain.ProcessIface)
}
}
return r0
} | [
0.6788194179534912,
0.21990150213241577,
0.5440373420715332,
0.12615250051021576,
0.2610352337360382,
-0.7135264873504639,
1.372305154800415,
0.060402702540159225,
0.6734530925750732,
-0.28834477066993713,
0.6302585005760193,
0.8321205973625183,
0.2127462476491928,
0.052935756742954254,
... |
func (_m *ContainerIface) IsSpecPath(s string) bool {
ret := _m.Called(s)
var r0 bool
if rf, ok := ret.Get(0).(func(string) bool); ok {
r0 = rf(s)
} else {
r0 = ret.Get(0).(bool)
}
return r0
} | [
-0.2963930070400238,
-0.5579119920730591,
0.5215799808502197,
0.7371504306793213,
-0.42776814103126526,
-0.32742634415626526,
0.8546998500823975,
-0.07765986770391464,
0.7677730321884155,
0.5163289308547974,
-0.4899813234806061,
-0.16639479994773865,
0.022179031744599342,
-0.25605669617652... |
func (_m *ContainerIface) ProcMaskPaths() []string {
ret := _m.Called()
var r0 []string
if rf, ok := ret.Get(0).(func() []string); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
return r0
} | [
-0.23695378005504608,
0.05193166434764862,
0.5439165830612183,
1.4474323987960815,
-0.03938854858279228,
-0.1640775054693222,
1.4624366760253906,
-0.04815562814474106,
-0.13424019515514374,
0.31751835346221924,
-0.035000886768102646,
-0.5831378102302551,
-0.03927556052803993,
0.52070289850... |
func (_m *ContainerIface) ProcRoPaths() []string {
ret := _m.Called()
var r0 []string
if rf, ok := ret.Get(0).(func() []string); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
return r0
} | [
-0.25694558024406433,
0.2610359787940979,
0.7563902735710144,
0.5879128575325012,
-0.032278988510370255,
0.2542068362236023,
1.0012917518615723,
-0.2653607726097107,
0.0456947423517704,
0.5389599204063416,
0.32168638706207275,
0.07624662667512894,
-0.15373459458351135,
0.2733379006385803,
... |
func (_m *ContainerIface) SetData(path string, name string, data string) {
_m.Called(path, name, data)
} | [
-0.3412810266017914,
0.40368708968162537,
0.4218331575393677,
1.1015563011169434,
-0.550857663154602,
0.4125056564807892,
0.5779086947441101,
0.28313058614730835,
0.09385722875595093,
-0.3046358525753021,
-0.5290038585662842,
0.4218924641609192,
0.535383939743042,
0.10763276368379593,
-0... |
func (_m *ContainerIface) SetInitProc(pid uint32, uid uint32, gid uint32) error {
ret := _m.Called(pid, uid, gid)
var r0 error
if rf, ok := ret.Get(0).(func(uint32, uint32, uint32) error); ok {
r0 = rf(pid, uid, gid)
} else {
r0 = ret.Error(0)
}
return r0
} | [
0.5170573592185974,
-0.2492065578699112,
0.6602615118026733,
-0.6461296081542969,
0.3385590612888336,
-0.2350667417049408,
0.6645602583885193,
-0.19298848509788513,
-0.2554633915424347,
-0.015484915114939213,
0.348040908575058,
-0.22158797085285187,
-0.022147074341773987,
-0.13376116752624... |
func (_m *ContainerIface) SetService(css domain.ContainerStateServiceIface) {
_m.Called(css)
} | [
-0.8272154927253723,
0.2236962765455246,
0.20945586264133453,
1.465973138809204,
0.24946258962154388,
0.737393319606781,
1.2603391408920288,
-0.29749631881713867,
0.09635233879089355,
-0.26735278964042664,
0.2513311505317688,
0.354120135307312,
0.4965475797653198,
0.4465068578720093,
-0.... |
func (_m *ContainerIface) String() string {
ret := _m.Called()
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
} | [
-0.3067168593406677,
-0.3009152412414551,
0.13626430928707123,
0.16300037503242493,
0.22606496512889862,
-0.6571568846702576,
1.0508943796157837,
-0.15195731818675995,
0.10011055320501328,
-0.020839909091591835,
0.13690686225891113,
0.547024130821228,
0.019606832414865494,
-0.1226792261004... |
func (_m *ContainerIface) UID() uint32 {
ret := _m.Called()
var r0 uint32
if rf, ok := ret.Get(0).(func() uint32); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint32)
}
return r0
} | [
-0.21549151837825775,
-0.23758946359157562,
0.49862679839134216,
0.3207814693450928,
0.5187245011329651,
0.40189987421035767,
1.3576236963272095,
0.8344335556030273,
0.8255226016044617,
-0.7891419529914856,
0.254757821559906,
0.5440779328346252,
0.20639942586421967,
0.5733233690261841,
-... |
func Uint64SliceToByteSlice(in []uint64) ([]byte, error) {
buffer := bytes.NewBuffer(make([]byte, 0, len(in)*8))
err := binary.Write(buffer, binary.LittleEndian, in)
if err != nil {
return nil, err
}
return buffer.Bytes(), nil
} | [
-1.3921133279800415,
0.13094711303710938,
0.39080050587654114,
0.08669751137495041,
0.3122131824493408,
-0.26762500405311584,
-0.8507422804832458,
-0.8450623750686646,
0.49501633644104004,
0.708148717880249,
-0.1709929257631302,
-0.4763832986354828,
0.0704050213098526,
0.7002823352813721,
... |
func ByteSliceToUint64Slice(in []byte) ([]uint64, error) {
buffer := bytes.NewBuffer(in)
out := make([]uint64, len(in)/8)
err := binary.Read(buffer, binary.LittleEndian, &out)
if err != nil {
return nil, err
}
return out, nil
} | [
-1.0848373174667358,
-0.11476343125104904,
0.24471335113048553,
-0.05091797932982445,
0.6185405850410461,
-0.28763023018836975,
-0.7084104418754578,
0.33972930908203125,
0.16145972907543182,
0.9135679602622986,
-0.3254903554916382,
0.18041236698627472,
0.05288476496934891,
0.34856316447257... |
func NewClient(uri string, requestTimeout time.Duration) Client {
return &client{
requester: rpc.NewEndpointRequester(uri, "/ext/ipcs", "ipcs", requestTimeout),
}
} | [
-0.20368672907352448,
0.017488721758127213,
0.3903912603855133,
0.11110436916351318,
-0.7707063555717468,
-0.07055512070655823,
-0.8363237977027893,
-0.4836317300796509,
0.14956916868686676,
-0.5038888454437256,
0.6231387257575989,
0.5268592238426208,
-1.4335657358169556,
-1.82484650611877... |
func (d *Dao) HandlerUserDmg(user string) {
u := strings.Split(user, "\u0001")
userDmg := &model.UserDmg{
MID: u[0],
Gender: u[1],
Age: u[2],
Geo: u[3],
ContentTag: u[4],
ViewedVideo: d.HandlerViewedVideo(u[5]),
ContentZone: u[6],
ContentCount: u[7],
FollowUps: ... | [
-0.9918704628944397,
0.35715651512145996,
0.32861509919166565,
-0.1324489414691925,
-1.2779463529586792,
-0.08800503611564636,
0.05735822021961212,
0.453753262758255,
0.44040003418922424,
-0.23815658688545227,
-1.4167423248291016,
-0.17457115650177002,
0.21807992458343506,
0.50738644599914... |
func (d *Dao) HandlerMids(mids []int64) {
res, err := d.VideoClient.SyncUserStas(context.Background(), &video.SyncMidsRequset{MIDS: mids})
if err != nil {
log.Error("userbases update failes, mids(%v), err(%v)", mids, err)
return
}
log.Info("userbases update success, affected %v rows", res.Affc)
} | [
-0.7991283535957336,
-0.3784058094024658,
0.3315834701061249,
0.0166615042835474,
-0.7394107580184937,
0.06407932937145233,
0.09921781718730927,
-0.06587543338537216,
0.9709683656692505,
0.4719408452510834,
-0.2959318161010742,
0.703554093837738,
-0.6192945837974548,
0.07909385859966278,
... |
func (d *Dao) HandlerMid(s string) {
mid, _ := strconv.ParseInt(s, 10, 64)
res, err := d.VideoClient.SyncUserSta(context.Background(), &video.SyncMidRequset{MID: mid})
if err != nil {
log.Error("userbase update failes, mid(%v), err(%v)", mid, err)
return
}
if res.Affc == 1 {
log.Info("userbase insert success... | [
0.005235297605395317,
-0.557651162147522,
0.7413931488990784,
0.3810059428215027,
-0.4609265923500061,
0.3712044656276703,
0.3193323314189911,
-0.16077254712581635,
0.913430392742157,
0.5605272650718689,
-0.22961793839931488,
0.5446237921714783,
-0.9810989499092102,
0.3457534909248352,
0... |
func (d *Dao) SelMidFromVideo() (mids []int64, err error) {
rows, err := d.db.Query(context.Background(), _selMidFromVideo)
if err != nil {
log.Error("SelMidFromVideo failed, err(%v)", err)
return
}
defer rows.Close()
for rows.Next() {
var s string
if err = rows.Scan(&s); err != nil {
panic(err.Error())... | [
-0.4811660051345825,
-1.092907190322876,
0.39323171973228455,
0.3456611931324005,
0.005213470198214054,
-0.7660262584686279,
-0.6168066263198853,
-0.5529455542564392,
1.7809841632843018,
0.7481565475463867,
-0.46626895666122437,
0.5663170218467712,
-0.631351888179779,
0.6369794011116028,
... |
func (d *Dao) MergeUpInfo(mid int64) (err error) {
var (
ctx = context.Background()
params = url.Values{}
req = &http.Request{}
id int64
res struct {
Code int
Data model.UpUserInfoRes
}
)
err = d.db.QueryRow(ctx, "select mid from user_base where mid = ?", mid).Scan(&id)
if err == nil ... | [
-0.4320877492427826,
0.4674791395664215,
1.3480517864227295,
0.19159142673015594,
-0.366068035364151,
0.029704686254262924,
0.9055739045143127,
-0.7631744742393494,
0.29164910316467285,
0.014328581281006336,
-0.8323100209236145,
-0.30438968539237976,
-0.3223285377025604,
0.0933343991637229... |
func (d *Dao) SelMidFromUserBase(start int) (mids []int64, err error) {
var mid int64
rows, err := d.db.Query(context.Background(), _selMidFromUserBase, start)
if err != nil {
log.Error("SelMidFromUserBase failed, err(%v)", err)
return
}
defer rows.Close()
for rows.Next() {
var s string
if err = rows.Scan... | [
-0.4459477663040161,
-1.0070431232452393,
0.267299622297287,
0.4101025462150574,
-0.4978540539741516,
-0.4412217140197754,
-0.4299303889274597,
-0.5771196484565735,
0.8820623159408569,
0.7271833419799805,
-0.4675165116786957,
0.10929041355848312,
-0.6209003329277039,
0.33688658475875854,
... |
func NewProcedureCache() *ProcedureCache {
return &ProcedureCache{
dbToProcedureMap: make(map[string]map[string]map[int]*Procedure),
IsPopulating: false,
}
} | [
-0.3230745792388916,
-0.09214657545089722,
0.23537208139896393,
0.008911149576306343,
-0.9829672574996948,
-0.49235692620277405,
-0.18310296535491943,
0.37000036239624023,
0.3966602087020874,
0.28673940896987915,
0.2602198123931885,
0.2384994775056839,
-0.24045616388320923,
0.6309736371040... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.