text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (puo *PhoneUpdateOne) ClearManufacturer() *PhoneUpdateOne { puo.mutation.ClearManufacturer() return puo }
[ -1.3265796899795532, 0.8444784283638, 0.09690199792385101, 1.3982855081558228, -1.0777181386947632, 0.5592696666717529, -0.8549270629882812, 0.14464038610458374, 1.0328797101974487, -0.36486145853996277, 0.12910917401313782, 0.6753044724464417, -0.21928556263446808, 0.4744208753108978, 0...
func (puo *PhoneUpdateOne) ClearOperatingSystem() *PhoneUpdateOne { puo.mutation.ClearOperatingSystem() return puo }
[ -1.3871123790740967, 0.963367760181427, 0.08432640135288239, 1.0868233442306519, -0.6667379140853882, 0.6735633611679077, -0.24840840697288513, -0.6658118963241577, 0.32543477416038513, -0.15106382966041565, 0.6110097765922546, -0.3869889974594116, 0.12808096408843994, -0.5940295457839966,...
func (puo *PhoneUpdateOne) Save(ctx context.Context) (*Phone, error) { var ( err error node *Phone ) puo.defaults() if len(puo.hooks) == 0 { if err = puo.check(); err != nil { return nil, err } node, err = puo.sqlSave(ctx) } else { var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) ...
[ -0.6419357657432556, 0.3100259304046631, 0.6352909207344055, 0.11910548806190491, 0.5844763517379761, -0.17535440623760223, 0.08057505637407303, -0.7259726524353027, -0.02308177761733532, 0.22888381779193878, 0.2006751298904419, -0.7923791408538818, -0.6602039337158203, -0.1080280020833015...
func (puo *PhoneUpdateOne) SaveX(ctx context.Context) *Phone { node, err := puo.Save(ctx) if err != nil { panic(err) } return node }
[ -0.8064107894897461, 0.9835273027420044, 0.547406017780304, 0.5413692593574524, -0.31072574853897095, 1.0772507190704346, -1.0083204507827759, 0.1607399582862854, 1.518405795097351, 0.11827052384614944, -0.7989954352378845, -0.6521821022033691, -0.7611029148101807, -0.22919481992721558, ...
func (puo *PhoneUpdateOne) Exec(ctx context.Context) error { _, err := puo.Save(ctx) return err }
[ -0.052105940878391266, 0.18761079013347626, 0.6268119215965271, 0.6951563358306885, 0.6582894325256348, 1.1535136699676514, -0.6554819941520691, 0.16930687427520752, 0.39147064089775085, 0.1434716284275055, -0.11212223023176193, -0.9804922938346863, -0.7092937231063843, -0.3604045808315277...
func (puo *PhoneUpdateOne) ExecX(ctx context.Context) { if err := puo.Exec(ctx); err != nil { panic(err) } }
[ 0.4144513010978699, 0.6917507648468018, 0.708617091178894, 0.6834025382995605, 0.2391287237405777, 1.2338231801986694, -1.0347096920013428, 0.32840031385421753, 0.7615343332290649, -0.29221785068511963, 0.1291997879743576, -0.0843782052397728, -0.16078732907772064, -0.18380211293697357, ...
func (puo *PhoneUpdateOne) defaults() { if _, ok := puo.mutation.ModifiedAt(); !ok { v := phone.UpdateDefaultModifiedAt() puo.mutation.SetModifiedAt(v) } }
[ -0.7613768577575684, 0.27915284037590027, 0.17440924048423767, 0.18812662363052368, 1.0194764137268066, -0.12293636798858643, -0.8622391819953918, -0.36146530508995056, 0.5387663841247559, -0.6800143718719482, -0.4362591505050659, -0.6878029108047485, -0.29122698307037354, 0.01208632439374...
func (puo *PhoneUpdateOne) check() error { if v, ok := puo.mutation.Name(); ok { if err := phone.NameValidator(v); err != nil { return &ValidationError{Name: "name", err: fmt.Errorf("ent: validator failed for field \"name\": %w", err)} } } if _, ok := puo.mutation.ManufacturerID(); puo.mutation.ManufacturerCl...
[ -0.4784114956855774, 0.3414471745491028, 0.5523500442504883, 0.522384762763977, 0.5520963072776794, 0.7910440564155579, -0.12661124765872955, -0.08535203337669373, 0.18561215698719025, 0.09958569705486298, 0.44726884365081787, -0.49373820424079895, -0.2743833065032959, 1.2277199029922485, ...
func NewWorker(id int, workerQueue chan chan WorkRequest) Worker { // Create, and return the worker. worker := Worker{ ID: id, Work: make(chan WorkRequest), WorkerQueue: workerQueue, QuitChan: make(chan bool)} return worker }
[ -0.6916705369949341, -0.9205625653266907, 0.3611687421798706, -0.30188071727752686, -0.40104037523269653, 0.278791606426239, -0.5817267298698425, -1.262211799621582, 0.5781478881835938, -0.4516228437423706, -1.0669503211975098, 0.19830119609832764, -0.2287614792585373, 0.3134131133556366, ...
func (w *Worker) Start() { go func() { for { // Add ourselves into the worker queue. w.WorkerQueue <- w.Work select { case work := <-w.Work: // Receive a work request. fmt.Printf("worker%d: Received work request %s\n", w.ID, work.URL) status, err := MakeRequest(work) if err != nil { ...
[ -0.7324261665344238, -0.37724167108535767, 0.6116316318511963, -0.5251702070236206, 0.06153660640120506, 0.1381945013999939, 0.39485201239585876, -0.3430362641811371, -1.1102122068405151, -0.22042983770370483, -0.7110398411750793, 0.8312100172042847, -0.5558244585990906, 0.4971044957637787...
func (w *Worker) Stop() { go func() { w.QuitChan <- true }() }
[ -0.770318329334259, 0.01311573851853609, 0.38147106766700745, -0.5345426201820374, 0.7363132834434509, 1.187652349472046, 0.4802711606025696, -0.20406928658485413, -0.8534179925918579, 0.13634391129016876, -1.2978253364562988, 0.6069340109825134, -0.9265194535255432, 0.771732747554779, -...
func handlerConfirm(w http.ResponseWriter, r *http.Request) { code := r.URL.Query()["code"][0] email, err := confirmations.Get(code).Result() if err != nil { errors.ReportAsJSON(w, err.Error(), http.StatusInternalServerError) return } if exists, err := users.Exists(email).Result(); err != nil || exists != 1 {...
[ -0.3776176869869232, -0.04045986756682396, 0.6408590078353882, 0.5410932898521423, 0.6141485571861267, -0.10786744952201843, -0.06143529340624809, 0.43070295453071594, -1.0043011903762817, 0.4183930456638336, -0.48647570610046387, 0.13293829560279846, 0.6543766260147095, 1.0869669914245605...
func sendRequest(req *graphql.Request) (interface{}, error) { ctx := context.Background() URL := os.Getenv("NOTIFICATIONS_URL") if URL == "" { return nil, fmt.Errorf("Missing required environment variable NOTIFICATIONS_URL") } client := graphql.NewClient(URL) client.Log = func(s string) { fmt.Println(s) } ...
[ -0.4138692617416382, 0.4481125771999359, 0.8034029603004456, 0.13960567116737366, 0.4061395525932312, 0.25779351592063904, -0.14703960716724396, -0.7056417465209961, -0.8522701859474182, 0.7633458971977234, 0.635117769241333, 1.1108330488204956, -0.10376299172639847, 0.18598105013370514, ...
func initOpsProcessedTotal() *prometheus.CounterVec { return promauto.NewCounterVec( prometheus.CounterOpts{ Name: "ent_operation_total", Help: "Number of ent mutation operations", }, entLabels, ) }
[ -0.2600823640823364, -0.03515838459134102, 0.7327696681022644, -0.8335557579994202, 0.6106177568435669, -0.2936473488807678, 0.9763008952140808, -0.17458806931972504, -0.39905646443367004, 0.1590183824300766, -0.10143440961837769, -0.10135052353143692, 0.8129803538322449, -0.63306522369384...
func initOpsProcessedError() *prometheus.CounterVec { return promauto.NewCounterVec( prometheus.CounterOpts{ Name: "ent_operation_error", Help: "Number of failed ent mutation operations", }, entLabels, ) }
[ -0.3448135256767273, 0.1436251997947693, 0.4992169439792633, -0.2658071517944336, 0.5387859344482422, 0.11357951164245605, 0.7834181785583496, -0.043553970754146576, -0.4954322874546051, -0.21214979887008667, 0.30438631772994995, 0.11429218202829361, 0.6776859760284424, -0.0920248851180076...
func initOpsDuration() *prometheus.HistogramVec { return promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "ent_operation_duration_seconds", Help: "Time in seconds per operation", }, entLabels, ) }
[ 0.08705296367406845, 0.8497527241706848, 0.543321967124939, 0.16051039099693298, 0.405534029006958, -0.02293860726058483, 0.7520374655723572, 0.5718653798103333, -0.47110140323638916, 0.4204258918762207, 0.19967617094516754, 0.14593763649463654, 1.147415280342102, 0.3242647647857666, -0....
func Hook() ent.Hook { opsProcessedTotal := initOpsProcessedTotal() opsProcessedError := initOpsProcessedError() opsDuration := initOpsDuration() return func(next ent.Mutator) ent.Mutator { return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { // Before mutation, start measuring ...
[ -0.8150092959403992, -0.0754876434803009, 0.7354686856269836, 0.2274221032857895, -0.21871565282344818, 0.6083277463912964, 0.35234692692756653, -0.7041258811950684, 0.06668908894062042, 0.39913034439086914, 0.7965368032455444, 0.5920027494430542, 1.4193087816238403, 0.028438467532396317, ...
func (*MessageSet) Descriptor() ([]byte, []int) { return file_internal_testprotos_messageset_messagesetpb_message_set_proto_rawDescGZIP(), []int{0} }
[ -0.6050406098365784, 0.17511892318725586, 0.27902695536613464, -0.9915679097175598, -0.013134823180735111, -0.339095801115036, 0.7296019196510315, -1.0824586153030396, -0.3237605392932892, -0.4686206579208374, 0.32667502760887146, 0.24729762971401215, 0.013799182139337063, 0.78273695707321...
func (*MessageSetContainer) Descriptor() ([]byte, []int) { return file_internal_testprotos_messageset_messagesetpb_message_set_proto_rawDescGZIP(), []int{1} }
[ -0.35961297154426575, 0.39488571882247925, 0.4073350429534912, -0.6689416170120239, -0.20612287521362305, -0.28875744342803955, 1.202512502670288, -1.4175384044647217, -0.20452889800071716, -0.616478681564331, 0.17323529720306396, 0.6486934423446655, 0.49144208431243896, 1.3451659679412842...
func NewCmd(f cmdutil.Factory, clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, cmFlags *genericclioptionscm.CMFlags, streams genericclioptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "get", Short: "get a resource", } cmd.AddCommand(clusters.NewCmd(cmFlags, streams)) cmd.AddComma...
[ 0.7444953322410583, -0.264019250869751, 0.6125248074531555, -0.06253696233034134, 0.2586909234523773, 0.35500219464302063, 0.5316107273101807, -0.035146523267030716, 0.07503817975521088, -0.982951283454895, 1.0608562231063843, 0.8510024547576904, 0.10649358481168747, 0.38166922330856323, ...
func New(m map[string]interface{}, publisher events.Publisher) (datatx.DataTX, error) { c, err := parseConfig(m) if err != nil { return nil, err } return &manager{ conf: c, publisher: publisher, statCache: cache.GetStatCache(c.Store, c.Nodes, c.Database, c.Table, time.Duration(c.TTL)*time.Second, c.Si...
[ 0.14121992886066437, -0.21142537891864777, 0.15787456929683685, -0.3826097548007965, -1.171953797340393, -0.3058530390262604, -0.615308403968811, 0.4336836338043213, -0.7046154737472534, -0.12537947297096252, -0.3768393397331238, -0.11703017354011536, 0.6581274271011353, 0.864763081073761,...
func NewRdbClient(options *redis.Options) (*RdbClient, error) { if options == nil { options = defaultOptions() } c := &RdbClient{ client: redis.NewClient(options), } _, err := c.client.Ping(context.Background()).Result() if err != nil { return nil, ErrorServiceNotReachable } return c, nil }
[ 0.07841043919324875, 0.599357008934021, 0.6117596626281738, 0.1738935112953186, -0.18450167775154114, -0.0292509738355875, -0.43497583270072937, -1.2049269676208496, -0.03065020591020584, 0.2184470295906067, -0.14396986365318298, 0.3846542537212372, -1.399751901626587, -0.3145405650138855,...
func (c *RdbClient) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error { s, err := json.Marshal(value) if err != nil { return err } return c.client.Set(ctx, key, s, expiration).Err() }
[ -0.9691271781921387, 0.2594297230243683, 0.3815038204193115, -0.6135329604148865, -0.3397466838359833, 0.19144003093242645, -1.5009657144546509, -0.8483598232269287, -0.2897800803184509, 1.1762478351593018, -0.4995943307876587, 0.7958793640136719, -0.34030401706695557, -0.10858455300331116...
func (c *RdbClient) Get(ctx context.Context, key string, value interface{}) error { s, err := c.client.Get(ctx, key).Result() if err != nil { if err == redis.Nil { return ErrorKeyNotExists } return err } return json.Unmarshal([]byte(s), value) }
[ -0.9997071027755737, 0.455215185880661, 0.8097637295722961, -0.48461219668388367, -0.29492875933647156, -0.49367934465408325, -1.6320252418518066, -0.9472478628158569, -0.6309150457382202, 1.014490008354187, 0.15857051312923431, 0.8235990405082703, -0.5933520793914795, -0.4566247761249542,...
func (c *RdbClient) Expire(ctx context.Context, key string, expiration time.Duration) error { b, err := c.client.Expire(ctx, key, expiration).Result() if err != nil { return err } if !b { return ErrorKeyNotExists } return nil }
[ -0.38158100843429565, 0.42604202032089233, 0.5277667045593262, 0.5128726959228516, 0.04410240054130554, -0.39313367009162903, -1.7783477306365967, -0.8651544451713562, -0.6784180998802185, 1.1257261037826538, 0.07518911361694336, -0.1006893515586853, -0.8029599785804749, 0.2403179705142974...
func (c *RdbClient) ReadTimeout() time.Duration { return c.client.Options().ReadTimeout }
[ 1.0214276313781738, 0.27524521946907043, 0.40018922090530396, -0.26454806327819824, 0.4205385446548462, 0.44386929273605347, -0.08141361176967621, -0.09933522343635559, -0.15696951746940613, 0.9220981597900391, 0.6179468035697937, 0.22256909310817719, -1.0040907859802246, -0.60739785432815...
func (c *RdbClient) WriteTimeout() time.Duration { return c.client.Options().WriteTimeout }
[ 0.4386560916900635, -0.11377790570259094, 0.33082789182662964, -0.4710126221179962, 1.2544313669204712, 0.18570223450660706, 0.663408637046814, 0.21639999747276306, -0.2640533447265625, 0.975382924079895, 0.022173620760440826, -0.07011919468641281, -1.4811499118804932, 0.10355381667613983,...
func (l *SensorListener) Accept() (connectorAddress string, state bool, err error) { // Keep looping until we get a notification message for { resp, err := l.conn.ReadResponse() if err != nil { return "", false, err } if strings.HasPrefix(resp, "sensornotify,") { resp = strings.TrimPref...
[ -0.22721277177333832, -1.179616093635559, 0.6821098327636719, -0.8478358387947083, -0.2960675060749054, -0.11473912000656128, -0.2880972921848297, 0.23169946670532227, -0.05995240807533264, 0.10486787557601929, 0.3323579430580139, -0.2735435664653778, -0.24447548389434814, 0.34093239903450...
func (l *SensorListener) Close() error { return l.conn.Close() }
[ 0.5162429809570312, -1.0450551509857178, 0.3549988269805908, -0.2424483299255371, -0.2840183973312378, 1.0933951139450073, -0.6132162809371948, -0.4397736191749573, -0.4237784743309021, -0.7135619521141052, 0.7466122508049011, -0.7102465033531189, -0.9915727376937866, 1.0715930461883545, ...
func (store *Store) Open() error { db, err := sql.Open("postgres", store.config.DatabaseURL) if err != nil { return err } if err := db.Ping(); err != nil { return err } store.db = db if err := store.createTables(); err != nil { return err } return nil }
[ -0.43456870317459106, 1.0373495817184448, 0.19898957014083862, 0.6186267137527466, -0.46591612696647644, 0.6431152820587158, 0.3386411964893341, 1.0786104202270508, -0.3986312747001648, 0.016284719109535217, -0.42219531536102295, 0.40697404742240906, -0.599316418170929, 0.3826327621936798,...
func Login(c *gin.Context) { phone := c.PostForm("phone") password := c.PostForm("password") //find user users, err := userModel.GetUsersByStrKey("phone", phone) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{ "msg": err.Error(), }) log.ErrorLog.Println(err) c.Error(err) return } // ...
[ -0.7514497637748718, -0.49630221724510193, 1.1690032482147217, 0.969589352607727, -0.17618125677108765, 0.42462167143821716, 0.5539090037345886, -0.4752854108810425, 0.612180233001709, 0.5686386227607727, -0.9381968379020691, -0.37501275539398193, 0.06760291755199432, 0.23323853313922882, ...
func (g *DeleteConsumerGroups) Run(globals *Globals) error { config := getSaramaConfig(globals.SourceAPIKey) admin, err := sarama.NewClusterAdmin(g.BrokerList, config) if err != nil { return err } // List consumergroups on the source cluster consumergroups, err := admin.ListConsumerGroups() if err != nil { ...
[ 0.3694334924221039, -0.023127751424908638, 0.6943947076797485, 0.20060445368289948, 0.055270008742809296, -0.33533263206481934, 0.37019479274749756, -0.1731305867433548, -0.318735808134079, 1.2293107509613037, -0.2379193902015686, 1.0041099786758423, -1.2161633968353271, 1.0643901824951172...
func ReadEncoderBoundaryPoint(data io.Reader) (ebp EncoderBoundaryPoint, err error) { dataFieldTag := []byte{byte(0)} if _, err := data.Read(dataFieldTag); err != nil { return nil, err } switch dataFieldTag[0] { case ComcastEbpTag: ebp, err = readComcastEbp(data) case CableLabsEbpTag: ebp, err = readCableL...
[ 0.12186547368764877, -0.8026684522628784, 0.6012529134750366, 0.46259909868240356, 0.3382582664489746, 0.7976134419441223, -0.3346208333969116, -0.7218934893608093, -0.1651734709739685, 0.5550850629806519, -0.004795340355485678, 0.7323474884033203, -1.1579296588897705, 0.5192598700523376, ...
func timeTrack(start time.Time, name string) { elapsed := time.Since(start) fmt.Printf("%s took %s \n", name, elapsed) }
[ 0.4701649248600006, 0.4454474151134491, 0.7105074524879456, -0.7642012238502502, -0.6898398995399475, 0.4991747736930847, 0.04180522635579109, -0.09824182093143463, -1.051151156425476, 0.7311318516731262, -1.0631582736968994, 0.4320111870765686, 0.07071206718683243, 0.88048255443573, -0....
func findGoldbachException() int { defer timeTrack(time.Now(), "findGoldbachException()") const LIMIT = 10000 primeList, compositeList := listPrimesAndOddComposites(LIMIT) resultsMap := make(map[int]bool) // the largest number that the integer portion can be and still have a result less than 'lim' integerLimit...
[ -0.7800519466400146, 0.32649192214012146, 0.8787884712219238, -0.23009972274303436, -0.20369072258472443, 0.4970580041408539, 0.8162581324577332, 0.04654655605554581, 0.23329968750476837, -0.029888618737459183, -0.42085763812065125, -0.4014279842376709, -1.9916085004806519, 1.2195456027984...
func New() *Server { dlog.Server.Info("Starting server", version.String()) s := Server{ sshServerConfig: &gossh.ServerConfig{ Config: gossh.Config{ KeyExchanges: config.Server.KeyExchanges, Ciphers: config.Server.Ciphers, MACs: config.Server.MACs, }, }, catLimiter: make(chan str...
[ -0.5833401083946228, -0.7170760035514832, 0.4379461109638214, -0.24527844786643982, -0.5147997736930847, 0.22281666100025177, -0.8149108290672302, 0.4614989757537842, -0.15145671367645264, 0.13056409358978271, -1.147573709487915, 0.5739269256591797, -0.07645545154809952, 0.8041829466819763...
func (s *Server) Callback(c gossh.ConnMetadata, authPayload []byte) (*gossh.Permissions, error) { user, err := user.New(c.User(), c.RemoteAddr().String()) if err != nil { return nil, err } authInfo := string(authPayload) splitted := strings.Split(c.RemoteAddr().String(), ":") remoteIP := splitted[0] switch...
[ 0.43774572014808655, 0.2716310918331146, 0.9070038199424744, 0.4112517535686493, -0.47705844044685364, 0.33173510432243347, 0.2630314528942108, -0.058671969920396805, 0.16080370545387268, 0.44026556611061096, 0.675294041633606, 0.047731366008520126, -0.1060696467757225, 0.27750200033187866...
func ZoneToLocation(zone string) (string, error) { l := strings.Split(zone, "-") if len(l) != 2 { return "", fmt.Errorf("invalid Azure zone: %q ", zone) } return l[0], nil }
[ -0.7219622135162354, -1.0286016464233398, 0.443361759185791, -0.3784410357475281, -0.20251907408237457, 0.27658745646476746, 1.409460186958313, 0.1492844820022583, 0.8805395364761353, 0.3343726098537445, -0.02564593032002449, 0.26706463098526, -0.34386637806892395, -0.6883063912391663, 0...
func ZoneToAvailabilityZoneNumber(zone string) (string, error) { l := strings.Split(zone, "-") if len(l) != 2 { return "", fmt.Errorf("invalid Azure zone: %q ", zone) } return l[1], nil }
[ -0.942766547203064, -1.1614596843719482, 0.531438946723938, -0.22980593144893646, -0.4275831878185272, 0.20847642421722412, 1.2333495616912842, 1.2100120782852173, 0.846127450466156, 0.2936343848705292, -0.31814044713974, 0.44695088267326355, -0.05190786346793175, -0.10824327170848846, 1...
func NewPool(numWorkers int, jobQueueLen int) *Pool { jobQueue := make(chan Job, jobQueueLen) workerPool := make(chan *worker, numWorkers) pool := &Pool{ JobQueue: jobQueue, dispatcher: newDispatcher(workerPool, jobQueue), } return pool }
[ 0.29705798625946045, -0.8980217576026917, 0.44863182306289673, -0.38139501214027405, -0.5434257984161377, -0.06150183081626892, -0.03410063311457634, -0.2181370109319687, 0.10623261332511902, -0.9519129395484924, -0.34459879994392395, 0.7289453744888306, 0.44312021136283875, 0.097134672105...
func (p *Pool) JobDone() { p.wg.Done() }
[ 0.8481962084770203, -0.21545098721981049, 0.28020918369293213, 0.422219842672348, 0.6163087487220764, 1.651287317276001, 0.37000414729118347, -0.10734368860721588, -2.0622315406799316, -0.2256881147623062, -0.21662282943725586, 0.8569125533103943, -0.5582430958747864, 0.630776047706604, ...
func (p *Pool) WaitCount(count int) { p.wg.Add(count) }
[ -0.18012748658657074, 0.2850835621356964, 0.48648104071617126, 0.017361588776111603, 0.5933865904808044, 0.8451430201530457, 0.9334933161735535, 0.20382480323314667, -1.6266430616378784, -0.05418509244918823, -0.7681077122688293, -0.4872554540634155, -0.3920404016971588, 0.3993588984012604...
func (p *Pool) WaitAll() { p.wg.Wait() }
[ 0.6473640203475952, -0.47694623470306396, 0.22599081695079803, 0.2517704367637634, 0.6858291029930115, 1.729896903038025, 0.013936505652964115, 0.1580791026353836, -0.9665495753288269, -0.34017884731292725, 0.12969952821731567, 0.9687321186065674, -0.35369929671287537, 1.206580638885498, ...
func NewAttachment(ctx *pulumi.Context, name string, args *AttachmentArgs, opts ...pulumi.ResourceOption) (*Attachment, error) { if args == nil { return nil, errors.New("missing one or more required arguments") } if args.InstanceIds == nil { return nil, errors.New("invalid value for required argument 'Instance...
[ -0.16957776248455048, 0.5663549304008484, 0.40916869044303894, -0.16723105311393738, 0.0024627982638776302, 1.035096526145935, -0.08728963136672974, -0.4568714201450348, 0.07874635607004166, 0.6604559421539307, 0.30906009674072266, -0.10379157960414886, -0.5457172989845276, 0.1941044777631...
func GetAttachment(ctx *pulumi.Context, name string, id pulumi.IDInput, state *AttachmentState, opts ...pulumi.ResourceOption) (*Attachment, error) { var resource Attachment err := ctx.ReadResource("alicloud:slb/attachment:Attachment", name, id, state, &resource, opts...) if err != nil { return nil, err } retur...
[ 0.4762875735759735, -0.2528941035270691, 0.12079624086618423, 0.24160224199295044, 0.09499915689229965, 0.5286475419998169, -0.22911345958709717, -0.6354032158851624, 1.3660417795181274, -0.011999521404504776, 0.5765438079833984, 0.8102473020553589, 0.07025863975286484, -1.0313163995742798...
func (o AttachmentOutput) BackendServers() pulumi.StringOutput { return o.ApplyT(func(v *Attachment) pulumi.StringOutput { return v.BackendServers }).(pulumi.StringOutput) }
[ 0.28761160373687744, -0.35075491666793823, 0.6395120024681091, -0.35892289876937866, 0.9633434414863586, 0.6063649654388428, 0.18199226260185242, -0.6180089712142944, 0.7300013303756714, -0.2758848965167999, -0.4318420886993408, 1.3078856468200684, -0.426095187664032, -1.4756516218185425, ...
func (o AttachmentOutput) DeleteProtectionValidation() pulumi.BoolPtrOutput { return o.ApplyT(func(v *Attachment) pulumi.BoolPtrOutput { return v.DeleteProtectionValidation }).(pulumi.BoolPtrOutput) }
[ 0.6071220636367798, -0.5963071584701538, 0.7071939706802368, 0.7777940034866333, -0.1303389072418213, 1.009326457977295, 0.20103518664836884, 0.366104394197464, 1.2502388954162598, 0.13836565613746643, 0.05582211911678314, -0.09424761682748795, -0.5548364520072937, -1.4752216339111328, -...
func (o AttachmentOutput) InstanceIds() pulumi.StringArrayOutput { return o.ApplyT(func(v *Attachment) pulumi.StringArrayOutput { return v.InstanceIds }).(pulumi.StringArrayOutput) }
[ -0.5758631825447083, -0.7504718899726868, 0.5406646728515625, -0.6499786376953125, 0.10115619748830795, 0.961694061756134, -0.19700416922569275, -0.10479910671710968, 0.3701283633708954, 0.2745536267757416, -0.4112124443054199, 1.5094473361968994, -0.5049945116043091, -0.5790032148361206, ...
func (o AttachmentOutput) LoadBalancerId() pulumi.StringOutput { return o.ApplyT(func(v *Attachment) pulumi.StringOutput { return v.LoadBalancerId }).(pulumi.StringOutput) }
[ 1.2750698328018188, -0.6237402558326721, 0.5131661295890808, -0.583636999130249, -0.026394004002213478, 1.364461064338684, -1.0797414779663086, -0.42653888463974, 0.6658154726028442, -0.2818871736526489, 0.555859386920929, 1.1166154146194458, -0.23330514132976532, -0.31375759840011597, 0...
func (o AttachmentOutput) ServerType() pulumi.StringPtrOutput { return o.ApplyT(func(v *Attachment) pulumi.StringPtrOutput { return v.ServerType }).(pulumi.StringPtrOutput) }
[ 0.4448040723800659, -0.18952018022537231, 0.5572916865348816, -0.4940955638885498, 0.7117384076118469, 0.9473247528076172, 0.2403171807527542, -0.3342702388763428, 1.2856541872024536, -0.3182418644428253, 0.16454410552978516, 1.6440727710723877, -0.6625135540962219, -0.6278553009033203, ...
func (o AttachmentOutput) Weight() pulumi.IntPtrOutput { return o.ApplyT(func(v *Attachment) pulumi.IntPtrOutput { return v.Weight }).(pulumi.IntPtrOutput) }
[ 0.65262371301651, -0.7374009490013123, 0.552172839641571, 0.3144969940185547, -0.1338696926832199, 0.5923634171485901, 0.8614070415496826, -0.1722341626882553, 0.4596153497695923, -0.20200082659721375, 0.4628722667694092, 0.21570703387260437, -0.1126309335231781, -0.910978376865387, 0.33...
func (a *Sortable) Len() int { return len(a.List) }
[ -0.01493507344275713, 0.025087323039770126, 0.03318336233496666, -0.16306930780410767, 0.1839245706796646, -0.2502219080924988, 0.6422190070152283, 0.8092698454856873, 0.012943404726684093, -0.5675653219223022, -1.039617657661438, 0.23589852452278137, 0.49268749356269836, 0.203092575073242...
func (a *Sortable) Less(i, j int) bool { return a.Cmp(a.List[i], a.List[j]) < 0 }
[ -0.1827014535665512, -0.19106771051883698, 0.3530488908290863, -0.3638300597667694, -0.595718264579773, -0.01656670682132244, -0.3830089569091797, -1.2359322309494019, -0.6021763682365417, -0.5496125817298889, -0.8510319590568542, -0.49909013509750366, -0.5154064297676086, 0.62451130151748...
func (a *Sortable) Swap(i, j int) { a.List[i], a.List[j] = a.List[j], a.List[i] }
[ -1.6806567907333374, -0.3239084780216217, 0.2868380546569824, -0.07403254508972168, 0.04561552405357361, 0.3170318305492401, -0.10929884016513824, 0.18635134398937225, -0.691119909286499, -0.29099416732788086, -0.715053141117096, 0.040810391306877136, 0.30572590231895447, -0.32703757286071...
func NewConsumerManager() (ConsumerManager, error) { conf := GetConfigFromEnv() return NewConsumerManagerFromConfig(&conf) }
[ -0.3601990044116974, -1.387197732925415, 0.28777801990509033, 0.9447088837623596, -0.39328357577323914, -0.9428268074989319, -0.9527063369750977, -0.42349132895469666, 0.24921205639839172, 0.47117379307746887, -0.6892564296722412, 0.48472389578819275, -0.6918651461601257, 1.897313117980957...
func (cm *consumerManager) Add(queueName string, consumer rmq.Consumer) { cm.consumers[queueName] = consumer }
[ -0.24168197810649872, -1.7054550647735596, 0.31453853845596313, -0.22508522868156433, -0.07905150949954987, -0.3321915566921234, -0.8899667263031006, -0.4289475679397583, 0.3752758502960205, 0.5948145389556885, 0.1205272525548935, 0.932927668094635, -0.9326530694961548, 1.1184059381484985,...
func (cm *consumerManager) StartConsuming(queueName string, replicas int, pollDuration time.Duration) { cm.mutex.Lock() defer cm.mutex.Unlock() consumer, exists := cm.consumers[queueName] if !exists { panic(fmt.Errorf("there is no consumer for queue `%s`", queueName)) } cm.queues[queueName] = cm.conn.OpenQueue...
[ -0.3301478922367096, -0.15933109819889069, 0.7988482117652893, -0.17727410793304443, -0.36116066575050354, -0.28911441564559937, -0.5002335906028748, 0.5503020882606506, 0.025586551055312157, 0.8243975043296814, -0.28239211440086365, 0.5374956727027893, 0.12653881311416626, 0.4888280034065...
func (cm *consumerManager) StopConsuming(queueName string) { cm.queues[queueName].StopConsuming() }
[ -1.0791165828704834, -1.2985674142837524, 0.17282943427562714, -0.8849272727966309, -0.521450400352478, -0.37527886033058167, 0.10200521349906921, -0.22504772245883942, -0.7512194514274597, 1.412623643875122, -0.31743600964546204, -0.5829287767410278, -0.6103066205978394, 0.348160922527313...
func (t *Transcript) AppendMessage(label []byte, src []byte) { storeMeta(&t.strobe, label, src) t.strobe.Ad(src, false) }
[ -0.10525767505168915, 0.9132055044174194, 0.3628830313682556, -0.3911031484603882, 0.34074047207832336, 0.28404003381729126, -0.9558068513870239, -0.12057673186063766, 0.3393602669239044, 0.6060844659805298, -0.2961769998073578, 0.678165853023529, -0.9323010444641113, 0.9713163375854492, ...
func (t *Transcript) ChallengeBytes(label []byte, dest []byte) { storeMeta(&t.strobe, label, dest) t.strobe.Prf(dest, false) }
[ -0.10302603244781494, 0.039419226348400116, 0.3379037082195282, 0.026810847222805023, -0.29178959131240845, 0.3388643264770508, -0.7747915983200073, 0.456592857837677, -0.048560064285993576, 1.447040319442749, -1.056117296218872, 0.4137544333934784, -1.0861303806304932, -0.3403449356555938...
func (t *TranscriptRngBuilder) RekeyWithWitness(label []byte, src []byte) { storeMeta(&t.strobe, label, src) t.strobe.Key(src, false) }
[ 0.3594595193862915, -0.3819980323314667, 0.2838733196258545, 0.09826900064945221, 0.28777632117271423, -0.11422193050384521, -0.20897066593170166, 0.09832379966974258, 0.11038408428430557, 1.2606570720672607, -1.1021208763122559, 0.8329523205757141, -0.7182996273040771, 0.01080456003546714...
func (t *TranscriptRngBuilder) Finalize(rng io.Reader) *TranscriptRng { entropy := make([]byte, 32) _, _ = rng.Read(entropy) t.strobe.MetaAd([]byte("rng"), false) t.strobe.Key(entropy, false) return &TranscriptRng{ t.strobe.Clone(), } }
[ -0.8131137490272522, 0.45439833402633667, 0.4012320935726166, -1.2457464933395386, -0.8344816565513611, -0.3460696041584015, -0.36908507347106934, -0.4165259599685669, 0.2381664663553238, 0.8808684945106506, -0.47027117013931274, 0.09775614738464355, -1.119565486907959, -0.2099882811307907...
func (t *TranscriptRng) Read(dest []byte) (n int, err error) { n, err = len(dest), nil if n > MaxBufferLength { panic("Buffer length " + string(n) + " is more then max allowed (2^32)") } bytes := encodeU32(uint32(n)) t.strobe.MetaAd(bytes, false) t.strobe.Prf(dest, false) return }
[ -0.35254254937171936, 0.9329439401626587, 0.5598437190055847, -0.4991646707057953, -1.0838816165924072, 0.20810402929782867, -0.2743595540523529, -0.4179633855819702, 0.24453061819076538, 0.6114308834075928, -0.699627161026001, 0.6267281174659729, -0.7014041543006897, -0.08810268342494965,...
func (g *GeneratedModuleProvider) ToSource(componentPackage string) string { moduleVariableName := SanitizeName(g.resolvedType.Module.Name) returnType := "target_pkg." + g.resolvedType.Name.Obj().Name() if g.resolvedType.IsPointer { returnType = "*" + returnType } var builder strings.Builder builder.WriteStrin...
[ -1.1681543588638306, -0.04764113202691078, 0.6360990405082703, -0.9125761389732361, 0.5694069266319275, -0.3788355886936188, 0.9171060919761658, 0.19352169334888458, 0.014770163223147392, 1.0923840999603271, -0.07862024754285812, 0.33437955379486084, 0.26483237743377686, 0.1934512555599212...
func UCDReader(file string) (io.Reader, error) { data, err := os.ReadFile(UCDPath(file)) if err != nil { return nil, err } return bytes.NewReader(data), nil }
[ 0.12968657910823822, 0.008867784403264523, 0.37251079082489014, -0.8784427642822266, -0.6963940858840942, 1.3306764364242554, -0.14333383738994598, 0.756813108921051, -0.9136551022529602, -0.4629659950733185, 0.7998997569084167, 0.2171599417924881, -0.0492648109793663, -0.6958263516426086,...
func UCDPath(file string) string { _, pkgdir, _, ok := runtime.Caller(0) if !ok { panic("no debug info") } return filepath.Join(filepath.Dir(pkgdir), "ucd", file) }
[ 0.3852042257785797, 0.20219124853610992, 0.7098075151443481, 0.010715054348111153, -0.19477684795856476, 1.5839301347732544, 1.524210810661316, 0.278110146522522, -0.470513254404068, 0.13327236473560333, 0.8170364499092102, -0.8826130628585815, 0.3241442143917084, 0.5797227025032043, 0.0...
func (store *Storage) Save(key []byte, value []byte) error { err := store.db.Put(store.writeOptions, key, value) if err != nil { fmt.Println("Write data to RocksDB failed!") return err } return nil }
[ -0.24681158363819122, 0.3144508898258209, 0.34135326743125916, -0.5606954097747803, 1.0573711395263672, 0.3407043516635895, -0.050452813506126404, -0.6121595501899719, -0.6042225360870361, 0.9048094153404236, -1.127764344215393, -0.30651530623435974, -1.5450317859649658, -0.395854383707046...
func (store *Storage) SaveValue(value []byte) ([]byte, error) { key := tmhash.Sum(value) return key, store.Save(key, value) }
[ -0.22445321083068848, 0.4689605236053467, 0.5351895093917847, 0.19287240505218506, 0.09001529216766357, -0.06878764927387238, 0.08163119852542877, 0.25711214542388916, 0.3403681218624115, 1.0445924997329712, -1.5125840902328491, -1.3500895500183105, -0.3668797016143799, 0.6391531825065613,...
func (store *Storage) Get(key []byte) ([]byte, error) { slice, err := store.db.Get(store.readOptions, key) if err != nil { fmt.Println("Get data from RocksDB failed!") return nil, err } return slice.Data(), nil }
[ -0.78940349817276, 0.3522334396839142, 0.6157807111740112, -0.477162629365921, 0.5039255023002625, 0.1338299810886383, -1.2060242891311646, -0.6001368165016174, -0.0529632531106472, 0.8178028464317322, -0.28357023000717163, 0.3951799273490906, -1.0448912382125854, -0.5905724167823792, 0....
func OpenDB(path string) (*gorocksdb.DB, error) { options := gorocksdb.NewDefaultOptions() options.SetCreateIfMissing(true) bloomFilter := gorocksdb.NewBloomFilter(10) readOptions := gorocksdb.NewDefaultReadOptions() readOptions.SetFillCache(false) rateLimiter := gorocksdb.NewRateLimiter(10000000, 10000, 10) ...
[ 0.030723456293344498, 0.886038064956665, 1.0901808738708496, 0.6396491527557373, 0.1721057891845703, -0.04498700425028801, 1.0673450231552124, -0.31122732162475586, 0.0905357301235199, 0.30287209153175354, -0.022685784846544266, -0.21393413841724396, -0.7755861282348633, 0.5631577372550964...
func (store *Storage) Close() { store.db.Close() }
[ 0.19150786101818085, 0.1506454199552536, 0.23156489431858063, 0.7185050845146179, -0.29435092210769653, 0.6560667753219604, -0.06739477068185806, -0.2332742065191269, -0.04600542411208153, -0.39412921667099, 0.0513492152094841, -0.18114082515239716, -0.7404008507728577, 1.3531017303466797,...
func NeverUseSHA1() error { password := "pleasedontshare1234" var output []byte hash := sha1.New() hash.Sum([]byte(password)) _, err := hash.Write(output) if err != nil { return fmt.Errorf("so sad %w", err) } fmt.Println("Output: " + string(output)) return nil }
[ -0.8575183749198914, -0.06300228089094162, 0.6735597848892212, 0.4189497232437134, 0.17640851438045502, 0.4098181426525116, 0.6893022060394287, 0.2840060889720917, 0.12261158227920532, -0.15400318801403046, -0.006055659148842096, 0.053900912404060364, -0.7160796523094177, 0.584993183612823...
func testDownloadAndToHTML(t *testing.T) { pageID := "92dd7aedf1bb4121aaa8986735df3d13" client := &notionapi.Client{} page, err := client.DownloadPage(pageID) assert.NoError(t, err) html := ToHTML(page) assert.True(t, len(html) > 0) }
[ 0.2782493829727173, 0.07918238639831543, 0.585704505443573, -0.22118282318115234, 0.39572277665138245, 0.18816149234771729, -0.349533349275589, 0.2682839334011078, 0.9154446721076965, -0.2230711728334427, 0.37744268774986267, -0.0630555972456932, 0.15178470313549042, 0.7225821614265442, ...
func (s *BatchProvidingSystem) Stat(ctx context.Context) (BatchedProviderStats, error) { // TODO: Does it matter that there is no locking around the total+average values? return BatchedProviderStats{ TotalProvides: s.totalProvides, LastReprovideBatchSize: s.lastReprovideBatchSize, AvgProvideDuration: ...
[ 0.07129785418510437, 0.3003482222557068, 0.23906974494457245, -0.01825660839676857, 0.7428359985351562, 0.01180068776011467, 0.32099634408950806, -0.5159573554992676, 0.7622849345207214, 0.11050616949796677, -0.2976844906806946, 1.1995410919189453, 0.1776476353406906, 0.5007153749465942, ...
func (hand *Handle) Equals(el interface {}) (bool) { other, ok := el.(*Handle) if !ok { return false; } return hand == other }
[ -0.9345623850822449, -0.6631247401237488, 0.29085713624954224, 0.5111794471740723, 0.30037203431129456, 0.8540225028991699, -0.2934843897819519, -0.7436034083366394, 0.5830156207084656, -0.8377959132194519, -0.7348792552947998, 0.029517289251089096, -0.016434673219919205, 0.287718385457992...
func (hash *SpaceHash) Equals(el interface {}) (bool) { other, ok := el.(*SpaceHash) if !ok { return false; } return hash == other }
[ 0.023680558428168297, -0.052554138004779816, 0.1815451979637146, 0.7684749960899353, 0.16343361139297485, 0.5718610882759094, -0.7819227576255798, -0.32866042852401733, 0.7978708148002625, -0.6973931789398193, -0.6603648066520691, 0.18077600002288818, 0.21109208464622498, 0.971500098705291...
func (hash * SpaceHash) clearHash() { for i:=0; i<hash.numcells; i++ { hash.clearHashCell(i) } }
[ 1.1347042322158813, 0.5269598364830017, 0.3977404236793518, 1.1655892133712769, 0.029559608548879623, 0.4041394293308258, -0.17964929342269897, -0.41293415427207947, -0.3848617672920227, -0.15038247406482697, 0.4908048212528229, 0.9714744091033936, 0.04308723285794258, 0.8837261199951172, ...
func (bin *SpaceHashBin) containsHandle(hand *Handle) (bool) { if bin != nil { if (bin.handle == hand) { return true } bin = bin.next } return false }
[ 0.5214930772781372, 0.0357523038983345, 0.38765180110931396, 0.4801550805568695, -0.298967570066452, 1.334786057472229, 0.07592041045427322, -0.5310090780258179, 0.18964533507823944, -1.2370227575302124, 0.09289508312940598, 0.44062522053718567, -1.2614381313323975, 0.8634978532791138, -...
func (hash * SpaceHash) getEmptyBin() (* SpaceHashBin) { bin := hash.pooledBins if bin != nil { hash.pooledBins = bin.next return bin } // Pool is exhausted, make more count := 100 buffer := make([]SpaceHashBin, count) hash.allocatedBuffers.Push(buffer) // push all but the first one, ret...
[ -0.2613820433616638, 0.4560789167881012, 0.8830981850624084, 0.19593706727027893, 0.6992611885070801, 0.7546915411949158, 0.3937014937400818, -0.7731061577796936, 0.294615238904953, -0.5682655572891235, -0.17093664407730103, 1.3718464374542236, -0.862928032875061, 1.0194878578186035, 0.5...
func hash_func(x, y, n HashValue) (HashValue) { return (x*1640531513 ^ y*2654435789) % n }
[ 0.8689253926277161, 0.9810546040534973, 0.2812507450580597, 0.24721485376358032, -0.4016176760196686, -0.44825080037117004, 0.27200016379356384, -0.7240639328956604, -0.40821322798728943, -0.5574402809143066, -0.07012681663036346, 0.5570377111434937, 1.2028478384017944, -0.7209405899047852...
func (f Float) floor_int() (int) { i := int(f) if f < Float(0.0) && f != Float(i) { return i - 1 } return i }
[ 0.6149054169654846, -0.31111204624176025, 0.2915845215320587, -0.06932083517313004, -0.2515208423137665, 0.7808623909950256, 1.2354211807250977, -0.35386988520622253, -1.6006128787994385, -0.7668794989585876, 0.5411742925643921, -0.7559751868247986, -1.0401315689086914, 1.512315034866333, ...
func handleRehashHelper(bin, data HashElement) { var hand * Handle = bin.(*Handle) var hash * SpaceHash = data.(*SpaceHash) hash.hashHandle(hand, hand.obj.GetBB()) }
[ 1.3583632707595825, -0.1478632092475891, 0.4459059536457062, 0.4434584677219391, 0.7949042320251465, 0.8207303881645203, 0.22173435986042023, 0.26407745480537415, -0.2876986265182495, -1.038395881652832, 0.0848868191242218, 0.39851078391075134, 0.4433329701423645, 0.600200355052948, 1.33...
func (pair *eachPair) Equals(el interface {}) (bool) { other, ok := el.(*eachPair) if !ok { return false; } return pair == other }
[ -2.116689443588257, -0.3147803544998169, 0.45406293869018555, 0.21260836720466614, -0.7833373546600342, 0.251360684633255, -0.16980187594890594, -0.3961421847343445, 0.562484622001648, -0.13118430972099304, -0.4045048654079437, -0.37762022018432617, -0.8682783842086792, 0.31696176528930664...
func eachHelper(bin , data HashElement) { var hand * Handle = bin.(*Handle) var pair * eachPair = data.(*eachPair) pair.fun(hand.obj, pair.data) }
[ 0.01972549594938755, -0.6433560252189636, 0.3115306496620178, 0.5068399906158447, 0.26503631472587585, 0.6055419445037842, 0.9140723347663879, -0.19700776040554047, -0.4986377954483032, -0.8282276391983032, 0.13901139795780182, 0.02457292377948761, -0.1007748618721962, 0.8269174695014954, ...
func (hash *SpaceHash) Each(fun SpaceHashIterator, data HashElement) { // Bundle the callback up to send to the hashset iterator. pair := &eachPair{fun, data} hash.handleSet.Each(eachHelper, pair) }
[ -0.19351865351200104, 0.062046755105257034, 0.037295542657375336, 0.4102227985858917, 0.0016699753468856215, 0.35729363560676575, 0.33824577927589417, 0.11289216578006744, -0.46104156970977783, -1.0582093000411987, 0.8812072277069092, 0.1960044503211975, 0.7630571722984314, 0.7658439874649...
func (hash *SpaceHash) query(bin * SpaceHashBin, obj HashElement, fun SpaceHashQueryFunc, data HashElement) { for ; bin != nil ; bin = bin.next { hand := bin.handle other := hand.obj // Skip over certain conditions if hand.stamp == hash.stamp || obj.Equals(other) || other == nil { ...
[ 0.6342060565948486, -0.30258792638778687, 0.25267791748046875, 1.1521248817443848, -0.1319214403629303, 0.29396262764930725, 0.5736030340194702, -0.28535833954811096, 0.4538087248802185, -0.7644408345222473, -0.24113449454307556, 0.6271438598632812, -0.20599162578582764, -0.035575889050960...
func handleQueryRehashHelper(p1, p2 HashElement) { var hand * Handle = p1.(*Handle) var pair * queryRehashPair = p2.(*queryRehashPair) // Unpack the user callback data. hash := pair.hash fun := pair.fun // dim := hash.celldim n := hash.numcells obj := hand.obj bb := obj.Ge...
[ 0.5889808535575867, 0.1437855064868927, 0.7158218026161194, 0.7233706712722778, -0.13836678862571716, 0.14814840257167816, 0.8722816705703735, -0.2526794373989105, -0.33941057324409485, -0.34305447340011597, -0.24330878257751465, -0.16064928472042084, -0.3343425691127777, -0.12797334790229...
func (*MessageContent) XXX_OneofWrappers() []interface{} { return []interface{}{ (*MessageContent_Text)(nil), (*MessageContent_Face)(nil), (*MessageContent_Voice)(nil), (*MessageContent_Image)(nil), (*MessageContent_File)(nil), (*MessageContent_Location)(nil), (*MessageContent_Command)(nil), (*MessageC...
[ -0.7077697515487671, -0.68043452501297, 0.5150254368782043, -0.40192481875419617, 0.223971426486969, -0.27359071373939514, -0.09026001393795013, -1.2075209617614746, 0.7915552258491516, 0.26048436760902405, 0.06568101048469543, -0.01188499853014946, -0.592828631401062, 0.9101932644844055, ...
func (d *peerMsgHandler) handleLeaderTransferMsg(req *raft_cmdpb.RaftCmdRequest) *raft_cmdpb.RaftCmdResponse { // construct response response := new(raft_cmdpb.TransferLeaderResponse) adminResponse := &raft_cmdpb.AdminResponse{ CmdType: raft_cmdpb.AdminCmdType_TransferLeader, TransferLeader: response, } ...
[ -0.31919026374816895, -0.15933233499526978, 0.6537310481071472, -0.4414300322532654, 0.10497654229402542, 0.00022162459208630025, 0.11056443303823471, -0.8089957237243652, 0.7960546612739563, -0.024073632434010506, 0.31871047616004944, 0.1530003398656845, -1.2595816850662231, 1.18492066860...
func (d *peerMsgHandler) handleCompactLogMsg(req *raft_cmdpb.RaftCmdRequest) *raft_cmdpb.RaftCmdResponse { // handle logGCCompact // construct response response := new(raft_cmdpb.CompactLogResponse) adminResponse := &raft_cmdpb.AdminResponse{ CmdType: raft_cmdpb.AdminCmdType_CompactLog, CompactLog: response,...
[ 0.4795491099357605, -0.15264268219470978, 0.7583640217781067, -0.9459391832351685, -0.3933814764022827, -0.2141765058040619, 0.5034599900245667, -0.5350068211555481, 0.09312223643064499, 0.14156386256217957, 0.14430907368659973, -0.23543810844421387, -0.48846688866615295, 0.587357640266418...
func (d *peerMsgHandler) checkConfChangeNeedProcessed(p *metapb.Peer, ct eraftpb.ConfChangeType) bool { if ct == eraftpb.ConfChangeType_AddNode { // if it is add operation, we need to check whether peers already has this peer findPeer := util.FindPeer(d.Region(), p.StoreId) return findPeer == nil } else { // ...
[ -0.5845054984092712, 0.09533531218767166, 0.6471572518348694, -0.19699928164482117, 0.4737442433834076, 0.30454719066619873, 0.1869654655456543, 0.05102800950407982, -0.39869433641433716, 0.7890710234642029, 0.36071017384529114, 0.21688266098499298, -0.9152859449386597, 1.45694100856781, ...
func (d *peerMsgHandler) generateConfChange(msg *raft_cmdpb.RaftCmdRequest) (*eraftpb.ConfChange, error) { cc := new(eraftpb.ConfChange) peer := msg.AdminRequest.ChangePeer.Peer needProcessed := d.checkConfChangeNeedProcessed(peer, msg.AdminRequest.ChangePeer.ChangeType) if !needProcessed { log.Warnf("skip propos...
[ -0.7652497291564941, 0.19407637417316437, 0.7600892186164856, -0.16463179886341095, -0.05379233881831169, 0.09256558865308762, -0.25837334990501404, 0.11007718741893768, -0.5133287906646729, 0.691952109336853, 0.09159552305936813, -0.10842093825340271, -0.8866022825241089, 1.27428984642028...
func (d *peerMsgHandler) validateRaftMessage(msg *rspb.RaftMessage) bool { regionID := msg.GetRegionId() from := msg.GetFromPeer() to := msg.GetToPeer() log.Debugf("[region %d] handle raft message %s from %d to %d", regionID, msg, from.GetId(), to.GetId()) if to.GetStoreId() != d.storeID() { log.Warnf("[region %...
[ 0.25108692049980164, 0.049035705626010895, 0.8103991150856018, -0.636337399482727, -0.3176594078540802, 0.9932796359062195, 0.5425511002540588, -0.6700087785720825, -0.5241966843605042, 0.11952536553144455, 0.5163674354553223, 0.032060254365205765, -1.0166144371032715, 0.8351150751113892, ...
func (d *peerMsgHandler) checkMessage(msg *rspb.RaftMessage) bool { fromEpoch := msg.GetRegionEpoch() isVoteMsg := util.IsVoteMessage(msg.Message) fromStoreID := msg.FromPeer.GetStoreId() // Let's consider following cases with three nodes [1, 2, 3] and 1 is leader: // a. 1 removes 2, 2 may still send MsgAppendRes...
[ -0.6639207601547241, 0.29989662766456604, 0.8462445735931396, 0.18106591701507568, 0.2720303535461426, -0.0370340421795845, 0.7770659327507019, -0.25323301553726196, -0.12416442483663559, 0.789806604385376, 0.17847135663032532, -0.18961317837238312, -1.1392825841903687, 1.0272283554077148,...
func (d *peerMsgHandler) checkSnapshot(msg *rspb.RaftMessage) (*snap.SnapKey, error) { if msg.Message.Snapshot == nil { return nil, nil } regionID := msg.RegionId snapshot := msg.Message.Snapshot key := snap.SnapKeyFromRegionSnap(regionID, snapshot) snapData := new(rspb.RaftSnapshotData) err := snapData.Unmars...
[ -0.28001776337623596, -0.2449602335691452, 1.0037134885787964, -0.4397925138473511, -0.6266913414001465, -0.02646617963910103, 0.533536970615387, -0.19243188202381134, -0.05260268226265907, 0.16290336847305298, 0.8167257905006409, -0.18604212999343872, -0.4561631679534912, 0.83465123176574...
func checkRequired(required ...string) error { missing := make([]string, 0) for _, req := range required { if !viper.IsSet(req) { missing = append(missing, req) } } if len(missing) == 0 { return nil } return &RequiredConfigError{missing: missing} }
[ -1.0783576965332031, -0.07749597728252411, 0.5053215622901917, 0.36876776814460754, 0.3794786334037781, 0.36284202337265015, -1.4548749923706055, 0.12784796953201294, -0.9964859485626221, 0.8810088634490967, 0.11921839416027069, 0.21652139723300934, -0.6425461769104004, 1.5951768159866333,...
func diffStrings(new, old []string) (added, removed []string) { Add: for _, x := range new { for _, y := range old { if x == y { continue Add } } added = append(added, x) } Rem: for _, x := range old { for _, y := range new { if x == y { continue Rem } } removed = append(removed, x) ...
[ -0.2738786041736603, -1.0876280069351196, 0.7955717444419861, -0.9304984211921692, -0.32935580611228943, -0.11112306267023087, -0.8650482892990112, -0.5261488556861877, 0.14934802055358887, 0.7784827351570129, 0.035802945494651794, 0.9117977023124695, -0.14103901386260986, 0.18480572104454...
func (m *PodState) Validate(formats strfmt.Registry) error { return nil }
[ -0.5783740282058716, 0.06771828234195709, 0.31608515977859497, -0.38076528906822205, 0.07932955026626587, -0.07985548675060272, -0.09660270065069199, -0.5344116687774658, 0.23060433566570282, -0.9932270050048828, 0.22839370369911194, -0.5900137424468994, -0.9380096197128296, -0.16709534823...
func (m *PodState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil }
[ -0.3989127278327942, -0.15861502289772034, 0.3638259768486023, -0.3829827308654785, -0.5253057479858398, 0.5627923607826233, -0.7502350211143494, -0.525338888168335, 1.0561211109161377, -0.49134209752082825, 0.1362280398607254, 0.34050995111465454, -0.8431423902511597, -0.5250780582427979,...
func CreateHistory(c *gin.Context) { newHistoryPoint := model.History{} userID, _ := strconv.Atoi(c.Param("userId")) bodyErr := c.BindJSON(&newHistoryPoint) specificExercise := service.GetSpecificExercise(int(newHistoryPoint.RoutineSpecificExercisesID)) assignedRoutine := service.GetAssignedRoutine(int(specificEx...
[ 0.12325645238161087, 0.4456643760204315, 0.6652625203132629, 0.8115374445915222, 0.7029383182525635, 0.8410168886184692, 0.618567705154419, -0.30505049228668213, 0.09747099876403809, 0.8157421350479126, 0.3250752389431, 0.7133342027664185, -0.3786737620830536, 0.2977336347103119, 0.65327...