text
stringlengths
11
6.3k
embedding
listlengths
768
768
func NewTrade(symbol string, capacity int) *Trade { model := &Trade{ Tbk: io.NewTimeBucketKey(TradeBucketKey(symbol)), } model.make(capacity) return model }
[ -0.029866447672247887, 0.7670959234237671, 0.20031540095806122, -0.06035924702882767, 0.7521539330482483, -0.13378430902957916, -0.305092453956604, -1.2704042196273804, -0.6815592050552368, -0.7948322296142578, -0.6041375398635864, -0.2258630096912384, -0.1202513799071312, -1.0188086032867...
func (model *Trade) Key() string { return model.Tbk.GetItemKey() }
[ -0.174764022231102, 0.35401418805122375, 0.41167014837265015, 0.9220955967903137, 0.7011123299598694, 1.4456857442855835, 0.525574266910553, -0.45859500765800476, -0.3413952589035034, 1.086093544960022, -0.5578932166099548, -0.5936111807823181, 0.1279803216457367, -0.6111924052238464, -0...
func (model *Trade) Len() int { return len(model.Epoch) }
[ -0.09507906436920166, 0.8284778594970703, 0.18038040399551392, -0.3904898166656494, 0.8236530423164368, -0.041427887976169586, 0.9686293601989746, 0.10977412760257721, -0.6003756523132324, 0.06472497433423996, -1.673535943031311, 0.8823676109313965, 1.1920346021652222, -0.26042279601097107...
func (model *Trade) Symbol() string { return model.Tbk.GetItemInCategory("Symbol") }
[ -1.1525940895080566, 1.4301214218139648, 0.17777033150196075, 0.29089489579200745, 0.4355236291885376, -0.06131330132484436, 1.388732671737671, -0.5690911412239075, 0.6443750262260437, 0.05598534271121025, -0.5233603715896606, 0.12001778185367584, 1.333519697189331, -0.22991715371608734, ...
func (model *Trade) make(capacity int) { model.Epoch = make([]int64, 0, capacity) model.Nanos = make([]int32, 0, capacity) model.Price = make([]enum.Price, 0, capacity) model.Size = make([]enum.Size, 0, capacity) model.Exchange = make([]enum.Exchange, 0, capacity) model.TapeID = make([]enum.Tape, 0, capacity) mo...
[ -0.4089879095554352, 0.4989962577819824, 0.6946976780891418, -0.6716410517692566, 0.026347843930125237, 0.19082556664943695, 0.9364069104194641, -0.8583358526229858, -0.5493209362030029, 0.04308689013123512, -0.6952835321426392, -0.08143159002065659, 0.6079588532447815, -0.6829759478569031...
func (model *Trade) Add(epoch int64, nanos int, price enum.Price, size enum.Size, exchange enum.Exchange, tapeid enum.Tape, conditions ...enum.TradeCondition, ) { model.Epoch = append(model.Epoch, epoch) model.Nanos = append(model.Nanos, int32(nanos)) model.Price = append(model.Price, price) model.Size = append(mo...
[ -0.9500200748443604, -0.00934276171028614, 0.47261378169059753, -0.21316318213939667, 0.3811884820461273, 0.5239878296852112, 0.30197256803512573, -0.4920702278614044, -0.040091849863529205, 0.3989294767379761, -0.2509300410747528, 0.28211671113967896, 0.24640461802482605, 0.43570142984390...
func (model *Trade) buildCsm() *io.ColumnSeriesMap { csm := io.NewColumnSeriesMap() csm.AddColumnSeries(*model.Tbk, model.GetCs()) return &csm }
[ -0.6238363981246948, -0.38319551944732666, 0.15182793140411377, 0.44131991267204285, 0.33221060037612915, 0.16750194132328033, -0.04548497870564461, -0.3867408335208893, 0.2946390211582184, -0.7505804896354675, -0.41065648198127747, -0.3605789542198181, 0.6007605195045471, -0.1448405534029...
func (model *Trade) Write() error { start := time.Now() csm := model.buildCsm() err := executor.WriteCSM(*csm, true) model.WriteTime = time.Since(start) if err != nil { log.Error("Failed to write trades for %s (%+v)", model.Key(), err) return err } return nil }
[ -0.8452321887016296, 0.3800317049026489, 0.2616767883300781, 0.2929679751396179, 1.8791580200195312, 0.21286188066005707, 0.3425035774707794, 0.24316759407520294, -0.5880433917045593, -0.21308469772338867, -0.8148394227027893, 0.4144464433193207, -0.034561410546302795, 0.7340445518493652, ...
func UpdateNerfLevels(ctx sdk.Context, keeper keeper.Keeper) sdk.Result { buffbois, nerfbois, _, banbois := keeper.GetOPandUPCards(ctx) keeper.NerfBuffCards(ctx, buffbois, true) keeper.NerfBuffCards(ctx, nerfbois, false) keeper.UpdateBanStatus(ctx, banbois) keeper.ResetAllVotes(ctx) keeper.RemoveExpiredVoteRigh...
[ -0.9764455556869507, -0.2089737355709076, 0.48040464520454407, 0.3388519585132599, 0.1679830551147461, -0.15351028740406036, -0.621298611164093, -0.9121548533439636, -0.28811779618263245, 0.8558868765830994, -0.458663672208786, -0.4508686363697052, -1.2064440250396729, 0.8458546996116638, ...
func testRule(ruleSlice []metadata.CacheRule, url, contentType string) bool { for _, item := range ruleSlice { compiledGlob := glob.MustCompile(item.Glob) urlMatchesGlob := compiledGlob.Match(url) if !urlMatchesGlob { continue } if item.OnlyTypes != nil { onlyTypeMatched := false for _, onlyType :=...
[ -0.3636794686317444, -0.25883030891418457, 0.44665658473968506, 0.47827795147895813, 0.7222916483879089, 0.6241850852966309, 0.4342413544654846, 0.8079949021339417, -0.23152214288711548, -0.027738602831959724, 0.4600447714328766, 0.8453248739242554, -1.1679322719573975, 1.2219502925872803,...
func shouldCacheUrl(req *http.Request, contentType string) int { simpleUrl := req.URL.Hostname() + req.URL.Path settings := metadata.GetSettings(req) if testRule(settings.NeverCache, simpleUrl, contentType) { return forceNoCache } if testRule(settings.AlwaysCache, simpleUrl, contentType) { return forceCache ...
[ -1.0269811153411865, 0.5674625039100647, 0.5992427468299866, 0.6415905952453613, 0.23304881155490875, 0.8730907440185547, -0.0780944973230362, 0.32817602157592773, 0.08463820070028305, -0.33117246627807617, 0.41547080874443054, 0.2575019299983978, -0.6327838897705078, 1.165669322013855, ...
func main() { app := cli.NewApp() app.Name = "go-init" app.Usage = "Initialize a go project" app.Version = "1.1.0" // global flags //Log Level and Config Path app.Flags = []cli.Flag{ cli.StringFlag{ Name: "configPath, c", EnvVar: "CONFIGPATH", Usage: "config path", Value: "./", }, cli.Stri...
[ -0.0713510662317276, 0.22730904817581177, 1.1556603908538818, 0.510761022567749, 0.7151121497154236, 1.0149881839752197, 0.5051373839378357, 0.6601070761680603, -1.0148670673370361, 0.3874930441379547, -0.3440076410770416, 0.41825351119041443, -0.22665421664714813, 0.1702953577041626, 0....
func LoadConfig() { if v == nil { v = viper.New() v.SetConfigName(configName) v.AddConfigPath(configPath) err := v.ReadInConfig() // Find and read the config file if err != nil { // Handle errors reading the config file log.Fatal(fmt.Errorf("Fatal error config file: %s \n", err)) } } }
[ 1.0726515054702759, -0.19287142157554626, 0.6192260980606079, 0.651713490486145, 0.7704220414161682, -0.14430788159370422, 0.1761813908815384, 1.4540296792984009, -0.6437314748764038, 0.7765347361564636, 0.04562092199921608, -0.3701324164867401, -0.5230857729911804, 0.7894580364227295, 0...
func Config() *viper.Viper { if v == nil { LoadConfig() } return v }
[ 0.9473909735679626, 0.151363804936409, 0.2548648416996002, 0.5223172307014465, -0.004550210200250149, -0.5868098735809326, 0.9182506203651428, 0.40983423590660095, 0.9571115970611572, -0.2239147424697876, 0.011898139491677284, -0.09229988604784012, -0.35055166482925415, 0.5378610491752625,...
func watermarkGetCustomLocation(x, y int, wand, logo *gm.MagickWand) (int, int, error) { width, height, err := wand.Size() if err != nil { return 0, 0, err } logowidth, logoheight, err := logo.Size() if err != nil { return 0, 0, err } if x >= 0 && y >= 0 && uint(x)+logowidth < width && uint(y)+logoheight < h...
[ -0.15736407041549683, -0.5189763903617859, 0.8453347086906433, -0.901827871799469, -1.3452668190002441, -0.4306080639362335, 1.00688898563385, -0.44622331857681274, 0.3502199947834015, -0.28174418210983276, 0.00784736406058073, 1.502456784248352, 0.036543283611536026, -0.038430988788604736...
func watermarkGetLocation(location string, wand, logo *gm.MagickWand) (int, int, error) { var ( x uint = 0 y uint = 0 ) width, height, err := wand.Size() if err != nil { return 0, 0, err } logowidth, logoheight, err := logo.Size() if err != nil { return 0, 0, err } switch location { case "nw": x, y...
[ -0.5724719166755676, -0.9155811667442322, 0.9588293433189392, -0.9745297431945801, -0.839891254901886, -0.36279821395874023, 0.9576898813247681, 0.20725585520267487, 0.10960322618484497, 0.03239699825644493, -0.06770797818899155, 0.6684582233428955, 0.08635476231575012, -0.1059970930218696...
func watermarkGetLogoWand(ctx *context.Context, watermarkName string, dissolve int) (*gm.MagickWand, error) { bt, err := store.Storage().Read(ctx, watermarkName) if err != nil { return nil, err } logoWand, err := gm.NewMagickWand(bt) if err != nil { return nil, err } if dissolve == 0 || dissolve == 100 { ...
[ -0.10125499963760376, 0.30251380801200867, 0.8154274225234985, -0.7272948026657104, -1.2987074851989746, -0.030360737815499306, -0.46690604090690613, -0.16523940861225128, 0.6535686254501343, -0.16127772629261017, 0.45807597041130066, 1.7570174932479858, -0.1538841277360916, -0.16579227149...
func watermarkDecideLocationType(location string, dstX, dstY int) bool { if location != "" { return false } if dstX != 0 || dstY != 0 { return true } return false }
[ -0.452158659696579, -0.033033765852451324, 0.5835575461387634, -0.5040736794471741, 0.1899334192276001, 0.7752965688705444, -0.21649405360221863, 0.5512984991073608, 0.6256719827651978, 0.3194718360900879, 0.613091230392456, 0.09653744846582413, 0.22644680738449097, 0.16686251759529114, ...
func createGameDayReport(date string) (*gameDayReport, error) { matches, err := findMatchesByGameDateID(date) if err != nil { return nil, err } if len(matches) == 0 { return nil, fmt.Errorf("no matches found for date %s", date) } reportGames := make(map[int64]gameReport) for _, game := range matches { g...
[ -0.14792591333389282, 0.19276387989521027, 0.7746695876121521, -0.544905960559845, 0.3471623957157135, 0.010127474553883076, -0.06776142865419388, -1.067352294921875, -0.6610882878303528, -0.49615925550460815, -0.3021206557750702, -1.262464165687561, -0.6152627468109131, 0.0533343404531478...
func evaluateGameDayReport(date string) error { report, err := findGameDayReportByID(date) if err != nil { if !errors.Is(err, mongo.ErrNoDocuments) { return err } // report doesn't exist for whatever reason, so make one report, err = createGameDayReport(date) if err != nil { return err } } gam...
[ -0.15763309597969055, 0.061348892748355865, 0.837238073348999, -0.8504015207290649, 0.6838740110397339, -0.2624663710594177, -0.03553588315844536, -0.6878750920295715, -0.36070603132247925, -0.4581124782562256, -0.140472874045372, -1.213335633277893, -0.5330182909965515, 0.3597386479377746...
func Asset(name string) ([]byte, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) } return a.bytes, nil } return nil, fmt.Errorf("Asset %s not foun...
[ -0.7961482405662537, -1.2313158512115479, 0.6331650614738464, -0.6093901991844177, -1.546920895576477, -0.11101029813289642, 0.129714235663414, -1.3390333652496338, -1.135871410369873, 0.4855230152606964, 0.30901390314102173, 0.3249545693397522, -0.6009676456451416, -0.44264793395996094, ...
func MustAsset(name string) []byte { a, err := Asset(name) if err != nil { panic("asset: Asset(" + name + "): " + err.Error()) } return a }
[ -0.012778956443071365, 0.11985661834478378, 0.4091298282146454, -0.5268413424491882, -0.8276715278625488, 0.4719155430793762, -0.8186293840408325, -1.5736604928970337, 0.16388541460037231, 0.6357062458992004, -0.5354578495025635, 0.35693347454071045, 0.0057142809964716434, -0.0248885955661...
func AssetInfo(name string) (os.FileInfo, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) } return a.info, nil } return nil, fmt.Errorf("Asset...
[ 0.3719695508480072, -1.1052989959716797, 0.5630441904067993, -0.9225736260414124, -1.356386423110962, 0.003355572931468487, 0.6777525544166565, -0.8006678819656372, -1.274828553199768, 0.311536967754364, 0.26360753178596497, 0.26388123631477356, 0.06357761472463608, -0.39880770444869995, ...
func AssetNames() []string { names := make([]string, 0, len(_bindata)) for name := range _bindata { names = append(names, name) } return names }
[ -0.7293784618377686, -0.8460342288017273, 0.7321816682815552, -0.39323121309280396, -0.48951536417007446, 0.7661203145980835, -0.5028699636459351, -0.8655748963356018, -0.4145073890686035, 0.8099913597106934, 0.16903363168239594, 1.163049578666687, -0.028152840211987495, 0.0342608317732811...
func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { return err } info, err := AssetInfo(name) if err != nil { return err } err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) if err != nil { return err } err = ioutil.WriteFile(_filePath(dir, name), d...
[ 0.34371325373649597, -0.3622533082962036, 0.6770349144935608, -1.2592034339904785, -0.00613967701792717, -0.044532135128974915, -0.00726317847147584, -0.43950432538986206, -0.2061910331249237, -0.2510174810886383, 0.17843623459339142, 0.1356850564479828, -0.2362709492444992, -0.56985044479...
func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File if err != nil { return RestoreAsset(dir, name) } // Dir for _, child := range children { err = RestoreAssets(dir, filepath.Join(name, child)) if err != nil { return err } } return nil }
[ 0.4226192533969879, 0.3001989424228668, 0.5813396573066711, -0.20641714334487915, -0.23828980326652527, -0.24414613842964172, 0.5739712119102478, -0.029911452904343605, 0.061882976442575455, -0.43923527002334595, 0.5113739371299744, 0.3275964856147766, -0.612514853477478, 0.035165321081876...
func List(db services.DB, req *GetRequest) (*Session, error) { if req.ID < 1 && len(req.SessionString) < 1 { return nil, nil } q := util.Sq. Select("id", "user_id", "session_string", "inserted_at", "google_users_id"). From("sessions") if req.ID > 0 { q = q.Where(sq.Eq{"id": req.ID}) } if len(req.Sessio...
[ -0.48142915964126587, -1.0905784368515015, 0.5503777861595154, -0.014388133771717548, -0.2403651773929596, -0.555240273475647, -0.16315105557441711, -0.6329382658004761, 1.0268322229385376, 0.7615951895713806, 0.05779841169714928, 0.7365859150886536, -0.20068638026714325, 0.013307319954037...
func (_m *MockAuthServiceServer) Auth(_a0 context.Context, _a1 *AuthRequest) (*AuthResponse, error) { ret := _m.Called(_a0, _a1) var r0 *AuthResponse if rf, ok := ret.Get(0).(func(context.Context, *AuthRequest) *AuthResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*AuthResp...
[ -0.8204020261764526, -0.4858027696609497, 0.5112622380256653, -0.1825878620147705, 0.1331741064786911, -0.07370278984308243, 1.141654133796692, -0.15011020004749298, -0.027455009520053864, -0.013254547491669655, 0.5018025636672974, 0.3160942792892456, 0.5851114988327026, 0.0484489686787128...
func (_m *MockAuthServiceServer) Parse(_a0 context.Context, _a1 *ParseRequest) (*ParseResponse, error) { ret := _m.Called(_a0, _a1) var r0 *ParseResponse if rf, ok := ret.Get(0).(func(context.Context, *ParseRequest) *ParseResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*Pa...
[ -0.5643016695976257, -0.43569791316986084, 0.5628408789634705, -0.7248701453208923, 0.36751607060432434, -0.14894048869609833, 0.6036622524261475, -0.10085399448871613, -0.006078699138015509, -0.07467938959598541, 0.4935761094093323, 0.07011548429727554, -0.006834631320089102, 0.3079967796...
func (_m *MockAuthServiceServer) Refresh(_a0 context.Context, _a1 *RefreshRequest) (*RefreshResponse, error) { ret := _m.Called(_a0, _a1) var r0 *RefreshResponse if rf, ok := ret.Get(0).(func(context.Context, *RefreshRequest) *RefreshResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { r0 = ret...
[ -0.4722851812839508, -0.7111212611198425, 0.6191062331199646, -0.36071667075157166, 0.027487531304359436, 0.041506122797727585, 0.3812301754951477, -0.4612312614917755, 0.10919876396656036, 0.19061875343322754, 0.40639206767082214, 0.2784629464149475, 0.40838366746902466, 0.304480642080307...
func (_m *MockAuthServiceServer) Validate(_a0 context.Context, _a1 *ValidateRequest) (*ValidateResponse, error) { ret := _m.Called(_a0, _a1) var r0 *ValidateResponse if rf, ok := ret.Get(0).(func(context.Context, *ValidateRequest) *ValidateResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { r0...
[ -0.5935018062591553, -0.5474497079849243, 0.5282198190689087, -0.7597734928131104, 0.3754842281341553, -0.028161877766251564, 0.6937011480331421, -0.11968672275543213, 0.1027790829539299, 0.03136434033513069, 0.7624698877334595, 0.040197957307100296, 0.11664276570081711, 0.2989006936550140...
func NewSwitch(ctx *pulumi.Context, name string, args *SwitchArgs, opts ...pulumi.ResourceOption) (*Switch, error) { if args == nil { args = &SwitchArgs{} } var resource Switch err := ctx.RegisterResource("sakuracloud:index/switch:Switch", name, args, &resource, opts...) if err != nil { return nil, err } r...
[ -0.21967875957489014, 0.5293758511543274, 0.5482705235481262, 0.6883965134620667, 0.2523999512195587, 0.21604281663894653, -0.5974528789520264, 0.03738150745630264, 0.5739569664001465, 0.07037457823753357, -0.5250471830368042, 0.2136339247226715, -0.18171338737010956, -0.38692203164100647,...
func GetSwitch(ctx *pulumi.Context, name string, id pulumi.IDInput, state *SwitchState, opts ...pulumi.ResourceOption) (*Switch, error) { var resource Switch err := ctx.ReadResource("sakuracloud:index/switch:Switch", name, id, state, &resource, opts...) if err != nil { return nil, err } return &resource, nil }
[ -0.014095144346356392, 0.3086365759372711, 0.2782370150089264, 0.5984283089637756, 0.24794809520244598, 0.18149521946907043, -0.7732450366020203, -0.1636572927236557, 1.0869688987731934, -0.5474488735198975, -0.17464415729045868, 0.842362642288208, -0.13270647823810577, -1.4305944442749023...
func NewSNSServer(v *viper.Viper) (ss *SNSServer, err error) { var cfg *AWSConfig if cfg, err = NewAWSConfig(v); err != nil { return nil, err } cred := credentials.NewStaticCredentials(cfg.AccessKey, cfg.SecretKey, "") sess, aws_err := session.NewSession(&aws.Config{ Region: aws.String(cfg.Sns.Region),...
[ -0.38184764981269836, -0.39243510365486145, 0.6364349722862244, -0.2493051290512085, -0.03777186572551727, -0.640881359577179, -0.4969891607761383, -0.24709372222423553, 1.0264942646026611, 0.26152318716049194, -1.1277132034301758, 1.0487799644470215, -0.1756771206855774, 0.556964457035064...
func NewNotifier(v *viper.Viper) (Notifier, error) { return NewSNSServer(v) }
[ -0.30820924043655396, -0.3356994390487671, 0.09905388951301575, 0.8407800197601318, -0.5403350591659546, -0.730665385723114, -0.292197585105896, -0.014581489376723766, 1.1016314029693604, -0.09821370244026184, -1.5880526304244995, 0.6462724804878235, 0.019559204578399658, 0.991566479206085...
func (ss *SNSServer) PrepareAndStart() { ss.Subscribe() }
[ 0.7297951579093933, 0.14765334129333496, 0.35593661665916443, 0.686029314994812, -0.015833020210266113, -0.3450011909008026, -0.8000203967094421, 0.17161652445793152, 2.081225872039795, -0.3367711007595062, -0.5736788511276245, 1.4307074546813965, 0.5334827899932861, 0.9669103026390076, ...
func (ss *SNSServer) DnsReady() (e error) { // if an SOA provider isn't given, we're done if ss.SOAProvider == "" { return nil } var ( ctx context.Context cancel context.CancelFunc ) if ss.waitForDns > 0 { ctx, cancel = context.WithTimeout(context.Background(), ss.waitForDns) } else { ctx, cancel...
[ -0.6321821808815002, 0.8294230699539185, 0.6176170706748962, -0.4032783806324005, 0.5044218301773071, -0.9171150326728821, -0.012621746398508549, -0.33031725883483887, 0.40580248832702637, 0.7163851857185364, -0.36302492022514343, 1.3002599477767944, -0.027868814766407013, 0.76773226261138...
func (ss *SNSServer) ValidateSubscriptionArn(reqSubscriptionArn string) bool { if ss.subscriptionArn.Load() == nil { ss.logger.Info("SNS subscriptionArn is nil") return false } else if strings.EqualFold(reqSubscriptionArn, ss.subscriptionArn.Load().(string)) { return true } else { ss.logger.Info( "SNS In...
[ -0.03779425844550133, -1.0892796516418457, 0.4818168878555298, 0.815266489982605, -0.43802544474601746, -0.05785021930932999, -0.3554185628890991, -0.40550747513771057, 0.8573954701423645, -0.8808226585388184, -0.40706002712249756, 1.1305296421051025, 0.42247748374938965, 0.585777163505554...
func (ss *SNSServer) SNSNotificationReceivedCounter(code int) { ss.snsNotificationReceivedChan <- code }
[ 0.4352366030216217, 0.8739839792251587, 0.4809865951538086, -0.7995339035987854, -0.6014712452888489, 0.8828798532485962, 0.7380701899528503, 0.3340379297733307, 0.15393970906734467, -0.3350284695625305, -1.6330543756484985, 0.2768549621105194, 0.5138388872146606, 0.6336368322372437, 0.5...
func (ss *SNSServer) SNSNotificationReceivedInit() chan int { // notification channel notifyChan := make(chan int) // create counters internalErr := ss.metrics.SNSNotificationReceived.With("code", strconv.Itoa(http.StatusInternalServerError)) badRequest := ss.metrics.SNSNotificationReceived.With("code", strconv.I...
[ -0.17345862090587616, -0.2044679820537567, 0.6583082675933838, -1.109486699104309, 0.5172041654586792, 0.06641194224357605, 0.3113872706890106, -0.3747388422489166, -0.1309543401002884, -0.2452738881111145, -0.4748029410839081, 0.24629418551921844, 0.31775787472724915, 0.1597980558872223, ...
func NewActivityDumpLoadController(adm *ActivityDumpManager) (*ActivityDumpLoadController, error) { activityDumpConfigDefaultsMap, found, err := adm.manager.GetMap("activity_dump_config_defaults") if err != nil { return nil, err } if !found { return nil, fmt.Errorf("couldn't find activity_dump_config_defaults m...
[ -0.3207172453403473, 0.15582144260406494, 0.4148278534412384, -0.6535479426383972, -0.3792370855808258, -0.7785013318061829, -0.4312703609466553, -0.5623123645782471, 0.47327765822410583, 0.0013012030394747853, -0.11233659833669662, -0.0002742934157140553, -0.24887418746948242, 0.602375328...
func (lc *ActivityDumpLoadController) PushCurrentConfig() error { // push default load config values if err := lc.activityDumpConfigDefaults.Put(uint32(0), lc.getDefaultLoadConfig()); err != nil { return fmt.Errorf("couldn't update default activity dump load config: %w", err) } return nil }
[ -0.36740320920944214, 0.2763521671295166, 0.5616974234580994, -0.3938916027545929, -0.2719269096851349, 0.08130152523517609, -0.6900399923324585, -0.45547622442245483, -0.6251791715621948, 0.9228516817092896, 0.04369739443063736, 0.5831013917922974, -0.2947690188884735, 0.7734125852584839,...
func (lc *ActivityDumpLoadController) NextPartialDump(ad *ActivityDump) *ActivityDump { newDump := NewActivityDump(ad.adm) newDump.Metadata.ContainerID = ad.Metadata.ContainerID newDump.Metadata.Comm = ad.Metadata.Comm newDump.Metadata.DifferentiateArgs = ad.Metadata.DifferentiateArgs newDump.Tags = ad.Tags // c...
[ 0.2292572557926178, -0.12378896772861481, 0.8575742840766907, -0.3449794054031372, -0.4010792672634125, -0.27075591683387756, 0.6318100094795227, -0.7454904913902283, 0.4561704695224762, -0.34040024876594543, 0.18164460361003876, 0.4762841463088989, -0.18845310807228088, 0.5691110491752625...
func (lc *ActivityDumpLoadController) reduceDumpRate(old, new *ActivityDump) error { new.LoadConfig.Rate = old.LoadConfig.Rate * 3 / 4 // reduce by 25% // send metric return lc.sendLoadControllerTriggeredMetric([]string{"reduction:rate"}) }
[ 0.053431909531354904, 0.4695904552936554, 0.3841826915740967, -0.25871363282203674, -0.15341085195541382, -0.4611181616783142, 0.48086032271385193, -0.15314288437366486, 0.12716419994831085, -0.2136944830417633, -0.33445867896080017, -0.2791598439216614, -0.459850937128067, 0.9421361684799...
func (lc *ActivityDumpLoadController) reduceTracedEventTypes(old, new *ActivityDump) error { var evtToRemove model.EventType new.LoadConfig.TracedEventTypes = new.LoadConfig.TracedEventTypes[:0] reductionOrder: for _, evt := range TracedEventTypesReductionOrder { for _, tracedEvt := range old.LoadConfig.TracedEve...
[ -0.01877732388675213, 0.14003612101078033, 0.9037219882011414, -0.3057463765144348, 1.219580888748169, 0.0856989324092865, 1.1539101600646973, -0.30794069170951843, 0.15199169516563416, 0.642899215221405, -0.996320903301239, 0.01737375371158123, -0.21427084505558014, 0.33117902278900146, ...
func (lc *ActivityDumpLoadController) reduceDumpTimeout(new *ActivityDump) error { newTimeout := new.LoadConfig.Timeout * 3 / 4 // reduce by 25% if minTimeout := lc.adm.config.RuntimeSecurity.ActivityDumpLoadControlMinDumpTimeout; newTimeout < minTimeout { newTimeout = minTimeout } new.SetTimeout(newTimeout) //...
[ 0.30603504180908203, 0.1761212944984436, 0.6068347692489624, -0.6893109083175659, -0.1935642808675766, 0.15787898004055023, 0.5193752646446228, 0.07935547083616257, 0.5107753872871399, 0.4707406759262085, -0.42457038164138794, 0.19493862986564636, -0.3644564151763916, 0.40090999007225037, ...
func (Gender) EnumDescriptor() ([]byte, []int) { return file_user_proto_rawDescGZIP(), []int{0} }
[ -1.218248724937439, 0.44969916343688965, 0.5173957943916321, 0.11707592010498047, 0.34075480699539185, 0.46787330508232117, 0.18400029838085175, 0.20574790239334106, -0.6256759166717529, -0.21175126731395721, -1.036453127861023, 0.6924662590026855, -0.3468009829521179, 2.0450327396392822, ...
func (*LoginParams) Descriptor() ([]byte, []int) { return file_user_proto_rawDescGZIP(), []int{0} }
[ -0.5407208204269409, 0.05512864887714386, 0.1053384393453598, 0.04215538501739502, -0.22796498239040375, 0.24427998065948486, 0.12939061224460602, 0.13996373116970062, -0.43226808309555054, -0.07439535856246948, -0.9576069712638855, 0.6956197619438171, -1.0412817001342773, 0.53652954101562...
func (*UserInfo) Descriptor() ([]byte, []int) { return file_user_proto_rawDescGZIP(), []int{1} }
[ -0.25938817858695984, 0.21991725265979767, 0.30767664313316345, 0.43059444427490234, -0.4500223696231842, 0.09910029917955399, 0.6629112362861633, 0.356207937002182, -1.2887665033340454, -0.31647756695747375, -1.0877660512924194, 0.08640369027853012, -0.01035084668546915, 0.419094264507293...
func (*Result) Descriptor() ([]byte, []int) { return file_user_proto_rawDescGZIP(), []int{2} }
[ -0.6819248199462891, 1.1239609718322754, 0.39257684350013733, 0.7565339207649231, 0.14949104189872742, -0.14446580410003662, 1.0121815204620361, 0.12819038331508636, -0.3726441264152527, -0.7606172561645508, -1.2040140628814697, -0.013657649047672749, -0.20213504135608673, 0.42551571130752...
func (*NoneParam) Descriptor() ([]byte, []int) { return file_user_proto_rawDescGZIP(), []int{3} }
[ -0.16570287942886353, 1.0109423398971558, 0.4900220036506653, 0.2446361631155014, 0.13354834914207458, -0.1799464225769043, 1.019968867301941, -0.062153417617082596, -0.7886201739311218, -0.5093218088150024, -0.2816076874732971, 0.38190171122550964, -0.9102113246917725, 0.5213748216629028,...
func (sm *stateMachine) read() int8 { if sm.mi == len(sm.memory) { sm.memory = append(sm.memory, 0) return 0 // empty memory is always zero } else if sm.mi == -1 { // a bit of fiddling // don't actually go into negative space, rather, move the memory strip // to the right and change what is zero sm.memory...
[ -0.6512337327003479, -0.06663978099822998, 0.5948143005371094, -0.27120107412338257, -0.533420205116272, 0.1266917884349823, 0.11178357154130936, -0.0544443279504776, 0.7732527852058411, 0.12338677048683167, 1.0175057649612427, 0.6830949783325195, -1.2986234426498413, 0.32522904872894287, ...
func (m *tapeMemory) read() bool { if m.position == len(m.bits) { m.bits = append(m.bits, false) return false // empty memory is always zero } else if m.position == -1 { // a bit of fiddling // don't actually go into negative space, rather, move the memory strip // to the right and change what is zero m.b...
[ -0.7999385595321655, -0.23165372014045715, 0.6217933297157288, -0.4726148247718811, -1.0431420803070068, 0.9041624069213867, 0.04550505802035332, -0.8304210901260376, 0.20979197323322296, -0.02802540920674801, 0.6075610518455505, -0.1990351378917694, -0.8871437311172485, 0.3614214658737182...
func (m *MetricsProvider) LoopDevices() int { return 0 }
[ -1.297447681427002, 0.8115919232368469, 0.4981502592563629, 0.48966583609580994, -0.12520313262939453, 1.3891069889068604, 1.2338247299194336, -0.4319676458835602, 0.27827271819114685, 0.7868148684501648, 0.40494081377983093, 0.5663681626319885, -0.8684517741203308, 0.7303172945976257, -...
func (m *MetricsProvider) BackingStores() int { return 0 }
[ 0.25319504737854004, 0.876578152179718, 0.2109125703573227, 0.15781401097774506, -0.2670994699001312, 0.6883544325828552, 0.9215103983879089, -0.0684271976351738, 0.36895692348480225, 0.20824451744556427, 0.2549242079257965, -0.6847317814826965, -1.4851704835891724, -0.5158052444458008, ...
func Println(args ...interface{}){ fmt.Println(args...) }
[ 0.13487860560417175, -0.2746027112007141, 0.5094417333602905, 1.0126169919967651, 0.2605768144130707, 0.1404370367527008, -0.33845168352127075, 0.11991362273693085, -0.3596697151660919, -1.3102147579193115, -0.45852503180503845, 0.6236197352409363, 0.4551227390766144, 0.7382683157920837, ...
func (c *ClusterController) setupOnosConfig() error { if err := c.createOnosConfigConfigMap(); err != nil { return err } if err := c.createOnosConfigService(); err != nil { return err } if err := c.createOnosConfigDeployment(); err != nil { return err } if err := c.awaitOnosConfigDeploymentReady(); err != ...
[ -0.37728551030158997, 0.6198841333389282, 0.5666308403015137, 0.20343300700187683, 0.5933077335357666, -0.6034898161888123, 0.5105047821998596, -0.1959790140390396, -0.4971093237400055, 0.7463863492012024, -0.5371084213256836, -0.39923781156539917, 0.8172034025192261, 1.268301010131836, ...
func (c *ClusterController) createOnosConfigConfigMap() error { config, err := c.config.load() if err != nil { return err } // Serialize the change store configuration changeStore, err := json.Marshal(config["changeStore"]) if err != nil { return err } // Serialize the network store configuration network...
[ -0.9173248410224915, 0.13451465964317322, 0.3223879337310791, 0.06410740315914154, 0.03624613583087921, -0.6517090201377869, -0.3074324131011963, 0.05520067736506462, -0.06900658458471298, 0.48735007643699646, -0.7610714435577393, -0.5704228281974792, 0.08312217146158218, 0.359335690736770...
func (c *ClusterController) addSimulatorToConfig(name string) error { labelSelector := metav1.LabelSelector{MatchLabels: map[string]string{"app": "onos", "type": "config"}} pods, err := c.kubeclient.CoreV1().Pods(c.clusterID).List(metav1.ListOptions{ LabelSelector: labels.Set(labelSelector.MatchLabels).String(), }...
[ -1.7233213186264038, 0.7001806497573853, 0.5965364575386047, 0.15478616952896118, 0.2122737467288971, -0.25188377499580383, -0.2768404185771942, -0.20951193571090698, 0.189571350812912, 0.981947124004364, -0.7104930877685547, -0.1620733141899109, 0.14843451976776123, 0.9196729063987732, ...
func (c *ClusterController) addNetworkToConfig(name string, config *NetworkConfig) error { labelSelector := metav1.LabelSelector{MatchLabels: map[string]string{"app": "onos", "type": "config"}} pods, err := c.kubeclient.CoreV1().Pods(c.clusterID).List(metav1.ListOptions{ LabelSelector: labels.Set(labelSelector.Matc...
[ -1.4068862199783325, 0.23432199656963348, 0.6384531855583191, -0.41088154911994934, 0.7551226615905762, -0.20378345251083374, -0.056869786232709885, -0.24430668354034424, 0.042911313474178314, 0.5190790295600891, -1.017554521560669, -0.9178223609924316, -0.12052947282791138, 0.789880633354...
func (c *ClusterController) addSimulatorToPod(name string, pod corev1.Pod) error { command := fmt.Sprintf("onos devices add \"id: '%s', address: '%s:10161' version: '1.0.0' devicetype: 'Devicesim'\" --address 127.0.0.1:5150 --keyPath /etc/onos-config/certs/client1.key --certPath /etc/onos-config/certs/client1.crt", na...
[ -0.8026120662689209, 0.9265994429588318, 0.7127225995063782, 0.17881016433238983, -0.10855408012866974, 0.47583234310150146, 0.6356022953987122, -0.5091203451156616, 0.7277151942253113, 0.5375634431838989, -0.40890803933143616, 0.4732716977596283, 0.04438282921910286, -0.30628424882888794,...
func (c *ClusterController) addNetworkToPod(name string, port int, pod corev1.Pod) error { command := fmt.Sprintf("onos devices add \"id: '%s', address: '%s:%s' version: '1.0.0' devicetype: 'Stratum'\" --address 127.0.0.1:5150 --keyPath /etc/onos-config/certs/client1.key --certPath /etc/onos-config/certs/client1.crt",...
[ -0.7871476411819458, 0.5676539540290833, 0.7747970223426819, -0.47071295976638794, 0.643489420413971, 0.6790634989738464, 0.2434593141078949, -1.2389880418777466, -0.17527802288532257, 0.5017610192298889, -0.1726578027009964, -0.4983879029750824, -0.3821291923522949, -0.23229917883872986, ...
func (c *ClusterController) removeSimulatorFromConfig(name string) error { labelSelector := metav1.LabelSelector{MatchLabels: map[string]string{"app": "onos", "type": "config"}} pods, err := c.kubeclient.CoreV1().Pods(c.clusterID).List(metav1.ListOptions{ LabelSelector: labels.Set(labelSelector.MatchLabels).String(...
[ -1.2069990634918213, 0.32360509037971497, 0.27637779712677, 0.2967629134654999, -0.8809400200843811, -0.28156593441963196, -0.026298653334379196, -0.18581385910511017, -0.0026459863875061274, 0.8823347091674805, -0.2892097532749176, -0.28008121252059937, -0.5523627400398254, 0.815138459205...
func (c *ClusterController) removeNetworkFromConfig(name string, configMap *corev1.ConfigMapList) error { labelSelector := metav1.LabelSelector{MatchLabels: map[string]string{"app": "onos", "type": "config"}} pods, err := c.kubeclient.CoreV1().Pods(c.clusterID).List(metav1.ListOptions{ LabelSelector: labels.Set(lab...
[ -1.0165040493011475, -0.14754173159599304, 0.410525381565094, 0.013105591759085655, -0.033779215067625046, -0.36667367815971375, -0.023610984906554222, 0.3589484691619873, -0.04624878242611885, 0.4917558431625366, -0.8067132234573364, -0.9250531792640686, -0.6776238679885864, 0.47440603375...
func (c *ClusterController) removeSimulatorFromPod(name string, pod corev1.Pod) error { command := fmt.Sprintf("onos devices remove %s --address 127.0.0.1:5150 --keyPath /etc/onos-config/certs/client1.key --certPath /etc/onos-config/certs/client1.crt", name) return c.execute(pod, []string{"/bin/bash", "-c", command})...
[ -0.8172943592071533, 0.5411146283149719, 0.3667432963848114, 0.43415147066116333, -0.7438181638717651, -0.05172773450613022, 0.7349424958229065, -0.01265828125178814, 0.3812028765678406, 0.3798465132713318, -0.3441479504108429, 0.47104576230049133, -0.8658750653266907, -0.08945221453905106...
func (c *ClusterController) removeNetworkFromPod(name string, pod corev1.Pod) error { command := fmt.Sprintf("onos devices remove %s --address 127.0.0.1:5150 --keyPath /etc/onos-config/certs/client1.key --certPath /etc/onos-config/certs/client1.crt", name) return c.execute(pod, []string{"/bin/bash", "-c", command}) }
[ -0.9911701083183289, -0.24852655827999115, 0.4902709424495697, 0.1779475063085556, -0.019233549013733864, 0.37191516160964966, 0.39098668098449707, -0.11434934288263321, 0.11992895603179932, -0.014517703093588352, -0.6786577105522156, -0.29874375462532043, -0.9254467487335205, 0.0123069239...
func (c *ClusterController) createOnosConfigDeployment() error { nodes := int32(c.config.ConfigNodes) zero := int64(0) dep := &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "onos-config", Namespace: c.clusterID, }, Spec: appsv1.DeploymentSpec{ Replicas: &nodes, Selector: &metav1.Labe...
[ 0.09688757359981537, 0.22420784831047058, 0.4885236620903015, -0.3859529495239258, -0.12445363402366638, -0.14432424306869507, -0.0011338636977598071, 0.36129748821258545, -0.3555764853954315, 0.91856849193573, -0.5497117638587952, -0.2692059576511383, 0.8432533740997314, 0.265583008527755...
func (c *ClusterController) createOnosConfigService() error { service := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: "onos-config", Namespace: c.clusterID, }, Spec: corev1.ServiceSpec{ Selector: map[string]string{ "app": "onos", "type": "config", }, Ports: []corev1.ServiceP...
[ -0.8531674742698669, 0.4646320939064026, 0.052912455052137375, -0.07270514219999313, 0.392924964427948, -0.2047102004289627, -0.36231520771980286, -0.6417017579078674, -0.7218955755233765, 0.900338351726532, -0.6883304119110107, 0.1618889421224594, -0.165877103805542, 0.6819074749946594, ...
func (c *ClusterController) awaitOnosConfigDeploymentReady() error { labelSelector := metav1.LabelSelector{MatchLabels: map[string]string{"app": "onos", "type": "config"}} unblocked := make(map[string]bool) for { // Get a list of the pods that match the deployment pods, err := c.kubeclient.CoreV1().Pods(c.cluste...
[ -0.8173664212226868, 0.1279667615890503, 0.6360911726951599, -0.4077662229537964, 0.2503427565097809, -0.8848868012428284, -0.4300587773323059, 0.23253892362117767, -0.3297467827796936, 1.3794151544570923, -0.7029561996459961, 0.29449522495269775, 0.5008426904678345, 0.7044011354446411, ...
func (c *ClusterController) GetOnosConfigNodes() ([]NodeInfo, error) { configLabelSelector := metav1.LabelSelector{MatchLabels: map[string]string{"app": "onos", "type": "config"}} pods, err := c.kubeclient.CoreV1().Pods(c.clusterID).List(metav1.ListOptions{ LabelSelector: labels.Set(configLabelSelector.MatchLabels...
[ -1.4138634204864502, -0.1848990023136139, 0.16323073208332062, -0.0611356683075428, -0.05768290162086487, -0.2607310712337494, -0.687700092792511, -0.13119398057460785, -0.6446675062179565, 1.104271411895752, -0.8098021745681763, 0.10000988841056824, 0.3014926016330719, 0.25545570254325867...
func calMod(b, mod byte) byte { return b % mod }
[ 0.04296215996146202, 0.32511115074157715, 0.2539580166339874, 0.23373660445213318, -0.8738363981246948, 1.0801254510879517, -0.6277065277099609, 0.4235747754573822, 0.3940739333629608, 0.7701102495193481, -0.3170197308063507, 0.3173809349536896, -0.3053944408893585, -0.3009350895881653, ...
func nilcheckelim(f *Func) { // A nil check is redundant if the same nil check was successful in a // dominating block. The efficacy of this pass depends heavily on the // efficacy of the cse pass. idom := f.idom domTree := make([][]*Block, f.NumBlocks()) // Create a block ID -> [dominees] mapping for _, b := r...
[ 0.35541102290153503, -0.3897051215171814, 0.748965322971344, 0.5022886991500854, -0.5535188317298889, -0.2027077078819275, 1.3092070817947388, 0.07304864376783371, 0.18654511868953705, 0.40149909257888794, 0.10547282546758652, 0.004718689247965813, 0.6667461395263672, 0.5004033446311951, ...
func checkedptr(b *Block) *Value { if b.Kind == BlockCheck { return b.Control.Args[0] } if b.Kind == BlockIf && b.Control.Op == OpIsNonNil { return b.Control.Args[0] } return nil }
[ 0.8515928983688354, -0.3036205768585205, 0.675954282283783, 1.1049343347549438, -0.14325104653835297, -0.10348232835531235, 0.009374136105179787, -0.5889750123023987, 0.08230365812778473, 0.9421080350875854, 1.7460260391235352, 0.20187626779079437, -1.3548082113265991, 0.8161161541938782, ...
func nonnilptr(b *Block) *Value { if len(b.Preds) == 1 { bp := b.Preds[0].b if bp.Kind == BlockCheck { return bp.Control.Args[0] } if bp.Kind == BlockIf && bp.Control.Op == OpIsNonNil && bp.Succs[0].b == b { return bp.Control.Args[0] } } return nil }
[ 0.009630106389522552, -0.5208888649940491, 0.689183235168457, 0.9233461618423462, -0.6154770255088806, -0.1508365124464035, 0.04398714005947113, -0.3991365432739258, -0.407166987657547, 0.5348231792449951, 0.9881517291069031, -0.49996066093444824, -1.06100594997406, 1.016726016998291, 0....
func (obj *expense) Hash() hash.Hash { return obj.immutable.Hash() }
[ 0.1544874906539917, -0.5178850293159485, 0.442146897315979, 0.041260384023189545, -0.0805739313364029, 0.7736677527427673, 0.32271766662597656, 0.4371595084667206, 0.8377184271812439, 0.0988306999206543, -0.24304163455963135, 1.2862627506256104, -0.0018349841702729464, -0.7920322418212891,...
func (obj *expense) From() []hash.Hash { return obj.from }
[ 0.011563915759325027, -1.125166654586792, 0.5657849907875061, 0.3348967432975769, -0.19713547825813293, 0.2640290856361389, -0.560912013053894, -0.08946803212165833, 0.782002329826355, -0.07648470997810364, -0.2716255187988281, 0.389941543340683, 1.0263985395431519, -0.9617816209793091, ...
func (obj *expense) To() hash.Hash { return obj.to }
[ -0.49360647797584534, -0.23340457677841187, 0.5646068453788757, -1.028586745262146, 0.23069897294044495, -0.058298248797655106, 0.09178105741739273, 0.04050430282950401, 0.43378880620002747, 0.00772984279319644, -0.6202106475830078, 0.4796227514743805, 0.6697564721107483, -1.83190393447875...
func (obj *expense) CreatedOn() time.Time { return obj.immutable.CreatedOn() }
[ 0.06991442292928696, -0.4013979136943817, 0.5596771836280823, 0.23149432241916656, -0.36340028047561646, 0.5338135361671448, -0.6268328428268433, 0.9097362756729126, 0.44929978251457214, 0.3709339499473572, -0.9525725841522217, 0.005951761268079281, -0.13950106501579285, 0.1077342107892036...
func (obj *expense) Signatures() []signature.RingSignature { return obj.signatures }
[ -1.0373533964157104, -0.8579300045967102, 0.5850438475608826, -0.0794343501329422, 0.554046630859375, -0.25968310236930847, 0.6062270402908325, -0.2170848548412323, 0.9536092281341553, 0.5164148211479187, -1.2042263746261597, -1.1747671365737915, -0.4289950728416443, -0.32414817810058594, ...
func (obj *expense) HasRemaining() bool { return obj.remaining != nil }
[ -0.31759998202323914, -0.5463910102844238, 0.7461349964141846, -0.37137603759765625, 0.12969544529914856, -0.4014500677585602, -0.689226508140564, 0.42127129435539246, 0.40271878242492676, -0.024894574657082558, -1.2815572023391724, -1.0807950496673584, -0.22273650765419006, 0.365010261535...
func (obj *expense) Remaining() *hash.Hash { return obj.remaining }
[ -0.2768422067165375, -1.0217347145080566, 0.45017242431640625, -0.3021395802497864, -0.4828285872936249, 0.5221187472343445, -0.7839446067810059, -0.9928261637687683, 0.5589460730552673, -0.0637473315000534, -0.9029895067214966, -0.7221435308456421, -0.051178108900785446, -0.63623821735382...
func (obj *expense) MarshalJSON() ([]byte, error) { ins := createJSONExpenseFromExpense(obj) return json.Marshal(ins) }
[ -0.675778329372406, -0.6494623422622681, 0.5508524775505066, 0.45325660705566406, -0.6788702011108398, -0.4927598536014557, 0.2841108739376068, 0.47668689489364624, 1.823672890663147, 0.5702477693557739, -0.8530256152153015, 0.7162945866584778, 0.14229793846607208, -0.4923032224178314, 0...
func (obj *expense) UnmarshalJSON(data []byte) error { ins := new(jsonExpense) err := json.Unmarshal(data, ins) if err != nil { return err } pr, err := createExpenseFromJSON(ins) if err != nil { return err } insExpense := pr.(*expense) obj.immutable = insExpense.immutable obj.from = insExpense.from obj...
[ -0.8888026475906372, -0.42066657543182373, 0.841632068157196, -0.6330538988113403, -0.6384737491607666, -0.37901389598846436, 0.46792206168174744, 0.38360631465911865, 1.0427523851394653, 0.8805177211761475, -0.7591750025749207, -0.0751180648803711, -0.3183627128601074, -0.6701341867446899...
func UserID(ctx *context.APIContext) int64 { if ctx.User == nil { return 0 } return ctx.User.ID }
[ -0.13633589446544647, -0.22986067831516266, 0.4115397334098816, 0.3762514889240265, 0.44902896881103516, 0.670439600944519, 0.5945016741752625, 0.22979901731014252, 1.399516224861145, -0.35603347420692444, 0.606316864490509, 0.5050332546234131, -0.23178286850452423, 0.8928297162055969, -...
func PrintGreenF(writer io.Writer, format string, args ...interface{}) { PrintColorF(writer, "green", format, args...) }
[ 0.5227322578430176, -0.11731374263763428, 0.507473349571228, 0.12936532497406006, 0.5237966775894165, 0.5112514495849609, -0.45673173666000366, -0.35114097595214844, -1.388251543045044, -0.33552852272987366, -0.337433785200119, 0.9229653477668762, -0.15029580891132355, 0.5536945462226868, ...
func PrintRedF(writer io.Writer, format string, args ...interface{}) { PrintColorF(writer, "red", format, args...) }
[ 0.2288469672203064, 0.11401071399450302, 0.42160817980766296, 0.03883979842066765, 0.7214853763580322, -0.24619412422180176, -0.26295337080955505, -0.10374811291694641, -0.4143494963645935, -0.7878579497337341, -0.25901034474372864, 1.1666632890701294, 0.060291554778814316, 0.8614684939384...
func PrintColorF(writer io.Writer, color, format string, args ...interface{}) { format = fmt.Sprintf("[%s]%s[reset]", color, format) fmt.Fprint(writer, colorstring.Color(fmt.Sprintf(format, args...))) }
[ 0.4937070608139038, -0.5833687782287598, 0.4585683345794678, -0.37840983271598816, 1.2200813293457031, -0.4363150894641876, -0.33792543411254883, -0.08140641450881958, -1.0753207206726074, 0.12356778234243393, 0.39651432633399963, 1.1942609548568726, -0.05434056743979454, -0.00651812832802...
func DebugF(format string, args ...interface{}) { if env := os.Getenv(EnvDebug); len(env) != 0 { log.Printf("[DEBUG] "+format+"\n", args...) } }
[ 0.3217305839061737, 0.1599622666835785, 0.7125190496444702, 0.06930810958147049, 0.8640449047088623, -0.10145755112171173, -0.6517941951751709, 0.14083737134933472, -1.2300028800964355, -0.5223332047462463, 0.16221623122692108, 0.6627928018569946, 0.08413677662611008, 1.8872218132019043, ...
func (cli *CLI) Run(args []string) int { var ( version bool users strslice channel string webhookURL string name string iconEmojiPositive string iconEmojiNegative string msgNegative string ) flags := flag.NewFlagSet(Name, flag.ExitOnError) flags.SetO...
[ 0.3152652680873871, -0.134169802069664, 1.1266318559646606, 0.3128909468650818, 0.38223156332969666, 0.31180763244628906, 0.6935262084007263, 0.21013259887695312, -0.9633358120918274, 0.5038023591041565, -0.14952632784843445, 0.5541681051254272, -1.171892523765564, 1.0046777725219727, 0....
func (i *Invitation) EntityID() uuid.UUID { return i.ID }
[ 0.09691867232322693, -1.1914923191070557, 0.07817693054676056, 0.2691098749637604, 0.0834965929389, 1.2616482973098755, 0.6429871320724487, 1.5960607528686523, 0.6930977702140808, 1.047187089920044, 0.6482850909233093, 0.9492416381835938, 0.028285568580031395, 0.5005434155464172, -0.3274...
func (i *Invitation) AggregateVersion() int { return i.Version }
[ -0.7614390254020691, 0.5149351954460144, 0.33496224880218506, 0.4028438329696655, 0.4592253863811493, 0.18987484276294708, 0.7791698575019836, 0.9012812376022339, 0.1004856675863266, 1.2538865804672241, -0.5219962000846863, 0.14518344402313232, -0.6722204685211182, 0.057476706802845, 0.5...
func NewInvitationProjector() *InvitationProjector { return &InvitationProjector{} }
[ 0.0010009752586483955, 0.060010574758052826, -0.1890532523393631, 0.5282596349716187, -1.4733942747116089, -0.2824108898639679, -0.7742368578910828, -0.34065166115760803, 0.02628425322473049, 0.9147725701332092, -0.40904003381729126, -0.38780301809310913, -1.380605936050415, -0.52779847383...
func (p *InvitationProjector) ProjectorType() projector.Type { return projector.Type(InvitationAggregateType.String()) }
[ 0.03429694101214409, 0.5460543632507324, 0.3599179983139038, -0.2082936316728592, 0.19911718368530273, 0.7044274806976318, -0.020374588668346405, -0.28548115491867065, 0.4492659866809845, 1.0220266580581665, 1.3824405670166016, 0.136600524187088, -1.0094906091690063, 0.2762763500213623, ...
func (p *InvitationProjector) Project(ctx context.Context, event eh.Event, entity eh.Entity) (eh.Entity, error) { i, ok := entity.(*Invitation) if !ok { return nil, errors.New("model is of incorrect type") } // Apply the changes for the event. switch event.EventType() { case InviteCreatedEvent: data, ok := e...
[ -0.4395982325077057, 0.35419657826423645, 0.4645237922668457, 0.47935938835144043, -0.35222676396369934, 0.39625823497772217, -0.33952102065086365, 0.4547223150730133, 0.15364554524421692, 1.1981638669967651, -0.07586415112018585, -0.27818164229393005, -0.08235909789800644, -0.149815738201...
func (g *GuestList) EntityID() uuid.UUID { return g.ID }
[ -0.437223345041275, -0.832129955291748, 0.0769117996096611, 0.616721510887146, 0.2713982164859772, 1.62153959274292, 0.8201717138290405, 1.5725038051605225, 0.07128582149744034, 0.8846984505653381, -0.03492360934615135, 0.8360821604728699, 0.048624180257320404, 1.0251872539520264, -0.794...
func NewGuestListProjector(repo eh.ReadWriteRepo, eventID uuid.UUID) *GuestListProjector { p := &GuestListProjector{ repo: repo, eventID: eventID, } return p }
[ -0.06041158363223076, -0.2153317630290985, 0.20689240097999573, 0.338290810585022, -0.7513603568077087, 0.002562284702435136, -0.7674671411514282, 0.5072887539863586, 0.43068593740463257, 1.5926268100738525, -1.1939371824264526, -0.15444619953632355, -0.7866407036781311, -0.250881016254425...
func (p *GuestListProjector) HandlerType() eh.EventHandlerType { return eh.EventHandlerType("projector_GuestList") }
[ -0.1695665419101715, 0.5732507109642029, 0.43713292479515076, 1.1409803628921509, 0.5425743460655212, 0.8712537884712219, 1.0644298791885376, 1.1125203371047974, 0.11135955154895782, 0.3486102819442749, -0.18312989175319672, -0.6351358890533447, -0.0481538400053978, 0.9500235915184021, 0...
func (p *GuestListProjector) HandleEvent(ctx context.Context, event eh.Event) error { // NOTE: Temp fix because we need to count the guests atomically. p.repoMu.Lock() defer p.repoMu.Unlock() // Load or create the guest list. var g *GuestList m, err := p.repo.Find(ctx, p.eventID) if errors.Is(err, eh.ErrEntityN...
[ -0.4145403802394867, 0.7262997627258301, 0.48165830969810486, -0.15026040375232697, 0.9749059677124023, 0.48999735713005066, 0.48035550117492676, 0.9603222608566284, -0.1220412328839302, 0.6918666958808899, -0.5954498052597046, -0.7784945368766785, -0.15810148417949677, 0.590303897857666, ...
func (query SetQueryBuilder) Field(name string, value float64) SetQueryBuilder { query.fields = append(query.fields, Field{name, value}) return query }
[ 0.2547913193702698, 0.781112551689148, 0.15779578685760498, -0.3696722388267517, -0.24581333994865417, 1.2488293647766113, -0.8159546256065369, -0.7231104373931885, 0.5678893327713013, -0.733841598033905, -0.3004691004753113, -0.20409071445465088, -0.01916201412677765, 0.5371801853179932, ...
func (query SetQueryBuilder) IfNotExists() SetQueryBuilder { query.nx = true return query }
[ -0.5752361416816711, 0.09025377780199051, 0.17226001620292664, -0.1495875120162964, 0.3657703995704651, 0.12692703306674957, -0.858134388923645, -0.13109856843948364, 1.113196611404419, -0.5084561705589294, 0.5798333287239075, -0.21283096075057983, -0.560889482498169, 0.8934683799743652, ...