text
stringlengths
11
6.3k
embedding
listlengths
768
768
func hasValidDataExtractionQuery(query interface{}) error { queryConverted := query.(map[string]interface{}) if val, ok := queryConverted["columns"]; ok { columns := reflect.ValueOf(val) if columns.Len() > 10 { return errors.New("Data Extraction Validator: The key 'columns' in data extraction result must have ...
[ 0.3587319552898407, 0.8177583813667297, 0.5046970844268799, -1.0249191522598267, 0.21373505890369415, -0.6921406984329224, -0.3231181502342224, 0.26355740427970886, 0.08240341395139694, -0.5212629437446594, -0.3383014500141144, -0.7951257824897766, 0.7167345285415649, 0.26750054955482483, ...
func hasValidColumn(query interface{}) error { if reflect.ValueOf(query).Kind() == reflect.Slice { columnData := query.([]interface{}) for _, column := range columnData { column := column.(map[string]interface{}) validateColumn(column) } } else { query := query.(map[string]interface{}) valida...
[ 0.051584985107183456, -0.6370190978050232, 0.6114484667778015, 0.24215546250343323, 0.319477915763855, -0.08394013345241547, 0.3758202791213989, 0.05094697326421738, 0.008882863447070122, -0.3543425500392914, -0.7608965039253235, 0.28773340582847595, 0.3191070556640625, 1.0153030157089233,...
func New(key *APIKey, timeout int) *SlicingDice { SlicingDice := new(SlicingDice) if len(key.MasterKey) != 0 { SlicingDice.key = map[string]string{ "masterKey": key.MasterKey, } } else if len(key.CustomKey) != 0 { SlicingDice.key = map[string]string{ "customKey": key.CustomKey, } } else { SlicingDic...
[ -1.0321028232574463, -0.955449640750885, 0.3346618413925171, -0.6908330917358398, -1.3867937326431274, -0.5269249081611633, -0.5631948709487915, 1.13564133644104, -0.24889230728149414, 1.5062819719314575, 0.3812843859195709, -0.053168293088674545, 0.057904914021492004, 0.1210983619093895, ...
func (s *SlicingDice) getKey(keys map[string]string, endpointKeyLevel int) (string, error) { currentKeyLevel := s.getKeyLevel(keys) if currentKeyLevel == 2 { if len(keys["masterKey"]) != 0 { return keys["masterKey"], nil } else if len(keys["customKey"]) != 0 { return keys["customKey"], nil } } else if cu...
[ -1.4221298694610596, -0.29809194803237915, 0.7054186463356018, 0.701415479183197, -0.2812937796115875, -1.0363259315490723, -0.022149479016661644, 0.41759729385375977, -0.034903354942798615, 1.4459776878356934, 1.2296142578125, 0.34340378642082214, -0.8898367881774902, -0.11622287333011627...
func (s *SlicingDice) getFullUrl(path string) string { if len(sd_base) != 0 { return sd_base + path } return "https://api.slicingdice.com/v1" + path }
[ -0.21664147078990936, -0.019692452624440193, 0.5842108130455017, 0.744684636592865, -0.6051087379455566, -0.10754875093698502, -0.02814999781548977, 0.3272773027420044, 0.5527981519699097, 0.7585833072662354, 0.30025744438171387, -0.2411210983991623, 0.6684322953224182, 0.26077672839164734...
func (s *SlicingDice) makeRequestSQL(url string, method string, endpointKeyLevel int, query interface{}, sql bool) (map[string]interface{}, error) { methodsAllowed := []string{"GET", "POST", "PUT", "DELETE"} if !stringInSlice(method, methodsAllowed) { return nil, errors.New("request: this is a invalid method to mak...
[ -0.7079381942749023, 0.13654246926307678, 1.1358367204666138, 0.347592830657959, -0.6000393033027649, -0.3555750250816345, -0.9809585809707642, -0.37723684310913086, -0.244186133146286, 0.8692297339439392, 0.7638216614723206, 0.34754425287246704, 0.07603941112756729, -0.20100663602352142, ...
func (s *SlicingDice) handlerResponse(res *http.Response, err error) (map[string]interface{}, error) { if err != nil { return nil, err } // check api response json defer res.Body.Close() contents, _ := ioutil.ReadAll(res.Body) result := string(contents) decodeResponse, err := s.DecodeJSON(result) if err != ni...
[ -0.6122956871986389, -1.767427682876587, 0.7767519950866699, -0.49642589688301086, -0.15059232711791992, -0.5613299012184143, 0.1821996420621872, 0.1790364682674408, 0.12784886360168457, 0.22791893780231476, -0.47294530272483826, -0.5654709935188293, 0.2441534847021103, -0.2734907269477844...
func CreateNode(ctx context.Context, s *xmpp.Session, node string, cfg *form.Data) error { return CreateNodeIQ(ctx, s, stanza.IQ{}, node, cfg) }
[ 0.16957616806030273, 0.12024135142564774, 0.3924506902694702, -0.22185078263282776, 0.504412055015564, -0.07129515707492828, -0.7282406687736511, -0.22763633728027344, 0.4709620177745819, 0.015739846974611282, -0.1275867372751236, -0.3807946741580963, -0.3839983642101288, 0.329371362924575...
func CreateNodeIQ(ctx context.Context, s *xmpp.Session, iq stanza.IQ, node string, cfg *form.Data) error { iq.Type = stanza.SetIQ payload := xmlstream.Wrap( nil, xml.StartElement{Name: xml.Name{Local: "create"}, Attr: []xml.Attr{{Name: xml.Name{Local: "node"}, Value: node}}}, ) if cfg != nil { submitted, _ :=...
[ -0.26902538537979126, -0.01264494564384222, 0.5309085249900818, -0.7129442095756531, -0.27799543738365173, -0.153855100274086, -1.1009690761566162, -0.43344300985336304, -0.5492125749588013, 0.6959774494171143, -0.2633410394191742, -0.0064991251565515995, -0.39673468470573425, 0.5016458630...
func NewHTTPServer(listenHTTP, connectTCP string) Runner { result := &httpServer{ wsHandler: wsHandler{ connectTCP: connectTCP, wsUpgrader: websocket.Upgrader{ ReadBufferSize: BufferSize, WriteBufferSize: BufferSize, CheckOrigin: func(r *http.Request) bool { return true }, }, }, listenH...
[ -0.1981562376022339, -0.2230108678340912, 0.6731475591659546, -0.30144259333610535, -0.3331405222415924, 0.8426687717437744, 0.32558968663215637, -0.5886873006820679, -0.355989009141922, 0.5461995601654053, -0.0800640657544136, -0.09399405121803284, -0.3384181261062622, 0.9658095836639404,...
func getMultiplicationOrder(i int, j int, n int, bracket [][]int, mat []string, pos *int, result *string) { // If only one matrix left in current segment if i == j { if *pos < 26 { (*result) += mat[*pos] } else { repeatedChar := "" for l := 0; l < (*pos / 26); l++ { repeatedChar = mat[l] + mat[(*pos...
[ -0.22960419952869415, 0.6540123820304871, 0.8248411417007446, -0.22173042595386505, -0.6324347853660583, -0.9500689506530762, 0.16315068304538727, -0.34107545018196106, -0.08695434778928757, 0.2477695494890213, -0.7739076614379883, -0.5588676929473877, -0.16354089975357056, 0.3650167584419...
func CheckHMACHash(data string, hash string, secret string) bool { h := hmac.New(sha256.New, []byte(secret)) h.Write([]byte(data)) // Get result and encode as hexadecimal string sha := hex.EncodeToString(h.Sum(nil)) return sha == hash }
[ 0.6940094232559204, -0.39764559268951416, 0.6465397477149963, 0.7142834067344666, -0.03708730638027191, 0.42157217860221863, -1.1500972509384155, 0.3057584762573242, 0.25202614068984985, 0.0318792499601841, -0.8332898020744324, 0.4347147047519684, -0.3960680365562439, 0.3562604486942291, ...
func HashPassword(password string) (string, error) { bytes, err := bcrypt.GenerateFromPassword([]byte(password), 5) return string(bytes), err }
[ 1.0174129009246826, 0.6534175872802734, 0.5266351699829102, 0.4202204942703247, -0.7104236483573914, 0.14309920370578766, 0.028617216274142265, -0.1625150889158249, 0.32086390256881714, 0.6284070611000061, -1.2299052476882935, 0.3183484673500061, -0.8678475022315979, -0.20982548594474792, ...
func CheckPasswordHash(password, hash string) bool { err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) return err == nil }
[ 1.4680734872817993, -0.2759840786457062, 0.7701563835144043, 0.8426914811134338, -0.10086017847061157, 0.37645620107650757, -0.9116308093070984, 0.25125473737716675, -0.34252816438674927, 0.46869203448295593, -0.33648887276649475, 0.6874673962593079, -1.0030791759490967, 0.4724424481391907...
func NewConfig(clientId, clientSecret, redirectUrl string) *oauth2.Config { if redirectUrl == "" { redirectUrl = "oob" } config := &oauth2.Config{ ClientID: clientId, ClientSecret: clientSecret, Endpoint: oauth2.Endpoint{ AuthURL: AuthURL, TokenURL: TokenURL, }, RedirectURL: redirectUrl, } ...
[ -0.08965568989515305, -0.5022417902946472, 0.3715653717517853, 0.3760972321033478, -0.7830277681350708, 0.1779557764530182, -0.5053569078445435, 0.6329541206359863, 0.7894680500030518, 0.07048750668764114, 0.5591699481010437, 1.064441442489624, 0.7488083243370056, 0.3560541868209839, 0.8...
func NewOwnableFromArgs() *router.Chaincode { return router.NewChaincode(router. New(`ownableFromArgs`). Init(InvokeSetFromArgs). Invoke(QueryMethod, Query)) }
[ 0.5159787535667419, -0.7896743416786194, 0.2313581258058548, 0.7257404327392578, 0.006577288266271353, -1.3705106973648071, 0.33472302556037903, -0.943647027015686, -0.28085118532180786, -0.4779033660888672, 0.13053865730762482, 0.32904815673828125, -0.19165557622909546, -0.123289808630943...
func (query *Query) GetGlobalAllocationParam(ctx context.Context) (*param.GlobalAllocationParam, error) { resp, err := query.transport.Query(ctx, ParamKVStoreKey, param.QueryAllocationParam, []string{}) if err != nil { return nil, err } param := new(param.GlobalAllocationParam) if err := query.transport.Cdc.Unm...
[ -0.39719077944755554, 0.31877854466438293, 0.5564650893211365, -0.39711442589759827, -0.7338672280311584, 0.8160369396209717, 0.8651595115661621, 0.15039986371994019, 0.5173566937446594, 0.9879003167152405, 0.7383741736412048, 0.861710250377655, -0.5312743186950684, 0.3945421278476715, -...
func (query *Query) GetVoteParam(ctx context.Context) (*param.VoteParam, error) { resp, err := query.transport.Query(ctx, ParamKVStoreKey, param.QueryVoteParam, []string{}) if err != nil { return nil, err } param := new(param.VoteParam) if err := query.transport.Cdc.UnmarshalJSON(resp, param); err != nil { re...
[ -0.6528224945068359, 0.12768815457820892, 0.49990567564964294, 0.4124281108379364, 0.09257079660892487, 0.170643612742424, -0.12087556719779968, -0.00501086562871933, 0.30966901779174805, 0.6195619702339172, 0.33344101905822754, 0.6791030764579773, -0.7125819325447083, 0.13476750254631042,...
func (query *Query) GetProposalParam(ctx context.Context) (*param.ProposalParam, error) { resp, err := query.transport.Query(ctx, ParamKVStoreKey, param.QueryProposalParam, []string{}) if err != nil { return nil, err } param := new(param.ProposalParam) if err := query.transport.Cdc.UnmarshalJSON(resp, param); e...
[ -0.5570996403694153, 0.4497198164463043, 0.5177618265151978, -0.3217300772666931, -0.5516296625137329, 0.03853445500135422, -0.3750079870223999, 0.6988434195518494, 0.5068144798278809, 0.5583368539810181, 0.7172264456748962, 0.11922396719455719, -0.50300532579422, -0.12371188402175903, -...
func (query *Query) GetValidatorParam(ctx context.Context) (*param.ValidatorParam, error) { resp, err := query.transport.Query(ctx, ParamKVStoreKey, param.QueryValidatorParam, []string{}) if err != nil { return nil, err } param := new(param.ValidatorParam) if err := query.transport.Cdc.UnmarshalJSON(resp, param...
[ -0.6997514367103577, -0.07731322944164276, 0.3152943551540375, 0.11767305433750153, -0.7646711468696594, 0.36255282163619995, 0.18003961443901062, 0.3194960355758667, 0.09792669117450714, -0.35644394159317017, 0.4083596169948578, 0.5325972437858582, -0.3937116265296936, 0.35672828555107117...
func (query *Query) GetAccountParam(ctx context.Context) (*param.AccountParam, error) { resp, err := query.transport.Query(ctx, ParamKVStoreKey, param.QueryAccountParam, []string{}) if err != nil { return nil, err } param := new(param.AccountParam) if err := query.transport.Cdc.UnmarshalJSON(resp, param); err !...
[ -0.67816561460495, 0.2131519764661789, 0.5437089204788208, 0.21615006029605865, -0.12519267201423645, -0.11639527976512909, 0.9178186655044556, 0.23538626730442047, 0.903535008430481, 0.6121467351913452, 0.8837113976478577, 1.0068527460098267, 0.14275288581848145, 0.25564855337142944, -0...
func (query *Query) GetPostParam(ctx context.Context) (*param.PostParam, error) { resp, err := query.transport.Query(ctx, ParamKVStoreKey, param.QueryPostParam, []string{}) if err != nil { return nil, err } param := new(param.PostParam) if err := query.transport.Cdc.UnmarshalJSON(resp, param); err != nil { re...
[ -0.16161860525608063, 0.23786194622516632, 0.5205894112586975, 0.14068372547626495, 0.030036546289920807, 0.1461605578660965, -0.41946080327033997, -0.06295992434024811, 0.19114859402179718, -0.36445048451423645, 0.02466755174100399, 0.4562186300754547, -0.617883026599884, 0.12014535069465...
func (app *folderNameBuilder) Create() FolderNameBuilder { return createFolderNameBuilder() }
[ -0.07392613589763641, 0.047060806304216385, 0.374022901058197, 1.3353245258331299, -0.6229508519172668, 0.26823559403419495, -0.01346820779144764, 0.21313390135765076, 0.22183012962341309, -0.9852246642112732, -0.1291494220495224, -0.46555304527282715, -0.21453312039375305, 1.3628987073898...
func (app *folderNameBuilder) IsCurrent() FolderNameBuilder { app.isCurrent = true return app }
[ -0.2097153663635254, -0.7465104460716248, 0.544327974319458, 0.7355828881263733, -0.6791452169418335, 0.9154830574989319, 0.40020740032196045, 0.5539408326148987, 0.4426932632923126, 0.03279921039938927, -0.0725010558962822, 0.21887560188770294, 0.20353132486343384, 0.5572932958602905, -...
func (app *folderNameBuilder) IsPrevious() FolderNameBuilder { app.isPrevious = true return app }
[ -0.046878255903720856, 0.8781046271324158, 0.7167999148368835, 0.9408640265464783, -0.08352227509021759, 0.09124639630317688, 0.34183362126350403, 0.4589098393917084, 1.3750526905059814, -0.7204321622848511, -0.05691401660442352, -0.19116145372390747, -0.4810916781425476, 0.597198963165283...
func (app *folderNameBuilder) WithName(name string) FolderNameBuilder { app.name = name return app }
[ -0.3162125051021576, -0.5314645171165466, 0.5103581547737122, 0.6635938882827759, -1.359623670578003, -0.0736706405878067, 0.2907472252845764, 0.3664979040622711, 0.6103002429008484, -0.04695558175444603, -0.4603114128112793, -0.6418642997741699, 0.32454198598861694, 0.7302883267402649, ...
func (app *folderNameBuilder) Now() (FolderName, error) { if app.isCurrent { return createFolderNameWithCurrent(), nil } if app.isPrevious { return createFolderNameWithPrevious(), nil } if app.name != "" { return createFolderNameWithName(app.name), nil } return nil, errors.New("the FolderName is invalid...
[ -0.21960270404815674, -0.26479288935661316, 0.6818158626556396, 1.0494258403778076, -0.29313212633132935, 0.025092879310250282, 0.30967170000076294, 0.0976400375366211, -0.5149083137512207, -0.35332873463630676, 0.18102692067623138, -0.25416845083236694, 0.16034331917762756, 0.842824101448...
func (o *GetAPIV10PeerReviewsTaskIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetAPIV10PeerReviewsTaskIDOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err ...
[ -0.48459428548812866, -0.513729989528656, 0.7691878080368042, -0.24014027416706085, -0.4196939468383789, -0.7352909445762634, -0.12140389531850815, 0.1798081398010254, 0.6566209197044373, 0.6109347939491272, 0.7472679615020752, -0.09029526263475418, -0.6257167458534241, -0.5206466913223267...
func NewGetAPIV10PeerReviewsTaskIDOK() *GetAPIV10PeerReviewsTaskIDOK { return &GetAPIV10PeerReviewsTaskIDOK{} }
[ -0.7650192379951477, 0.37482401728630066, 0.3095690608024597, -0.41102415323257446, -0.39050421118736267, -0.18673203885555267, -0.5740370154380798, 1.2891061305999756, -0.08039504289627075, 0.0355352982878685, 0.5171573758125305, -0.11589104682207108, 0.6560110449790955, -0.39397495985031...
func NewGetAPIV10PeerReviewsTaskIDUnauthorized() *GetAPIV10PeerReviewsTaskIDUnauthorized { return &GetAPIV10PeerReviewsTaskIDUnauthorized{} }
[ -1.1124341487884521, 0.21937227249145508, 0.4835836589336395, -0.5515863299369812, -0.8431975841522217, -0.2805453836917877, -0.43596991896629333, 1.281510353088379, 0.4276772141456604, -0.8197735548019409, 0.20528863370418549, 1.0998326539993286, 0.14988037943840027, -0.948169469833374, ...
func NewGetAPIV10PeerReviewsTaskIDForbidden() *GetAPIV10PeerReviewsTaskIDForbidden { return &GetAPIV10PeerReviewsTaskIDForbidden{} }
[ -0.3185769021511078, 0.38339436054229736, 0.3345935344696045, -0.44010695815086365, -0.9695294499397278, 0.2675560414791107, -0.6185076236724854, 0.5559800863265991, 0.3354405462741852, -0.12938649952411652, 0.981596827507019, 0.7381455302238464, -0.15955841541290283, -1.034648060798645, ...
func NewGetAPIV10PeerReviewsTaskIDNotFound() *GetAPIV10PeerReviewsTaskIDNotFound { return &GetAPIV10PeerReviewsTaskIDNotFound{} }
[ -0.43865275382995605, -0.5209261775016785, 0.3221561014652252, -0.8548111319541931, -0.18662422895431519, 0.4022887945175171, -0.6265405416488647, 0.7739715576171875, 0.34567052125930786, -0.8087280988693237, 0.40704914927482605, 0.3606417775154114, 0.3454529643058777, -0.5703238248825073,...
func ValidStorageTypeStrings() []string { return []string{ StorageMemory.String(), StorageBolt.String(), StorageMysql.String(), StorageFilesystem.String(), } }
[ -0.2957543432712555, -1.115472435951233, 0.3081071078777313, 0.6953489184379578, 0.22434934973716736, 0.4113136827945709, -0.6044481992721558, -0.8306671380996704, 0.3932688236236572, 0.3435957729816437, -0.3484016954898834, -0.2598740756511688, -0.5763155221939087, -0.003377314191311598, ...
func StorageTypeFromString(in string) StorageType { in = strings.ToLower(in) in = strings.TrimSpace(in) switch in { case "": return StorageBolt case "memory": return StorageMemory case "bolt": return StorageBolt case "mysql": return StorageMysql case "filesystem": return StorageFilesystem } return...
[ 0.5465251207351685, -0.8316519260406494, 0.1996551752090454, 0.45391711592674255, -0.25008803606033325, 0.3995508849620819, -0.06074340268969536, -0.5307987928390503, 0.42332789301872253, -0.22392116487026215, -0.32924914360046387, -0.34210333228111267, -1.1252796649932861, 0.1542867720127...
func (s StorageType) Import() string { base := "github.com/jkomoros/boardgame/storage" return filepath.Join(base, s.String()) }
[ 0.3018966019153595, -0.011221055872738361, 0.4458729326725006, 0.7462590336799622, 0.6024728417396545, 0.5982400178909302, 0.6068188548088074, -0.1797991394996643, -0.7104310989379883, 0.5424817204475403, -0.4658823013305664, -0.09155526012182236, -0.03439898043870926, -0.5099417567253113,...
func (s StorageType) Constructor(optionalLiteralArgs string) string { args := "" switch s { case StorageFilesystem: args = "\"games/\"" case StorageBolt: args = "\".database\"" case StorageMysql: args = "false" } if optionalLiteralArgs != "" { args = optionalLiteralArgs } return s.String() + ".NewS...
[ 0.05543292313814163, -0.39200130105018616, 0.41298580169677734, -0.042573459446430206, 0.060730624943971634, 0.24907711148262024, -0.2708318829536438, -0.10521373152732849, -0.6401300430297852, -0.04072154313325882, 0.37503257393836975, -0.7131832242012024, -0.3996392488479614, 1.237337231...
func RootCmd() *cobra.Command { man, err := helper.GetManual("root") if err != nil { fmt.Println(err) os.Exit(1) } cmd := &cobra.Command{ Use: man.Use, Short: man.Short, Long: man.Long, } // Here you will define your flags and configuration settings. // Cobra supports persistent flags, which, if d...
[ 1.0449718236923218, -0.5936272144317627, 0.6910492181777954, 0.9374178051948547, 0.01091980841010809, 0.6596310138702393, 0.33897775411605835, 0.12810300290584564, -0.09627588093280792, -0.6976493000984192, 0.3718721866607666, 1.042325496673584, -0.12406164407730103, 1.0333226919174194, ...
func (ns *VersionNamespace) Unpack(cfg *Config) error { fields := cfg.GetFields() if len(fields) == 0 { return nil } configVersion, err := cfg.String("version", -1) if err != nil { // element is no configuration object -> continue so a namespace // configVersionFactory unpacked as a namespace can have othe...
[ -0.460157185792923, 0.18955107033252716, 0.5759043097496033, 0.2596204876899719, -0.7309209108352661, -0.5344275236129761, 0.11805862188339233, 0.2867719233036041, 0.9226637482643127, 0.04843410477042198, -1.1635290384292603, -0.2854239344596863, 0.657738208770752, 0.6370047330856323, 0....
func (ns *VersionNamespace) Name() string { return ns.version }
[ -0.49563848972320557, -1.5360708236694336, -0.04229266569018364, 0.3778250515460968, -1.1353225708007812, 0.7646346092224121, -0.2527056634426117, -1.3148629665374756, 0.44809603691101074, 1.1301355361938477, -0.8810954689979553, -0.19081805646419525, 0.45760446786880493, 0.811074137687683...
func (ns *VersionNamespace) Config() ConfigFactory { return ns.config }
[ 0.36827990412712097, -0.34200382232666016, 0.07095795124769211, 0.5468379259109497, -0.4621462821960449, 0.18358144164085388, -0.20782463252544403, 0.06704650819301605, 0.5126774311065674, -0.8560366630554199, -0.44242024421691895, 0.29868239164352417, 0.8361604809761047, 0.577512741088867...
func (ns *VersionNamespace) IsSet() bool { return ns.config != nil }
[ -0.44354432821273804, -0.408565491437912, 0.11918342113494873, -0.15291909873485565, 0.2843879759311676, 0.2245546132326126, -0.8043826818466187, -0.21624316275119781, -0.04788583517074585, 0.8967146277427673, -0.9586341977119446, 0.34205830097198486, 0.21317283809185028, 0.917488455772399...
func Askwit(textrequest string, res interface{}) error { //I prepare the request to send to wit.ai to interpret what is being said in Telegram req, err := http.NewRequest("GET", "https://api.wit.ai/message", nil) if err != nil { log.Print(err) os.Exit(1) } q := req.URL.Query() q.Add("q", textrequest) req.URL...
[ -0.9581587910652161, -0.8847655057907104, 1.0178053379058838, -0.7858191132545471, -0.539138674736023, 0.04678294435143471, -0.5763675570487976, -0.3174766004085541, -0.5198124051094055, 0.10000545531511307, -0.2176932692527771, 0.557002067565918, -0.5015652775764465, 0.6881566643714905, ...
func CaptureMetric(ctx context.Context, log logr.Logger, trial *redskyv1beta1.Trial, metric *redskyv1beta1.Metric, target runtime.Object) (float64, float64, error) { // Execute the queries as Go templates var err error if metric.Query, metric.ErrorQuery, err = template.New().RenderMetricQueries(metric, trial, target...
[ -0.5107662081718445, 0.08161661773920059, 0.5117753744125366, 0.4868716895580292, 0.027377724647521973, 0.2688957154750824, -0.2927629053592682, -1.3172607421875, -0.8064529895782471, 0.8196911811828613, 0.7423376441001892, 0.49160102009773254, 0.3971335291862488, 0.4177725315093994, -0....
func (o *DeleteConnectorUsingDELETEReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 204: result := NewDeleteConnectorUsingDELETENoContent() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil...
[ -0.7384012937545776, -1.1488374471664429, 1.1032668352127075, 0.3440406620502472, -0.5351236462593079, -1.350553035736084, 0.12832078337669373, -0.15144343674182892, 1.004224419593811, 0.1527828723192215, 0.7480102181434631, -0.5890185832977295, -1.0702381134033203, 0.17111827433109283, ...
func NewDeleteConnectorUsingDELETENoContent() *DeleteConnectorUsingDELETENoContent { return &DeleteConnectorUsingDELETENoContent{} }
[ -0.653009831905365, -0.8281561732292175, 0.25714167952537537, 0.16189739108085632, -0.9943096041679382, -0.7645257711410522, -0.47226664423942566, -0.9572762846946716, 0.2677866816520691, -0.968297004699707, 0.15695960819721222, -0.7943205833435059, 0.04794459789991379, 1.2026265859603882,...
func NewDeleteConnectorUsingDELETEBadRequest() *DeleteConnectorUsingDELETEBadRequest { return &DeleteConnectorUsingDELETEBadRequest{} }
[ -0.19737394154071808, -1.1685267686843872, 0.7745579481124878, 1.5528852939605713, -0.4273477792739868, -0.14991073310375214, -0.9431663155555725, -0.008147113025188446, 0.852566123008728, -0.7158230543136597, 0.7558778524398804, -0.24265804886817932, 0.017581824213266373, 1.41374731063842...
func NewDeleteConnectorUsingDELETEUnauthorized() *DeleteConnectorUsingDELETEUnauthorized { return &DeleteConnectorUsingDELETEUnauthorized{} }
[ -1.1401474475860596, -0.7645363807678223, 0.736591100692749, 0.8707229495048523, -1.1469199657440186, -0.479739248752594, -0.2866289019584656, 0.8673788905143738, 0.8428046703338623, -1.0010349750518799, 0.39680513739585876, 0.4201975464820862, 0.35497555136680603, 0.8359143733978271, 0....
func NewDeleteConnectorUsingDELETEForbidden() *DeleteConnectorUsingDELETEForbidden { return &DeleteConnectorUsingDELETEForbidden{} }
[ 0.018439145758748055, -0.18083348870277405, 0.7590207457542419, 1.359998106956482, -0.6695457100868225, -0.3398210406303406, -0.017723791301250458, -0.49007704854011536, 1.050146222114563, -0.3707011044025421, 0.669725775718689, -0.16142839193344116, -0.020007451996207237, 0.50690722465515...
func NewDeleteConnectorUsingDELETEMethodNotAllowed() *DeleteConnectorUsingDELETEMethodNotAllowed { return &DeleteConnectorUsingDELETEMethodNotAllowed{} }
[ -0.14674869179725647, -0.17888610064983368, 0.6821766495704651, 1.0355267524719238, -0.8666004538536072, -0.23870885372161865, 0.20098328590393066, -0.7930587530136108, 0.27535280585289, -0.013594667427241802, 1.478915810585022, -0.2061048299074173, -0.588480532169342, 0.9392668008804321, ...
func NewDeleteConnectorUsingDELETEConflict() *DeleteConnectorUsingDELETEConflict { return &DeleteConnectorUsingDELETEConflict{} }
[ -0.4057241380214691, -0.7775351405143738, 0.6484000086784363, 0.5783344507217407, -0.3734750747680664, -0.5627232789993286, -0.11314928531646729, -0.8313620686531067, 1.0180962085723877, -0.32998549938201904, 0.5751489996910095, -0.6817775368690491, -0.5149747729301453, 0.7431079745292664,...
func NewDeleteConnectorUsingDELETEServiceUnavailable() *DeleteConnectorUsingDELETEServiceUnavailable { return &DeleteConnectorUsingDELETEServiceUnavailable{} }
[ -1.5576661825180054, -1.0943927764892578, 0.764370322227478, 0.3659987449645996, -0.547383189201355, -0.7617183327674866, -0.39720162749290466, 0.816311240196228, 1.020666241645813, -0.7879210710525513, 0.22982341051101685, 0.05386717990040779, 0.49962911009788513, 0.9296752214431763, 0....
func InitResponse() ValidatorResponse { var ve = []ValidationError{} vr := ValidatorResponse{ Message: "Valid", Valid: true, Errors: ve} return vr }
[ 0.07543930411338806, -1.3893502950668335, 0.2361520379781723, 0.40821948647499084, -0.2067876011133194, -0.7567539811134338, -0.176533505320549, 0.6910909414291382, 0.8549613356590271, -0.034595388919115067, -0.8132388591766357, -0.30843234062194824, -1.1179615259170532, 0.1708215922117233...
func EmptyString(v string) bool { v = strings.Replace(v, " ", "", -1) if len(v) == 0 || v == "null" { return true } return false }
[ -0.9015657901763916, 0.29149866104125977, 0.6279248595237732, -0.3600177466869354, -0.13078324496746063, 0.16805174946784973, -0.4918566048145294, 0.2662517726421356, 0.7262039184570312, 1.0267161130905151, -0.44308194518089294, -0.06645286828279495, -0.24023112654685974, 0.220305100083351...
func InvalidEmail(v string) bool { if EmptyString(v) { return false } if emailRegexp.MatchString(v) { return false } else { return true } }
[ -0.7894877791404724, -0.1628258228302002, 0.5592687726020813, 0.2916710078716278, -1.0526657104492188, 0.6339004635810852, -0.5609560012817383, 1.262791633605957, -0.04833432659506798, -0.5236803889274597, 0.22010917961597443, 0.588036835193634, -1.2778306007385254, -0.699194073677063, -...
func FileExist(f string) bool { if _, err := os.Stat(f); os.IsNotExist(err) { return false } else { return true } }
[ 0.19749779999256134, -0.1383161097764969, 0.7116754055023193, 0.17117896676063538, 1.0472534894943237, 1.3387075662612915, -0.30061933398246765, 0.8551040291786194, -1.5761858224868774, 0.23720920085906982, -0.1307644546031952, -1.2465541362762451, 0.5281668901443481, 0.824431300163269, ...
func ValidFileExtension(fp string, ext string) bool { if filepath.Ext(fp) != ext { return false } return true }
[ 0.897982120513916, -0.9511438608169556, 0.5203513503074646, 0.7138048410415649, -0.7676966190338135, 1.184499740600586, -1.2012592554092407, 0.6135205030441284, 0.060005731880664825, 0.6576100587844849, -0.24681131541728973, -0.281290739774704, -0.2602345943450928, -0.7726181745529175, -...
func EmailValidation(v string, id string, r *ValidatorResponse) { if InvalidEmail(v) { AppendError("Invalid Email", id, r) } }
[ 0.013009431771934032, 0.05468938872218132, 0.06347420811653137, -0.15524601936340332, -0.6451732516288757, -0.03773669898509979, -0.3844744861125946, 0.8525082468986511, 0.5108365416526794, 0.5863208770751953, 0.07663939148187637, 0.37290823459625244, -0.35575464367866516, -0.5824264883995...
func IntegerValueValidation(v string, id string, r *ValidatorResponse) { if EmptyString(v) { AppendError("This field is required", id, r) return } _, err := strconv.Atoi(v) if err != nil { AppendError("Invalid Integer", id, r) } }
[ -0.4176748991012573, -0.5640977025032043, 0.3264385759830475, -0.47942227125167847, -0.6430391073226929, 0.25203895568847656, -0.16626673936843872, 0.5502879619598389, 0.07021474838256836, 0.5217866897583008, -0.07043291628360748, 0.1869484782218933, -0.42722752690315247, 0.098043553531169...
func DBIntegerValidation(v string, id string, r *ValidatorResponse) { if EmptyString(v) { AppendError(id+":ID required", id, r) return } ID, err := strconv.Atoi(v) if err != nil || ID <= 0 { AppendError("Invalid ID for:"+id, id, r) } }
[ -0.3730126917362213, -0.10880260169506073, 0.41987907886505127, -0.6215659379959106, -0.2532271146774292, 0.03127960488200188, -0.1867271214723587, -0.0034668445587158203, 0.3438480496406555, 0.4691849946975708, -0.0837143138051033, -0.03822985291481018, -1.2608869075775146, 0.540019452571...
func EmailValue(v string, id string, r *ValidatorResponse) { if EmptyString(v) { return } if InvalidEmail(v) { AppendError("Invalid Email", id, r) } }
[ 0.11359676718711853, 0.04319983720779419, 0.4031310975551605, -0.40661710500717163, -0.5481554269790649, 0.17963679134845734, -0.7231489419937134, 0.3832522928714752, -0.027123115956783295, 0.3283410966396332, 0.2144535481929779, 1.0188311338424683, 0.20877227187156677, -0.4494784772396087...
func MockTestHandler01(w http.ResponseWriter, r *http.Request, params httprouter.Params) { id, err := strconv.Atoi(params.ByName("id")) if err != nil { common.ErrHandler(w, err) return } if r.Method == "GET" { switch id { case 1: mockTest0101(w, r) case 2: mockTest0102(w, r) case 3: mockTest01...
[ -0.8581715226173401, -0.7300853729248047, 0.7895365953445435, 0.49419429898262024, -0.11809415370225906, 0.6989888548851013, 0.9684300422668457, -0.3937169909477234, 0.36515170335769653, 0.35410287976264954, 0.31423550844192505, -0.4110463261604309, -0.7786538004875183, 0.37511882185935974...
func mockTest0101(w http.ResponseWriter, r *http.Request) { hostname, err := os.Hostname() if err != nil { common.ErrHandler(w, err) return } s := fmt.Sprintf("mockTest01: from Host %s\n", hostname) // get query args size, err := common.GetIntArgFromQuery(r, "size") if err != nil { common.ErrHandler(w, er...
[ -0.32964229583740234, 0.015388739295303822, 0.8052865266799927, -0.14952577650547028, -0.10262258350849152, 0.9248141050338745, 0.9155557751655579, -0.19429334998130798, 0.022823389619588852, 0.18794074654579163, -0.16877640783786774, -0.3246091306209564, -0.6242531538009644, -0.3056241869...
func mockTest0102(w http.ResponseWriter, r *http.Request) { hostname, err := os.Hostname() if err != nil { common.ErrHandler(w, err) return } s := fmt.Sprintf("mockTest02: from Host %s\n", hostname) // get query args filepath, err := common.GetStringArgFromQuery(r, "file") if err != nil { common.ErrHandle...
[ -0.13835611939430237, -0.4989131987094879, 0.9144851565361023, -0.3077036142349243, -0.30553746223449707, 0.7309815883636475, 0.6366931796073914, 0.05136615410447121, -0.6262139678001404, 0.2183162122964859, 0.5852722525596619, -0.12890653312206268, -0.48457077145576477, -0.129115223884582...
func mockTest0103(w http.ResponseWriter, r *http.Request) { retCode, err := common.GetIntArgFromQuery(r, "code") if err != nil { common.ErrHandler(w, err) return } if retCode < http.StatusOK { retCode = http.StatusOK } b := []byte("mockTest0103, mock return error code.") w.Header().Set(common.TextContentL...
[ -0.617432177066803, -0.06992637366056442, 0.7758236527442932, -0.34384772181510925, 0.4533673822879791, 0.01188160851597786, 0.5527207255363464, 0.1651591658592224, 0.4809022843837738, 0.12206809967756271, 0.35926687717437744, -0.49619659781455994, -1.0307977199554443, -0.1100679263472557,...
func mockTest0104(w http.ResponseWriter, r *http.Request) { wait, err := common.GetIntArgFromQuery(r, "wait") if err != nil { common.ErrHandler(w, err) return } unit, err := common.GetStringArgFromQuery(r, "unit") if err != nil { common.ErrHandler(w, err) return } retIP := `"42.48.232.7", "10.200.20.21"...
[ -0.7256152629852295, -0.6244623064994812, 0.9574412703514099, -0.31857505440711975, -0.36650437116622925, 0.2015533149242401, 0.704751193523407, -0.07814700156450272, 0.43086370825767517, 0.2863423228263855, -0.06077371910214424, -0.5509106516838074, -0.5115124583244324, -0.303218066692352...
func mockTest0105(w http.ResponseWriter, r *http.Request) { var ( b []byte err error ) b, err = ioutil.ReadFile("diskusage") if err != nil { common.ErrHandler(w, err) return } // gzip encode b, err = myutils.GzipEncode(b) if err != nil { b = []byte(fmt.Sprintln("gzip encode error:", err)) w.Heade...
[ 0.30443382263183594, -0.44763702154159546, 0.8693145513534546, -0.06478597968816757, 0.06275153160095215, 0.21044398844242096, 1.109232783317566, -0.5326666831970215, 0.020055122673511505, 0.4279310405254364, -0.14632950723171234, -0.29052525758743286, -0.9187700152397156, -0.2554408609867...
func mockTest0106(w http.ResponseWriter, r *http.Request) { mimetypeTable := make(map[string]string) mimetypeTable["txt"] = "text/plain" mimetypeTable["jpg"] = "image/jpeg" mimetypeTable["bin"] = "application/octet-stream" // get query args mimetype, err := common.GetStringArgFromQuery(r, "type") if err != nil ...
[ 0.03210499510169029, -0.36998242139816284, 1.0090974569320679, -0.21385090053081512, 0.2659938335418701, 0.3134714961051941, 0.7778587341308594, -0.07795435935258865, 0.05794449895620346, 0.8631529211997986, -0.0084015978500247, -0.06070912629365921, -1.261911153793335, -0.0748494565486908...
func NewClient(master gfs.ServerAddress) *Client { return &Client{ master: master, leaseBuf: newLeaseBuffer(master, gfs.LeaseBufferTick), } }
[ 0.9655067920684814, -0.28532031178474426, 0.23688091337680817, -0.4940653443336487, -1.0170620679855347, 0.3350074887275696, 0.39075273275375366, 0.2808413803577423, 0.19783999025821686, -0.6632505059242249, -0.21287094056606293, 0.7272058725357056, -0.606879711151123, -0.21542774140834808...
func (c *Client) Create(path gfs.Path) error { var reply gfs.CreateFileReply err := util.Call(c.master, "Master.RPCCreateFile", gfs.CreateFileArg{path}, &reply) if err != nil { return err } return nil }
[ 0.2559402883052826, 0.5419573187828064, 0.3753570318222046, -0.2306164652109146, 0.811530590057373, 0.9201812744140625, -0.12250138819217682, -1.027464509010315, -1.2206186056137085, -0.12312168627977371, -0.09680617600679398, -0.8879026174545288, -1.0484530925750732, 0.34990328550338745, ...
func (c *Client) Delete(path gfs.Path) error { var reply gfs.DeleteFileReply err := util.Call(c.master, "Master.RPCDeleteFile", gfs.DeleteFileArg{path}, &reply) if err != nil { return err } return nil }
[ 0.7286258935928345, 0.48068705201148987, 0.5880857110023499, -0.03321393206715584, 0.8412355184555054, 0.6422243714332581, 0.27439209818840027, -0.39019790291786194, -0.4425784647464752, 0.2280149757862091, -0.0916704460978508, -0.22328400611877441, -1.6461970806121826, -0.1437311023473739...
func (c *Client) Rename(source gfs.Path, target gfs.Path) error { var reply gfs.RenameFileReply err := util.Call(c.master, "Master.RPCRenameFile", gfs.RenameFileArg{source, target}, &reply) if err != nil { return err } return nil }
[ -0.25840410590171814, 0.02632635086774826, 0.4547126591205597, 0.2021719068288803, 0.35659217834472656, -0.2689551115036011, -0.3065912127494812, 0.22707611322402954, -1.082411527633667, 0.39320337772369385, -0.031395602971315384, 0.4209495186805725, -0.7367547154426575, -0.415889382362365...
func (c *Client) Mkdir(path gfs.Path) error { var reply gfs.MkdirReply err := util.Call(c.master, "Master.RPCMkdir", gfs.MkdirArg{path}, &reply) if err != nil { return err } return nil }
[ -0.15391337871551514, 0.7569062113761902, 0.5092974901199341, -0.2534613311290741, -0.09102389216423035, 0.8531455397605896, -0.05539843812584877, -0.33619052171707153, -0.07985228300094604, -0.4245603382587433, -0.17832769453525543, -0.3046720325946808, -1.0613963603973389, 0.843102574348...
func (c *Client) List(path gfs.Path) ([]gfs.PathInfo, error) { var reply gfs.ListReply err := util.Call(c.master, "Master.RPCList", gfs.ListArg{path}, &reply) if err != nil { return nil, err } return reply.Files, nil }
[ -0.029066672548651695, -0.32296842336654663, 0.554017961025238, -0.2123018503189087, 0.7855676412582397, -0.048777516931295395, -0.20162582397460938, -0.2794901132583618, 0.16393929719924927, 0.21440429985523224, -0.8243969082832336, -0.5650835633277893, -1.3247642517089844, 0.131924793124...
func (c *Client) Read(path gfs.Path, offset gfs.Offset, data []byte) (n int, err error) { var f gfs.GetFileInfoReply err = util.Call(c.master, "Master.RPCGetFileInfo", gfs.GetFileInfoArg{path}, &f) if err != nil { return -1, err } if int64(offset/gfs.MaxChunkSize) > f.Chunks { return -1, fmt.Errorf("read offs...
[ -0.1834256798028946, -0.5399243831634521, 0.9476921558380127, -0.9697299599647522, -0.5942760705947876, 0.16478875279426575, -0.10158808529376984, -0.21855215728282928, -1.1259561777114868, 0.23086732625961304, 0.27495843172073364, -0.04531731456518173, -0.8598688840866089, -0.178938910365...
func (c *Client) Write(path gfs.Path, offset gfs.Offset, data []byte) error { var f gfs.GetFileInfoReply err := util.Call(c.master, "Master.RPCGetFileInfo", gfs.GetFileInfoArg{path}, &f) if err != nil { return err } if int64(offset/gfs.MaxChunkSize) > f.Chunks { return fmt.Errorf("write offset exceeds file si...
[ -0.21704338490962982, -0.46510952711105347, 0.7034986615180969, -0.7529182434082031, 0.3494499921798706, 0.24158994853496552, -0.35763245820999146, -0.325745165348053, -1.0473659038543701, 0.15322594344615936, -0.19343377649784088, 0.1287914365530014, -0.8995434045791626, -0.33423244953155...
func (c *Client) Append(path gfs.Path, data []byte) (offset gfs.Offset, err error) { if len(data) > gfs.MaxAppendSize { return 0, fmt.Errorf("len(data) = %v > max append size %v", len(data), gfs.MaxAppendSize) } var f gfs.GetFileInfoReply err = util.Call(c.master, "Master.RPCGetFileInfo", gfs.GetFileInfoArg{path...
[ 0.43924084305763245, -0.046656012535095215, 0.9423770904541016, -1.00576651096344, -0.7402359247207642, 0.48393315076828003, -0.47943219542503357, -0.26194339990615845, -0.3498886823654175, 0.11913257092237473, -0.05246538668870926, 0.46558332443237305, -1.1343004703521729, 0.3457840085029...
func (c *Client) GetChunkHandle(path gfs.Path, index gfs.ChunkIndex) (gfs.ChunkHandle, error) { var reply gfs.GetChunkHandleReply err := util.Call(c.master, "Master.RPCGetChunkHandle", gfs.GetChunkHandleArg{path, index}, &reply) if err != nil { return 0, err } return reply.Handle, nil }
[ -0.0001226425083586946, 0.29237258434295654, 0.5177340507507324, -0.2903467118740082, 0.7581260800361633, 0.29005345702171326, 0.40929555892944336, -1.6059585809707642, -0.7286434173583984, -0.45169052481651306, 0.5523010492324829, 1.2888805866241455, -1.5531336069107056, -1.31804513931274...
func (c *Client) ReadChunk(handle gfs.ChunkHandle, offset gfs.Offset, data []byte) (int, error) { var readLen int if gfs.MaxChunkSize-offset > gfs.Offset(len(data)) { readLen = len(data) } else { readLen = int(gfs.MaxChunkSize - offset) } var l gfs.GetReplicasReply err := util.Call(c.master, "Master.RPCGetR...
[ -0.36531680822372437, 0.3943505585193634, 0.8229594826698303, -0.6426154375076294, -0.4346064031124115, 0.44133275747299194, 0.30327311158180237, 0.72596675157547, -0.7328488230705261, -0.0661211907863617, 0.094786137342453, 1.396250605583191, -0.3813246488571167, -0.23689252138137817, 0...
func (c *Client) WriteChunk(handle gfs.ChunkHandle, offset gfs.Offset, data []byte) error { if len(data)+int(offset) > gfs.MaxChunkSize { return fmt.Errorf("len(data)+offset = %v > max chunk size %v", len(data)+int(offset), gfs.MaxChunkSize) } l, err := c.leaseBuf.Get(handle) if err != nil { return err } da...
[ -0.36371979117393494, 0.014390718191862106, 0.7170732021331787, -0.8192321062088013, 0.5563661456108093, 0.9094343781471252, 0.15996208786964417, 0.41919296979904175, -1.0807968378067017, -1.3774244785308838, -0.15395677089691162, 1.3879259824752808, -0.7325344681739807, 0.7505371570587158...
func (c *Client) AppendChunk(handle gfs.ChunkHandle, data []byte) (offset gfs.Offset, err error) { if len(data) > gfs.MaxAppendSize { return 0, gfs.Error{gfs.UnknownError, fmt.Sprintf("len(data) = %v > max append size %v", len(data), gfs.MaxAppendSize)} } //log.Infof("Client : get lease ") l, err := c.leaseBuf....
[ -0.22864405810832977, 0.05759891867637634, 0.9947980642318726, -0.8563551902770996, -0.1362551599740982, 0.3505227565765381, 0.10716282576322556, 0.35377058386802673, -1.0297425985336304, -1.0543804168701172, 0.18638260662555695, 0.9290916919708252, -1.0025678873062134, 0.8875912427902222,...
func (Docs) Lint(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() c = c.Pipeline("docs").Pipeline("lint") workdir := util.Repository(c) eg, gctx := errgroup.WithContext(ctx) // Markdown eg.Go(func() error { _, err =...
[ 0.6385485529899597, 0.20805789530277252, 0.8637058138847351, 0.0149382334202528, 0.3818191587924957, 0.10223042219877243, 0.5293152332305908, -0.8750238418579102, 0.19034889340400696, 0.08527285605669022, 0.5433216094970703, 0.06297682225704193, 0.4800357222557068, 0.5731922388076782, -0...
func (t *tokensService) GetUserByToken(tokenstring string) (*users.User, *errors.CustomError) { var customError *errors.CustomError var token *tokens.Token var user *users.User token = &tokens.Token{Token: tokenstring} if customError = token.ValidateToken(); customError != nil { return nil, customError } if...
[ 0.19668465852737427, -0.5237835645675659, 0.053380999714136124, 0.3197416067123413, 0.10211953520774841, -0.5990536212921143, 0.07130621373653412, -1.1406269073486328, 0.10884718596935272, -0.8642922639846802, -1.029518723487854, 0.39029812812805176, -0.46724727749824524, -0.84334903955459...
func (t *tokensService) CreateToken(update bool, userID uint) (string, *errors.CustomError) { var customError *errors.CustomError var token tokens.Token var err error var newToken string newToken, err = webtoken.JWTCreate(userID, "global", 60) if err != nil { return "", errors.TextError("An error on JSON web t...
[ -0.41555798053741455, -0.5916253328323364, 0.7898069024085999, 0.217453271150589, -1.1551491022109985, 0.5600661039352417, 0.0852932259440422, 0.3248937427997589, 0.49045971035957336, 0.27014967799186707, -0.45015770196914673, 0.5864284038543701, -0.6051554083824158, 0.623592734336853, -...
func (t *tokensService) DeleteToken(userID uint) *errors.CustomError { var customError *errors.CustomError var token tokens.Token token.UserID = userID if customError = token.Delete(); customError != nil { return customError } return nil }
[ -0.23965631425380707, -0.23577389121055603, 0.03090391680598259, 0.3529360890388489, -0.15428076684474945, -0.1724034696817398, 0.6560031771659851, 0.34869712591171265, 0.7485485076904297, -0.7517291307449341, -0.5165860056877136, 1.622550129890442, 0.2665170133113861, 0.8420266509056091, ...
func Hex(s string) Integer { return integer{x: bigint.MustHex(s)} }
[ -0.28128138184547424, 0.21004435420036316, 0.14434729516506195, -0.5072939395904541, -0.7656379342079163, 0.1309778243303299, -0.33798304200172424, 1.5336188077926636, 0.7657864093780518, -0.5241726636886597, -0.7860053181648254, 0.38747984170913696, 0.6538313627243042, -0.5222300291061401...
func (r Result) Target() *big.Int { return new(big.Int).Sub(r.N.Int(), big.NewInt(r.D)) }
[ -1.1605027914047241, 0.36546164751052856, 0.2086760252714157, -0.9424564242362976, -0.040403153747320175, -0.17129720747470856, 0.6049267053604126, -0.5444201231002808, 0.5275862812995911, -0.6324604153633118, 0.3014453947544098, 0.6778199076652527, -0.006037379615008831, -0.51775848865509...
func (r Result) Delta() int { return r.Length - r.BestKnown }
[ -0.5124412775039673, -0.24603509902954102, 0.443928986787796, 0.026644181460142136, 0.40556949377059937, 0.8880991339683533, 0.9069126844406128, 0.31318199634552, -0.3211773931980133, -0.6774250864982605, -0.8991251587867737, -0.25447672605514526, -0.21170176565647125, 0.06226348876953125,...
func (l *FileWriter) Write(p []byte) (n int, err error) { l.mu.Lock() defer l.mu.Unlock() if l.file == nil { if err = l.openExistingOrNew(); err != nil { return 0, err } } n, err = l.file.Write(p) l.size += int64(n) return n, err }
[ -1.0731858015060425, 0.5542727112770081, 0.5981626510620117, -0.06932855397462845, 0.6677375435829163, -0.3306368291378021, 0.8487638831138611, 0.7024050354957581, -0.014917545020580292, -0.10544019192457199, -0.34777817130088806, -0.9274637699127197, -0.6410124897956848, 1.063208937644958...
func (l *FileWriter) Close() error { l.mu.Lock() defer l.mu.Unlock() return l.close() }
[ -0.48715856671333313, -0.3546287715435028, 0.31644871830940247, 0.28157803416252136, -0.2414962202310562, -0.5881164073944092, 0.40766727924346924, 0.07397545874118805, -0.9489086866378784, -1.014388084411621, 0.758967399597168, -1.3483761548995972, -1.384339451789856, 0.8643547296524048, ...
func (l *FileWriter) close() error { if l.file == nil { return nil } err := l.file.Close() l.file = nil return err }
[ 0.18570099771022797, -0.298688143491745, 0.20499281585216522, -0.02945106476545334, 0.29585522413253784, -0.3585929870605469, 0.4279009997844696, 0.5070838928222656, -1.034016728401184, -0.8668290376663208, 0.7023240327835083, -0.9065648913383484, -0.42128193378448486, 1.4991204738616943, ...
func (l *FileWriter) Rotate() error { l.mu.Lock() defer l.mu.Unlock() return l.rotate() }
[ -0.529072105884552, -0.04680333286523819, 0.3344349265098572, 0.11116240173578262, 0.7630523443222046, -1.3503087759017944, 0.5503989458084106, -0.09533333778381348, -1.038400411605835, -1.2098312377929688, 0.5741704106330872, -0.9315111637115479, -1.8842018842697144, -0.14603658020496368,...
func (l *FileWriter) rotate() error { if err := l.close(); err != nil { return err } if err := l.openNew(); err != nil { return err } l.mill() return nil }
[ -0.570601224899292, 0.049218181520700455, 0.4566873610019684, -0.016998473554849625, 1.2873575687408447, -0.43231460452079773, 0.9610334038734436, -0.23962421715259552, -0.976389467716217, -0.9905384182929993, 0.34331148862838745, -0.8490404486656189, -1.1487610340118408, 0.178598389029502...
func (l *FileWriter) openNew() error { err := os.MkdirAll(l.dir(), 0744) if err != nil { return fmt.Errorf("can't make directories for new logfile: %s", err) } name := l.filename() mode := os.FileMode(0644) info, err := os_Stat(name) if err == nil { // Copy the mode off the old logfile. mode = info.Mode()...
[ 0.43695586919784546, -0.03362242877483368, 0.9738644957542419, -0.3908284902572632, -0.16058604419231415, -0.1631833165884018, 0.31400930881500244, 0.2504010498523712, -0.6182774305343628, -0.5220755338668823, -0.034945204854011536, -0.37407293915748596, 0.7632207870483398, 0.3951160013675...
func (l *FileWriter) backupName(name string) string { if l.CustomerBackupFormat != "" { return l.customerBackupName(name) } dir := filepath.Dir(name) filename := filepath.Base(name) ext := filepath.Ext(filename) prefix := filename[:len(filename)-len(ext)] t := currentTime() timestamp := t.Format(backupTimeFo...
[ 0.17778044939041138, -0.8988617062568665, 0.946338415145874, -0.19940808415412903, -1.1633687019348145, -0.29538530111312866, 0.25413426756858826, 0.47233468294143677, -0.3092370927333832, 0.8491495251655579, 0.05841156467795372, -0.8959939479827881, 0.5799947381019592, -0.4054179787635803...
func (l *FileWriter) openExistingOrNew() error { l.mill() filename := l.filename() info, err := os_Stat(filename) if os.IsNotExist(err) { return l.openNew() } if err != nil { return fmt.Errorf("error getting log file info: %s", err) } file, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, 0644) if e...
[ 0.027397826313972473, -0.49694544076919556, 0.7231461405754089, -0.6300920844078064, 0.1811748445034027, 0.08923393487930298, 0.21098729968070984, 0.06344663351774216, -0.5487276911735535, -0.4623357057571411, 0.34064754843711853, -0.7274390459060669, 0.5618216395378113, 0.68898606300354, ...
func (l *FileWriter) filename() string { if l.FileName != "" { return l.FileName } return defaultLogName }
[ 0.25634998083114624, -0.7088953256607056, 0.27685797214508057, 0.18235164880752563, 0.5889455080032349, -0.39991623163223267, 0.0398208349943161, 0.9868656992912292, -0.7942824959754944, -0.09717646986246109, 0.6688554883003235, -0.9382522702217102, -0.3269394338130951, 0.39086002111434937...
func (l *FileWriter) millRunOnce() error { if l.MaxBackups == 0 && !l.Compress { return nil } files, err := l.oldLogFiles() if err != nil { return err } var compress, remove []logInfo if l.MaxBackups > 0 && l.MaxBackups < len(files) { preserved := make(map[string]bool) var remaining []logInfo for _,...
[ 0.4146891236305237, 0.14361624419689178, 0.9382920265197754, 0.3762838840484619, 0.22480838000774384, -0.05136033520102501, 0.31314900517463684, 0.48259395360946655, -0.1450735330581665, 0.2659394443035126, -0.13598807156085968, -0.48128047585487366, -0.9287521839141846, 0.865319550037384,...
func (l *FileWriter) millRun() { for _ = range l.millCh { // what am I going to do, log this? _ = l.millRunOnce() } }
[ 0.3388918340206146, -0.9487569332122803, 0.17737384140491486, -0.018485574051737785, 0.6673563122749329, 0.21080295741558075, 0.06825748831033707, 0.40791115164756775, 0.33825552463531494, -0.8997711539268494, -0.6556018590927124, -0.07030881941318512, 0.013302233070135117, 1.1164345741271...
func (l *FileWriter) mill() { l.startMill.Do(func() { l.millCh = make(chan bool, 1) go l.millRun() }) select { case l.millCh <- true: default: } }
[ 0.6918727159500122, -0.7446389198303223, 0.37905317544937134, 0.5107882618904114, 0.21463871002197266, 0.746027410030365, 0.8276057839393616, 0.569372296333313, 0.35774415731430054, -1.3667923212051392, 0.8588429093360901, 0.31098616123199463, -0.8616437315940857, 1.2231248617172241, -0....
func (l *FileWriter) oldLogFiles() ([]logInfo, error) { files, err := ioutil.ReadDir(l.dir()) if err != nil { return nil, fmt.Errorf("can't read log file directory: %s", err) } logFiles := []logInfo{} if len(files) == 0 { return nil, nil } for _, e := range files { logFiles = append(logFiles, e) } sor...
[ -0.3211196959018707, -0.45271745324134827, 0.856177568435669, -0.5219789743423462, -0.13335557281970978, -0.38673052191734314, -0.46963757276535034, -0.48089632391929626, -0.18821991980075836, 0.05864076688885689, -0.3810758590698242, 0.17623667418956757, -0.5307943820953369, 0.09175240993...