text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (o *StartPostgreSQLShowCreateTableActionParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
} | [
0.8630802631378174,
-0.49440619349479675,
0.09526881575584412,
-0.5052454471588135,
-0.535467267036438,
0.16689057648181915,
1.2168948650360107,
-0.6362289786338806,
-1.6631410121917725,
-0.31089964509010315,
-0.1640055626630783,
1.1753863096237183,
-0.07884523272514343,
0.1789023876190185... |
func (o *StartPostgreSQLShowCreateTableActionParams) WithBody(body StartPostgreSQLShowCreateTableActionBody) *StartPostgreSQLShowCreateTableActionParams {
o.SetBody(body)
return o
} | [
0.29253730177879333,
-0.322243869304657,
0.2382853478193283,
0.0900619775056839,
-0.17226773500442505,
-0.11514526605606079,
0.594204306602478,
-1.1713833808898926,
-0.20045220851898193,
0.21501994132995605,
0.24692344665527344,
0.3792162537574768,
-0.03633284568786621,
0.7190569639205933,... |
func (o *StartPostgreSQLShowCreateTableActionParams) SetBody(body StartPostgreSQLShowCreateTableActionBody) {
o.Body = body
} | [
0.1743617206811905,
-0.44101062417030334,
0.2155664712190628,
0.5148986577987671,
-0.11373471468687057,
0.21393096446990967,
0.6673142313957214,
-0.9484517574310303,
-0.3093324601650238,
0.24010226130485535,
-0.12415140122175217,
0.6714586019515991,
-0.3880893290042877,
1.3627368211746216,... |
func (o *StartPostgreSQLShowCreateTableActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValid... | [
-0.6494722962379456,
-0.0685550719499588,
0.5813471674919128,
-0.3634992837905884,
0.6334331631660461,
0.07929917424917221,
1.2655435800552368,
-0.3751015365123749,
-1.121401309967041,
0.2476016730070114,
0.4052017331123352,
0.874683678150177,
-0.5387205481529236,
0.3721500039100647,
0.3... |
func Power(b, e int) int {
if e == 0 {
return 1
}
return b * Power(b, e-1)
} | [
-0.5422054529190063,
0.3048240542411804,
0.6799185872077942,
1.617689609527588,
0.44279491901397705,
-0.14349699020385742,
-0.03819246590137482,
1.4588744640350342,
-0.6788554787635803,
0.8475173115730286,
0.24031652510166168,
-0.7610525488853455,
-0.7113341689109802,
0.5179221630096436,
... |
func (rcv *Block) Offset() int64 {
return rcv._tab.GetInt64(rcv._tab.Pos + flatbuffers.UOffsetT(0))
} | [
0.021338535472750664,
-0.18443764746189117,
0.28337904810905457,
0.47701916098594666,
-0.5803549289703369,
1.0189447402954102,
0.9327895641326904,
0.7419284582138062,
-0.1492568701505661,
-0.2616443634033203,
-0.5537788271903992,
0.4999217391014099,
-0.47150737047195435,
0.5020411014556885... |
func (rcv *Block) MutateOffset(n int64) bool {
return rcv._tab.MutateInt64(rcv._tab.Pos+flatbuffers.UOffsetT(0), n)
} | [
-0.8775725364685059,
0.22381587326526642,
0.4432494640350342,
-0.03340679034590721,
-0.517760157585144,
0.45442190766334534,
0.23968210816383362,
-0.5827410221099854,
0.428263783454895,
-0.1935064196586609,
-0.5095874667167664,
0.06243433430790901,
-0.2168651819229126,
0.33935385942459106,... |
func (rcv *Block) MetaDataLength() int32 {
return rcv._tab.GetInt32(rcv._tab.Pos + flatbuffers.UOffsetT(8))
} | [
0.6559655666351318,
0.2791556119918823,
0.2632424235343933,
-0.19806115329265594,
0.9579880833625793,
1.46586275100708,
-0.06968995183706284,
0.050806980580091476,
-0.36831778287887573,
0.5556322336196899,
-0.19427816569805145,
0.7200785875320435,
0.03565621376037598,
-0.09400800615549088,... |
func (rcv *Block) MutateMetaDataLength(n int32) bool {
return rcv._tab.MutateInt32(rcv._tab.Pos+flatbuffers.UOffsetT(8), n)
} | [
-0.4898085594177246,
0.5980427265167236,
0.3648175299167633,
-0.28155606985092163,
-0.03541303053498268,
1.0925841331481934,
-0.32704809308052063,
-0.7570159435272217,
0.3007335364818573,
0.8541563153266907,
-0.716507077217102,
0.3623850643634796,
0.04029461368918419,
0.07370585203170776,
... |
func (rcv *Block) BodyLength() int64 {
return rcv._tab.GetInt64(rcv._tab.Pos + flatbuffers.UOffsetT(16))
} | [
0.63725745677948,
0.12924210727214813,
0.2598826587200165,
-0.07106538861989975,
0.7510061264038086,
1.5747017860412598,
0.5185095071792603,
-0.15346753597259521,
0.14976000785827637,
-0.03356172889471054,
-1.0841494798660278,
0.13563747704029083,
-0.4512141942977905,
0.022954612970352173,... |
func (rcv *Block) MutateBodyLength(n int64) bool {
return rcv._tab.MutateInt64(rcv._tab.Pos+flatbuffers.UOffsetT(16), n)
} | [
-0.8032857775688171,
0.5215945243835449,
0.5396780967712402,
-0.0014181856531649828,
0.1227019727230072,
1.0652062892913818,
-0.225924551486969,
-0.5713852643966675,
0.3732171952724457,
-0.003254539566114545,
-1.4479598999023438,
0.03623483330011368,
-0.7264466881752014,
0.5859337449073792... |
func validateConfig(args ArgCollection) error {
expectedKeys := []string{}
configFileRequired := false
if args.ProviderFlag == "custom" {
configFileRequired = true
expectedKeys = append(expectedKeys, []string{"providers.custom.insecure", "providers.custom.endpoint_format", "providers.custom.regions", "providers.... | [
-0.27361753582954407,
-0.38075485825538635,
0.8221414685249329,
0.20267139375209808,
0.498199462890625,
0.5983327031135559,
0.40294739603996277,
0.5673246383666992,
-0.9604357481002808,
1.0694888830184937,
0.35303065180778503,
0.05721120908856392,
-0.32592472434043884,
1.2031607627868652,
... |
func NewWebhookTenantBuilder(labelInputBuilder labelInputBuilder, tenantRepository tenantRepository) *WebhookTenantBuilder {
return &WebhookTenantBuilder{
labelInputBuilder: labelInputBuilder,
tenantRepository: tenantRepository,
}
} | [
0.35072705149650574,
-1.2988371849060059,
0.30721378326416016,
0.19719548523426056,
-0.44066962599754333,
0.7328051924705505,
-0.17345735430717468,
0.9430330395698547,
0.5530912280082703,
0.3525227904319763,
-0.45565953850746155,
0.5079789757728577,
-0.7350714206695557,
0.28404882550239563... |
func (b *WebhookTenantBuilder) GetTenantsForApplicationTemplates(ctx context.Context, tenant string, labels map[string]map[string]string, objectIDs []string) (map[string]*webhook.TenantWithLabels, error) {
tenantsForObjects := make(map[string]*webhook.TenantWithLabels)
tenantIDs := make([]string, 0)
tenantIDsMap := ... | [
0.11561118066310883,
-0.6371422410011292,
0.7843338251113892,
-0.46868735551834106,
-0.2577158212661743,
0.2134585976600647,
0.032401058822870255,
0.25690174102783203,
-0.13750626146793365,
0.7408902645111084,
-0.06657706201076508,
0.8367704749107361,
0.042673733085393906,
0.47351592779159... |
func (b *WebhookTenantBuilder) GetTenantForApplicationTemplate(ctx context.Context, tenant string, labels map[string]string) (*webhook.TenantWithLabels, error) {
if subaccountID, ok := labels[globalSubaccountIDLabelKey]; ok {
tenantModel, err := b.tenantRepository.GetByExternalTenant(ctx, subaccountID)
if err != n... | [
0.4326850175857544,
-0.41208890080451965,
0.37817153334617615,
-0.3978123962879181,
-0.14874038100242615,
0.15152132511138916,
-0.02695680409669876,
-0.1283775269985199,
-0.2444627285003662,
-0.013243640772998333,
0.34641000628471375,
0.7195401191711426,
-0.07237836718559265,
0.29072982072... |
func (b *WebhookTenantBuilder) GetTenantsForObjects(ctx context.Context, tenant string, objectIDs []string, resourceType resource.Type) (map[string]*webhook.TenantWithLabels, error) {
tenantsForObjects := make(map[string]*webhook.TenantWithLabels)
tenantIDs := make([]string, 0)
tenantIDsMap := make(map[string]*model... | [
-0.5822213292121887,
-1.179036259651184,
0.6073020696640015,
-0.8068219423294067,
0.23056501150131226,
-0.05174537003040314,
-0.016966143622994423,
-0.391060471534729,
-0.15136967599391937,
0.41396188735961914,
0.04275205731391907,
0.4514210820198059,
0.17027676105499268,
0.327542990446090... |
func (b *WebhookTenantBuilder) GetTenantForObject(ctx context.Context, objectID string, resourceType resource.Type) (*webhook.TenantWithLabels, error) {
tenantID, err := b.tenantRepository.GetLowestOwnerForResource(ctx, resourceType, objectID)
if err != nil {
return nil, errors.Wrapf(err, "while getting tenant lowe... | [
-0.23575244843959808,
-1.0956294536590576,
0.5270137786865234,
-0.6138858795166016,
-0.1738421767950058,
-0.1973162591457367,
0.20016895234584808,
-0.8939141631126404,
0.35528722405433655,
-0.016055535525083542,
-0.15395045280456543,
0.9496268033981323,
0.21941378712654114,
0.2790780663490... |
func init() {
var err error
DB, err = gorm.Open(config.MysqlConf.DriverName, config.MysqlConf.Conn)
if err != nil {
log.Fatal(err)
}
DB.DB().SetMaxOpenConns(config.MysqlConf.MaxOpenConns)
DB.DB().SetMaxIdleConns(config.MysqlConf.MaxIdleConns)
DB.DB().SetConnMaxLifetime(time.Duration(config.MysqlConf.ConnMaxLif... | [
-0.28940141201019287,
-0.05142432823777199,
0.7330026626586914,
0.4384499192237854,
0.22167839109897614,
0.5985593199729919,
-0.4909459948539734,
1.5242892503738403,
-0.5334352254867554,
0.3159559965133667,
-0.8632075786590576,
0.36601749062538147,
-0.6268658638000488,
0.2538478970527649,
... |
func (b BurnTractserverIO) Apply(topo *topology.Topology, failer *failimpl.Failer) func() error {
numTs := len(topo.Tractservers)
if numTs == 0 {
return nil
}
// Pick a random tract server.
ts := topo.Tractservers[rand.Intn(numTs)]
if len(ts.Roots) == 0 {
return nil
}
host, _ := splitHostPort(ts.Addr)
l... | [
-0.022250110283493996,
-0.2305040955543518,
0.7566580772399902,
-0.04661926254630089,
-0.30632638931274414,
0.11704418063163757,
0.06972038000822067,
-0.034330353140830994,
0.6803879141807556,
-0.6189637780189514,
0.15879562497138977,
0.1670108139514923,
0.22542761266231537,
-0.17351956665... |
func Dynamic(opts *cli.Options) error {
llog := logrus.WithField("pkg", "rstreams/dynamic")
// Start up writer
writer, err := NewStreamsClient(opts)
if err != nil {
return errors.Wrap(err, "unable to connect to Redis Streams")
}
defer writer.Close()
// Start up dynamic connection
grpc, err := dproxy.New(op... | [
-0.21782729029655457,
0.015481825917959213,
0.8436529040336609,
-0.5982401967048645,
1.2167255878448486,
-0.7565397620201111,
0.10659299045801163,
-0.9792917966842651,
-0.8177002668380737,
0.45264238119125366,
0.5584056377410889,
1.372040867805481,
-0.6405926942825317,
0.11910448968410492,... |
func New(method SigningMethod, opts ...TokenOption) *Token {
return NewWithClaims(method, MapClaims{}, opts...)
} | [
-0.26936477422714233,
-0.5658454298973083,
0.33872729539871216,
0.7099459171295166,
-1.6250466108322144,
-0.665959894657135,
-0.20346440374851227,
0.474002867937088,
0.35939744114875793,
-1.2556222677230835,
-0.23426465690135956,
0.11093190312385559,
1.4338678121566772,
0.1741373986005783,... |
func NewWithClaims(method SigningMethod, claims Claims, opts ...TokenOption) *Token {
return &Token{
Header: map[string]interface{}{
"typ": "JWT",
"alg": method.Alg(),
},
Claims: claims,
Method: method,
}
} | [
-0.03888314217329025,
-0.23124584555625916,
0.35651251673698425,
-0.4400433599948883,
-1.5645723342895508,
-0.8802610039710999,
-0.7931440472602844,
-1.089189052581787,
0.2014634907245636,
-0.9278854727745056,
0.16993984580039978,
0.41163527965545654,
0.6769933700561523,
-0.410110741853714... |
func (t *Token) SignedString(key interface{}) (string, error) {
sstr, err := t.SigningString()
if err != nil {
return "", err
}
sig, err := t.Method.Sign(sstr, key)
if err != nil {
return "", err
}
return sstr + "." + t.EncodeSegment(sig), nil
} | [
-0.1265033632516861,
-0.5994501113891602,
0.5454057455062866,
-0.37854984402656555,
-0.8709844946861267,
0.32682281732559204,
-0.3979395925998688,
-0.6350239515304565,
-0.03944873437285423,
0.8285161256790161,
-0.1734997034072876,
-0.5492460131645203,
-0.4263566732406616,
-0.00143034954089... |
func (t *Token) SigningString() (string, error) {
h, err := json.Marshal(t.Header)
if err != nil {
return "", err
}
c, err := json.Marshal(t.Claims)
if err != nil {
return "", err
}
return t.EncodeSegment(h) + "." + t.EncodeSegment(c), nil
} | [
0.06344638764858246,
-0.8901150226593018,
0.5425348281860352,
-0.8958313465118408,
-0.8970224261283875,
0.18980076909065247,
-1.089034914970398,
-0.5387328863143921,
-1.0861232280731201,
0.6769323348999023,
0.25828418135643005,
0.03479354456067085,
0.11079145967960358,
-0.7401343584060669,... |
func (*Token) EncodeSegment(seg []byte) string {
return base64.RawURLEncoding.EncodeToString(seg)
} | [
-0.9607812166213989,
-0.5795727372169495,
0.23253215849399567,
-0.7439805865287781,
0.08344457298517227,
0.12715108692646027,
-0.5492960810661316,
-0.08760715276002884,
0.6957006454467773,
0.43028524518013,
-0.10263223201036453,
0.0894315168261528,
-0.18599967658519745,
-0.1660760939121246... |
func (w *spdkWrapper) suppressOutput() (restore restoreFn, err error) {
realStdout, dErr := syscall.Dup(syscall.Stdout)
if dErr != nil {
err = dErr
return
}
devNull, oErr := os.OpenFile(os.DevNull, os.O_WRONLY, 0)
if oErr != nil {
err = oErr
return
}
if err = Dup2(int(devNull.Fd()), syscall.Stdout); er... | [
0.7022958993911743,
-0.21624526381492615,
0.7280592322349548,
0.6634345650672913,
-0.5725193023681641,
-1.1730238199234009,
1.006024718284607,
-0.26042279601097107,
0.5570153594017029,
-0.7222619652748108,
0.24656890332698822,
-0.5455631017684937,
0.4633541703224182,
-0.017327670007944107,... |
func createHugepageWalkFunc(log logging.Logger, topDir string, stat statFn, remove removeFn, count *uint) filepath.WalkFunc {
re := regexp.MustCompile(spdkHugepagePattern)
return func(path string, info os.FileInfo, err error) error {
switch {
case err != nil:
return err
case info == nil:
return errors.Ne... | [
0.05461911857128143,
-0.7276011109352112,
0.7812749147415161,
-0.016010858118534088,
0.23249386250972748,
0.035226739943027496,
1.453903079032898,
0.21211807429790497,
0.0030675558373332024,
-0.69967120885849,
0.43145278096199036,
-0.6243067383766174,
0.2658582031726837,
-0.261623144149780... |
func cleanHugepages(log logging.Logger, topDir string) (count uint, _ error) {
return count, filepath.Walk(topDir,
createHugepageWalkFunc(log, topDir, os.Stat, os.Remove, &count))
} | [
-1.0862659215927124,
-0.011960983276367188,
0.6000893712043762,
-0.26022765040397644,
0.016027197241783142,
0.3345915973186493,
1.467830777168274,
0.6395038962364197,
0.22319325804710388,
0.3298245370388031,
-0.10147476196289062,
-0.9184964299201965,
-0.2364325225353241,
1.0792334079742432... |
func (sb *spdkBackend) prepare(req storage.BdevPrepareRequest, vmdDetect vmdDetectFn, hpClean hpCleanFn) (*storage.BdevPrepareResponse, error) {
resp := &storage.BdevPrepareResponse{}
if req.CleanHugepagesOnly {
// Remove hugepages that were created by a no-longer-active SPDK process. Note that
// when running p... | [
-0.6827717423439026,
0.08950474113225937,
0.765049397945404,
1.2867403030395508,
-0.0932418555021286,
-1.2710423469543457,
0.5438088178634644,
-0.0947633683681488,
0.5452626943588257,
0.5778152942657471,
0.6289967894554138,
0.29133370518684387,
0.042424049228429794,
0.9919793009757996,
0... |
func (sb *spdkBackend) reset(req storage.BdevPrepareRequest, vmdDetect vmdDetectFn) (*storage.BdevPrepareResponse, error) {
resp := &storage.BdevPrepareResponse{}
// Update request if VMD has been explicitly enabled and there are VMD endpoints configured.
if err := updatePrepareRequest(sb.log, &req, vmdDetect); err... | [
-0.47271883487701416,
0.010994941927492619,
0.5258463621139526,
1.131742000579834,
0.1210990846157074,
-0.7665593028068542,
0.5890064835548401,
-0.06353417038917542,
0.06359005719423294,
0.9898313283920288,
0.2644491493701935,
0.7170594930648804,
-0.6317406892776489,
0.5245546698570251,
... |
func (sb *spdkBackend) Reset(req storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error) {
sb.log.Debugf("spdk backend reset (script call): %+v", req)
return sb.reset(req, DetectVMD)
} | [
-0.7876039743423462,
0.45661062002182007,
0.40650123357772827,
1.1961747407913208,
0.677008330821991,
-0.9626386761665344,
0.4174646735191345,
-0.23211638629436493,
-0.561755359172821,
0.6679359674453735,
-0.07375535368919373,
0.9260140657424927,
-0.7164458632469177,
0.30162566900253296,
... |
func (sb *spdkBackend) Prepare(req storage.BdevPrepareRequest) (*storage.BdevPrepareResponse, error) {
sb.log.Debugf("spdk backend prepare (script call): %+v", req)
return sb.prepare(req, DetectVMD, cleanHugepages)
} | [
-0.7436923384666443,
0.5829789638519287,
0.41006946563720703,
1.2490774393081665,
0.5015584230422974,
-1.2564520835876465,
-0.22628015279769897,
-0.11256197839975357,
0.2999650239944458,
0.40182486176490784,
0.1328054517507553,
0.06549367308616638,
-0.3696992099285126,
0.8698898553848267,
... |
func groomDiscoveredBdevs(reqDevs *hardware.PCIAddressSet, discovered storage.NvmeControllers, vmdEnabled bool) (storage.NvmeControllers, error) {
// if the request does not specify a device filter, return all discovered controllers
if reqDevs.IsEmpty() {
return discovered, nil
}
var missing hardware.PCIAddressS... | [
0.1921311765909195,
0.11492450535297394,
0.8164358139038086,
0.7102376222610474,
0.042580973356962204,
-0.10971316695213318,
-0.18390175700187683,
0.10519485175609589,
0.7353559732437134,
-0.010921632871031761,
0.2792789340019226,
0.5521588325500488,
-0.8240622282028198,
1.4897133111953735... |
func (sb *spdkBackend) Scan(req storage.BdevScanRequest) (*storage.BdevScanResponse, error) {
sb.log.Debugf("spdk backend scan (bindings discover call): %+v", req)
// Only filter devices if all have a PCI address, avoid validating the presence of emulated
// NVMe devices as they may not exist yet e.g. for SPDK AIO-... | [
-0.6507527828216553,
-0.004688318353146315,
0.9758068919181824,
1.059250831604004,
-0.6541423797607422,
-0.8454026579856873,
0.7856259346008301,
-0.04392785578966141,
0.13486315310001373,
0.28493133187294006,
0.28626853227615356,
0.46697667241096497,
-0.5691767930984497,
0.9936481714248657... |
func (sb *spdkBackend) formatKdev(req *storage.BdevFormatRequest) (*storage.BdevFormatResponse, error) {
resp := &storage.BdevFormatResponse{
DeviceResponses: make(storage.BdevDeviceFormatResponses),
}
for _, device := range req.Properties.DeviceList.Devices() {
resp.DeviceResponses[device] = new(storage.BdevDe... | [
-0.7482059001922607,
-0.3837100565433502,
0.49565884470939636,
1.0048006772994995,
-0.17410972714424133,
-0.38070040941238403,
0.2224065214395523,
-0.616249144077301,
0.6538423299789429,
0.32746621966362,
1.2364689111709595,
-0.5169985294342041,
-0.7813618183135986,
1.3914117813110352,
0... |
func (sb *spdkBackend) Format(req storage.BdevFormatRequest) (resp *storage.BdevFormatResponse, err error) {
sb.log.Debugf("spdk backend format (bindings call): %+v", req)
// TODO (DAOS-3844): Kick off device formats in parallel?
switch req.Properties.Class {
case storage.ClassFile:
return sb.formatAioFile(&req)... | [
-0.9759383797645569,
-0.4157889187335968,
0.5828568935394287,
1.1411665678024292,
0.19943326711654663,
-0.8335472345352173,
0.03927477449178696,
-0.6695824861526489,
0.47010374069213867,
-0.33588317036628723,
1.627697229385376,
-0.1674061417579651,
-0.028888139873743057,
0.7615875005722046... |
func (sb *spdkBackend) UpdateFirmware(pciAddr string, path string, slot int32) error {
sb.log.Debug("spdk backend update firmware")
if pciAddr == "" {
return FaultBadPCIAddr("")
}
if err := sb.binding.Update(sb.log, pciAddr, path, slot); err != nil {
return err
}
return nil
} | [
-0.654940664768219,
-0.2981899678707123,
0.4991379976272583,
0.5559499859809875,
-1.271297574043274,
-0.5463087558746338,
0.4181862473487854,
0.04739896580576897,
-0.5956655144691467,
0.4084537923336029,
0.31829652190208435,
0.35593336820602417,
-1.3983256816864014,
1.0330694913864136,
0... |
func AssertString(t *testing.T, got string, want string) {
t.Helper()
if got != want {
t.Errorf("got %q, want %q", got, want)
}
} | [
-0.030145911499857903,
-0.225771963596344,
0.44669225811958313,
-0.4654347598552704,
1.328970193862915,
0.14413847029209137,
-0.2687579393386841,
-0.8039959669113159,
-0.34630829095840454,
-0.5911879539489746,
1.0279419422149658,
1.5379530191421509,
0.4894094169139862,
0.41886278986930847,... |
func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource {
logOnce.Do(func() {
log.Print("google: AppEngineTokenSource is deprecated on App Engine standard second generation runtimes (>= Go 1.11) and App Engine flexible. Please use DefaultTokenSource or ComputeTokenSource.")
})
return Com... | [
-0.5638693571090698,
0.045438047498464584,
0.2115587443113327,
-0.8247263431549072,
-0.8604461550712585,
-0.9527419209480286,
-1.2972346544265747,
0.6131020784378052,
-0.410636305809021,
-0.0984976664185524,
-0.4824642837047577,
0.1798843890428543,
0.27844005823135376,
-0.09329853951931,
... |
func (server *Server) Start() (err error) {
if server.raftStore, err = raftstore.NewRaftStore(&raftstore.Config{
NodeID: server.nodeId,
IPAddr: server.ip,
HeartbeatPort: server.raftHeartbeatPort,
ReplicaPort: server.raftReplicatePort,
RaftPath: server.walDir,
NumOfL... | [
-0.40892985463142395,
0.6169803738594055,
0.6896727681159973,
-0.2360389232635498,
0.8952245712280273,
0.16550584137439728,
1.1476927995681763,
0.43335527181625366,
-0.2941250205039978,
0.6368687748908997,
-0.6926504373550415,
1.616600751876831,
-0.8023540377616882,
0.23876766860485077,
... |
func NewData(r *tr51.Reader) (*Data, error) {
m := make(map[rune]emojiData)
var unqualified int
for {
l, err := r.Read()
if err == io.EOF {
break
} else if err != nil {
return nil, err
}
isEmoji := l.HasProperty("Emoji")
isPresentation := l.HasProperty("Emoji_Presentation")
low, high := l.AsRa... | [
-0.6440365314483643,
-0.9266452789306641,
0.6271030902862549,
-0.517494261264801,
-1.3327687978744507,
-0.42930132150650024,
0.2124195098876953,
0.07928841561079025,
-0.27595123648643494,
-0.16149400174617767,
-0.07381350547075272,
0.6302514672279358,
-0.04017426073551178,
0.66043770313262... |
func (ed *Data) Text() []rune {
out := make([]rune, 0, ed.unqualified)
for r, data := range ed.emoji {
if data.unqualified {
out = append(out, r)
}
}
runeSlice(out).Sort()
return out
} | [
-0.6644020676612854,
0.31428828835487366,
0.5564486384391785,
0.02693069912493229,
-0.16275441646575928,
-0.05094023048877716,
-0.028661023825407028,
0.14754879474639893,
-0.32185253500938416,
1.1205378770828247,
-0.6504833698272705,
0.5249858498573303,
-0.7228608727455139,
0.2457845658063... |
func (ed *Data) Strip(raw string) string {
return ed.Normalize(raw, stripAll)
} | [
-0.8761057257652283,
-0.14836446940898895,
0.26227903366088867,
-0.6743209958076477,
-1.5139617919921875,
0.8415361046791077,
-0.49880528450012207,
0.5735207796096802,
0.7381352782249451,
-0.6687371134757996,
-0.3839288651943207,
0.4972890019416809,
0.47055208683013916,
-0.6131436228752136... |
func (ed *Data) Normalize(raw string, opts StripOpts) string {
pending := []rune{0}
// #0: Special-case single rune tone modifiers, which appear in test data.
var singleTone bool
for i, r := range raw {
if i == 0 && IsSkinTone(r) {
singleTone = true
} else {
singleTone = false
break
}
}
if singleT... | [
-0.41328999400138855,
0.32053783535957336,
0.9022951126098633,
-0.16424120962619781,
-0.8893198370933533,
-1.100898265838623,
0.828578770160675,
-0.05827004089951515,
-0.09850788116455078,
0.6656006574630737,
0.144478902220726,
0.28819578886032104,
-0.42907193303108215,
0.29288116097450256... |
func (mpr *MultiPlayerRoom) WriteJSON(
v1 interface{}, v2 interface{}) (ok1 bool, ok2 bool) {
return mpr.connWriteJSON(v1, &mpr.Conn1, mpr.Request1),
mpr.connWriteJSON(v2, &mpr.Conn2, mpr.Request2)
} | [
-2.2359559535980225,
-1.4333864450454712,
0.8674144148826599,
0.11747049540281296,
-0.12427670508623123,
0.029009658843278885,
0.04176659137010574,
0.05087204650044441,
-0.23478452861309052,
0.7074559926986694,
-0.6325373649597168,
0.6385058164596558,
-1.0037606954574585,
0.646483242511749... |
func (mpr *MultiPlayerRoom) connReadJSON(
v interface{}, _conn *atomicConn, r *http.Request) bool {
conn := _conn.Get()
if conn != nil {
err := conn.ReadJSON(v)
if handlers.WSHandleErrForward(
r, formats.ErrWebSocketFailure, mpr.RoomId, err) != nil {
mpr.Disconnect(_conn)
return false
}
return true
... | [
-1.3167035579681396,
-0.813791036605835,
1.0064289569854736,
-0.3286873996257782,
-1.4251735210418701,
-0.07100603729486465,
-0.7281990647315979,
-0.6378031969070435,
0.02813267894089222,
1.0346981287002563,
0.11878706514835358,
-0.2512165904045105,
-0.7003790140151978,
0.01623736321926117... |
func createSchema(db *pg.DB) (err error) {
// db.AddQueryHook(dbLogger{})
refresh := false
models := []interface{}{
&structs.User{},
&structs.Project{},
&structs.Webhook{},
&structs.IssueEntry{},
&structs.Comment{},
&structs.InviteCode{},
}
for _, model := range models {
if refresh {
db.Model(m... | [
-0.5239987969398499,
0.4127495586872101,
1.200364112854004,
0.9572787880897522,
1.3984094858169556,
0.5615617632865906,
0.22498278319835663,
-0.311066597700119,
-0.26906585693359375,
0.5706387758255005,
-0.7850973606109619,
-0.5426697134971619,
-0.4917895793914795,
0.4200562834739685,
0.... |
func (buff *Bytes) ToInt() int {
return (int)(binary.LittleEndian.Uint32(*buff))
} | [
1.4302024841308594,
-0.05591830611228943,
0.44205400347709656,
-1.2275400161743164,
0.5722606778144836,
0.9254958629608154,
0.18469665944576263,
-0.6833099126815796,
0.08701015263795853,
-0.6615443825721741,
-1.5698531866073608,
-0.3875415027141571,
-1.3466432094573975,
-0.1330448240041732... |
func (buff *Bytes) ToString() string {
return *(*string)(unsafe.Pointer(buff))
} | [
1.0995886325836182,
-0.5048531889915466,
0.2638271152973175,
-1.0915968418121338,
0.36363402009010315,
0.4733067750930786,
0.12361835688352585,
-1.2198727130889893,
0.7458897233009338,
-0.10640976577997208,
-0.9069599509239197,
0.49243929982185364,
-1.0263310670852661,
-0.9218935370445251,... |
func (buff *Bytes) ToFloat32() float32 {
return *(*float32)(unsafe.Pointer(&(*buff)[0]))
} | [
1.4804832935333252,
0.19322960078716278,
0.6266705393791199,
-1.1919701099395752,
0.7057205438613892,
0.2774130403995514,
-0.047426119446754456,
-1.0111761093139648,
0.5153127908706665,
-0.4102577269077301,
-1.1969016790390015,
0.4614191949367523,
-0.8857144117355347,
0.7582578659057617,
... |
func (buff *Bytes) ToFloat64() float64 {
return *(*float64)(unsafe.Pointer(&(*buff)[0]))
} | [
0.6291365623474121,
-0.19998672604560852,
0.47593846917152405,
-0.4036347270011902,
1.269809603691101,
-0.6406493782997131,
0.4221205711364746,
-0.5040508508682251,
0.5264773368835449,
-0.19124649465084076,
-1.0186690092086792,
0.1115550622344017,
-1.1538864374160767,
0.977811872959137,
... |
func (buff *Bytes) NULTrim() *Bytes {
i := 0
for ; (*buff)[i] != 0; i++ {
}
return NewBytes((*buff)[0:i])
} | [
1.1592433452606201,
-0.034625522792339325,
0.5240750908851624,
-0.7539041042327881,
0.16429613530635834,
-0.6341500878334045,
-1.0038470029830933,
-0.36508992314338684,
1.2225428819656372,
-1.0456594228744507,
-0.7543869018554688,
-0.20756183564662933,
-0.9113326072692871,
0.26915630698204... |
func NewSynchronizedCollector(coll Collector) Collector {
return &synchronizedCollector{
Collector: coll,
}
} | [
0.21528245508670807,
-0.6971935033798218,
-0.0634104385972023,
0.21648778021335602,
-0.598115861415863,
-0.5893464684486389,
-0.31918901205062866,
-0.8535549640655518,
0.45504507422447205,
-0.16839599609375,
-1.086547613143921,
0.1593339443206787,
0.5061519145965576,
0.6197248697280884,
... |
func (s *SceneUtils) JSObject() *js.Object { return s.p } | [
0.42553412914276123,
-0.5173693895339966,
0.39834845066070557,
-1.0722371339797974,
-0.8433274626731873,
0.05136270821094513,
-0.006335997022688389,
-1.5336709022521973,
-0.12034426629543304,
-0.4951835870742798,
-0.8505900502204895,
0.27533334493637085,
0.9287171363830566,
-0.597936213016... |
func (t *Three) SceneUtils() *SceneUtils {
p := t.ctx.Get("SceneUtils")
return SceneUtilsFromJSObject(p)
} | [
-0.4792843759059906,
0.1303836554288864,
0.39436307549476624,
-0.3987751007080078,
0.16544000804424286,
-0.2057349979877472,
-0.9516164660453796,
-1.1050974130630493,
0.9747028350830078,
0.43163201212882996,
-0.9860863089561462,
-0.12750187516212463,
0.1181388571858406,
-1.5262136459350586... |
func SceneUtilsFromJSObject(p *js.Object) *SceneUtils {
return &SceneUtils{p: p}
} | [
-0.08263437449932098,
-0.3137575685977936,
0.23538777232170105,
-0.013641812838613987,
-0.9435411095619202,
0.17132499814033508,
-0.7982145547866821,
-1.0826765298843384,
1.0971044301986694,
0.26893413066864014,
-1.1502046585083008,
-0.2553330361843109,
0.7797137498855591,
-0.6482663154602... |
func (t *Three) NewSceneUtils() *SceneUtils {
p := t.ctx.Get("SceneUtils").New()
return SceneUtilsFromJSObject(p)
} | [
-0.4896642565727234,
-0.014807152561843395,
0.24240775406360626,
0.21335306763648987,
-0.19223475456237793,
-0.665492057800293,
-0.9777599573135376,
-1.2933892011642456,
0.7589814066886902,
0.46395647525787354,
-1.29683256149292,
0.06655538827180862,
0.3519580364227295,
-0.8615936040878296... |
func (s *SceneUtils) CreateMultiMaterialObject(geometry JSObject, materials []JSObject) *Group {
array := []*js.Object{}
for i := 0; i < len(materials); i++ {
array = append(array, materials[i].JSObject())
}
return GroupFromJSObject(s.p.Call("createMultiMaterialObject", geometry.JSObject(), array))
} | [
-0.14458736777305603,
-0.19441862404346466,
0.5534139275550842,
0.01729763112962246,
-0.29995912313461304,
-0.28828126192092896,
-0.8736628890037537,
-1.510101318359375,
-0.26113995909690857,
0.4292154014110565,
-0.5337223410606384,
-0.15759548544883728,
0.010181482881307602,
0.47442382574... |
func (s *SceneUtils) Detach(child, parent, scene float64) *SceneUtils {
s.p.Call("detach", child, parent, scene)
return s
} | [
0.8526613116264343,
0.5336750149726868,
0.27874472737312317,
0.06571244448423386,
-0.4788728654384613,
0.0930168405175209,
0.18218670785427094,
-0.8905115723609924,
-0.7980378866195679,
-0.10449235886335373,
-0.7891886830329895,
-0.32174980640411377,
-0.11701010912656784,
0.128032490611076... |
func (s *SceneUtils) Attach(child, scene, parent float64) *SceneUtils {
s.p.Call("attach", child, scene, parent)
return s
} | [
0.4777073860168457,
-0.017621828243136406,
0.38209354877471924,
-0.19046255946159363,
-0.5670952200889587,
0.5882059931755066,
0.025754811242222786,
-1.0246564149856567,
-0.8893345594406128,
-0.16536906361579895,
-0.5215399861335754,
-0.0018893119413405657,
-0.34563085436820984,
0.68431222... |
func NewReaderFromFloat32Reader(r Float32Reader) io.Reader {
return &f32Reader{r: r}
} | [
0.4862265884876251,
-0.40386849641799927,
0.28277334570884705,
-0.33596763014793396,
-1.1772024631500244,
1.139864444732666,
-0.32972458004951477,
-0.829740047454834,
-0.4377531111240387,
-0.546863317489624,
0.6959102153778076,
-0.21256673336029053,
-0.3686884045600891,
0.35753968358039856... |
func createRouter() *httprouter.Router {
router := httprouter.New()
router.GET("/", index)
router.GET("/block/:block", showBlock)
router.GET("/api/"+network+"/getdifficulty", getDifficulty)
router.GET("/api/"+network+"/blocks", getLatestBlocks)
router.GET("/api/"+network+"/block/:hash", getBlock)
router.GET("/a... | [
-0.5883066654205322,
-0.6402459740638733,
0.753703773021698,
-0.02300000935792923,
0.5105818510055542,
0.5082860589027405,
-0.053593579679727554,
-0.045345403254032135,
-0.7911806702613831,
-0.05312943458557129,
0.41716742515563965,
0.007295873947441578,
-0.2302185595035553,
0.531284809112... |
func getLatestBlocks(w http.ResponseWriter, req *http.Request, _ httprouter.Params) {
blockCount := blockdata.GetBlockCount() // get the latest blocks
var blocks []*btcjson.GetBlockVerboseResult
// blockheight - 1 in the loop. Get the blockhash from the height
for i := 0; i < 10; i++ {
prevBlock := blockCount -... | [
0.12874995172023773,
0.00914604589343071,
0.8451824188232422,
-0.041120078414678574,
0.7844237089157104,
-0.46380874514579773,
-0.40580642223358154,
-0.9806801080703735,
-1.0520877838134766,
1.111784815788269,
-0.869674801826477,
0.7198268175125122,
-0.5376203060150146,
0.44711798429489136... |
func getBlock(w http.ResponseWriter, req *http.Request, ps httprouter.Params) {
hash, err := chainhash.NewHashFromStr(ps.ByName("hash"))
if err != nil {
log.Printf("could not convert string to hash: %s\n", err)
}
block, err := dao.GetBlock(hash)
if err != nil {
fmt.Fprintf(w, "Not found")
return
}
//bloc... | [
-0.8724793195724487,
0.5066718459129333,
0.8322440981864929,
1.0458940267562866,
0.6687712073326111,
-0.378235399723053,
0.1422940492630005,
-0.9504584074020386,
-0.37742358446121216,
-0.170654296875,
0.17729565501213074,
0.6569318771362305,
0.06047416105866432,
0.8721766471862793,
1.048... |
func GetAllPerfectSquaresBetweenTwoNumbers(a, b int) int {
if a > b {
return GetAllPerfectSquaresBetweenTwoNumbers(b, a)
}
c := float64(a)
d := float64(b)
return int(math.Floor(math.Sqrt(d)) - math.Ceil(math.Sqrt(c))) + 1
} | [
-0.07244111597537994,
-0.9691601395606995,
0.7907382845878601,
0.4723294675350189,
-0.824246883392334,
0.10528147965669632,
0.0891595184803009,
-0.561969518661499,
-0.06217001751065254,
-0.7628987431526184,
-0.04496418312191963,
1.105074405670166,
-0.15490134060382843,
0.29500892758369446,... |
func (f *FileList) ToLevelViewBytes(pad string) []byte {
return []byte(f.ToLevelView(pad, false))
} | [
-0.20273852348327637,
0.5841764807701111,
0.5266545414924622,
-0.16516123712062836,
-0.5169786214828491,
0.25463905930519104,
-0.29284247756004333,
0.16112728416919708,
0.022110283374786377,
-0.6455444097518921,
-1.6379776000976562,
0.45027050375938416,
-0.8102569580078125,
1.4323645830154... |
func (f *FileList) ToLevelExtendViewBytes(pad string) []byte {
return []byte(f.ToLevelView(pad, true))
} | [
-0.04892050102353096,
1.2159219980239868,
0.49826687574386597,
-0.09741206467151642,
-0.7605802416801453,
0.6287108063697815,
-1.0404599905014038,
0.39217478036880493,
0.1863498091697693,
-0.31441888213157654,
-1.5240615606307983,
0.4867389500141144,
-0.8178190588951111,
1.704465389251709,... |
func (f *FileList) ToLevelView(pad string, isExtended bool) string {
paw.Logger.Debug("LevelView...")
var (
w = f.StringBuilder()
dirs = f.Dirs()
fm = f.Map()
fNDirs, fNFiles, _ = f.NTotalDirsAndFile()
nItems = fNDirs + fNFiles
git ... | [
-0.18727664649486542,
0.4566936790943146,
0.8191157579421997,
-0.5954138040542603,
-0.08140084147453308,
0.022358540445566177,
0.7818202972412109,
-0.008993220515549183,
-0.27923810482025146,
-0.5170357823371887,
-0.47089096903800964,
0.23997358977794647,
0.1803104132413864,
1.143600583076... |
func (p PowerControl) SetIn(in chan interface{}) {
p.in = in
} | [
-0.12748835980892181,
-0.778847336769104,
0.6259078979492188,
0.22783011198043823,
0.08576314896345139,
1.1201879978179932,
-0.3510129451751709,
0.6850181221961975,
-0.621167004108429,
-0.895817220211029,
-0.9483376741409302,
0.8005165457725525,
-0.7597480416297913,
0.4615429639816284,
0... |
func (p PowerControl) In(val interface{}) {
p.in <- val
} | [
0.13737604022026062,
-0.21147802472114563,
0.5370866060256958,
0.28777486085891724,
-0.3463740944862366,
1.2937426567077637,
0.047944050282239914,
0.43034207820892334,
-0.7213155627250671,
-0.9314354658126831,
-0.49351152777671814,
0.32913780212402344,
-0.05698930472135544,
0.7616323232650... |
func (p PowerControl) Do() {
go func() {
var (
interval = 1 * time.Second
)
_in := debounce(interval, p.in)
for {
select {
case <-_in:
//out <- val
p.status = !p.status
if p.status {
mack.Say("power on. Welcome? o c?!", "Victoria") //, "-v", "Victoria")
} else {
mack.Say("pow... | [
0.8258920311927795,
0.27075526118278503,
0.629429042339325,
0.11003174632787704,
0.5806723833084106,
0.5324208736419678,
-0.4766511917114258,
-0.4759337604045868,
-0.6361521482467651,
0.4258138835430145,
-0.74595046043396,
0.6593798398971558,
0.14960676431655884,
0.5517887473106384,
0.11... |
func NewPowerControl(status bool) *PowerControl {
p := PowerControl{status: status}
p.in = make(chan interface{})
p.Do()
return &p
} | [
0.4218917787075043,
-0.45014408230781555,
0.2262784093618393,
0.5140295028686523,
-0.3876110315322876,
0.40241339802742004,
-0.37461668252944946,
-0.08442649990320206,
-0.7754827737808228,
-0.117547906935215,
-0.8052730560302734,
0.16370980441570282,
-0.15943236649036407,
0.019308008253574... |
func (p *SingleProcess) SetIn(in chan interface{}) {
p.in = in
} | [
-0.2783200740814209,
-0.6314204335212708,
0.7760922908782959,
0.23981599509716034,
0.11702344566583633,
1.3854845762252808,
0.26823920011520386,
1.020025610923767,
-0.19864776730537415,
-0.7092273235321045,
-0.9020056128501892,
1.9366095066070557,
-1.1216541528701782,
1.1051247119903564,
... |
func (p *SingleProcess) In(val interface{}) {
p.in <- val
} | [
0.04276328906416893,
-0.02944529429078102,
0.6734118461608887,
0.3497990369796753,
-0.5691137313842773,
1.5366533994674683,
0.6018223762512207,
0.85430508852005,
-0.2887323796749115,
-0.8256863355636597,
-0.5435453057289124,
1.2216163873672485,
-0.33229339122772217,
1.4245891571044922,
-... |
func NewSingleProcess(doFn DoFunction) *SingleProcess {
p := SingleProcess{}
p.SetIn(make(chan interface{}))
p.doFn = doFn
p.do()
return &p
} | [
0.6140775084495544,
-0.2509884238243103,
0.3429867923259735,
0.21154706180095673,
0.1389700323343277,
0.22140181064605713,
0.32725512981414795,
-0.11391839385032654,
0.5634313225746155,
-0.5044711232185364,
-0.5393880605697632,
1.0951550006866455,
-0.2921517789363861,
-0.15595601499080658,... |
func NewClient(config Config) ClientInterface {
context := ctx.Background()
if config.GitHubToken == "" {
return Client{
Client: github.NewClient(nil),
Context: context,
Config: config,
}
}
oauth2Client := oauth2.NewClient(context, oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: config.GitHubT... | [
0.23828274011611938,
-0.15481415390968323,
0.3297244608402252,
0.22104604542255402,
-0.3256469666957855,
0.5886383652687073,
0.15575839579105377,
-0.11395549774169922,
0.235911026597023,
0.3299102783203125,
0.44902780652046204,
0.6926072239875793,
-0.2566379904747009,
-0.34184014797210693,... |
func base64DecodedWriter(output io.Writer) io.WriteCloser {
readPipe, writePipe := io.Pipe()
go func() {
decoder := base64.NewDecoder(base64.StdEncoding, readPipe)
_, err := io.Copy(output, decoder)
if err != nil {
readPipe.CloseWithError(err)
return
}
err = readPipe.Close()
if err != nil {
panic... | [
-0.2236562818288803,
-0.7333223819732666,
0.5293595790863037,
0.5593703985214233,
-0.9307076334953308,
-0.2413579374551773,
0.3328512907028198,
0.17036646604537964,
-0.2686655819416046,
-0.20311515033245087,
0.5905521512031555,
-0.4254443943500519,
-0.33649197220802307,
0.12292016297578812... |
func SupplyInvariant(ctx sdk.Context, store api.BasketTable, bank bankSupplyStore, basketBalances map[uint64]math.Dec) (string, bool) {
goCtx := sdk.WrapSDKContext(ctx)
bids := make([]uint64, len(basketBalances))
i := 0
for bid := range basketBalances {
bids[i] = bid
i++
}
sort.Slice(bids, func(i, j int) boo... | [
-0.39679211378097534,
-0.09103954583406448,
1.0306570529937744,
-0.6401752829551697,
-0.17469657957553864,
0.523173451423645,
0.4002746045589447,
-0.8988725543022156,
0.6262437701225281,
0.5779078006744385,
-0.06709560751914978,
-0.22081467509269714,
-0.856843888759613,
-0.2955035269260406... |
func (k Keeper) computeBasketBalances(ctx context.Context) (map[uint64]math.Dec, error) {
it, err := k.stateStore.BasketBalanceTable().List(ctx, &api.BasketBalancePrimaryKey{})
if err != nil {
return nil, fmt.Errorf("failed to create basket balance iterator: %w", err)
}
defer it.Close()
balances := map[uint64]ma... | [
0.09761565923690796,
0.05956165865063667,
0.6059209108352661,
0.25647878646850586,
0.048165760934352875,
-0.01761798933148384,
-0.34482547640800476,
-0.19673945009708405,
0.6590949296951294,
0.7162452340126038,
-0.08292559534311295,
0.03136540204286575,
-0.13865582644939423,
1.067769408226... |
func FirstToken(node phrase.AstNode) *lexer.Token {
if t, ok := node.(*lexer.Token); ok {
return t
}
if e, ok := node.(*phrase.ParseError); ok {
return e.Unexpected
}
if p, ok := node.(*phrase.Phrase); ok && len(p.Children) != 0 {
return FirstToken(p.Children[0])
}
return nil
} | [
0.5725278854370117,
-0.4852422773838043,
0.5481885075569153,
-0.40072324872016907,
0.06166961044073105,
-0.06197872757911682,
-0.3850749433040619,
0.5761780142784119,
0.14744696021080017,
-0.2431487739086151,
0.45209869742393494,
0.34841665625572205,
0.669589102268219,
0.8995122313499451,
... |
func LastToken(node phrase.AstNode) *lexer.Token {
if t, ok := node.(*lexer.Token); ok {
return t
}
if e, ok := node.(*phrase.ParseError); ok {
return e.Unexpected
}
if p, ok := node.(*phrase.Phrase); ok && len(p.Children) != 0 {
return LastToken(p.Children[len(p.Children)-1])
}
return nil
} | [
0.06661774963140488,
-0.5627045631408691,
0.7717402577400208,
-0.8566038608551025,
-0.14005179703235626,
0.2087080031633377,
-0.4037451148033142,
0.7756186723709106,
0.1372040957212448,
0.004336815793067217,
0.1788700819015503,
0.26443639397621155,
0.01793145388364792,
0.008450241759419441... |
func IsOfPhraseType(node phrase.AstNode, phraseType phrase.PhraseType) (*phrase.Phrase, bool) {
p, ok := node.(*phrase.Phrase)
if !ok {
return nil, false
}
return p, p.Type == phraseType
} | [
-0.6538875102996826,
-0.5279603004455566,
0.6274322271347046,
-0.5744186043739319,
-0.004484224133193493,
-0.12569311261177063,
-1.0897854566574097,
-0.7211829423904419,
0.5852972269058228,
1.517756462097168,
0.3918570280075073,
-0.15923437476158142,
-0.7094468474388123,
0.4570272564888000... |
func IsOfPhraseTypes(node phrase.AstNode, phraseTypes []phrase.PhraseType) (*phrase.Phrase, bool) {
p, ok := node.(*phrase.Phrase)
if !ok {
return nil, false
}
for _, phraseType := range phraseTypes {
if p.Type == phraseType {
return p, true
}
}
return nil, false
} | [
-1.0756962299346924,
-0.3895278573036194,
0.7023745179176331,
-0.3755512833595276,
0.04192688688635826,
0.21075394749641418,
-0.9012001752853394,
-0.6579903364181519,
0.23435765504837036,
1.386739730834961,
0.13574589788913727,
-0.6166666746139526,
-1.33182954788208,
0.34006765484809875,
... |
func (netrule *NetworkingRule) AppendRule(ID string, CBNet string, CBNetIP string, PublicIP string) {
CBLogger.Infof("A rule: {%s, %s, %s, %s}", ID, CBNet, CBNetIP, PublicIP)
if !netrule.Contain(ID) { // If HostID doesn't exists, append rule
netrule.HostID = append(netrule.HostID, ID)
netrule.HostIPCIDRBlock = ap... | [
0.5478005409240723,
0.4788380265235901,
0.5760365128517151,
-0.8884967565536499,
0.8135560750961304,
0.8835273385047913,
-1.1298516988754272,
0.6127205491065979,
0.00041067172423936427,
-0.1548694521188736,
0.015108500607311726,
-0.6043533682823181,
-1.0804258584976196,
1.3468146324157715,... |
func (netrule *NetworkingRule) UpdateRule(id string, hostIPCIDRBlock string, hostIPAddress string, publicIP string) {
CBLogger.Infof("A rule: {%s, %s, %s, %s}", id, hostIPCIDRBlock, hostIPAddress, publicIP)
if netrule.Contain(id) { // If HostID exists, update rule
index := netrule.GetIndexOfID(id)
if hostIPCIDRBl... | [
0.07300648838281631,
-0.1544889658689499,
0.5738626718521118,
-0.6440460085868835,
0.6041673421859741,
0.38631191849708557,
-0.7085488438606262,
0.8971704840660095,
-0.27801117300987244,
0.45635750889778137,
-0.2703046202659607,
-0.1790779083967209,
-1.262229561805725,
0.5830222368240356,
... |
func (netrule NetworkingRule) GetIndexOfID(id string) int {
return netrule.find(netrule.HostID, id)
} | [
0.28557124733924866,
0.38266199827194214,
0.19703997671604156,
-0.5878958106040955,
-0.23514100909233093,
-0.009953100234270096,
0.1779477447271347,
-0.07010279595851898,
-0.11724478751420975,
0.23855726420879364,
-0.23464082181453705,
-0.2773016691207886,
-0.7599481344223022,
0.6730729937... |
func (netrule NetworkingRule) GetIndexOfCBNet(hostIPCIDRBlock string) int {
return netrule.find(netrule.HostIPCIDRBlock, hostIPCIDRBlock)
} | [
0.3360257148742676,
0.9670063853263855,
0.2541850507259369,
-0.18402273952960968,
0.31768471002578735,
-0.23739802837371826,
1.0156739950180054,
0.1208612248301506,
-0.5778653025627136,
0.2910482585430145,
-0.05490855872631073,
-0.603863000869751,
-1.2045265436172485,
0.0371563658118248,
... |
func (netrule NetworkingRule) GetIndexOfCBNetIP(hostIPAddress string) int {
return netrule.find(netrule.HostIPAddress, hostIPAddress)
} | [
0.43196624517440796,
0.6558501720428467,
0.21063637733459473,
-0.08393346518278122,
0.33344966173171997,
0.18195156753063202,
0.8257877230644226,
0.7480267882347107,
-0.1921616643667221,
0.3747573792934418,
0.6268002390861511,
-0.5833532214164734,
-0.6923374533653259,
-0.5474585890769958,
... |
func (netrule NetworkingRule) GetIndexOfPublicIP(publicIP string) int {
return netrule.find(netrule.PublicIPAddress, publicIP)
} | [
0.612558126449585,
0.5164769291877747,
0.19780901074409485,
-0.6811608672142029,
-0.1282729059457779,
0.07054657489061356,
0.485891193151474,
0.3126698136329651,
0.13331755995750427,
0.8961564898490906,
0.4031546413898468,
-0.7017086148262024,
-0.5987004041671753,
-0.41319674253463745,
-... |
func (netrule NetworkingRule) Contain(x string) bool {
for _, n := range netrule.HostID {
if x == n {
return true
}
}
return false
} | [
0.3414740562438965,
0.5706738829612732,
0.47939708828926086,
-0.5466412305831909,
-0.2803647816181183,
1.400810718536377,
-0.7160260677337646,
-0.17639359831809998,
-1.131278395652771,
0.5280024409294128,
-0.30693700909614563,
-0.4472007155418396,
-1.4164067506790161,
0.6235331892967224,
... |
func stats(pid int) {
proc, _ := process.NewProcess(int32(pid))
for {
logSample(getSample(pid, proc))
time.Sleep(time.Second * samplerSleepSeconds)
}
} | [
0.5011498928070068,
-0.5943433046340942,
0.4878426492214203,
-0.9181497693061829,
-0.10991877317428589,
-0.35579338669776917,
-0.42450618743896484,
-1.4739294052124023,
0.7415251135826111,
-0.7365924119949341,
0.1080780103802681,
0.9182302355766296,
0.6253154873847961,
0.7719326615333557,
... |
func (validator *validatorImpl) GetID() []byte {
return validator.peer.GetID()
} | [
0.33391326665878296,
-0.2581998407840729,
0.46571582555770874,
0.5233707427978516,
0.7552467584609985,
0.9821788668632507,
0.19194665551185608,
0.039678726345300674,
0.766650915145874,
-0.4938574731349945,
-0.17337189614772797,
0.4792959988117218,
-1.3596417903900146,
0.7603878378868103,
... |
func (validator *validatorImpl) GetEnrollmentID() string {
return validator.peer.GetEnrollmentID()
} | [
0.48747894167900085,
0.013297867961227894,
0.4807049334049225,
0.649116575717926,
-0.3027178943157196,
1.3809391260147095,
1.194072961807251,
0.4009031355381012,
0.6909399628639221,
0.5197880268096924,
0.1923026442527771,
0.017139779403805733,
-0.015635527670383453,
1.1105163097381592,
0... |
func (validator *validatorImpl) TransactionPreValidation(tx *obc.Transaction) (*obc.Transaction, error) {
if !validator.isInitialized {
return nil, utils.ErrNotInitialized
}
return validator.peer.TransactionPreValidation(tx)
} | [
-0.4058150053024292,
0.7765884399414062,
0.5359660387039185,
-0.3586343228816986,
-0.7280281186103821,
-0.5127999186515808,
0.4772944450378418,
-0.033676791936159134,
0.6539793014526367,
0.42076376080513,
-0.3586391806602478,
-1.1931198835372925,
-0.27745071053504944,
-0.056363657116889954... |
func (validator *validatorImpl) TransactionPreExecution(tx *obc.Transaction) (*obc.Transaction, error) {
if !validator.isInitialized {
return nil, utils.ErrNotInitialized
}
validator.peer.node.log.Debug("Pre executing [%s].", tx.String())
validator.peer.node.log.Debug("Tx confdential level [%s].", tx.Confidentia... | [
0.09630578011274338,
0.4454785883426666,
0.8050248026847839,
0.43738114833831787,
-0.28100720047950745,
-0.10451387614011765,
0.2572561204433441,
-0.7277650237083435,
0.4720087945461273,
0.9180343747138977,
0.3928256332874298,
-0.23231521248817444,
-0.5281888842582703,
-0.3032616674900055,... |
func (validator *validatorImpl) Sign(msg []byte) ([]byte, error) {
return validator.signWithEnrollmentKey(msg)
} | [
-1.2626419067382812,
-0.03960133343935013,
0.2171955555677414,
0.3716003894805908,
-0.6099970936775208,
0.28961890935897827,
0.5689985752105713,
0.41399824619293213,
-0.014069141820073128,
0.42653825879096985,
-0.6501753926277161,
-0.018965743482112885,
-0.5968244075775146,
1.7067950963974... |
func (validator *validatorImpl) Verify(vkID, signature, message []byte) error {
cert, err := validator.getEnrollmentCert(vkID)
if err != nil {
validator.peer.node.log.Error("Failed getting enrollment cert ", utils.EncodeBase64(vkID), err)
}
vk := cert.PublicKey.(*ecdsa.PublicKey)
ok, err := validator.verify(vk... | [
0.05503265559673309,
0.32645490765571594,
0.36657920479774475,
0.42941808700561523,
0.1371779888868332,
-0.10369407385587692,
-0.3103674054145813,
-0.017886195331811905,
-0.06993819028139114,
0.9577397108078003,
-0.9105538725852966,
0.571844756603241,
-0.07585195451974869,
1.22973513603210... |
func CheckShortIDCollision(nodes []insolar.NetworkNode, id insolar.ShortNodeID) bool {
for _, n := range nodes {
if id == n.ShortID() {
return true
}
}
return false
} | [
0.6546066999435425,
-0.4176270365715027,
0.467599093914032,
0.25173497200012207,
0.32832613587379456,
0.3228130340576172,
-0.32084599137306213,
-0.5682694911956787,
0.06299896538257599,
0.3786674439907074,
-0.2650662362575531,
0.40295615792274475,
-0.42213085293769836,
0.3350535035133362,
... |
func GenerateUniqueShortID(nodes []insolar.NetworkNode, nodeID insolar.Reference) insolar.ShortNodeID {
shortID := insolar.ShortNodeID(node.GenerateUintShortID(nodeID))
if !CheckShortIDCollision(nodes, shortID) {
return shortID
}
return regenerateShortID(nodes, shortID)
} | [
0.29345232248306274,
0.6063052415847778,
0.4242441952228546,
-0.29741716384887695,
0.25800472497940063,
0.7087742686271667,
0.45497071743011475,
0.11859020590782166,
1.1238398551940918,
0.10732292383909225,
0.10428985208272934,
0.9564046263694763,
-0.23555807769298553,
0.23922498524188995,... |
func ExcludeOrigin(discoveryNodes []insolar.DiscoveryNode, origin insolar.Reference) []insolar.DiscoveryNode {
for i, discoveryNode := range discoveryNodes {
if origin.Equal(*discoveryNode.GetNodeRef()) {
return append(discoveryNodes[:i], discoveryNodes[i+1:]...)
}
}
return discoveryNodes
} | [
-0.4050225615501404,
-0.05733930319547653,
0.5048725605010986,
0.4462519586086273,
-0.6593063473701477,
0.6715623140335083,
0.2625199556350708,
0.6186209917068481,
0.3158336877822876,
0.6504632234573364,
0.34061378240585327,
1.4215672016143799,
-0.4975217580795288,
0.04074140638113022,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.