query
stringlengths
7
3.85k
document
stringlengths
11
430k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
NewRabbitMQServer returns the new rabbitmq server with the connection and channel
func NewRabbitMQServer(username string, password string, host string) *Server { return &Server{ RabbitMQUsername: username, RabbitMQPassword: password, RabbitMQHost: host, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewServer(cfg *ServerConfig) (*Server, error) {\n\tvar s = &Server{\n\t\tmux: http.NewServeMux(),\n\t}\n\n\t// register api handlers\n\ts.registerHandlers()\n\tconsole.Info(\"registered handlers\")\n\n\t// http client for authorization\n\ts.hc = &http.Client{}\n\n\t// establish rabbitmq session\n\tmqaddr := f...
[ "0.7595138", "0.66407835", "0.6526455", "0.6236298", "0.6043651", "0.6040377", "0.6027341", "0.58490276", "0.58328205", "0.5806928", "0.5803156", "0.57954323", "0.5707904", "0.5688219", "0.5674982", "0.55992335", "0.55966425", "0.5593839", "0.5593327", "0.558049", "0.55695677...
0.7509787
1
Connect connects to the RabbitMQ server
func (s *Server) Connect() { connectionAddr := fmt.Sprintf("amqp://%s:%s@%s", s.RabbitMQUsername, s.RabbitMQPassword, s.RabbitMQHost) conn, err := amqp.Dial(connectionAddr) FailOnError(err, "Failed to connect to RabbitMQ") s.Conn = conn }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *RabbitMQ) Connect() (err error) {\n\tr.conn, err = amqp.Dial(Conf.AMQPUrl)\n\tif err != nil {\n\t\tlog.Info(\"[amqp] connect error: %s\\n\", err)\n\t\treturn err\n\t}\n\tr.channel, err = r.conn.Channel()\n\tif err != nil {\n\t\tlog.Info(\"[amqp] get channel error: %s\\n\", err)\n\t\treturn err\n\t}\n\tr.d...
[ "0.7894139", "0.7789549", "0.76434803", "0.72879946", "0.72490144", "0.7248601", "0.7241409", "0.72375685", "0.7220578", "0.715189", "0.7151718", "0.7076857", "0.70511913", "0.7030396", "0.702692", "0.69975215", "0.69159627", "0.6912748", "0.6884651", "0.6796288", "0.6754217"...
0.76561403
2
Close closes the connection and channel
func (s *Server) Close() { s.Conn.Close() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ch *Channel) Close() {}", "func (c *client) Close() error { return c.c.Close() }", "func (cha *Channel) close() {\n\t// not care about channel close error, because it's the client action\n\tcha.cha.Close()\n\n\tcha.conn.decrNumOpenedChannel()\n\tcha.cha = nil\n\tcha.conn = nil\n}", "func (con *IRCConn)...
[ "0.8092423", "0.7488273", "0.74117875", "0.7401336", "0.7297787", "0.72844076", "0.7258919", "0.7258919", "0.70475566", "0.70170844", "0.6994085", "0.68766195", "0.68766195", "0.68566006", "0.6801606", "0.67880464", "0.67727214", "0.6753569", "0.67466146", "0.67429197", "0.67...
0.0
-1
Defang Takes an IOC and defangs it using the standard defangReplacements
func (ioc *IOC) Defang() *IOC { copy := *ioc ioc = &copy // Just do a string replace on each if replacements, ok := defangReplacements[ioc.Type]; ok { for _, fangPair := range replacements { ioc.IOC = strings.ReplaceAll(ioc.IOC, fangPair.fanged, fangPair.defanged) } } return ioc }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ioc *IOC) Fang() *IOC {\n\tcopy := *ioc\n\tioc = &copy\n\n\t// String replace all defangs in our standard set\n\tif replacements, ok := defangReplacements[ioc.Type]; ok {\n\t\tfor _, fangPair := range replacements {\n\t\t\tioc.IOC = strings.ReplaceAll(ioc.IOC, fangPair.defanged, fangPair.fanged)\n\t\t}\n\t}\...
[ "0.61296785", "0.5149551", "0.4850799", "0.47487968", "0.46673915", "0.44889128", "0.4452262", "0.44432408", "0.44358099", "0.44134143", "0.43503362", "0.43301424", "0.4324857", "0.43207198", "0.4270548", "0.42602628", "0.425869", "0.425649", "0.42529112", "0.42438713", "0.42...
0.7187308
0
Fang Takes an IOC and removes the defanging stuff from it (converts to a fanged IOC).
func (ioc *IOC) Fang() *IOC { copy := *ioc ioc = &copy // String replace all defangs in our standard set if replacements, ok := defangReplacements[ioc.Type]; ok { for _, fangPair := range replacements { ioc.IOC = strings.ReplaceAll(ioc.IOC, fangPair.defanged, fangPair.fanged) } } // Regex replace everyth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ioc *IOC) Defang() *IOC {\n\tcopy := *ioc\n\tioc = &copy\n\n\t// Just do a string replace on each\n\tif replacements, ok := defangReplacements[ioc.Type]; ok {\n\t\tfor _, fangPair := range replacements {\n\t\t\tioc.IOC = strings.ReplaceAll(ioc.IOC, fangPair.fanged, fangPair.defanged)\n\t\t}\n\t}\n\n\treturn ...
[ "0.7177586", "0.50840104", "0.48262703", "0.48175362", "0.48002586", "0.4679298", "0.4660034", "0.4584422", "0.45685875", "0.45614737", "0.45376295", "0.44981825", "0.44849345", "0.44699618", "0.44661286", "0.44610918", "0.44461814", "0.4425764", "0.44216082", "0.44178298", "...
0.68866414
1
IsFanged Takes an IOC and returns if it is fanged. Non fanging types (bitcoin, hashes, file, cve) are always determined to not be fanged
func (ioc *IOC) IsFanged() bool { if ioc.Type == Bitcoin || ioc.Type == MD5 || ioc.Type == SHA1 || ioc.Type == SHA256 || ioc.Type == SHA512 || ioc.Type == File || ioc.Type == CVE { return false } // Basically just check if the fanged version is different from the input // This does label a partially ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (b Bet) IsForced() bool {\n\tswitch b.Type {\n\tcase bet.Ante, bet.BringIn, bet.SmallBlind, bet.BigBlind, bet.GuestBlind, bet.Straddle:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "func (me TxsdWorkType) IsFc() bool { return me.String() == \"FC\" }", "func (me TxsdWorkType) IsFo() bool { retu...
[ "0.5777848", "0.5636446", "0.5450624", "0.53252184", "0.5296213", "0.52835715", "0.5083163", "0.5069068", "0.49672344", "0.4967114", "0.4961127", "0.49527285", "0.4931717", "0.49222323", "0.49133813", "0.49083734", "0.4903117", "0.48999462", "0.48911142", "0.48828495", "0.485...
0.7952134
0
Get finds projects by tags or all projects or the project in the current directory
func (i *Index) Get(tags []string, all bool) ([]string, error) { switch { case all: err := i.clean() return i.projects(), err case len(tags) > 0: if err := i.clean(); err != nil { return []string{}, err } projectsWithTags := []string{} for _, p := range i.projects() { found, err := i.hasTags(p, tag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetProjects(w http.ResponseWriter, r *http.Request, auth string) []Project {\n\tvar projects []Project\n\tprojectFileName := auth + globals.PROJIDFILE\n\t//First see if project already exist\n\tstatus, filepro := caching.ShouldFileCache(projectFileName, globals.PROJIDDIR)\n\tdefer filepro.Close()\n\tif status...
[ "0.649808", "0.61884755", "0.61773306", "0.61728644", "0.6160904", "0.6150968", "0.6148858", "0.61327946", "0.61255896", "0.6123783", "0.61141396", "0.6096289", "0.6066046", "0.60416514", "0.6032895", "0.6004244", "0.59767795", "0.59659183", "0.59482855", "0.5927783", "0.5922...
0.7243131
0
loginAttempt increments the number of login attempts in sessions variable
func loginAttempt(sess *sessions.Session) { // Log the attempt if sess.Values[sessLoginAttempt] == nil { sess.Values[sessLoginAttempt] = 1 } else { sess.Values[sessLoginAttempt] = sess.Values[sessLoginAttempt].(int) + 1 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func AuthenticateLoginAttempt(r *http.Request) *sessions.Session {\n\tvar userid string\n\tlog.Println(\"Authenticating Login credentials.\")\n\tattemptEmail := template.HTMLEscapeString(r.Form.Get(\"email\")) //Escape special characters for security.\n\tattemptPassword := template.HTMLEscapeString(r.Form.Ge...
[ "0.68752503", "0.68752503", "0.6131486", "0.58911663", "0.57096565", "0.5694199", "0.5596062", "0.5593208", "0.55727524", "0.55451465", "0.5532529", "0.54767036", "0.54591733", "0.54341775", "0.5418249", "0.5364072", "0.5343915", "0.53298", "0.5306828", "0.53017807", "0.52956...
0.8348744
0
jdecrypt private function to "decrypt" password
func jdecrypt( stCuen string , stPass string)(stRes string,err error){ var stEnc []byte stEnc, err = base64.StdEncoding.DecodeString(stPass) if err != nil { log.Println("jdecrypt ", stPass, err ) } else{ lon := len(stEnc) lan := len(stCuen) if lon > ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func DecryptJasypt(encrypted []byte, password string) ([]byte, error) {\n\tif len(encrypted) < des.BlockSize {\n\t\treturn nil, fmt.Errorf(\"Invalid encrypted text. Text length than block size.\")\n\t}\n\n\tsalt := encrypted[:des.BlockSize]\n\tct := encrypted[des.BlockSize:]\n\n\tkey, err := PBKDF1MD5([]byte(passw...
[ "0.7013464", "0.6491337", "0.6297993", "0.6259881", "0.61593276", "0.6147527", "0.6136691", "0.6125619", "0.61233604", "0.605838", "0.605469", "0.60460126", "0.6022822", "0.6017218", "0.60095084", "0.59779716", "0.5960361", "0.59481645", "0.59393644", "0.59285855", "0.5919928...
0.77491564
0
JLoginGET service to return persons data
func JLoginGET(w http.ResponseWriter, r *http.Request) { var params httprouter.Params sess := model.Instance(r) v := view.New(r) v.Vars["token"] = csrfbanana.Token(w, r, sess) params = context.Get(r, "params").(httprouter.Params) cuenta := params.ByName("cuenta") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetData(accessToken string, w http.ResponseWriter, r *http.Request) {\n\trequest, err := http.NewRequest(\"GET\", \"https://auth.vatsim.net/api/user\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\trequest.Header.Add(\"Bearer\", accessToken)\n\trequest.Header.Add(\"accept\", \"application/json\")\n\tc...
[ "0.63776165", "0.6154853", "0.615378", "0.6062602", "0.59676594", "0.5934943", "0.5893324", "0.58626664", "0.5861018", "0.5853691", "0.584366", "0.5807749", "0.5805815", "0.57685137", "0.5765969", "0.57202905", "0.57076734", "0.57067597", "0.5703087", "0.5691566", "0.5685883"...
0.76519233
0
LoginGET displays the login page
func LoginGET(w http.ResponseWriter, r *http.Request) { sess := model.Instance(r) v := view.New(r) v.Name = "login/login" v.Vars["token"] = csrfbanana.Token(w, r, sess) // Refill any form fields view.Repopulate([]string{"cuenta","password"}, r.Form, v.Vars) v.Render(w) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func LoginGET(c *gin.Context) {\n\tc.HTML(http.StatusOK, \"login.html\", gin.H{})\n}", "func (m *Repository) GetLogin(w http.ResponseWriter, r *http.Request) {\n\tif m.App.Session.Exists(r.Context(), \"user_id\") {\n\t\thttp.Redirect(w, r, \"/\", http.StatusSeeOther)\n\t\treturn\n\t}\n\n\trender.Template(w, r, \...
[ "0.78163654", "0.75899374", "0.7468364", "0.7320955", "0.7160428", "0.691093", "0.68139416", "0.6773794", "0.675614", "0.6752772", "0.66593784", "0.66468394", "0.6646164", "0.66439223", "0.6637479", "0.6600472", "0.659737", "0.65903026", "0.6589105", "0.65679455", "0.65355605...
0.801604
0
LoginPOST handles the login form submission
func LoginPOST(w http.ResponseWriter, r *http.Request) { sess := model.Instance(r) // Validate with required fields if validate, missingField := view.Validate(r, []string{"cuenta", "pass"}); !validate { sess.AddFlash(view.Flash{"Falta campo: " + missingField, view.FlashError}) sess.Save(r, w) LoginGET(w, r) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Login) LoginPostHandler(rw http.ResponseWriter, r *http.Request) {\n\t// Create struct of form data to handle possible errors.\n\tformData := web_models.Login{\n\t\tUsername: r.FormValue(\"username\"),\n\t\tPassword: r.FormValue(\"password\"),\n\t\tMessages: &web_models.FormMessages{}}\n\n\tuser, err := c...
[ "0.81102294", "0.78819275", "0.781747", "0.77993685", "0.7782218", "0.77255404", "0.7672384", "0.7642712", "0.76279587", "0.7588439", "0.7473256", "0.746993", "0.7370692", "0.7357331", "0.73544604", "0.72728825", "0.7212554", "0.72107416", "0.71366787", "0.713251", "0.7117336...
0.74688363
12
LogoutGET clears the session and logs the user out
func LogoutGET(w http.ResponseWriter, r *http.Request) { // Get session sess := model.Instance(r) // If user is authenticated if sess.Values["id"] != nil { model.Empty(sess) sess.AddFlash(view.Flash{"Goodbye!", view.FlashNotice}) sess.Save(r, w) } http.Redirect(w, r, "/", http.StatusFound) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Logout(w http.ResponseWriter, r *http.Request) {\n\tPrintln(\"Endpoint Hit: Logout\")\n\n\tsession := sessions.Start(w, r)\n\tsession.Clear()\n\tsessions.Destroy(w, r)\n\thttp.Redirect(w, r, \"/\", 302)\n}", "func Logout(w http.ResponseWriter, req *http.Request) {\n\tif !requirePost(w, req) {\n\t\tlog.Warn(...
[ "0.79834914", "0.7754024", "0.7634268", "0.7630396", "0.7539964", "0.75395024", "0.7527865", "0.7512331", "0.7508096", "0.7494285", "0.7482439", "0.74492276", "0.74395335", "0.7416064", "0.7408597", "0.7404034", "0.7349339", "0.73031014", "0.73013866", "0.72951627", "0.728178...
0.760095
4
Returns a new JWK for the desired type. An error will be returned if an invalid type is passed
func NewJwk(kty string) (j *Jwk, err error) { switch kty { case KeyTypeOct, KeyTypeRSA, KeyTypeEC: j = &Jwk{Type: kty} default: err = errors.New("Key Type Invalid. Must be Oct, RSA or EC") } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *JWK) GetType() Type {\n\treturn TypeJWK\n}", "func NewJWK(jwk map[string]interface{}) JWK {\n\treturn jwk\n}", "func (pk PublicKey) JWK() JWK {\n\tentry, ok := pk[JwkProperty]\n\tif !ok {\n\t\treturn nil\n\t}\n\n\tjson, ok := entry.(map[string]interface{})\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn Ne...
[ "0.655761", "0.63698053", "0.577357", "0.5768871", "0.5633736", "0.562614", "0.5422218", "0.54051393", "0.5397407", "0.53441304", "0.532489", "0.51979995", "0.5142026", "0.5117357", "0.5048858", "0.498495", "0.49803796", "0.4941713", "0.49219853", "0.4858893", "0.4855007", ...
0.6999248
0
Curve returns the elliptic.Curve for the specificied CrvType. If the CrvType is invalid or unknown, a nil Curve type will be returned.
func CurveByName(curveName string) ec.Curve { switch curveName { case "P-224": return ec.P224() case "P-256": return ec.P256() case "P-384": return ec.P384() case "P-521": return ec.P521() default: return nil } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetCurve(s string) elliptic.Curve {\n\ts3 := s[len(s)-3:]\n\tif s3 == \"256\" {\n\t\treturn elliptic.P256()\n\t} else if s3 == \"384\" {\n\t\treturn elliptic.P384()\n\t} else if s3 == \"521\" {\n\t\treturn elliptic.P521()\n\t}\n\treturn elliptic.P224()\n}", "func getCurve(curve string) (elliptic.Curve, stri...
[ "0.637573", "0.62552565", "0.602968", "0.58757263", "0.5873665", "0.5735538", "0.5681037", "0.56702095", "0.54787964", "0.5441163", "0.5343881", "0.53248847", "0.5061041", "0.49801546", "0.49398685", "0.49108317", "0.477204", "0.4748864", "0.47185302", "0.47031447", "0.466137...
0.5999522
3
Implements the json.Marshaler interface and JSON encodes the Jwk
func (jwk *Jwk) MarshalJSON() (data []byte, err error) { // Remove any potentionally conflicting claims from the JWK's additional members delete(jwk.AdditionalMembers, "kty") delete(jwk.AdditionalMembers, "kid") delete(jwk.AdditionalMembers, "alg") delete(jwk.AdditionalMembers, "use") delete(jwk.AdditionalMember...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (j *JWK) MarshalJSON() ([]byte, error) {\n\tif isSecp256k1(j.Kty, j.Crv) {\n\t\treturn marshalSecp256k1(j)\n\t}\n\n\treturn (&j.JSONWebKey).MarshalJSON()\n}", "func JSONEncoder() Encoder { return jsonEncoder }", "func (m KeyPair) MarshalJSON() ([]byte, error) {\n\t_parts := make([][]byte, 0, 2)\n\n\taO0, ...
[ "0.70164174", "0.6944281", "0.68375885", "0.67024183", "0.6682063", "0.6647078", "0.6481345", "0.647343", "0.64550096", "0.64235896", "0.64145947", "0.637341", "0.6367879", "0.6362876", "0.6359962", "0.63448554", "0.63441277", "0.632238", "0.6312419", "0.62963176", "0.6285640...
0.76333815
0
Validate checkes the JWK object to verify the parameter set represent a valid JWK. If jwk is valid a nil error will be returned. If a JWK is invalid an error will be returned describing the values that causes the validation to fail.
func (jwk *Jwk) Validate() error { // If the alg parameter is set, make sure it matches the set JWK Type if len(jwk.Algorithm) > 0 { algKeyType := GetKeyType(jwk.Algorithm) if algKeyType != jwk.Type { fmt.Errorf("Jwk Type (kty=%v) doesn't match the algorithm key type (%v)", jwk.Type, algKeyType) } } switc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (jwk *Jwk) validateECParams() error {\n\tif jwk.X == nil {\n\t\treturn errors.New(\"EC Required Param (X) is nil\")\n\t}\n\tif jwk.Y == nil {\n\t\treturn errors.New(\"EC Required Param (Y) is nil\")\n\t}\n\tif jwk.Curve == nil {\n\t\treturn errors.New(\"EC Required Param (Crv) is nil\")\n\t}\n\treturn nil\n}"...
[ "0.6095678", "0.569532", "0.5664185", "0.560481", "0.5594125", "0.55730027", "0.5429043", "0.5408447", "0.52270234", "0.5226582", "0.5189666", "0.5134343", "0.5122218", "0.51015174", "0.5083125", "0.50354177", "0.5019506", "0.50113547", "0.49843422", "0.4983307", "0.49801493"...
0.7443554
0
ValidateRSAParams checks the RSA parameters of a RSA type of JWK. If a JWK is invalid an error will be returned describing the values that causes the validation to fail.
func (jwk *Jwk) validateRSAParams() error { if jwk.E < 1 { return errors.New("RSA Required Param (E) is empty/default (<= 0)") } if jwk.N == nil { return errors.New("RSA Required Param (N) is nil") } pOk := jwk.P != nil qOk := jwk.Q != nil dpOk := jwk.Dp != nil dqOk := jwk.Dq != nil qiOk := jwk.Qi != nil ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (priv *PKCS11PrivateKeyRSA) Validate() error {\n\tpub := priv.key.PubKey.(*rsa.PublicKey)\n\tif pub.E < 2 {\n\t\treturn errMalformedRSAKey\n\t}\n\t// The software implementation actively rejects 'large' public\n\t// exponents, in order to simplify its own implementation.\n\t// Here, instead, we expect the PKC...
[ "0.6804986", "0.6333782", "0.6148202", "0.58484894", "0.5737118", "0.56840175", "0.56579584", "0.5655421", "0.5614205", "0.5572611", "0.55541784", "0.55131155", "0.5499171", "0.54608613", "0.54498476", "0.54304063", "0.54144347", "0.5405987", "0.5393092", "0.5390702", "0.5346...
0.82881474
0
ValidateRSAParams checks the Elliptic parameters of an Elliptic type of JWK. If a JWK is invalid an error will be returned describing the values that causes the validation to fail.
func (jwk *Jwk) validateECParams() error { if jwk.X == nil { return errors.New("EC Required Param (X) is nil") } if jwk.Y == nil { return errors.New("EC Required Param (Y) is nil") } if jwk.Curve == nil { return errors.New("EC Required Param (Crv) is nil") } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (jwk *Jwk) validateRSAParams() error {\n\tif jwk.E < 1 {\n\t\treturn errors.New(\"RSA Required Param (E) is empty/default (<= 0)\")\n\t}\n\tif jwk.N == nil {\n\t\treturn errors.New(\"RSA Required Param (N) is nil\")\n\t}\n\n\tpOk := jwk.P != nil\n\tqOk := jwk.Q != nil\n\tdpOk := jwk.Dp != nil\n\tdqOk := jwk.D...
[ "0.81767845", "0.6853861", "0.61783284", "0.60745764", "0.57720494", "0.57669014", "0.57425594", "0.56880015", "0.5676771", "0.5632435", "0.55471593", "0.5539518", "0.5511913", "0.55004203", "0.5453801", "0.537776", "0.53551984", "0.5286759", "0.5272513", "0.5269113", "0.5266...
0.6563129
2
ValidateRSAParams checks the Octet (symmetric) parameters of an Octet type of JWK. If a JWK is invalid an error will be returned describing the values that causes the validation to fail.
func (jwk *Jwk) validateOctParams() error { if len(jwk.KeyValue) < 1 { return errors.New("Oct Required Param KeyValue (k) is empty") } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (jwk *Jwk) validateRSAParams() error {\n\tif jwk.E < 1 {\n\t\treturn errors.New(\"RSA Required Param (E) is empty/default (<= 0)\")\n\t}\n\tif jwk.N == nil {\n\t\treturn errors.New(\"RSA Required Param (N) is nil\")\n\t}\n\n\tpOk := jwk.P != nil\n\tqOk := jwk.Q != nil\n\tdpOk := jwk.Dp != nil\n\tdqOk := jwk.D...
[ "0.7987645", "0.67373997", "0.62081987", "0.6145181", "0.6035359", "0.5793185", "0.5590855", "0.54903513", "0.54756767", "0.5403163", "0.54031277", "0.5334416", "0.5298498", "0.52967113", "0.5285707", "0.5281143", "0.5264965", "0.52576", "0.5218722", "0.52063566", "0.5171835"...
0.607591
4
NewIndexDB creates a new instance of IndexDB
func NewIndexDB(db store.DB, recordStore *RecordDB) *IndexDB { return &IndexDB{db: db, recordStore: recordStore} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateIndexDB(langName string, dbT DBType) IndexDB {\n\t// TODO 暂时只实现了内存存储,一次性的。\n\treturn initMenDB(langName)\n}", "func NewIndex(addr, name, typ string, md *index.Metadata) (*Index, error) {\n\n\tfmt.Println(\"Get a new index: \", addr, name)\n client := &http.Client{\n\t\tTransport: &http.Transpo...
[ "0.7321358", "0.7077958", "0.6995988", "0.695568", "0.68397", "0.6816478", "0.6716526", "0.6652811", "0.664919", "0.66478133", "0.6618617", "0.65940624", "0.65865254", "0.6480771", "0.64426786", "0.64285284", "0.6395965", "0.6346326", "0.6320402", "0.6302338", "0.6245616", ...
0.7238606
1
SetIndex adds a bucket with provided pulseNumber and ID
func (i *IndexDB) SetIndex(ctx context.Context, pn insolar.PulseNumber, bucket record.Index) error { i.lock.Lock() defer i.lock.Unlock() err := i.setBucket(pn, bucket.ObjID, &bucket) if err != nil { return err } stats.Record(ctx, statIndexesAddedCount.M(1)) inslogger.FromContext(ctx).Debugf("[SetIndex] buck...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (i *IndexDB) ForID(ctx context.Context, pn insolar.PulseNumber, objID insolar.ID) (record.Index, error) {\n\tvar buck *record.Index\n\tbuck, err := i.getBucket(pn, objID)\n\tif err == ErrIndexNotFound {\n\t\tlastPN, err := i.getLastKnownPN(objID)\n\t\tif err != nil {\n\t\t\treturn record.Index{}, ErrIndexNotF...
[ "0.5462457", "0.53987634", "0.5329833", "0.5281275", "0.52774054", "0.52120125", "0.51768976", "0.51632243", "0.51465714", "0.5141648", "0.5139099", "0.51226485", "0.51036954", "0.5090387", "0.50686425", "0.50326204", "0.5007259", "0.4998986", "0.49797478", "0.49673653", "0.4...
0.5037024
15
UpdateLastKnownPulse must be called after updating TopSyncPulse
func (i *IndexDB) UpdateLastKnownPulse(ctx context.Context, topSyncPulse insolar.PulseNumber) error { i.lock.Lock() defer i.lock.Unlock() indexes, err := i.ForPulse(ctx, topSyncPulse) if err != nil && err != ErrIndexNotFound { return errors.Wrapf(err, "failed to get indexes for pulse: %d", topSyncPulse) } for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (trd *trxDispatcher) updateLastSeenBlock() {\n\t// get the current value\n\tlsb := trd.blkObserver.Load()\n\tlog.Noticef(\"last seen block is #%d\", lsb)\n\n\t// make the change in the database so the progress persists\n\terr := repo.UpdateLastKnownBlock((*hexutil.Uint64)(&lsb))\n\tif err != nil {\n\t\tlog.Er...
[ "0.5581604", "0.5498568", "0.5405669", "0.5070121", "0.5051444", "0.50203633", "0.4999089", "0.49901783", "0.4933522", "0.49308974", "0.4929331", "0.4919969", "0.49038833", "0.48871338", "0.48802578", "0.48719504", "0.48650056", "0.48559475", "0.48462912", "0.48119715", "0.47...
0.70539033
0
TruncateHead remove all records after lastPulse
func (i *IndexDB) TruncateHead(ctx context.Context, from insolar.PulseNumber) error { i.lock.Lock() defer i.lock.Unlock() it := i.db.NewIterator(&indexKey{objID: *insolar.NewID(pulse.MinTimePulse, nil), pn: from}, false) defer it.Close() var hasKeys bool for it.Next() { hasKeys = true key := newIndexKey(it....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *RecordDB) TruncateHead(ctx context.Context, from insolar.PulseNumber) error {\n\n\tif err := r.truncateRecordsHead(ctx, from); err != nil {\n\t\treturn errors.Wrap(err, \"failed to truncate records head\")\n\t}\n\n\tif err := r.truncatePositionRecordHead(ctx, recordPositionKey{pn: from}, recordPositionKey...
[ "0.75272435", "0.5956599", "0.58818066", "0.585593", "0.58506346", "0.5821484", "0.5794194", "0.57208204", "0.5657627", "0.5587941", "0.5498917", "0.5479526", "0.54287946", "0.5406762", "0.5404167", "0.53492576", "0.5343496", "0.5339121", "0.5239251", "0.5235306", "0.5232906"...
0.7663238
0
ForID returns a lifeline from a bucket with provided PN and ObjID
func (i *IndexDB) ForID(ctx context.Context, pn insolar.PulseNumber, objID insolar.ID) (record.Index, error) { var buck *record.Index buck, err := i.getBucket(pn, objID) if err == ErrIndexNotFound { lastPN, err := i.getLastKnownPN(objID) if err != nil { return record.Index{}, ErrIndexNotFound } buck, err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Storage) GetLifeline(objRef []byte, fromIndex *string, pulseNumberLt, pulseNumberGt, timestampLte, timestampGte *int64, limit, offset int, sortByIndexAsc bool) ([]models.Record, int, error) {\n\ttimer := prometheus.NewTimer(GetLifelineDuration)\n\tdefer timer.ObserveDuration()\n\n\tquery := s.db.Model(&mo...
[ "0.53838265", "0.5233115", "0.5099102", "0.5027689", "0.49831283", "0.4896206", "0.4884035", "0.48583797", "0.4837276", "0.47559118", "0.4734468", "0.4723855", "0.47236726", "0.4702978", "0.46923214", "0.46632597", "0.4632157", "0.46318308", "0.4618542", "0.46080965", "0.4602...
0.53829193
1
WaitReady waits for machinecontroller and its webhook to become ready
func WaitReady(s *state.State) error { if !s.Cluster.MachineController.Deploy { return nil } s.Logger.Infoln("Waiting for machine-controller to come up...") if err := cleanupStaleResources(s.Context, s.DynamicClient); err != nil { return err } if err := waitForWebhook(s.Context, s.DynamicClient); err != ni...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WaitReady(ctx *util.Context) error {\n\tif !ctx.Cluster.MachineController.Deploy {\n\t\treturn nil\n\t}\n\n\tctx.Logger.Infoln(\"Waiting for machine-controller to come up…\")\n\n\t// Wait a bit to let scheduler to react\n\ttime.Sleep(10 * time.Second)\n\n\tif err := WaitForWebhook(ctx.DynamicClient); err != n...
[ "0.81729543", "0.73304754", "0.6926979", "0.69264543", "0.6682231", "0.6572147", "0.6555187", "0.6544689", "0.64363945", "0.62041384", "0.61236566", "0.60687506", "0.60536796", "0.60392857", "0.5971176", "0.59554976", "0.58414894", "0.58387625", "0.5814672", "0.5803259", "0.5...
0.7730005
1
waitForCRDs waits for machinecontroller CRDs to be created and become established
func waitForCRDs(s *state.State) error { condFn := clientutil.CRDsReadyCondition(s.Context, s.DynamicClient, CRDNames()) err := wait.PollUntilContextTimeout(s.Context, 5*time.Second, 3*time.Minute, false, condFn.WithContext()) return fail.KubeClient(err, "waiting for machine-controller CRDs to became ready") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *MeshReconciler) waitForCRD(name string, client runtimeclient.Client) error {\n\tm.logger.WithField(\"name\", name).Debug(\"waiting for CRD\")\n\n\tbackoffConfig := backoff.ConstantBackoffConfig{\n\t\tDelay: time.Duration(backoffDelaySeconds) * time.Second,\n\t\tMaxRetries: backoffMaxretries,\n\t}\n\t...
[ "0.67166954", "0.6538773", "0.63380307", "0.6060883", "0.59197", "0.58800954", "0.5797496", "0.57853615", "0.5667254", "0.5638806", "0.55470073", "0.5496028", "0.54223436", "0.53780425", "0.5365897", "0.5323093", "0.531257", "0.5297731", "0.5264647", "0.5243112", "0.5234411",...
0.83833635
0
DestroyWorkers destroys all MachineDeployment, MachineSet and Machine objects
func DestroyWorkers(s *state.State) error { if !s.Cluster.MachineController.Deploy { s.Logger.Info("Skipping deleting workers because machine-controller is disabled in configuration.") return nil } if s.DynamicClient == nil { return fail.NoKubeClient() } ctx := context.Background() // Annotate nodes with...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bc *BaseCluster) Destroy() {\n\tfor _, m := range bc.Machines() {\n\t\tbc.numMachines--\n\t\tm.Destroy()\n\t}\n}", "func (mr *MapReduce) KillWorkers() *list.List {\n l := list.New()\n for _, w := range mr.Workers {\n DPrintf(\"DoWork: shutdown %s\\n\", w.address)\n args := &ShutdownArgs{}\n var ...
[ "0.6304216", "0.626198", "0.626198", "0.626198", "0.60066", "0.5894493", "0.5889124", "0.58310187", "0.57876456", "0.57876456", "0.57876456", "0.57876456", "0.57876456", "0.57876456", "0.57876456", "0.57876456", "0.57876456", "0.57876456", "0.57876456", "0.5772434", "0.565664...
0.7957886
0
WaitDestroy waits for all Machines to be deleted
func WaitDestroy(s *state.State) error { s.Logger.Info("Waiting for all machines to get deleted...") return wait.PollUntilContextTimeout(s.Context, 5*time.Second, 5*time.Minute, false, func(ctx context.Context) (bool, error) { list := &clusterv1alpha1.MachineList{} if err := s.DynamicClient.List(ctx, list, dyncl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bc *BaseCluster) Destroy() {\n\tfor _, m := range bc.Machines() {\n\t\tbc.numMachines--\n\t\tm.Destroy()\n\t}\n}", "func WaitForDeletion(ctx context.Context, mcpKey types.NamespacedName, timeout time.Duration) error {\n\treturn wait.PollImmediate(5*time.Second, timeout, func() (bool, error) {\n\t\tmcp := &...
[ "0.65745693", "0.62703717", "0.62244946", "0.6161704", "0.60007936", "0.59899086", "0.57228744", "0.57008475", "0.567827", "0.56474024", "0.5596537", "0.55710554", "0.5490832", "0.5463808", "0.5462064", "0.5462064", "0.5438312", "0.5418636", "0.54070365", "0.5403932", "0.5366...
0.7794994
0
waitForMachineController waits for machinecontroller to become running
func waitForMachineController(ctx context.Context, client dynclient.Client) error { condFn := clientutil.PodsReadyCondition(ctx, client, dynclient.ListOptions{ Namespace: resources.MachineControllerNameSpace, LabelSelector: labels.SelectorFromSet(map[string]string{ appLabelKey: resources.MachineControllerName, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func waitForMachineState(api *cloudapi.Client, id, state string, timeout time.Duration) error {\n\treturn waitFor(\n\t\tfunc() (bool, error) {\n\t\t\tcurrentState, err := readMachineState(api, id)\n\t\t\treturn currentState == state, err\n\t\t},\n\t\tmachineStateChangeCheckInterval,\n\t\tmachineStateChangeTimeout,...
[ "0.6205696", "0.59781384", "0.5872165", "0.57533246", "0.55674094", "0.5406494", "0.5349306", "0.53339887", "0.5305528", "0.52262676", "0.5192839", "0.5190781", "0.5143582", "0.51317656", "0.51000625", "0.5088618", "0.5088441", "0.50841904", "0.50794375", "0.5047249", "0.5038...
0.79245347
0
waitForWebhook waits for machinecontrollerwebhook to become running
func waitForWebhook(ctx context.Context, client dynclient.Client) error { condFn := clientutil.PodsReadyCondition(ctx, client, dynclient.ListOptions{ Namespace: resources.MachineControllerNameSpace, LabelSelector: labels.SelectorFromSet(map[string]string{ appLabelKey: resources.MachineControllerWebhookName, }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func waitFor(ctx context.Context, eventName string) error {\n\tch := make(chan struct{})\n\tcctx, cancel := context.WithCancel(ctx)\n\tchromedp.ListenTarget(cctx, func(ev interface{}) {\n\t\tswitch e := ev.(type) {\n\t\tcase *page.EventLifecycleEvent:\n\t\t\tif e.Name == eventName {\n\t\t\t\tcancel()\n\t\t\t\tclos...
[ "0.5618916", "0.5599623", "0.5432932", "0.54272896", "0.5426101", "0.54169494", "0.5409126", "0.54035944", "0.5363949", "0.527401", "0.5210134", "0.52003247", "0.51873827", "0.5170767", "0.5069141", "0.50672245", "0.50620365", "0.50183946", "0.49992928", "0.49969497", "0.4977...
0.78812975
0
Create creates a new user. The receiver is modified to the ID of the new user.
func (id *User) Create(tx *sql.Tx) error { sql := `INSERT INTO "user" DEFAULT VALUES RETURNING id` return tx.QueryRow(sql).Scan(id) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ctl UserController) Create(c *gin.Context) {\n\tvar createRequest microsoft.CreateUserRequest\n\tif err := c.ShouldBindJSON(&createRequest); err != nil {\n\t\tc.JSON(rootCtl.wrap(http.StatusUnprocessableEntity, err.Error()))\n\t\treturn\n\t}\n\n\tuid, err := microsoft.NewUser().Create(c.Param(\"id\"), create...
[ "0.7483689", "0.747625", "0.7386321", "0.73594594", "0.7348308", "0.73337317", "0.73107886", "0.73019266", "0.73012894", "0.7237672", "0.72374344", "0.7225838", "0.72086954", "0.71893203", "0.71826047", "0.71743757", "0.7169192", "0.7163983", "0.7156776", "0.7093787", "0.7080...
0.0
-1
Read the existing appNums out of what we published/checkpointed. Also read what we have persisted before a reboot Store in reserved map since we will be asked to allocate them later. Set bit in bitmap.
func appNumAllocatorInit(ctx *zedrouterContext) { pubAppNetworkStatus := ctx.pubAppNetworkStatus pubUuidToNum := ctx.pubUuidToNum items := pubUuidToNum.GetAll() for key, st := range items { status := cast.CastUuidToNum(st) if status.Key() != key { log.Errorf("appNumAllocatorInit key/UUID mismatch %s vs %s;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func appNumOnUNetInit(ctx *zedrouterContext) {\n\n\t// initialize the base\n\tappNumBase = make(map[string]*types.Bitmap)\n\n\tpubAppNetworkStatus := ctx.pubAppNetworkStatus\n\tpub := ctx.pubUUIDPairAndIfIdxToNum\n\tnumType := appNumOnUNetType\n\n\titems := pub.GetAll()\n\tfor _, item := range items {\n\t\tappNumM...
[ "0.63212216", "0.55052525", "0.5487842", "0.5469241", "0.5096306", "0.4942264", "0.4932391", "0.49198318", "0.47389328", "0.47235832", "0.4666213", "0.4537478", "0.45159277", "0.44901553", "0.44859603", "0.44783434", "0.44477382", "0.4390468", "0.4382944", "0.43749502", "0.43...
0.53405076
4
If an entry is not inUse and and its CreateTime were before the agent started, then we free it up.
func appNumAllocatorGC(ctx *zedrouterContext) { pubUuidToNum := ctx.pubUuidToNum log.Infof("appNumAllocatorGC") freedCount := 0 items := pubUuidToNum.GetAll() for _, st := range items { status := cast.CastUuidToNum(st) if status.NumType != "appNum" { continue } if status.InUse { continue } if s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Cache) CleanupExpired() {\n\tgo func() {\n\t\tfor {\n\t\t\tfor k, v := range c.Map {\n\t\t\t\tif v.RegTime.Add(time.Minute * 1).Before(time.Now()) {\n\t\t\t\t\tc.Remove(k)\n\t\t\t\t}\n\t\t\t}\n\t\t\ttime.Sleep(time.Second * 10)\n\t\t}\n\t}()\n}", "func (c *Cache) cleanup(ttl time.Duration) {\n\tvalids :...
[ "0.5817108", "0.5692876", "0.5678534", "0.5577531", "0.55638546", "0.5552982", "0.5491385", "0.5486231", "0.54780245", "0.546433", "0.5434327", "0.5383813", "0.53178895", "0.527339", "0.52312803", "0.5225152", "0.521923", "0.52158886", "0.5204025", "0.51703554", "0.51700693",...
0.0
-1
DefaultKeymap returns a copy of the default Keymap Useful if inspection/customization is needed.
func DefaultKeymap() Keymap { return Keymap{ ansi.NEWLINE: (*Core).Enter, ansi.CARRIAGE_RETURN: (*Core).Enter, ansi.CTRL_C: (*Core).Interrupt, ansi.CTRL_D: (*Core).DeleteOrEOF, ansi.CTRL_H: (*Core).Backspace, ansi.BACKSPACE: (*Core).Backspace, ansi.CTRL_L: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewDefaultKeyMap() *KeyMap {\n\treturn &KeyMap{\n\t\tYes: []string{\"y\", \"Y\"},\n\t\tNo: []string{\"n\", \"N\"},\n\t\tSelectYes: []string{\"left\"},\n\t\tSelectNo: []string{\"right\"},\n\t\tToggle: []string{\"tab\"},\n\t\tSubmit: []string{\"enter\"},\n\t\tAbort: []string{\"ctrl+c\"},...
[ "0.74792606", "0.6471782", "0.6430026", "0.6413645", "0.6204454", "0.6148289", "0.611857", "0.5991836", "0.5914652", "0.5903464", "0.5883921", "0.5832911", "0.5769057", "0.56442523", "0.5629255", "0.5577586", "0.5549471", "0.54746073", "0.54746073", "0.5446178", "0.5425417", ...
0.75022745
0
CreateFileSystem invokes the dfs.CreateFileSystem API synchronously
func (client *Client) CreateFileSystem(request *CreateFileSystemRequest) (response *CreateFileSystemResponse, err error) { response = CreateCreateFileSystemResponse() err = client.DoAction(request, response) return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (manager *mockFileSystemManager) CreateFileSystem(ctx context.Context, groupName string, filesystemName string, timeout *int32, xMsDate string, datalakeName string) (*autorest.Response, error) {\n\tfs := fileSystemResource{\n\t\tresourceGroupName: groupName,\n\t\tstorageAccountName: datalakeName,\n\t\tfilesy...
[ "0.7532974", "0.72078437", "0.71549237", "0.709281", "0.7048207", "0.7030605", "0.70085895", "0.6557903", "0.6551424", "0.6468269", "0.6361563", "0.63513356", "0.62807924", "0.62282985", "0.60684615", "0.6032318", "0.60243344", "0.6024124", "0.5850698", "0.5837949", "0.582154...
0.74027896
1
CreateFileSystemWithChan invokes the dfs.CreateFileSystem API asynchronously
func (client *Client) CreateFileSystemWithChan(request *CreateFileSystemRequest) (<-chan *CreateFileSystemResponse, <-chan error) { responseChan := make(chan *CreateFileSystemResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) CreateFileSystemWithCallback(request *CreateFileSystemRequest, callback func(response *CreateFileSystemResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *CreateFileSystemResponse\n\t\tvar err error\n\t\tdefer close(resul...
[ "0.7438406", "0.59352165", "0.58698547", "0.58682775", "0.5800312", "0.5783298", "0.5782387", "0.5774499", "0.56610906", "0.56329244", "0.5362752", "0.53274715", "0.52781004", "0.52586395", "0.52302724", "0.5204847", "0.517791", "0.5176203", "0.5168632", "0.50918365", "0.5090...
0.80296123
0
CreateFileSystemWithCallback invokes the dfs.CreateFileSystem API asynchronously
func (client *Client) CreateFileSystemWithCallback(request *CreateFileSystemRequest, callback func(response *CreateFileSystemResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateFileSystemResponse var err error defer close(result) response, err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (manager *mockFileSystemManager) CreateFileSystem(ctx context.Context, groupName string, filesystemName string, timeout *int32, xMsDate string, datalakeName string) (*autorest.Response, error) {\n\tfs := fileSystemResource{\n\t\tresourceGroupName: groupName,\n\t\tstorageAccountName: datalakeName,\n\t\tfilesy...
[ "0.66443145", "0.6494744", "0.64063805", "0.6279257", "0.6207732", "0.6184654", "0.61342597", "0.60683924", "0.6045436", "0.56931496", "0.5614541", "0.55832964", "0.5576147", "0.54953367", "0.5450374", "0.5437641", "0.53679824", "0.536721", "0.536561", "0.53433496", "0.533860...
0.8151044
0
CreateCreateFileSystemRequest creates a request to invoke CreateFileSystem API
func CreateCreateFileSystemRequest() (request *CreateFileSystemRequest) { request = &CreateFileSystemRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("DFS", "2018-06-20", "CreateFileSystem", "alidfs", "openAPI") request.Method = requests.POST return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) CreateFileSystem(request *CreateFileSystemRequest) (response *CreateFileSystemResponse, err error) {\n\tresponse = CreateCreateFileSystemResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "func CreateListFileSystemsRequest() (request *ListFileSystemsRequest) {\n\trequest ...
[ "0.74044955", "0.7277164", "0.7208954", "0.7005334", "0.6775199", "0.67420554", "0.66735137", "0.662397", "0.6544891", "0.63551843", "0.6137757", "0.605717", "0.59149057", "0.5900351", "0.58727604", "0.57616615", "0.57495767", "0.5742306", "0.573904", "0.57332695", "0.5698775...
0.8567599
0
CreateCreateFileSystemResponse creates a response to parse from CreateFileSystem response
func CreateCreateFileSystemResponse() (response *CreateFileSystemResponse) { response = &CreateFileSystemResponse{ BaseResponse: &responses.BaseResponse{}, } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (manager *mockFileSystemManager) CreateFileSystem(ctx context.Context, groupName string, filesystemName string, timeout *int32, xMsDate string, datalakeName string) (*autorest.Response, error) {\n\tfs := fileSystemResource{\n\t\tresourceGroupName: groupName,\n\t\tstorageAccountName: datalakeName,\n\t\tfilesy...
[ "0.7409187", "0.7196471", "0.7153243", "0.68064606", "0.67132664", "0.66525936", "0.65382826", "0.6406937", "0.6363215", "0.6359061", "0.6322241", "0.6244479", "0.61652124", "0.61642545", "0.61275655", "0.6105425", "0.5946818", "0.5941657", "0.5848543", "0.5826824", "0.577976...
0.8397854
0
SaveBody creates or overwrites the existing response body file for the url associated with the given Fetcher
func (f Fetcher) SaveBody() { file, err := os.Create(f.url) check(err) defer file.Close() b := f.processBody() _, err = file.Write(b) check(err) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Save(fileName string) error {\r\n\treturn ioutil.WriteFile(fileName, r.Body, 0644)\r\n}", "func (response *S3Response) WriteBody(dst io.Writer) error {\n defer response.Close()\n _, err := io.Copy(dst, response.httpResponse.Body)\n return err\n}", "func saveFile(savedPath string, re...
[ "0.6250908", "0.5745216", "0.54999065", "0.53012586", "0.52373475", "0.5236081", "0.52156407", "0.5190274", "0.5153593", "0.5066596", "0.50165904", "0.5004325", "0.5003726", "0.49831364", "0.49391568", "0.4936893", "0.49297172", "0.4924654", "0.49175733", "0.49039724", "0.488...
0.85055155
0
processBody reads the response body associated for the given Fetcher and reports any errors
func (f Fetcher) processBody() []byte { b, err := io.ReadAll(f.resp.Body) f.resp.Body.Close() if f.resp.StatusCode >= 300 { log.Fatalf("Response failed with status code: %d\n and body: %s\n", f.resp.StatusCode, b) } check(err) return b }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func decodeBody(resp *http.Response, out interface{}) (error) {\n\tswitch resp.ContentLength {\n\tcase 0:\n\t\tif out == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn errors.New(\"Got 0 byte response with non-nil decode object\")\n\tdefault:\n\t\tdec := json.NewDecoder(resp.Body)\n\t\treturn dec.Decode(out)\n\t}\n}",...
[ "0.5680592", "0.56435114", "0.5631959", "0.5522728", "0.54882276", "0.5482303", "0.54751396", "0.5364349", "0.5358157", "0.53234804", "0.5321872", "0.52747655", "0.5210658", "0.51857114", "0.5130053", "0.5072723", "0.50544876", "0.5036079", "0.5028855", "0.49748597", "0.49637...
0.7787903
0
linker_config generates protobuf file from json file. This protobuf file will be used from linkerconfig while generating ld.config.txt. Format of this file can be found from
func linkerConfigFactory() android.Module { m := &linkerConfig{} m.AddProperties(&m.properties) android.InitAndroidArchModule(m, android.HostAndDeviceSupported, android.MultilibFirst) return m }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GenerateAppLinkJsonFile(packageName string, sha256 string) {\n\tlog.Infof(\"[Cert Resource] Start to generate new app link json file!\")\n\t// mutex to lock\n\tandroidLock.Lock()\n\tdefer androidLock.Unlock()\n\n\tcurDir := getcurdir()\n\tfile, err := ioutil.ReadFile(curDir + \"/../app_site/.well-known/assetl...
[ "0.52065396", "0.52007353", "0.51941204", "0.51577306", "0.5107777", "0.5025856", "0.49242315", "0.48540878", "0.48468336", "0.47196868", "0.47193876", "0.4700907", "0.46915385", "0.46912202", "0.4678856", "0.46544382", "0.46082795", "0.45997837", "0.45863217", "0.4579745", "...
0.48850825
7
NewTree creates a new Tree.
func NewTree(options *Options) *Tree { if options == nil { options = new(Options) } setDefaultOptions(options) idx := &Tree{ newBlocks: make(chan int), done: make(chan bool), blockMap: make(map[int]int), manager: newEpochManager(options.NumAllocators), } idx.allocators = make([]*Allocator, opt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewTree() *Tree {\n\treturn &Tree{Symbol{NIL, \"NewTree holder\"}, make([]*Tree, 0, maxChildren), nil}\n}", "func NewTree() *Tree {\n\treturn new(Tree)\n}", "func NewTree() *Tree {\n\treturn &Tree{&bytes.Buffer{}}\n}", "func New() *Tree {\n\treturn &Tree{}\n}", "func New(name string) *Tree {\n\treturn...
[ "0.82855225", "0.8141068", "0.8019526", "0.7978955", "0.78814346", "0.784047", "0.7823877", "0.78038585", "0.77911633", "0.77679545", "0.7755644", "0.7601492", "0.74408257", "0.7408058", "0.7302533", "0.73020464", "0.7254405", "0.7205861", "0.7181317", "0.71228427", "0.711597...
0.6822363
32
NewTreeFromState initiates a Tree from state data previously written by
func NewTreeFromState(data io.Reader) (*Tree, error) { idx := &Tree{ newBlocks: make(chan int), done: make(chan bool), blockMap: make(map[int]int), } if err := idx.loadState(data); err != nil { return nil, fmt.Errorf("Failed loading index state : %v", err) } go idx.blockAllocator() return idx, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (db *DB) InitStateTree(depth int) error {\n\trootNode := core.NewStateRoot(depth)\n\treturn db.Instance.Create(&rootNode).Error\n}", "func newTreeNode(parent *treeNode, move Move, state GameState, ucbC float64) *treeNode {\n\t// Construct the new node.\n\tnode := treeNode{\n\t\tparent: parent,\n\t\t...
[ "0.6912023", "0.6191913", "0.6073148", "0.60606235", "0.6037155", "0.59091216", "0.58979636", "0.58852684", "0.5877665", "0.5856578", "0.583802", "0.5774494", "0.5756803", "0.57559043", "0.5738696", "0.5727683", "0.5727124", "0.5712563", "0.5702321", "0.56940013", "0.5655744"...
0.8084078
0
Len returns the current number of items in the tree It needs to query all allocators for their counters, so it will block if an allocator is constantly reserved...
func (idx *Tree) Len() (count int) { idx.Stop() count = int(idx.liveObjects) for _, a := range idx.allocators { count += int(a.itemCounter) } idx.Start() return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Tree) Len() int { return t.Count }", "func (s *Pool) Len() int { return int(atomic.LoadUint32(&s.avail)) }", "func (t *BinaryTree) Size() int { return t.count }", "func (t *Tree) Len() int {\n\treturn t.Count\n}", "func (h ReqHeap) Len() int { return len(h) }", "func (p NodePools) Len() int { re...
[ "0.6939439", "0.6840272", "0.6690427", "0.6655519", "0.6647418", "0.66106826", "0.64596206", "0.6438696", "0.64009213", "0.6397146", "0.6384905", "0.6336007", "0.6332157", "0.6309753", "0.6295182", "0.62948596", "0.62872094", "0.6268528", "0.6266187", "0.62337065", "0.6231077...
0.8014996
0
Stop withdraws all allocators to prevent any more write or reads. It will blocks until it gets all allocators. If already stopped, it returns silently.
func (idx *Tree) Stop() { if !atomic.CompareAndSwapInt32(&idx.stopped, 0, 1) { return } for i := 0; i < len(idx.allocators); i++ { _ = idx.allocatorQueue.get() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (fetchers Fetchers) Stop() {\n\tfor _, fetcher := range fetchers {\n\t\tfetcher.Stop()\n\t}\n}", "func (r *reducer) stop() {\n\tfor _, m := range r.mappers {\n\t\tm.stop()\n\t}\n\tsyncClose(r.done)\n}", "func exitAllocRunner(runners ...AllocRunner) {\n\tfor _, ar := range runners {\n\t\tterminalAlloc := a...
[ "0.6062398", "0.6048799", "0.59177333", "0.58795786", "0.5779963", "0.5743292", "0.5741704", "0.5685443", "0.56540674", "0.5640358", "0.56347626", "0.56151617", "0.5592923", "0.5573741", "0.55554795", "0.5539427", "0.55270153", "0.5490114", "0.5471471", "0.5466442", "0.545379...
0.7085047
0
Start releases all allocators withdrawn through a previous call to Stop. In case the indexed is not stopped in returns silently.
func (idx *Tree) Start() { if !atomic.CompareAndSwapInt32(&idx.stopped, 1, 0) { return } for i := 0; i < len(idx.allocators); i++ { idx.allocatorQueue.put(i) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (idx *Tree) Stop() {\n\tif !atomic.CompareAndSwapInt32(&idx.stopped, 0, 1) {\n\t\treturn\n\t}\n\tfor i := 0; i < len(idx.allocators); i++ {\n\t\t_ = idx.allocatorQueue.get()\n\t}\n}", "func (mi *MinerIndex) start() {\n\tdefer func() { mi.finished <- struct{}{} }()\n\n\tif err := mi.updateOnChainIndex(); err...
[ "0.6604761", "0.54873544", "0.5444315", "0.5245357", "0.50982845", "0.49836162", "0.49654576", "0.4962564", "0.4926634", "0.49095482", "0.4865416", "0.4863822", "0.48342353", "0.48192653", "0.48100424", "0.47962928", "0.4782292", "0.47776186", "0.47687042", "0.47663927", "0.4...
0.686857
0
Close stops the index, and then terminates the memory allocation goroutine, which will otherwise leak.
func (idx *Tree) Close() { idx.Stop() close(idx.done) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (i *queueIndex) close() error {\n\treturn i.indexArena.Unmap()\n}", "func (s ConsoleIndexStore) Close() error { return nil }", "func (f *IndexFile) Close() error {\n\t// Wait until all references are released.\n\tf.wg.Wait()\n\n\tf.sblk = SeriesBlock{}\n\tf.tblks = nil\n\tf.mblk = MeasurementBlock{}\n\tf....
[ "0.7114902", "0.7012508", "0.698615", "0.6954264", "0.6819634", "0.67804974", "0.66179514", "0.6605064", "0.6602648", "0.65786433", "0.64706266", "0.6317055", "0.63160914", "0.62167317", "0.61983234", "0.61652386", "0.61438406", "0.6076535", "0.6058903", "0.6026794", "0.60068...
0.60702044
18
WriteState writes the state of a stopped index to the given writer. If the indexed is not stopped the result is undefined.
func (idx *Tree) WriteState(out io.Writer) (n int, err error) { return idx.writeState(out) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d *EtcdStateDriver) WriteState(key string, value core.State,\n\tmarshal func(interface{}) ([]byte, error)) error {\n\tencodedState, err := marshal(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn d.Write(key, encodedState)\n}", "func (p *Platform) WriteState(w io.Writer) (*Platform, error) {\n\tp...
[ "0.5682337", "0.5468304", "0.535246", "0.5290441", "0.5290366", "0.51643854", "0.5085427", "0.50634223", "0.49989465", "0.49612185", "0.4951277", "0.4912789", "0.48487547", "0.47717863", "0.47549745", "0.46995154", "0.46872133", "0.4659843", "0.46535382", "0.46109673", "0.459...
0.62815976
0
allocateNode returns the new node and its data block, position at start
func (idx *Tree) allocateNode(a *Allocator, count int, prefixLen int) (n uint64, data []uint64) { prefixSlots := (prefixLen + 7) >> 3 if prefixLen >= 255 { prefixSlots++ } count += prefixSlots n = a.newNode(count) block := int(n >> blockSlotsShift) offset := int(n & blockSlotsOffsetMask) data = idx.blocks[blo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *BTree) AllocateNode() *BTreeNode {\n\tx := BTreeNode{}\n\tfor i := 0; i < 2*t.t; i++ {\n\t\tx.children = append(x.children, t.nullNode)\n\t}\n\tfor i := 0; i < 2*t.t-1; i++ {\n\t\tx.keys = append(x.keys, -1)\n\t}\n\treturn &x\n}", "func (idx *Tree) allocateNodeWithPrefix(a *Allocator, count int, prefix ...
[ "0.67350614", "0.66224706", "0.6255893", "0.62361896", "0.58610564", "0.5856234", "0.573066", "0.57271", "0.5717261", "0.5710908", "0.5661831", "0.5650009", "0.56370544", "0.56184864", "0.55880314", "0.55836654", "0.5574136", "0.55566436", "0.5539488", "0.5515493", "0.5494545...
0.7961014
0
allocateNodeWithPrefix returns the new node and its data block, positioned after the prefix
func (idx *Tree) allocateNodeWithPrefix(a *Allocator, count int, prefix []byte) (n uint64, data []uint64) { prefixLen := len(prefix) prefixSlots := (prefixLen + 7) >> 3 if prefixLen >= 255 { prefixSlots++ } count += prefixSlots n = a.newNode(count) block := int(n >> blockSlotsShift) offset := int(n & blockSlo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (idx *Tree) allocateNode(a *Allocator, count int, prefixLen int) (n uint64, data []uint64) {\n\tprefixSlots := (prefixLen + 7) >> 3\n\tif prefixLen >= 255 {\n\t\tprefixSlots++\n\t}\n\tcount += prefixSlots\n\tn = a.newNode(count)\n\tblock := int(n >> blockSlotsShift)\n\toffset := int(n & blockSlotsOffsetMask)\...
[ "0.6869773", "0.59520763", "0.56966764", "0.56332743", "0.5543914", "0.5521665", "0.5477629", "0.54177904", "0.5407354", "0.5355928", "0.5346138", "0.5242986", "0.5131678", "0.51244336", "0.51227385", "0.5112621", "0.51077956", "0.50852245", "0.50659835", "0.5065695", "0.5056...
0.8430526
0
GetAllocator reserves an allocator used for bulk Lookup/Update/Delete operations.
func (idx *Tree) GetAllocator() *Allocator { return idx.allocators[idx.allocatorQueue.get()] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetRuntimePortAllocator() (*RuntimePortAllocator, error) {\n\tif rpa.pa == nil {\n\t\tif err := rpa.createAndRestorePortAllocator(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn rpa, nil\n}", "func NewAllocator(provider lCoreProvider) *Allocator {\n\treturn &Allocator{\n\t\tConfig: make(Alloc...
[ "0.68342525", "0.6720525", "0.67027986", "0.6658546", "0.66041344", "0.65315723", "0.6260463", "0.6200884", "0.613557", "0.60628927", "0.595554", "0.588803", "0.5842821", "0.5842404", "0.5824318", "0.57718134", "0.5739044", "0.56429476", "0.559904", "0.5523092", "0.537339", ...
0.7612451
0
ReleaseAllocator returns an allocator previously reserved using GetAllocator
func (idx *Tree) ReleaseAllocator(a *Allocator) { idx.allocatorQueue.put(a.id) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (allocator *Allocator) ReleaseAllocator() {\n\tC.zj_AllocatorRelease(allocator.A)\n}", "func (a *ResourceAllocator) Free(b []byte) {\n\tif a == nil {\n\t\tDefaultAllocator.Free(b)\n\t\treturn\n\t}\n\n\tsize := len(b)\n\n\t// Release the memory to the allocator first.\n\talloc := a.allocator()\n\talloc.Free(...
[ "0.81131625", "0.64977455", "0.64955264", "0.6233524", "0.6059499", "0.604095", "0.59881294", "0.59217936", "0.59119517", "0.5881009", "0.585588", "0.5847171", "0.5824737", "0.5790185", "0.56845546", "0.5651543", "0.5623506", "0.5620355", "0.56128675", "0.5577229", "0.5566453...
0.7707561
1
Lookup searches the tree for a key and if a candidate leaf is found returns the value stored with it. The caller needs to verify if the candidate is equal to the lookup key, since if the key didn't exist, the candidate will be another key sharing a prefix with the lookup key.
func (idx *Tree) Lookup(key []byte) (value uint64, found bool) { id := idx.allocatorQueue.get() value, found = idx.allocators[id].Lookup(key) idx.allocatorQueue.put(id) return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (rad *Radix) Lookup(key string) interface{} {\n\trad.lock.Lock()\n\tdefer rad.lock.Unlock()\n\tif x, ok := rad.root.lookup([]rune(key)); ok {\n\t\treturn x.value\n\t}\n\treturn nil\n}", "func (r *HashRing) Lookup(key string) (string, bool) {\n\tstrs := r.LookupN(key, 1)\n\tif len(strs) == 0 {\n\t\treturn \"...
[ "0.7312577", "0.6867788", "0.67531496", "0.66930187", "0.6563972", "0.65171254", "0.6340757", "0.6298961", "0.6256727", "0.62558097", "0.62538916", "0.62538916", "0.620855", "0.6186282", "0.6181887", "0.6181399", "0.6107317", "0.604099", "0.6003605", "0.59408414", "0.5936815"...
0.6672378
4
PrepareUpdate reserves an allocator and uses it to prepare an update operation. See Allocator.PrepareUpdate for details
func (idx *Tree) PrepareUpdate(key []byte) (found bool, op *UpdateOperation) { id := idx.allocatorQueue.get() op = newUpdateOperation(idx, idx.allocators[id], true) return op.prepareUpdate(key), op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Table) PrepareUpdate(tu fibdef.Update) (*UpdateCommand, error) {\n\tu := &UpdateCommand{}\n\tu.real.RealUpdate = tu.Real()\n\tu.virt.VirtUpdate = tu.Virt()\n\n\tu.allocSplit = u.real.prepare(t)\n\tu.allocated = make([]*Entry, u.allocSplit+u.virt.prepare(t))\n\tif e := t.allocBulk(u.allocated); e != nil {\...
[ "0.7424789", "0.5677787", "0.5536896", "0.5494887", "0.53911835", "0.5362883", "0.53093344", "0.52692324", "0.5254965", "0.5247992", "0.51920253", "0.51712793", "0.5147966", "0.5011077", "0.5002912", "0.4989964", "0.48652557", "0.48066962", "0.47724175", "0.47566584", "0.4719...
0.75170195
0
PrepareDelete reserves an allocator and uses it to prepare a delete operation. See Allocator.PrepareDelete for details
func (idx *Tree) PrepareDelete(key []byte) (found bool, op *DeleteOperation) { id := idx.allocatorQueue.get() op = newDeleteOperation(idx, idx.allocators[id], true) if op.prepare(key) { return true, op } op.Abort() return false, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client Client) DeletePreparer(resourceGroupName string, name string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"name\": url.QueryEscape(name),\n\t\t\"resourceGroupName\": url.QueryEscape(resourceGroupName),\n\t\t\"subscriptionId\": url.QueryEscape(client.Subs...
[ "0.52881616", "0.5262748", "0.5250947", "0.51915395", "0.51663846", "0.5157574", "0.51027143", "0.50212806", "0.49939945", "0.49535996", "0.49505183", "0.49463445", "0.49417627", "0.49401733", "0.49396092", "0.49217606", "0.49027976", "0.4893439", "0.4889526", "0.48798436", "...
0.7151367
0
MaxKey returns the maximum key having the given searchPrefix, or the maximum key in the whole index if searchIndex is nil. Maximum means the last key in the lexicographic order. If keys are uint64 in BigEndian it is also the largest number. If ok is false the index is empty. For example, if we store temperature reading...
func (idx *Tree) MaxKey(searchPrefix []byte) (v uint64, ok bool) { raw, _ := idx.partialSearch(searchPrefix) if raw == 0 { return 0, false } if isLeaf(raw) { return getLeafValue(raw), true } // now find the max searchLoop: for { _, node, count, prefixLen := explodeNode(raw) block := int(node >> blockSlot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetMaxIndexKey(shardID uint64, key []byte) []byte {\n\tkey = getKeySlice(key, idKeyLength)\n\treturn getIDKey(maxIndexSuffix, shardID, key)\n}", "func MaxKey() Val { return Val{t: bsontype.MaxKey} }", "func (this *AllOne) GetMaxKey() string {\n\tif this.tail.pre != this.head {\n\t\tfor k := range this.tai...
[ "0.64017457", "0.63471687", "0.5947757", "0.5752474", "0.56805396", "0.55782866", "0.5567208", "0.55566853", "0.5465598", "0.54230475", "0.5320258", "0.53081363", "0.52548325", "0.52321553", "0.51663005", "0.515594", "0.51534414", "0.5117315", "0.5105535", "0.5103728", "0.506...
0.76495737
0
MinKey returns the minimum key having the given searchPrefix, or the minimum key in the whole index if searchIndex is nil. Minimum means the first key in the lexicographic order. If keys are uint64 in BigEndian it is also the smallest number. If ok is false the index is empty.
func (idx *Tree) MinKey(searchPrefix []byte) (v uint64, ok bool) { raw, _ := idx.partialSearch(searchPrefix) if raw == 0 { return 0, false } if isLeaf(raw) { return getLeafValue(raw), true } // now find the min searchLoop: for { _, node, count, prefixLen := explodeNode(raw) block := int(node >> blockSlot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (tf tFiles) searchMin(icmp *iComparer, ikey internalKey) int {\n\treturn sort.Search(len(tf), func(i int) bool {\n\t\treturn icmp.Compare(tf[i].imin, ikey) >= 0\n\t})\n}", "func (t *binarySearchST) Min() interface{} {\n\tutils.AssertF(!t.IsEmpty(), \"called Min() with empty symbol table\")\n\treturn t.keys[...
[ "0.6254368", "0.5750522", "0.57202524", "0.5673002", "0.5619895", "0.55524933", "0.5537136", "0.5501438", "0.5443638", "0.5435102", "0.540519", "0.536403", "0.53208256", "0.5270773", "0.51773477", "0.5168706", "0.5153912", "0.51201713", "0.51032627", "0.510243", "0.50744075",...
0.7585947
0
NewIterator returns an Iterator for iterating in order over all keys having the given prefix, or the complete index if searchPrefix is nil.
func (idx *Tree) NewIterator(searchPrefix []byte) *Iterator { return NewIterator(idx, searchPrefix) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (db *MemoryCache) NewIteratorWithPrefix(prefix []byte) Iterator {\n\tdb.lock.RLock()\n\tdefer db.lock.RUnlock()\n\n\tvar (\n\t\tpr = string(prefix)\n\t\tkeys = make([]string, 0, len(db.db))\n\t\tvalues = make([][]byte, 0, len(db.db))\n\t)\n\t// Collect the keys from the memory database corresponding to ...
[ "0.7525866", "0.7403449", "0.7257108", "0.7165401", "0.711629", "0.6804367", "0.6732594", "0.6561419", "0.6538172", "0.63779676", "0.62592065", "0.6080891", "0.6077097", "0.60245144", "0.59363127", "0.58752656", "0.58317125", "0.58209616", "0.579653", "0.5795732", "0.5774168"...
0.6987235
5
Count returns the number of nodes and leaves in the part of tree having the given prefix, or the whole tree if searchPrefix is nil.
func (idx *Tree) Count(searchPrefix []byte) (nodes, leaves int) { return NewCounter(idx).Count(searchPrefix) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (db *DB) CountPrefix(prefix interface{}, value interface{}, count *int) error {\n\treturn db.bolt.View(func(tx *bolt.Tx) error {\n\t\treturn db.CountPrefixTx(tx, prefix, value, count)\n\t})\n}", "func (db *DB) CountPrefixTx(tx *bolt.Tx, prefix interface{}, value interface{}, count *int) error {\n\t*count = ...
[ "0.676077", "0.6484417", "0.63465744", "0.6022248", "0.6011498", "0.5960126", "0.5949926", "0.57407993", "0.5624859", "0.5569003", "0.5540688", "0.54302657", "0.54262424", "0.5414123", "0.5365138", "0.5362125", "0.53595495", "0.5323589", "0.53140223", "0.53023636", "0.5278311...
0.77689135
0
LookupCalled looks up ssa.Instruction that call the `fn` func in the given instr
func LookupCalled(instr ssa.Instruction, fn *types.Func) ([]ssa.Instruction, bool) { instrs := []ssa.Instruction{} call, ok := instr.(ssa.CallInstruction) if !ok { return instrs, false } ssaCall := call.Value() if ssaCall == nil { return instrs, false } common := ssaCall.Common() if common == nil { ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Module) instCall(old *ast.InstCall, resolved, unresolved map[ast.NamedValue]value.Named) bool {\n\tif isUnresolved(unresolved, old.Callee) || isUnresolved(unresolved, old.Args...) {\n\t\treturn false\n\t}\n\tv := m.getLocal(old.Name)\n\tinst, ok := v.(*ir.InstCall)\n\tif !ok {\n\t\tpanic(fmt.Errorf(\"inva...
[ "0.55088776", "0.51450753", "0.5084626", "0.49590853", "0.49253467", "0.49151275", "0.49031597", "0.48806983", "0.48682708", "0.4830155", "0.48227826", "0.47652534", "0.47241217", "0.46917644", "0.4687812", "0.46794826", "0.46600193", "0.46538463", "0.4650809", "0.46494117", ...
0.8261184
0
HasArgs returns whether the given ssa.Instruction has `typ` type args
func HasArgs(instr ssa.Instruction, typ types.Type) bool { call, ok := instr.(ssa.CallInstruction) if !ok { return false } ssaCall := call.Value() if ssaCall == nil { return false } for _, arg := range ssaCall.Call.Args { if types.Identical(arg.Type(), typ) { return true } } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (i Instruction) IsVariadic() bool {\n\treturn len(i.Arities()) > 1\n}", "func (TypesObject) IsVariadicParam() bool { return boolResult }", "func (f flagString) HasArg() bool {\n\treturn true\n}", "func (a *Args) Has(arg rune) bool {\n\t_, ok := a.marhalers[arg]\n\treturn ok\n}", "func (f flagBool) Has...
[ "0.6620399", "0.6070014", "0.58602", "0.5559968", "0.551633", "0.5394115", "0.53795916", "0.5353696", "0.5310007", "0.5298867", "0.52459556", "0.52079266", "0.5189788", "0.51717234", "0.51651365", "0.5159262", "0.51278657", "0.5124402", "0.51076514", "0.5105842", "0.50955737"...
0.8171181
0
Timestamp gen unix time stamp from string to int64
func Timestamp(createdBy string) (createdAtUnix int64) { timestamp, err := time.Parse(time.RFC3339, createdBy) if err != nil { createdAtUnix = time.Now().Unix() ErrorLog(err) } else { createdAtUnix = timestamp.Unix() } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func makeTimestamp() int64 {\n return time.Now().UnixNano() / int64(time.Millisecond)\n}", "func Str2TimeStampS(s string) int64 {\n\tloc, _ := time.LoadLocation(\"UTC\")\n\tt, err := time.ParseInLocation(DATE_FORMAT_SHORT, s, loc)\n\tCheckErr(err, CHECK_FLAG_LOGONLY)\n\treturn t.Unix()\n}", "func getTimesta...
[ "0.7013703", "0.6621233", "0.6551284", "0.6531924", "0.6515391", "0.6515391", "0.65082395", "0.6502291", "0.6467381", "0.64590216", "0.64448416", "0.6431059", "0.6380952", "0.62893873", "0.62606484", "0.62140614", "0.6206639", "0.62042296", "0.62012553", "0.6159245", "0.61543...
0.0
-1
implement function to return ServiceMiddleware
func newTracingMiddleware(tracer opentracing.Tracer) linkManagerMiddleware { return func(next om.LinkManager) om.LinkManager { return tracingMiddleware{next, tracer} } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Middleware(s Service) func(http.Handler) http.Handler {\n\treturn func(h http.Handler) http.Handler {\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tua := r.Header.Get(\"token\")\n\t\t\tauthrze, err := s.ParseToken(ua)\n\n\t\t\tif err != nil {\n\t\t\t\tw.WriteHeader(http.St...
[ "0.67944986", "0.67008346", "0.6686849", "0.6646141", "0.6577811", "0.64825916", "0.6465787", "0.63078403", "0.62981313", "0.62688965", "0.6257751", "0.62544674", "0.62497014", "0.62410784", "0.62030065", "0.6193984", "0.6193984", "0.6141814", "0.61197424", "0.6118263", "0.61...
0.0
-1
withClerk invokes the specified callback with a clerk that manages the specified queue. If there is no such clerk, withClerk first creates one. The clerk's reference count is incremented for the duration of the callback. withClerk returns whatever the callback returns.
func (registry *Registry) withClerk(queue string, callback func(*clerk) error) error { registry.mutex.Lock() entry, found := registry.queues[queue] if !found { entry = &refCountedClerk{ Clerk: clerk{ // TODO: context Enqueue: make(chan messageSend), Dequeue: make(chan messageReceive), Registry...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *ModuleManager) CallWithCallback(topic string, f, cb interface{}, cbParams, params []interface{}) (err error) {\n\tif m := this.GetModule(topic); m != nil {\n\t\terr = m.CallWithCallback(f, cb, cbParams, params)\n\t} else {\n\t\t// fmt.Println(this)\n\t\terr = Post.PutQueueWithCallback(f, cb, cbParams, ...
[ "0.5876569", "0.56525135", "0.53222644", "0.47999582", "0.47828177", "0.47699308", "0.47098765", "0.46049252", "0.45920306", "0.4560763", "0.45019993", "0.44990736", "0.4407609", "0.4383445", "0.42866144", "0.42831054", "0.42361563", "0.42217386", "0.4204431", "0.42024133", "...
0.79700077
0
optionalTimeout returns a channel on which the current time will be sent when the specified deadline arrives. Or, if deadline is nil, optionalTimeout returns a nil channel (receives will block forever, i.e. no timeout).
func optionalTimeout(deadline *time.Time) <-chan time.Time { var timeout <-chan time.Time if deadline != nil { timeout = time.NewTimer(time.Until(*deadline)).C } return timeout }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (f *Sink) TimeoutChan() <-chan time.Time {\n\treturn f.timeoutTimer.C\n}", "func With_timeout_nowait(ctx context.Context, timeout time.Duration) option {\n\treturn func(o *Group) {\n\t\tif o.Context != nil {\n\t\t\tpanic(\"context already set\")\n\t\t}\n\t\tif ctx == nil {\n\t\t\to.Context, o.CancelFunc = c...
[ "0.5174397", "0.5156724", "0.5065961", "0.5060068", "0.5043165", "0.50363374", "0.4978916", "0.49680018", "0.4962167", "0.49414706", "0.4929812", "0.48641688", "0.4854244", "0.48350728", "0.48332527", "0.48316026", "0.48256624", "0.48114562", "0.47939524", "0.4789711", "0.478...
0.8052867
0
copyHeader adds the HTTP header whose name is the specified `which` from the specified headers `from` to the specified headers `to`.
func copyHeader(which string, from http.Header, to http.Header) { for _, value := range from.Values(which) { to.Add(which, value) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func copyHeader(target, source http.Header) {\n\tfor k, vs := range source {\n\t\ttarget[k] = vs\n\t}\n}", "func copyHeader(src, dest http.Header) {\n\tfor key, val := range src {\n\t\tfor _, v := range val {\n\t\t\tdest.Add(key, v)\n\t\t}\n\t}\n}", "func copyHeader(dst http.Header, src http.Header) {\n\tfor k...
[ "0.7428583", "0.73180294", "0.6969307", "0.6939664", "0.68874514", "0.68320334", "0.68258685", "0.68127483", "0.6698579", "0.66148335", "0.6614227", "0.65428376", "0.62228173", "0.61663586", "0.6070402", "0.5893018", "0.572726", "0.5709158", "0.5704184", "0.56725305", "0.5646...
0.83915895
0
RemoveIfUnused deletes the entry for the specified queue in this registry if its reference count is zero. Return whether the entry has been removed, and any error that occurred.
func (registry *Registry) RemoveIfUnused(queue string) (bool, error) { registry.mutex.Lock() defer registry.mutex.Unlock() entry, found := registry.queues[queue] if !found { // "Not found" is unexpected, since I expect only the clerk itself // would be trying to remove its queue (so why, then, is it already ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func DeleteTimerQueue(timerQueue HANDLE) bool {\n\tret1 := syscall3(deleteTimerQueue, 1,\n\t\tuintptr(timerQueue),\n\t\t0,\n\t\t0)\n\treturn ret1 != 0\n}", "func (q *Queue) MaybeRemoveMissing(names []string) int {\n\tq.mu.Lock()\n\tsameSize := len(q.items) == len(names)\n\tq.mu.Unlock()\n\n\t// heuristically ski...
[ "0.60027367", "0.5677631", "0.563571", "0.5616582", "0.5497436", "0.5481202", "0.54472536", "0.54457", "0.54185396", "0.53994423", "0.5352575", "0.5277354", "0.52290535", "0.5129753", "0.5122774", "0.5116718", "0.5096262", "0.5095654", "0.50874686", "0.5082583", "0.50537497",...
0.83653677
0
ConnectDB connect to database
func ConnectDB() (db *gorm.DB, err error) { config := GetConfig() dbURI := fmt.Sprintf("host=%s port=%s user=%s dbname=%s password=%s sslmode=disable", config.DB.Host, config.DB.Port, config.DB.Username, config.DB.Name, config.DB.Password) db, err = gorm.Open(config.DB.Dialect, dbURI) if os.Getenv("ENV") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func connectDB() error {\n\t// define login variables\n\thost := config.Get(\"postgresql\", \"host\")\n\tport := config.Get(\"postgresql\", \"port\")\n\tssl := config.Get(\"postgresql\", \"ssl\")\n\tdatabase := config.Get(\"postgresql\", \"database\")\n\tusername := config.Get(\"postgresql\", \"username\")\n\tpass...
[ "0.8131591", "0.79059196", "0.77978474", "0.77385414", "0.76394755", "0.7557192", "0.7537929", "0.7522747", "0.75134176", "0.7506408", "0.7488831", "0.7472738", "0.745338", "0.745188", "0.74491537", "0.7444304", "0.74430364", "0.7442776", "0.74337655", "0.74329805", "0.743259...
0.72602135
46
GetConditions returns the list of conditions from the status
func (s NovaSchedulerStatus) GetConditions() condition.Conditions { return s.Conditions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (in HelmRepository) GetConditions() []metav1.Condition {\n\treturn in.Status.Conditions\n}", "func GetConditions(t *Target) ([]target.Condition, error) {\n\tif t.err != nil {\n\t\treturn nil, errors.New(\"GetConditions called on erroneous target\")\n\t}\n\ttype resource struct {\n\t\tStatus struct {\n\t\t\t...
[ "0.80807686", "0.7924006", "0.78700143", "0.7841353", "0.7607114", "0.7516203", "0.7490639", "0.7490639", "0.74454457", "0.73661876", "0.7353652", "0.7206037", "0.7205307", "0.7184931", "0.71787745", "0.7159376", "0.7145872", "0.71345544", "0.71258813", "0.7114645", "0.710496...
0.7768028
4
GetSecret returns the value of the NovaScheduler.Spec.Secret
func (n NovaScheduler) GetSecret() string { return n.Spec.Secret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *AssetReportRefreshRequest) GetSecret() string {\n\tif o == nil || o.Secret == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Secret\n}", "func GetSecret(tid string) ([]byte, error) {\n\tvar token string\n\n\tif err := db.QueryRow(\"SELECT token FROM event_tasks WHERE id = $1\", tid).\n\t\tS...
[ "0.7372657", "0.72075814", "0.7123475", "0.71159655", "0.70768034", "0.70471925", "0.7036488", "0.69847095", "0.6893502", "0.68894595", "0.68886346", "0.68447804", "0.6838665", "0.68321365", "0.67905784", "0.6787732", "0.6769878", "0.67160785", "0.67097425", "0.6685262", "0.6...
0.9030379
0
NewTravisBuildListCommand will add a `travis build list` command which is responsible for showing a list of build
func NewTravisBuildListCommand(client *travis.Client) *cobra.Command { cmd := &cobra.Command{ Use: "list", Short: "List all the builds", RunE: func(cmd *cobra.Command, args []string) error { return ListBuilds(client, os.Stdout) }, } return cmd }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ListBuilds(client *travis.Client, w io.Writer) error {\n\tfilterBranch := \"master\"\n\n\topt := &travis.RepositoryListOptions{Member: viper.GetString(\"TRAVIS_CI_OWNER\"), Active: true}\n\trepos, _, err := client.Repositories.Find(opt)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttr := tabwriter.NewWriter(w,...
[ "0.7019383", "0.6365712", "0.62861466", "0.62341", "0.61762345", "0.61427575", "0.61323035", "0.6077577", "0.5928921", "0.5884531", "0.5867837", "0.58048195", "0.57902944", "0.5639388", "0.56278795", "0.5610364", "0.5604566", "0.5572504", "0.5563013", "0.5516337", "0.5463784"...
0.8401678
0
ListBuilds will display a list of builds
func ListBuilds(client *travis.Client, w io.Writer) error { filterBranch := "master" opt := &travis.RepositoryListOptions{Member: viper.GetString("TRAVIS_CI_OWNER"), Active: true} repos, _, err := client.Repositories.Find(opt) if err != nil { return err } tr := tabwriter.NewWriter(w, 0, 0, 1, ' ', tabwriter.F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (b Build) List(c *gin.Context) {\n\tproject := c.DefaultQuery(\"project\", \"\")\n\tpublic := c.DefaultQuery(\"public\", \"\")\n\tbuilds := []models.Build{}\n\tvar err error\n\n\tif public == \"true\" {\n\t\tbuilds, err = b.publicBuilds()\n\t} else {\n\t\tbuilds, err = b.userBuilds(c, project)\n\t}\n\tif err ...
[ "0.82053334", "0.80467856", "0.7970842", "0.7654507", "0.7466744", "0.74304396", "0.7397928", "0.69482076", "0.6844837", "0.67070955", "0.65804696", "0.64626217", "0.6430503", "0.64146525", "0.64016765", "0.63869685", "0.63159895", "0.6205155", "0.6189829", "0.61538106", "0.6...
0.7866787
3
Bind a `RunnableWithContext` to this runner. WARNING: invoking it when state is StateRunning may cause blocked.
func (s *DeterminationWithContext) Bind(ctx context.Context, runnable RunnableWithContext) *DeterminationWithContext { defer s.lock.Unlock() /*_*/ s.lock.Lock() s.rctx = ctx s.runn = runnable return s }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (tx *WriteTx) RunWithContext(ctx context.Context) error {\n\tif tx.err != nil {\n\t\treturn tx.err\n\t}\n\tinput, err := tx.input()\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = retry(ctx, func() error {\n\t\tout, err := tx.db.client.TransactWriteItemsWithContext(ctx, input)\n\t\tif tx.cc != nil && out != ...
[ "0.6004581", "0.5999245", "0.59970725", "0.5727529", "0.56164736", "0.55119467", "0.5381095", "0.5210632", "0.52035266", "0.5194531", "0.5181738", "0.51611114", "0.5145714", "0.5078032", "0.50537634", "0.5029204", "0.5004192", "0.49929345", "0.4977733", "0.49630624", "0.49399...
0.7612144
0
State of this `Runner`.
func (s *DeterminationWithContext) State() State { return s.stat.get() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *task) State() State {\n\tv := atomic.LoadInt32(&t.state)\n\treturn State(v)\n}", "func (this *Job) State() int {\n\tanyRunningTasks := false\n\tfor _, task := range this.Tasks {\n\t\tif task.IsRunning() {\n\t\t\tanyRunningTasks = true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn JobState(this.Started, this.Finish...
[ "0.6165869", "0.614897", "0.6057116", "0.60031307", "0.59669775", "0.59290916", "0.59237635", "0.59144264", "0.5868559", "0.58162314", "0.579526", "0.5783789", "0.57044184", "0.5702006", "0.56892705", "0.5654448", "0.56457466", "0.5645388", "0.56394327", "0.56268454", "0.5624...
0.5167171
75
Run this `Runner`. Caller will be blocked until error happens or `Close` is called.
func (s *DeterminationWithContext) Run() (err error) { return s.run(s.prepare, s.booting, s.running, s.trigger, s.closing) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Runner) Run(ctx context.Context) error {\n\treturn errors.New(\"not implemented\")\n}", "func (e *Executor) Run() { e.loop() }", "func (b *Builder) Run(r *Runner) {\n\tr.Run()\n\tb.mu.Lock()\n\tdelete(b.running, r)\n\tb.mu.Unlock()\n}", "func (r *Runner) Run() {\n\tif err := os.MkdirAll(r.Dir, 0700)...
[ "0.69904256", "0.6832305", "0.6797363", "0.66353744", "0.65243745", "0.6519319", "0.6473249", "0.63717395", "0.6355448", "0.6291291", "0.62721133", "0.625664", "0.6250894", "0.62359995", "0.6224739", "0.61857235", "0.6171192", "0.6163286", "0.614711", "0.61339176", "0.6131875...
0.0
-1
WhileRunning do something if it is running. It provides a context o check if it stops.
func (s *DeterminationWithContext) WhileRunning(do func(context.Context) error) error { return s.whilerunning(func() error { select { case <-s.sctx.Done(): return ErrRunnerIsClosing default: return do(s.sctx) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Manager) WaitUntilRunning() {\n\tfor {\n\t\tm.mu.Lock()\n\n\t\tif m.ctx != nil {\n\t\t\tm.mu.Unlock()\n\t\t\treturn\n\t\t}\n\n\t\tstarted := m.started\n\t\tm.mu.Unlock()\n\n\t\t// Block until we have been started.\n\t\t<-started\n\t}\n}", "func (s *Stopwatch) isRunning() bool {\n\treturn !s.refTime.IsZe...
[ "0.622798", "0.61385405", "0.6091839", "0.5883035", "0.58240783", "0.57762426", "0.56919473", "0.5631193", "0.56184846", "0.5609338", "0.5568484", "0.55551463", "0.5537527", "0.55302274", "0.5524895", "0.5518544", "0.549713", "0.544841", "0.54235667", "0.5421718", "0.53941876...
0.7218582
0
CloseAsync sends a signal to close this runner asynchronously. This is a nonblock version of `Close`. Only an `ErrUnexpectedState` with a `StateStopped` may be returned.
func (s *DeterminationWithContext) CloseAsync() error { return s.closeasync(s.trigger) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Retry) CloseAsync() {\n\tif atomic.CompareAndSwapInt32(&r.running, 1, 0) {\n\t\tclose(r.closeChan)\n\t}\n}", "func (o *Switch) CloseAsync() {\n\to.close()\n}", "func (t *TestProcessor) CloseAsync() {\n\tprintln(\"Closing async\")\n}", "func (r *ReadUntil) CloseAsync() {\n\tr.shutSig.CloseAtLeisure()...
[ "0.68786585", "0.6547746", "0.6543886", "0.63452035", "0.6333746", "0.6276764", "0.61466765", "0.6040728", "0.5954821", "0.5851878", "0.5822685", "0.57749647", "0.5627606", "0.5361624", "0.5353209", "0.5353209", "0.5328969", "0.49306536", "0.48934168", "0.48741895", "0.469070...
0.60688484
7
Close this DeterminationWithContext and wait until stop running. Using it in `WhileRunning` will cause deadlock. Please use `CloseAsync()` instead.
func (s *DeterminationWithContext) Close() error { return s.close(s.trigger) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *DeterminationWithContext) CloseAsync() error {\n\treturn s.closeasync(s.trigger)\n}", "func (s *DeterminationWithContext) Run() (err error) {\n\treturn s.run(s.prepare, s.booting, s.running, s.trigger, s.closing)\n}", "func (s *DeterminationWithContext) WhileRunning(do func(context.Context) error) err...
[ "0.5852757", "0.52932596", "0.5185775", "0.4858248", "0.48176065", "0.47810063", "0.4778499", "0.47632846", "0.47588742", "0.47494122", "0.47453672", "0.47408634", "0.471754", "0.47167784", "0.4708157", "0.4693535", "0.46701324", "0.46656507", "0.46643656", "0.46549073", "0.4...
0.6293567
0
RecordReqDuration records the duration of given operation in metrics system
func (pr PrometheusRecorder) RecordReqDuration(jenkinsService, operation string, code int, elapsedTime float64) { reportRequestDuration(jenkinsService, operation, code, elapsedTime) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func recordDuration(name string, hostname string, path string, method string, duration float64) {\n\trequestDurations.WithLabelValues(name, hostname, path, method).Observe(duration)\n}", "func (me *Metrics) RecordRequestTime(labels Labels, length time.Duration) {\n\t// Only record times for successful requests, ...
[ "0.7509087", "0.6741319", "0.6448921", "0.601776", "0.58529365", "0.5823079", "0.573807", "0.5685555", "0.5597103", "0.5575818", "0.5555443", "0.55546105", "0.5551546", "0.5550965", "0.54829746", "0.54797477", "0.54717624", "0.5451511", "0.5430681", "0.5402279", "0.5385498", ...
0.83944345
0
Generates a random, 64bit token, encoded as base62.
func GenToken() (string, error) { var data [64]byte if _, err := io.ReadFull(rand.Reader, data[:]); err != nil { return "", err } return basex.Base62StdEncoding.EncodeToString(data[:]), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TokenB64(n int) string {\n\tif n < 1 {\n\t\treturn \"\"\n\t}\n\trand.Seed(time.Now().UTC().UnixNano())\n\tbts := make([]byte, n)\n\trand.Read(bts)\n\treturn base64.StdEncoding.EncodeToString(bts)\n}", "func randToken() string {\n\tba := make([]byte, 32)\n\trand.Read(ba)\n\treturn base64.StdEncoding.EncodeTo...
[ "0.71865994", "0.6750421", "0.67401165", "0.67401165", "0.66797066", "0.66131717", "0.65611285", "0.65567636", "0.65222335", "0.650689", "0.64505213", "0.641281", "0.63893825", "0.6360658", "0.63373137", "0.6330806", "0.63270384", "0.6306842", "0.6298314", "0.6294659", "0.629...
0.6891487
1
NewList instantiates a new list and sets the default values.
func NewList()(*List) { m := &List{ BaseItem: *NewBaseItem(), } odataTypeValue := "#microsoft.graph.list"; m.SetOdataType(&odataTypeValue); return m }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New() *List {\n\t// new returns a pointer to a List with all variables set to 0 value\n\treturn new(List).Init()\n}", "func NewList(vs ...Value) Value {\n\treturn StrictPrepend(vs, EmptyList)\n}", "func NewList() List {\n\treturn make(List, 0)\n}", "func NewList() List {\n\treturn List{}\n}", "func Ne...
[ "0.79136246", "0.78035533", "0.77620363", "0.775962", "0.7705582", "0.7686803", "0.7679327", "0.75430304", "0.75349677", "0.7452575", "0.7435865", "0.7435628", "0.7392671", "0.7382111", "0.737879", "0.73784304", "0.736477", "0.7362613", "0.73597026", "0.73436475", "0.7342709"...
0.72837466
26
CreateListFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateListFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewList(), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateBrowserSiteListFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {\n return NewBrowserSiteList(), nil\n}", "func CreateSharepointIdsFromDiscriminatorValue(p...
[ "0.7130501", "0.65420735", "0.6469803", "0.63655806", "0.62998223", "0.62049437", "0.61957437", "0.61202574", "0.61152625", "0.6078244", "0.6048618", "0.60275096", "0.601459", "0.59926915", "0.596089", "0.59600526", "0.5952939", "0.59473586", "0.59227026", "0.59070474", "0.58...
0.85900795
0
GetColumns gets the columns property value. The collection of field definitions for this list.
func (m *List) GetColumns()([]ColumnDefinitionable) { return m.columns }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Model) GetColumns() []Column {\n\treturn m.Columns\n}", "func (fmd *FakeMysqlDaemon) GetColumns(ctx context.Context, dbName, table string) ([]*querypb.Field, []string, error) {\n\treturn []*querypb.Field{}, []string{}, nil\n}", "func (c *Client) GetColumns(sheetID string) (cols []Column, err error) {\...
[ "0.6995068", "0.6583713", "0.65590763", "0.6495269", "0.64883107", "0.63101625", "0.6274126", "0.6241689", "0.6212528", "0.6161865", "0.605871", "0.60496694", "0.6028404", "0.6013853", "0.599702", "0.5981092", "0.5973022", "0.5952178", "0.59382784", "0.5925666", "0.58940035",...
0.76532036
0
GetContentTypes gets the contentTypes property value. The collection of content types present in this list.
func (m *List) GetContentTypes()([]ContentTypeable) { return m.contentTypes }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *LastMileAccelerationOptions) GetContentTypes() []string {\n\tif o == nil || o.ContentTypes == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.ContentTypes\n}", "func (m *List) SetContentTypes(value []ContentTypeable)() {\n m.contentTypes = value\n}", "func (set *ContentTypeSet) Types(...
[ "0.77380264", "0.7120515", "0.6951072", "0.683847", "0.6325658", "0.63171864", "0.62789446", "0.61402726", "0.6130467", "0.6012503", "0.5989417", "0.5985794", "0.59765583", "0.58592784", "0.56957906", "0.56474996", "0.5573628", "0.5445044", "0.5442282", "0.54262537", "0.54202...
0.79392874
0
GetDisplayName gets the displayName property value. The displayable title of the list.
func (m *List) GetDisplayName()(*string) { return m.displayName }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *DeviceClient) GetDisplayName() string {\n\tif o == nil || o.DisplayName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.DisplayName\n}", "func (o *RoleWithAccess) GetDisplayName() string {\n\tif o == nil || o.DisplayName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Displ...
[ "0.7741837", "0.7733561", "0.74696445", "0.7466271", "0.74494886", "0.7443389", "0.74368083", "0.7429317", "0.7401814", "0.74005044", "0.73881435", "0.73865306", "0.73865306", "0.7367366", "0.7334453", "0.73278743", "0.73046476", "0.72927064", "0.727479", "0.7256103", "0.7253...
0.83683056
0
GetDrive gets the drive property value. Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem].
func (m *List) GetDrive()(Driveable) { return m.drive }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *Block) GetDrive(ctx context.Context) (drive dbus.ObjectPath, err error) {\n\terr = o.object.CallWithContext(ctx, \"org.freedesktop.DBus.Properties.Get\", 0, InterfaceBlock, \"Drive\").Store(&drive)\n\treturn\n}", "func (m *Group) GetDrive()(Driveable) {\n return m.drive\n}", "func (m *User) GetDriv...
[ "0.752509", "0.7201301", "0.7189572", "0.6953924", "0.6819783", "0.6769293", "0.6731472", "0.66618615", "0.64475167", "0.6344764", "0.62929523", "0.6108446", "0.5979537", "0.59536654", "0.59533954", "0.59533954", "0.5950644", "0.59289634", "0.5919691", "0.5914934", "0.5872783...
0.78761816
0
GetFieldDeserializers the deserialization information for the current model
func (m *List) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.BaseItem.GetFieldDeserializers() res["columns"] = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.SetCollectionOfObjectValues(CreateColumnDefin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *AuthenticationMethod) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {\n res := m.Entity.GetFieldDeserializers()\n return res\n}", "func (m *IdentityProviderBase) GetFieldDeserializers()(map[string]func(i878a80d2330e89d2...
[ "0.7138905", "0.71287197", "0.7090122", "0.700706", "0.7002194", "0.6968013", "0.6934261", "0.68714935", "0.6712393", "0.6699971", "0.66959363", "0.6689326", "0.66878796", "0.66668355", "0.66515285", "0.661564", "0.6610947", "0.6606688", "0.6602702", "0.66005516", "0.6599443"...
0.6972001
5
GetItems gets the items property value. All items contained in the list.
func (m *List) GetItems()([]ListItemable) { return m.items }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (l *RestAPIList) GetItems() []resource.Managed {\n\titems := make([]resource.Managed, len(l.Items))\n\tfor i := range l.Items {\n\t\titems[i] = &l.Items[i]\n\t}\n\treturn items\n}", "func GetItems(c *gin.Context) {\n\tvar items []model.ItemJson\n\terr := util.DB.Table(\"items\").Find(&items).Error\n\tif err...
[ "0.75478745", "0.744459", "0.7434444", "0.74341697", "0.7407838", "0.73677117", "0.73617125", "0.7360272", "0.7359669", "0.7346144", "0.7336508", "0.7334327", "0.73200595", "0.7295804", "0.72761357", "0.72758305", "0.72643614", "0.7261494", "0.72567713", "0.7251349", "0.72445...
0.7805831
0
GetList gets the list property value. Provides additional details about the list.
func (m *List) GetList()(ListInfoable) { return m.list }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *ClientImpl) GetList(ctx context.Context, args GetListArgs) (*PickList, error) {\n\trouteValues := make(map[string]string)\n\tif args.ListId == nil {\n\t\treturn nil, &azuredevops.ArgumentNilError{ArgumentName: \"args.ListId\"}\n\t}\n\trouteValues[\"listId\"] = (*args.ListId).String()\n\n\tlocationId,...
[ "0.7402214", "0.7211892", "0.7197566", "0.7090484", "0.7002887", "0.69607484", "0.69395965", "0.68194044", "0.6801362", "0.67747223", "0.6725991", "0.663443", "0.66022295", "0.6588623", "0.65876096", "0.65801454", "0.65714175", "0.65714175", "0.6566503", "0.6454622", "0.64090...
0.7468337
0
GetOperations gets the operations property value. The collection of longrunning operations on the list.
func (m *List) GetOperations()([]RichLongRunningOperationable) { return m.operations }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *Endpoint) GetOperations() []models.EndpointOperation {\n\treturn e.Operations\n}", "func GetOperations() ([]dtos.Operation, error) {\n\tvar ops []dtos.Operation\n\n\tresp, err := makeJSONRequest(\"GET\", apiURL+\"/operations\", http.NoBody)\n\tif err != nil {\n\t\treturn ops, errors.Append(err, ErrCanno...
[ "0.7211943", "0.7144373", "0.7129846", "0.7005646", "0.6984113", "0.6979087", "0.6979087", "0.6970134", "0.6949761", "0.6890829", "0.6889747", "0.6889747", "0.68835425", "0.68729496", "0.68609893", "0.68579656", "0.68536425", "0.67909795", "0.6768954", "0.6740723", "0.6734948...
0.83329624
0
GetSharepointIds gets the sharepointIds property value. Returns identifiers useful for SharePoint REST compatibility. Readonly.
func (m *List) GetSharepointIds()(SharepointIdsable) { return m.sharepointIds }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Drive) GetSharePointIds()(SharepointIdsable) {\n return m.sharePointIds\n}", "func (o *MicrosoftGraphItemReference) GetSharepointIds() AnyOfmicrosoftGraphSharepointIds {\n\tif o == nil || o.SharepointIds == nil {\n\t\tvar ret AnyOfmicrosoftGraphSharepointIds\n\t\treturn ret\n\t}\n\treturn *o.Sharepoi...
[ "0.8100934", "0.79997236", "0.7919966", "0.67751956", "0.6737591", "0.6716384", "0.66700727", "0.64469844", "0.6421894", "0.62926507", "0.6288443", "0.614765", "0.5920941", "0.5585824", "0.5475095", "0.54425955", "0.5382097", "0.5301088", "0.5294862", "0.5176188", "0.51289743...
0.80914927
1
GetSubscriptions gets the subscriptions property value. The set of subscriptions on the list.
func (m *List) GetSubscriptions()([]Subscriptionable) { return m.subscriptions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (svc *SubscriptionService) GetSubscriptions(params *param.GetParams) ([]*nimbleos.Subscription, error) {\n\tsubscriptionResp, err := svc.objectSet.GetObjectListFromParams(params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn subscriptionResp, nil\n}", "func (c *Client) GetSubscriptions(queryParams ...
[ "0.7868426", "0.7729767", "0.7729074", "0.7635478", "0.75740594", "0.74823356", "0.7409729", "0.7403774", "0.7206823", "0.71313256", "0.7025433", "0.7023735", "0.69475216", "0.6929064", "0.6929064", "0.69113976", "0.6910021", "0.68576664", "0.6846115", "0.6791046", "0.6753372...
0.8141
0
GetSystem gets the system property value. If present, indicates that this is a systemmanaged list. Readonly.
func (m *List) GetSystem()(SystemFacetable) { return m.system }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client BaseClient) GetSystem(ctx context.Context, pathParameter string) (result System, err error) {\n\tif err := validation.Validate([]validation.Validation{\n\t\t{TargetValue: pathParameter,\n\t\t\tConstraints: []validation.Constraint{{Target: \"pathParameter\", Name: validation.Pattern, Rule: `.*`, Chain:...
[ "0.6552798", "0.6516161", "0.64446497", "0.5954586", "0.59397334", "0.5910173", "0.5894141", "0.58871907", "0.5834781", "0.5828252", "0.5756128", "0.56791264", "0.5651165", "0.5645735", "0.5644327", "0.5579365", "0.5558257", "0.55290455", "0.5488099", "0.5483745", "0.54779154...
0.6885303
0
Serialize serializes information the current object
func (m *List) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { err := m.BaseItem.Serialize(writer) if err != nil { return err } if m.GetColumns() != nil { cast := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p Registered) Serialize() common.JSON {\n\treturn common.JSON{\n\t\t\"ID\": p.ID,\n\t\t\"Date\": p.Date,\n\t\t\"Riders\": p.Riders,\n\t\t\"RidersID\": p.RidersID,\n\t\t\"Events\": p.Events,\n\t\t\"EventsID\": p.EventsID,\n\t\t\"StartNumber\": p.StartNumber,\n\t}\n}", "func (...
[ "0.6572986", "0.6466613", "0.6435532", "0.63836247", "0.6377068", "0.63716114", "0.6346305", "0.62336147", "0.6171269", "0.6162533", "0.61441034", "0.6142544", "0.6116166", "0.610626", "0.6100351", "0.6082516", "0.6060808", "0.6053123", "0.6039119", "0.60381764", "0.60261023"...
0.5830749
51
SetColumns sets the columns property value. The collection of field definitions for this list.
func (m *List) SetColumns(value []ColumnDefinitionable)() { m.columns = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Creater) SetColumns(c1 []builder.Columns) builder.Creater {\n\n\tcolumnDefs := make([]string, 0, len(c1))\n\n\tfor _, item := range c1 {\n\t\tcolumnDefs = append(columnDefs, fmt.Sprintf(\"%s %s %s\", item.Name, item.Datatype, item.Constraint))\n\t}\n\n\tcolumns := strings.Join(columnDefs, seperator)\n\tc....
[ "0.69769454", "0.6804708", "0.67329115", "0.65630496", "0.6390641", "0.6051947", "0.6024405", "0.5607218", "0.5591005", "0.556967", "0.55185026", "0.5513934", "0.5410269", "0.539816", "0.53536016", "0.5328212", "0.52258617", "0.52192163", "0.52094", "0.51368654", "0.5131282",...
0.7975869
0
SetContentTypes sets the contentTypes property value. The collection of content types present in this list.
func (m *List) SetContentTypes(value []ContentTypeable)() { m.contentTypes = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *LastMileAccelerationOptions) SetContentTypes(v []string) {\n\to.ContentTypes = &v\n}", "func (o *ExtrasSavedFiltersListParams) SetContentTypes(contentTypes *string) {\n\to.ContentTypes = contentTypes\n}", "func ContentTypes(types []string, blacklist bool) Option {\n\treturn func(c *config) error {\n\t...
[ "0.8701873", "0.81465465", "0.7151172", "0.70922256", "0.67580223", "0.6733916", "0.672834", "0.6628651", "0.65903586", "0.6576717", "0.6566702", "0.64906377", "0.64708567", "0.64687985", "0.643722", "0.63983715", "0.634481", "0.59890896", "0.59173846", "0.5863382", "0.586291...
0.82240343
1
SetDisplayName sets the displayName property value. The displayable title of the list.
func (m *List) SetDisplayName(value *string)() { m.displayName = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ListNodesParams) SetDisplayName(displayName *string) {\n\to.DisplayName = displayName\n}", "func (o *DeviceClient) SetDisplayName(v string) {\n\to.DisplayName = &v\n}", "func (o *SchemaDefinitionRestDto) SetDisplayName(v string) {\n\to.DisplayName = &v\n}", "func (o *AdminSearchUsersV2Params) SetDis...
[ "0.818561", "0.81110734", "0.8035491", "0.8012668", "0.79528517", "0.79295033", "0.7925276", "0.79108095", "0.7909268", "0.7899301", "0.7893911", "0.7893911", "0.78925425", "0.7877846", "0.7862184", "0.7839893", "0.7839308", "0.7833375", "0.7833274", "0.7830437", "0.78302985"...
0.8070391
2
SetDrive sets the drive property value. Only present on document libraries. Allows access to the list as a [drive][] resource with [driveItems][driveItem].
func (m *List) SetDrive(value Driveable)() { m.drive = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Group) SetDrive(value Driveable)() {\n m.drive = value\n}", "func (m *User) SetDrive(value Driveable)() {\n m.drive = value\n}", "func (o *User) SetDrive(v AnyOfmicrosoftGraphDrive) {\n\to.Drive = &v\n}", "func (o *User) SetDrive(v Drive) {\n\to.Drive = &v\n}", "func (m *Drive) SetDriveType(...
[ "0.7992977", "0.78732735", "0.7630548", "0.7536296", "0.69157124", "0.6463099", "0.6364722", "0.62700015", "0.6150766", "0.5855303", "0.5782538", "0.57769513", "0.5764786", "0.5764786", "0.57268894", "0.57063174", "0.56432295", "0.55852723", "0.5579085", "0.55205274", "0.5448...
0.8223476
0