text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (s *service) Create(ctx context.Context, in *model.FormationConstraintInput) (string, error) {
formationConstraintID := s.uidSvc.Generate()
log.C(ctx).Debugf("ID %s generated for Formation Constraint with name %s", formationConstraintID, in.Name)
err := s.repo.Create(ctx, s.converter.FromModelInputToModel(in,... | [
-1.1734580993652344,
-0.19484691321849823,
0.26652783155441284,
-0.24724410474300385,
-0.6309112310409546,
0.7378928661346436,
-0.06351243704557419,
-0.5938255190849304,
-0.4221477508544922,
0.1771315634250641,
-0.5158784985542297,
-0.7387560606002808,
-0.5982319712638855,
0.53773361444473... |
func (s *service) Get(ctx context.Context, id string) (*model.FormationConstraint, error) {
formationConstraint, err := s.repo.Get(ctx, id)
if err != nil {
return nil, errors.Wrapf(err, "while getting Formation Constraint with id %s", id)
}
return formationConstraint, nil
} | [
-1.4488966464996338,
-0.12902604043483734,
0.32709047198295593,
-1.0116243362426758,
0.15003927052021027,
-0.2679433524608612,
-0.6959027051925659,
-0.6475924253463745,
-0.6994209885597229,
0.01456365268677473,
-0.2749147117137909,
0.8567990064620972,
-0.24532602727413177,
0.35850530862808... |
func (s *service) List(ctx context.Context) ([]*model.FormationConstraint, error) {
formationConstraints, err := s.repo.ListAll(ctx)
if err != nil {
return nil, errors.Wrapf(err, "while listing all Formation Constraints")
}
return formationConstraints, nil
} | [
-0.9028734564781189,
-0.8117942214012146,
-0.08919268101453781,
-0.2083362191915512,
0.48421573638916016,
-0.1747637689113617,
-0.5794474482536316,
-0.09150509536266327,
-0.34152406454086304,
0.17187073826789856,
-0.4262895882129669,
0.16320982575416565,
-0.42818018794059753,
1.04304075241... |
func (s *service) ListByFormationTemplateID(ctx context.Context, formationTemplateID string) ([]*model.FormationConstraint, error) {
constraintReferences, err := s.formationTemplateConstraintReferenceRepo.ListByFormationTemplateID(ctx, formationTemplateID)
if err != nil {
return nil, errors.Wrapf(err, "while listin... | [
-1.0426396131515503,
-1.4056206941604614,
0.3009558916091919,
-0.4215225577354431,
0.3994161784648895,
-0.3292330801486969,
0.006214234046638012,
-0.319776713848114,
-0.08873357623815536,
0.7459341883659363,
-0.36081448197364807,
-0.35062435269355774,
-0.39382511377334595,
1.43504965305328... |
func (s *service) ListByFormationTemplateIDs(ctx context.Context, formationTemplateIDs []string) ([][]*model.FormationConstraint, error) {
constraintRefs, err := s.formationTemplateConstraintReferenceRepo.ListByFormationTemplateIDs(ctx, formationTemplateIDs)
if err != nil {
return nil, errors.Wrapf(err, "while list... | [
-1.2190710306167603,
-1.386807918548584,
0.5689710974693298,
-0.7794644236564636,
0.13698835670948029,
-0.46303391456604004,
0.2573448717594147,
-0.25330692529678345,
-0.37631383538246155,
0.6567091345787048,
-0.24355706572532654,
-0.42896172404289246,
-0.39683789014816284,
0.9904094338417... |
func (s *service) Delete(ctx context.Context, id string) error {
if err := s.repo.Delete(ctx, id); err != nil {
return errors.Wrapf(err, "while deleting Formation Constraint with ID %s", id)
}
return nil
} | [
-0.5938673615455627,
0.4353904128074646,
0.30423426628112793,
-0.3722058832645416,
0.5231714248657227,
0.09922793507575989,
-0.2506687045097351,
-0.1942545771598816,
-0.25926870107650757,
0.26175394654273987,
-0.13651332259178162,
-0.11457342654466629,
-0.6938580274581909,
0.11689147353172... |
func (s *service) ListMatchingConstraints(ctx context.Context, formationTemplateID string, location formationconstraint.JoinPointLocation, details formationconstraint.MatchingDetails) ([]*model.FormationConstraint, error) {
formationTemplateConstraintReferences, err := s.formationTemplateConstraintReferenceRepo.ListBy... | [
-0.915168285369873,
-0.9549749493598938,
0.27810874581336975,
-0.2494603842496872,
0.18204012513160706,
-0.09652552008628845,
-0.1879168599843979,
0.026628492400050163,
-0.7405460476875305,
0.13248877227306366,
-0.3690396547317505,
-0.29354143142700195,
-0.21782425045967102,
0.455277442932... |
func (s *service) Update(ctx context.Context, id string, in *model.FormationConstraintInput) error {
err := s.repo.Update(ctx, s.converter.FromModelInputToModel(in, id))
if err != nil {
return errors.Wrapf(err, "while updating Formation Constraint with ID %s", id)
}
return nil
} | [
-1.739121675491333,
-0.6510915756225586,
0.07647538185119629,
-0.32634851336479187,
-0.4162234663963318,
0.5535291433334351,
-0.17655375599861145,
-0.2109505832195282,
-0.6944420337677002,
0.24475258588790894,
-0.5062041282653809,
-0.2179265171289444,
-0.5308753252029419,
0.260304301977157... |
func (c *Config) Validate() error {
for _, ci := range c.Converters {
if ci.Pattern == "" {
return errors.New("[pattern] is required for a converter")
}
if ci.MetricName == "" {
return errors.New("[metricName] is required for a converter")
}
}
return nil
} | [
-0.28370770812034607,
0.32716983556747437,
0.3981640636920929,
-0.4592416286468506,
0.781582236289978,
0.24473251402378082,
-0.3142986297607422,
0.31985965371131897,
-1.5526841878890991,
0.5499690175056458,
-0.017182158306241035,
-0.4737561047077179,
-0.6352589130401611,
1.1907732486724854... |
func (m *Monitor) Configure(conf *Config) error {
m.logger = utils.NewThrottledLogger(log.WithFields(log.Fields{"monitorType": monitorMetadata.MonitorType, "monitorID": conf.MonitorID}), 30*time.Second)
var ctx context.Context
ctx, m.cancel = context.WithCancel(context.Background())
// Give default value to Liste... | [
0.8958464860916138,
0.2959439754486084,
0.8236542344093323,
-0.04312373697757721,
0.9826168417930603,
-0.08448170125484467,
0.4397233724594116,
-0.21398600935935974,
-0.9204207062721252,
0.15544328093528748,
0.011059507727622986,
-0.09777332842350006,
0.26539722084999084,
0.848804652690887... |
func (m *Monitor) Shutdown() {
if m.cancel != nil {
m.cancel()
}
if m.listener != nil {
m.listener.Close()
}
} | [
0.6828301548957825,
-0.6653218865394592,
0.46891871094703674,
-0.04778166115283966,
0.2644162178039551,
0.6073935031890869,
-0.07730410248041153,
0.6971622109413147,
0.5597631931304932,
0.20807376503944397,
0.852187991142273,
0.10523190349340439,
-0.7270071506500244,
0.6991596221923828,
... |
func (b *DbBackendImpl) CreateAccount(data *models.Account) error {
if nil == data {
return fmt.Errorf("param is nil")
}
return b.GetConn().Create(data).Error
} | [
-0.27972841262817383,
0.16987845301628113,
0.3777553141117096,
0.7499200701713562,
1.1593735218048096,
0.022937022149562836,
0.4787898659706116,
0.11480565369129181,
0.21663141250610352,
0.6958045959472656,
0.018792983144521713,
-0.4677455425262451,
-0.8832667469978333,
0.7658408284187317,... |
func oDataEncodeVals(strs []string) string {
encoded := make([]string, len(strs))
for i, str := range strs {
encoded[i] = strings.Replace(url.QueryEscape(str), "+", "%20", -1)
}
return strings.Join(encoded, ",")
} | [
-0.9863013625144958,
-0.3524312973022461,
0.42273083329200745,
-0.658098042011261,
-0.4279806315898895,
0.32513663172721863,
-1.084877848625183,
0.053524237126111984,
0.6844302415847778,
0.04092475399374962,
0.5974411964416504,
0.9971665740013123,
0.3766404986381531,
0.6451309323310852,
... |
func encodeQuery(query map[string][]string) string {
if len(query) == 0 {
return ""
}
var tuples []string
for key, vals := range query {
if len(vals) == 0 {
continue
}
tuple := key + "=" + oDataEncodeVals(vals)
tuples = append(tuples, tuple)
}
return "?" + strings.Join(tuples, "&")
} | [
-0.7235082387924194,
0.005430404096841812,
0.338638037443161,
-0.5895035862922668,
-0.4973439574241638,
0.2560839056968689,
-1.2120589017868042,
-0.08183137327432632,
0.35045233368873596,
0.47304293513298035,
1.0834556818008423,
0.36285287141799927,
-0.2232285588979721,
0.6139222383499146,... |
func getSinglePath(v interface{}) (string, error) {
if name, err := resourceName(v); err != nil {
return "", err
} else if id, err := resourceId(v); err != nil {
return "", err
} else {
return fmt.Sprintf("%s(%d)", name, id), nil
}
} | [
-0.30875271558761597,
-0.15442895889282227,
0.4752970039844513,
0.3147258758544922,
-0.6050609946250916,
0.12030606716871262,
0.4203329384326935,
-0.6421986222267151,
1.2062580585479736,
0.623502254486084,
0.45694541931152344,
-0.27760517597198486,
-0.23308031260967255,
0.8495135307312012,... |
func ptrType(v interface{}) (reflect.Type, error) {
if ty := reflect.TypeOf(v); ty.Kind() != reflect.Ptr {
return nil, errors.New("not a pointer")
} else {
return ty.Elem(), nil
}
} | [
-0.020710529759526253,
0.20052079856395721,
0.30147165060043335,
0.050722915679216385,
-0.36057281494140625,
-0.22252017259597778,
-0.17080576717853546,
-1.473917007446289,
1.5008641481399536,
1.131925106048584,
0.5475898385047913,
0.1983475238084793,
-1.5083513259887695,
0.568773269653320... |
func TestMailgunAlerts(t *testing.T) {
t.Parallel()
sql := `
insert into users (id, name, email)
values
({{uuid "user"}}, 'bob', 'joe');
insert into user_contact_methods (id, user_id, name, type, value)
values
({{uuid "cm1"}}, {{uuid "user"}}, 'personal', 'SMS', {{phone "1"}});
insert into user_notifica... | [
0.3568800091743469,
0.7662241458892822,
0.9639515280723572,
-0.37050190567970276,
0.4449442923069,
0.17844921350479126,
0.07107681781053543,
0.18870843946933746,
-0.6182246804237366,
-0.19867052137851715,
-1.0679082870483398,
1.3107855319976807,
0.4804309010505676,
0.24645653367042542,
0... |
func NewThreadUpdateOK() *ThreadUpdateOK {
return &ThreadUpdateOK{}
} | [
-0.24211347103118896,
-1.2019696235656738,
0.07842686772346497,
0.7325162887573242,
-1.0107029676437378,
-0.36947911977767944,
-0.1025756448507309,
0.3382384777069092,
-0.30903658270835876,
0.9505438804626465,
-0.31308090686798096,
-1.3193566799163818,
-0.6636188626289368,
-0.0301809925585... |
func (o *ThreadUpdateOK) WithPayload(payload *models.Thread) *ThreadUpdateOK {
o.Payload = payload
return o
} | [
0.3186820447444916,
-0.9203759431838989,
0.08016254007816315,
0.22299422323703766,
-1.2317882776260376,
-0.272451788187027,
-0.26771286129951477,
-0.448994904756546,
0.33324289321899414,
0.8817313313484192,
0.03058243729174137,
-1.6262837648391724,
-0.6427581906318665,
-0.3755074739456177,... |
func (o *ThreadUpdateOK) SetPayload(payload *models.Thread) {
o.Payload = payload
} | [
0.11854535341262817,
-0.6069685220718384,
0.22373420000076294,
0.33254197239875793,
-0.9307340383529663,
0.4667317569255829,
-0.36904728412628174,
-0.5449917912483215,
0.1864931881427765,
0.8222930431365967,
-0.1925927996635437,
-1.2089617252349854,
-1.3288764953613281,
-0.0071399663574993... |
func (o *ThreadUpdateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.28785955905914307,
-0.8991502523422241,
0.3300686776638031,
0.6015223264694214,
0.4145735502243042,
-0.5250145792961121,
0.19232334196567535,
-0.3048534095287323,
0.6686883568763733,
0.9745776057243347,
0.29227712750434875,
-1.2219558954238892,
-1.012641191482544,
-0.3254598379135132,
... |
func NewThreadUpdateNotFound() *ThreadUpdateNotFound {
return &ThreadUpdateNotFound{}
} | [
0.024894917383790016,
-1.9096179008483887,
-0.07501015812158585,
-0.23727944493293762,
-0.05062182992696762,
-0.1389676183462143,
-0.5319937467575073,
0.013878002762794495,
0.29264676570892334,
0.013678070157766342,
-0.2493806779384613,
-0.28428950905799866,
-1.1129157543182373,
-0.4635178... |
func (o *ThreadUpdateNotFound) WithPayload(payload *models.Error) *ThreadUpdateNotFound {
o.Payload = payload
return o
} | [
0.027493983507156372,
-1.097831130027771,
0.011965135112404823,
-0.42832812666893005,
-0.3711075186729431,
0.030138930305838585,
-0.3821430802345276,
-0.3158530294895172,
0.6933197975158691,
0.12314505875110626,
0.24362635612487793,
-0.6968010067939758,
-0.7445867657661438,
-0.229575231671... |
func (o *ThreadUpdateNotFound) SetPayload(payload *models.Error) {
o.Payload = payload
} | [
-0.3543767035007477,
-0.7567363381385803,
0.028618261218070984,
-0.330281525850296,
0.1239493116736412,
0.392500102519989,
-0.259857177734375,
-0.299466073513031,
0.6125255823135376,
0.13037806749343872,
-0.08408594131469727,
-0.35958006978034973,
-1.281861424446106,
0.18792515993118286,
... |
func (o *ThreadUpdateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(404)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.6439951062202454,
-0.8811671733856201,
0.22852206230163574,
0.3716442883014679,
1.135706901550293,
-0.43495604395866394,
0.37885257601737976,
-0.3270719051361084,
0.5962012410163879,
0.6974771022796631,
0.25637781620025635,
-0.7597438097000122,
-0.8657951354980469,
-0.34918951988220215,... |
func newIPVSService(svc *Service) *ipvsService {
ipvsSvc := &ipvsService{
Address: svc.Address,
Protocol: svc.Protocol,
Port: svc.Port,
FirewallMark: svc.FirewallMark,
Scheduler: svc.Scheduler,
Flags: svc.Flags,
Timeout: svc.Timeout,
Pe... | [
-0.8352893590927124,
-0.3312547206878662,
0.2594588100910187,
-0.38169941306114197,
-0.7452723979949951,
-0.5193279981613159,
-0.36801859736442566,
-0.645207405090332,
0.7651750445365906,
-0.2818734049797058,
-0.031114282086491585,
0.04858250543475151,
-0.23934735357761383,
0.1030142679810... |
func newIPVSDestination(dst *Destination) *ipvsDestination {
return &ipvsDestination{
Address: dst.Address,
Port: dst.Port,
Flags: dst.Flags,
Weight: uint32(dst.Weight),
UpperThreshold: dst.UpperThreshold,
LowerThreshold: dst.LowerThreshold,
}
} | [
-1.2991927862167358,
-0.2018936574459076,
0.10640155524015427,
-0.6239680051803589,
-1.6395074129104614,
-0.34458306431770325,
-0.4687982499599457,
-0.16020601987838745,
0.5240235924720764,
0.0027580340392887592,
-0.29186153411865234,
0.1438073366880417,
0.608744204044342,
-1.0421105623245... |
func (ipvsSvc ipvsService) toService() *Service {
svc := &Service{
Address: ipvsSvc.Address,
Protocol: ipvsSvc.Protocol,
Port: ipvsSvc.Port,
FirewallMark: ipvsSvc.FirewallMark,
Scheduler: ipvsSvc.Scheduler,
Flags: ipvsSvc.Flags,
Timeout: ... | [
-0.08378998190164566,
-0.2765698730945587,
0.42041686177253723,
-0.6425307393074036,
0.01559409685432911,
-0.7223283648490906,
0.27631697058677673,
-0.7764521241188049,
1.09540855884552,
-0.028124619275331497,
0.1977330446243286,
0.5726298093795776,
-0.08367575705051422,
-0.246961444616317... |
func (ipvsDst ipvsDestination) toDestination() *Destination {
dst := &Destination{
Address: ipvsDst.Address,
Port: ipvsDst.Port,
Weight: int32(ipvsDst.Weight), // TODO(jsing): uint32?
Flags: ipvsDst.Flags,
LowerThreshold: ipvsDst.LowerThreshold,
UpperThreshold: ipvsDst.Upp... | [
-0.5259153842926025,
0.3368500769138336,
0.6437290906906128,
-0.7701736092567444,
-0.33363696932792664,
-0.3025413453578949,
0.43194741010665894,
-0.41479015350341797,
0.914126455783844,
0.24368752539157867,
-0.1385975182056427,
0.18930299580097198,
0.7873071432113647,
-0.7442598938941956,... |
func (proto IPProto) String() string {
switch proto {
case syscall.IPPROTO_TCP:
return "TCP"
case syscall.IPPROTO_UDP:
return "UDP"
}
return fmt.Sprintf("IP(%d)", proto)
} | [
-0.8406351208686829,
0.12454190850257874,
0.360562264919281,
-0.22722052037715912,
-0.6409282088279724,
0.8096967935562134,
0.3593812584877014,
-0.4855670630931854,
-0.4619899392127991,
0.7958159446716309,
0.19268079102039337,
-0.3081866204738617,
-0.16432279348373413,
-0.5642669200897217,... |
func (v IPVSVersion) String() string {
return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
} | [
-0.45109671354293823,
-1.225165605545044,
0.2489117830991745,
-0.875820517539978,
-0.42206478118896484,
0.6010560989379883,
0.11991342902183533,
-0.8094809651374817,
-0.2951483726501465,
0.3590622544288635,
-0.2297382652759552,
0.05827171355485916,
0.012507028877735138,
-1.4165153503417969... |
func (f ServiceFlags) Bytes() []byte {
x := make([]byte, 8)
var b [4]byte
*(*uint32)(unsafe.Pointer(&b)) = uint32(f)
copy(x[:4], b[:])
*(*uint32)(unsafe.Pointer(&b)) = ^uint32(0)
copy(x[4:], b[:])
return x
} | [
-0.2534541189670563,
1.2520471811294556,
0.28863009810447693,
-0.8062492609024048,
0.7731657028198242,
0.4164544939994812,
-0.7273911237716675,
-0.636654794216156,
0.11703752726316452,
-0.6280458569526672,
-0.701880931854248,
0.9929229617118835,
-0.897182047367096,
0.3382989168167114,
0.... |
func (f *ServiceFlags) SetBytes(x []byte) {
var b [4]byte
copy(b[:], x)
*f = ServiceFlags(*(*uint32)(unsafe.Pointer(&b)))
} | [
0.1595458686351776,
2.120760202407837,
0.31702423095703125,
-0.31214019656181335,
0.8073946833610535,
0.4412838816642761,
0.1788320392370224,
-0.6470593214035034,
-0.5753690004348755,
-0.8359907269477844,
-1.2009882926940918,
0.6015255451202393,
-0.8627610206604004,
0.9283854365348816,
-... |
func (svc Service) Equal(other Service) bool {
return svc.Address.Equal(other.Address) &&
svc.Protocol == other.Protocol &&
svc.Port == other.Port &&
svc.FirewallMark == other.FirewallMark &&
svc.Scheduler == other.Scheduler &&
svc.Flags == other.Flags &&
svc.Timeout == other.Timeout &&
svc.PersistenceEn... | [
-0.35544562339782715,
-0.10151989012956619,
0.6632167100906372,
-0.038809336721897125,
0.20851872861385345,
0.30556046962738037,
-0.047946128994226456,
-0.7739641666412354,
-0.000004621652806235943,
-0.07943997532129288,
-0.8010150194168091,
0.8974997997283936,
-0.8067526817321777,
0.81847... |
func (svc Service) String() string {
switch {
case svc.FirewallMark > 0:
return fmt.Sprintf("FWM %d (%s)", svc.FirewallMark, svc.Scheduler)
case svc.Address.To4() == nil:
return fmt.Sprintf("%v [%v]:%d (%s)", svc.Protocol, svc.Address, svc.Port, svc.Scheduler)
default:
return fmt.Sprintf("%v %v:%d (%s)", svc.... | [
0.20050276815891266,
-0.8588672280311584,
0.36152327060699463,
-0.88482266664505,
-0.533223569393158,
0.1165446937084198,
0.4819701015949249,
-0.888096809387207,
-0.4518035650253296,
-0.12814630568027496,
0.4259798228740692,
0.8039329051971436,
-0.45929980278015137,
0.27676066756248474,
... |
func (dest Destination) Equal(other Destination) bool {
return dest.Address.Equal(other.Address) &&
dest.Port == other.Port &&
dest.Weight == other.Weight &&
dest.Flags == other.Flags &&
dest.LowerThreshold == other.LowerThreshold &&
dest.UpperThreshold == other.UpperThreshold
} | [
-0.5551812052726746,
-0.10425002127885818,
0.7515655755996704,
-0.2324143797159195,
0.024329159408807755,
0.2484750896692276,
-0.22704127430915833,
-0.521430492401123,
-0.406770795583725,
0.6876912713050842,
-0.8283616900444031,
0.2570473551750183,
0.6583995819091797,
-0.001843204023316502... |
func (dest Destination) String() string {
addr := dest.Address.String()
if dest.Address.To4() == nil {
addr = fmt.Sprintf("[%s]", addr)
}
return fmt.Sprintf("%s:%d", addr, dest.Port)
} | [
-0.4271586537361145,
-0.6583359241485596,
0.5187764763832092,
-1.1960382461547852,
-0.5537903308868408,
0.029839741066098213,
0.2199459671974182,
-0.4100751578807831,
-0.23018494248390198,
0.43128883838653564,
0.13442006707191467,
0.4845796823501587,
0.6716985106468201,
-0.7116369009017944... |
func Version() IPVSVersion {
v := uint(info.Version)
return IPVSVersion{
Major: (v >> 16) & 0xff,
Minor: (v >> 8) & 0xff,
Patch: v & 0xff,
}
} | [
-0.6898623108863831,
-0.6639030575752258,
0.4617522656917572,
-0.6102065443992615,
0.19443446397781372,
0.21705110371112823,
0.05239518731832504,
-0.4404490888118744,
0.46239104866981506,
-0.47118404507637024,
-0.7772794961929321,
-0.6262611746788025,
-0.7215057611465454,
-0.84099853038787... |
func Flush() error {
return netlink.SendMessage(C.IPVS_CMD_FLUSH, family, 0)
} | [
-0.6710420846939087,
0.6907135248184204,
0.3059273064136505,
-0.05214856564998627,
0.5737249851226807,
0.08138705044984818,
0.48151177167892456,
-0.40155503153800964,
0.10162458568811417,
-0.9561953544616699,
0.22818656265735626,
0.8251100778579712,
-0.9127798676490784,
0.30400747060775757... |
func AddService(svc Service) error {
ic := &ipvsCommand{Service: newIPVSService(&svc)}
if err := netlink.SendMessageMarshalled(C.IPVS_CMD_NEW_SERVICE, family, 0, ic); err != nil {
return err
}
for _, dst := range svc.Destinations {
if err := AddDestination(svc, *dst); err != nil {
return err
}
}
return n... | [
-1.3942030668258667,
0.7337360382080078,
0.701566755771637,
0.19850406050682068,
0.5899084210395813,
0.12895414233207703,
0.11590686440467834,
-0.12121305614709854,
-0.03879518061876297,
-0.9285470843315125,
0.13602283596992493,
-0.6249802708625793,
-0.1999199539422989,
0.4938108026981354,... |
func UpdateService(svc Service) error {
ic := &ipvsCommand{Service: newIPVSService(&svc)}
return netlink.SendMessageMarshalled(C.IPVS_CMD_SET_SERVICE, family, 0, ic)
} | [
-1.6716210842132568,
-0.2324453443288803,
0.4536144733428955,
-0.24267615377902985,
-0.22100743651390076,
-0.07362152636051178,
-0.0805409774184227,
-0.2664964497089386,
0.18086692690849304,
-0.46205374598503113,
-0.22665518522262573,
0.043805163353681564,
-0.861226499080658,
0.32101815938... |
func DeleteService(svc Service) error {
ic := &ipvsCommand{Service: newIPVSService(&svc)}
return netlink.SendMessageMarshalled(C.IPVS_CMD_DEL_SERVICE, family, 0, ic)
} | [
-1.0025553703308105,
0.4192841947078705,
0.43780893087387085,
-0.2351812869310379,
0.12091848254203796,
-0.2917042076587677,
0.04905882477760315,
-0.5152967572212219,
0.7246571183204651,
-1.4275933504104614,
-0.15942427515983582,
-0.19990259408950806,
-0.7406865358352661,
0.341601103544235... |
func AddDestination(svc Service, dst Destination) error {
ic := &ipvsCommand{
Service: newIPVSService(&svc),
Destination: newIPVSDestination(&dst),
}
return netlink.SendMessageMarshalled(C.IPVS_CMD_NEW_DEST, family, 0, ic)
} | [
-1.507838249206543,
0.596182644367218,
0.5274171829223633,
-0.3924625813961029,
-0.08625002950429916,
-0.006820737384259701,
-0.4651852548122406,
-0.06801159679889679,
0.2614422142505646,
-1.0148698091506958,
0.15719613432884216,
-0.1780211478471756,
0.40162160992622375,
0.0957283377647399... |
func UpdateDestination(svc Service, dst Destination) error {
ic := &ipvsCommand{
Service: newIPVSService(&svc),
Destination: newIPVSDestination(&dst),
}
return netlink.SendMessageMarshalled(C.IPVS_CMD_SET_DEST, family, 0, ic)
} | [
-1.6756356954574585,
-0.5114995837211609,
0.44234365224838257,
-0.4612387418746948,
-0.703360915184021,
-0.14231418073177338,
-0.46625760197639465,
0.07091836631298065,
0.2263181209564209,
-0.05092073976993561,
-0.010118852369487286,
0.234075129032135,
0.3986654281616211,
-0.15105421841144... |
func DeleteDestination(svc Service, dst Destination) error {
ic := &ipvsCommand{
Service: newIPVSService(&svc),
Destination: newIPVSDestination(&dst),
}
return netlink.SendMessageMarshalled(C.IPVS_CMD_DEL_DEST, family, 0, ic)
} | [
-0.8766310811042786,
0.39206334948539734,
0.49785560369491577,
-0.3143976032733917,
-0.28154438734054565,
-0.17979755997657776,
-0.29867497086524963,
0.08354537934064865,
0.6151431798934937,
-1.1134312152862549,
0.08667712658643723,
0.2161903828382492,
0.3924414813518524,
-0.18833570182323... |
func destinations(svc *Service) ([]*Destination, error) {
msg, err := netlink.NewMessage(C.IPVS_CMD_GET_DEST, family, netlink.MFDump)
if err != nil {
return nil, err
}
defer msg.Free()
ic := &ipvsCommand{Service: newIPVSService(svc)}
if err := msg.Marshal(ic); err != nil {
return nil, err
}
var dsts []*De... | [
-1.2578988075256348,
0.48233282566070557,
0.5719625949859619,
-0.4660564959049225,
0.28999441862106323,
-0.9592404961585999,
-0.2127208262681961,
-0.3781704306602478,
0.23985305428504944,
-0.061411235481500626,
0.1565706431865692,
-0.04394514113664627,
0.10669770836830139,
0.26204928755760... |
func services(svc *Service) ([]*Service, error) {
var flags int
if svc == nil {
flags = netlink.MFDump
}
msg, err := netlink.NewMessage(C.IPVS_CMD_GET_SERVICE, family, flags)
if err != nil {
return nil, err
}
defer msg.Free()
if svc != nil {
ic := &ipvsCommand{Service: newIPVSService(svc)}
if err := m... | [
-1.4827430248260498,
0.4457712471485138,
0.5354834198951721,
-0.47892045974731445,
0.13396815955638885,
-0.6153326630592346,
0.27263715863227844,
-0.539905846118927,
0.48214176297187805,
-0.6382058262825012,
0.24432624876499176,
-0.07317815721035004,
-0.4081064462661743,
0.4865425229072571... |
func GetService(svc *Service) (*Service, error) {
svcs, err := services(svc)
if err != nil {
return nil, err
}
if len(svcs) == 0 {
return nil, errors.New("no service found")
}
return svcs[0], nil
} | [
-0.009514103643596172,
0.1521380990743637,
0.2127152383327484,
0.6330873966217041,
0.255612313747406,
-0.6656734347343445,
0.21118800342082977,
-1.1235822439193726,
0.439412921667099,
-0.5578842163085938,
0.3420943319797516,
0.6500954627990723,
-0.4682570993900299,
0.8103172183036804,
0.... |
func GetServices() ([]*Service, error) {
return services(nil)
} | [
-0.37984010577201843,
0.8173187971115112,
0.3713456392288208,
0.8842853307723999,
1.0043818950653076,
-0.33450067043304443,
0.0026751558762043715,
-1.1183593273162842,
0.6888600587844849,
-1.5990018844604492,
-0.3225281238555908,
0.765583872795105,
-1.3141907453536987,
0.9994670748710632,
... |
func (c Cross) Blazon(count int, tincture string) (string, error) {
blazon, err := blazonForCharge(count, "cross", "crosses", "", tincture)
if err != nil {
err = fmt.Errorf("failed to generate blazon for cross: %w", err)
return "", err
}
return blazon, nil
} | [
0.7075234651565552,
-0.15887893736362457,
0.4842759370803833,
0.27219828963279724,
0.008954639546573162,
-0.20367535948753357,
0.5739918947219849,
0.22712400555610657,
-0.045171108096838,
0.5673990249633789,
-0.4874969720840454,
0.31817376613616943,
-0.23514042794704437,
0.2096912413835525... |
func (f Fess) Blazon(count int, tincture string) (string, error) {
blazon, err := blazonForCharge(count, "fess", "fesses", "", tincture)
if err != nil {
err = fmt.Errorf("failed to generate blazon for fess: %w", err)
return "", err
}
return blazon, nil
} | [
0.3804437816143036,
-0.18510238826274872,
0.3864910304546356,
-0.06298431754112244,
-0.26788046956062317,
-0.6172682046890259,
-0.16614924371242523,
0.5491130948066711,
0.043444570153951645,
-0.10565267503261566,
-0.5124173164367676,
0.27610471844673157,
0.4976503849029541,
0.3138814270496... |
func (p Pale) Blazon(count int, tincture string) (string, error) {
blazon, err := blazonForCharge(count, "pale", "pales", "", tincture)
if err != nil {
err = fmt.Errorf("failed to generate blazon for pale: %w", err)
return "", err
}
return blazon, nil
} | [
0.07919890433549881,
-0.2103128582239151,
0.538528561592102,
-0.23371022939682007,
-0.006754850037395954,
0.07514866441488266,
-0.018311962485313416,
0.15707853436470032,
0.3003632724285126,
0.05762868747115135,
-0.4982602596282959,
0.16639304161071777,
-0.5430251955986023,
0.0127034401521... |
func (r Roundel) Blazon(count int, tincture string) (string, error) {
blazon, err := blazonForCharge(count, "roundel", "roundels", "", tincture)
if err != nil {
err = fmt.Errorf("failed to generate blazon for roundel: %w", err)
return "", err
}
return blazon, nil
} | [
0.30265921354293823,
-0.4238159954547882,
0.45023202896118164,
0.02593887597322464,
-0.3264686167240143,
-0.45767268538475037,
0.8713236451148987,
-0.08872506767511368,
-0.06628649681806564,
0.3826177716255188,
-0.2995290160179138,
0.2915136516094208,
-0.47065168619155884,
0.13034597039222... |
func (c Cross) GetTags() []string {
tags := []string{
"full size",
"ordinary",
}
return tags
} | [
0.6140381097793579,
0.49340906739234924,
0.48798903822898865,
0.49425017833709717,
1.2909777164459229,
0.005936694331467152,
-0.6375505924224854,
-0.5330744385719299,
-0.04316474124789238,
0.5950065851211548,
-0.7227963209152222,
0.6145013570785522,
-0.25341665744781494,
0.7501030564308167... |
func (f Fess) GetTags() []string {
tags := []string{
"full size",
"ordinary",
}
return tags
} | [
0.36761805415153503,
0.5284651517868042,
0.38834860920906067,
0.36479824781417847,
0.9299237132072449,
-0.22408506274223328,
-1.0881497859954834,
-0.5447890162467957,
0.17532703280448914,
-0.5179926753044128,
-0.6859344244003296,
0.611095666885376,
0.8330214023590088,
1.145740270614624,
... |
func (p Pale) GetTags() []string {
tags := []string{
"full size",
"ordinary",
}
return tags
} | [
0.026599053293466568,
0.32686522603034973,
0.4823017716407776,
0.14900118112564087,
1.032891035079956,
0.3372719883918762,
-1.302838683128357,
-1.053273320198059,
0.6310107707977295,
-0.08934956789016724,
-0.7169473767280579,
0.684978723526001,
-0.3405683934688568,
0.7360996007919312,
-0... |
func (r Roundel) GetTags() []string {
tags := []string{
"ordinary",
}
return tags
} | [
-0.02993159368634224,
0.10550104826688766,
0.4822099506855011,
0.10667283833026886,
0.7743754386901855,
0.6318193078041077,
-0.5775165557861328,
-1.1526139974594116,
0.01749608851969242,
0.09458541125059128,
-0.43922069668769836,
0.6298883557319641,
-0.43849095702171326,
1.0761936902999878... |
func Load(filename string) (*monitor.Config, error) {
if err := exists(filename); err != nil {
return nil, fmt.Errorf("failed to load file %v: %v", filename, err)
}
b, err := ioutil.ReadFile(filename)
if err != nil {
return nil, fmt.Errorf("failed to load file %v: %v", filename, err)
}
cfg := &monitor.Confi... | [
0.38274577260017395,
-0.24822686612606049,
0.6869109272956848,
-0.9136321544647217,
-0.5482996106147766,
-0.5778740644454956,
0.19668669998645782,
0.48744872212409973,
-0.873934805393219,
0.4073527455329895,
-0.49097952246665955,
-0.4117465913295746,
-0.7997406721115112,
0.0717100948095321... |
func (t *AccountManagementChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
function, args := stub.GetFunctionAndParameters()
// Handle different functions
if function == "issue" {
// Assign ownership
return t.issue(stub, args)
} else if function == "assign" {
// Assign ownership
return t.a... | [
-0.8498859405517578,
-0.17060676217079163,
0.8667541742324829,
0.6555565595626831,
0.35918089747428894,
-0.648845374584198,
0.2573696970939636,
-0.5033764839172363,
0.1916189342737198,
-0.5855592489242554,
0.5936803817749023,
0.6474950313568115,
-0.4444493055343628,
-0.188588485121727,
0... |
func (t *AccountManagementChaincode) query(stub shim.ChaincodeStubInterface, function string, args []string) pb.Response {
fmt.Println("Query " + function)
if function == "user" {
return t.queryUserBalance(stub, args)
} else if function == "organization" {
return t.queryOrganizationBalance(stub, args)
} else {... | [
-0.028705133125185966,
-0.2806800305843353,
0.3982461392879486,
0.6079134345054626,
0.3837307393550873,
-0.3929331302642822,
-0.2574211657047272,
-0.5517282485961914,
0.4533606767654419,
-0.17655859887599945,
1.1851295232772827,
0.8398280739784241,
-0.5296292901039124,
-0.00240306346677243... |
func (emitter *EventEmitter) AddListener(eventName string, listener func(...interface{})) *EventEmitter {
return emitter.On(eventName, listener)
} | [
0.09509491920471191,
-0.12953205406665802,
0.3222403824329376,
-0.06599647551774979,
-0.48952239751815796,
0.42254677414894104,
-1.17503821849823,
1.1461575031280518,
-0.2623533308506012,
-0.828102707862854,
-0.02113427221775055,
-0.08406971395015717,
-0.3148922324180603,
0.521923780441284... |
func (emitter *EventEmitter) Emit(eventName string, args ...interface{}) bool {
if len(emitter.listenerMap[eventName]) == 0 {
return false
}
go func(listerners []func(...interface{})) {
for _, listerner := range listerners {
listerner(args...)
}
}(emitter.listenerMap[eventName])
return true
} | [
-0.8205190300941467,
0.1711162030696869,
0.5738621354103088,
-0.5166777968406677,
0.9439734220504761,
0.21981629729270935,
-0.4487292170524597,
0.5997355580329895,
-0.8539004921913147,
-0.018088875338435173,
-0.5774053931236267,
-0.4477279484272003,
-1.28630530834198,
0.8764029145240784,
... |
func (emitter *EventEmitter) EventNames() []string {
return getListenerMapKeys(emitter.listenerMap)
} | [
-0.4527483582496643,
-0.8607726693153381,
0.3581461012363434,
0.1782880574464798,
-0.21550382673740387,
-0.19315579533576965,
-0.8566256761550903,
0.49349266290664673,
0.07010473310947418,
0.4291229844093323,
-0.42557939887046814,
0.3854916989803314,
-0.037700243294239044,
0.49615326523780... |
func (emitter *EventEmitter) Listeners(eventName string) []func(...interface{}) {
listeners := make([]func(...interface{}), len(emitter.listenerMap[eventName]))
copy(listeners, emitter.listenerMap[eventName])
return listeners
} | [
-0.6009715795516968,
-0.9172652363777161,
0.3751799166202545,
-0.607520580291748,
0.0067921411246061325,
-0.1888561099767685,
0.10660749673843384,
0.5410098433494568,
0.7554317712783813,
-0.22005333006381989,
-1.0923606157302856,
0.5299067497253418,
0.33449023962020874,
0.37554651498794556... |
func (emitter *EventEmitter) On(eventName string, listener func(...interface{})) *EventEmitter {
return emitter.addListener(eventName, listener, false)
} | [
0.4141501486301422,
-0.6912077069282532,
0.37611693143844604,
-0.5031755566596985,
-0.6964353322982788,
0.39751946926116943,
-1.8208762407302856,
1.6368610858917236,
-0.4880686402320862,
-0.2848786413669586,
-0.5741490125656128,
0.32376453280448914,
-0.34337136149406433,
0.4407110214233398... |
func (emitter *EventEmitter) Off(eventName string, listener func(...interface{})) *EventEmitter {
return emitter.RemoveListener(eventName, listener)
} | [
0.47603198885917664,
-0.6498975157737732,
0.3569667339324951,
-0.3853592574596405,
-1.6251791715621948,
0.9750723838806152,
-0.6703881621360779,
1.1091562509536743,
-0.6347883939743042,
-0.4057471752166748,
-0.02253539115190506,
0.5448252558708191,
-0.3214755952358246,
0.4815496802330017,
... |
func (emitter *EventEmitter) Once(eventName string, listener func(...interface{})) *EventEmitter {
return emitter
} | [
-0.27577877044677734,
0.008552663028240204,
0.3959306478500366,
0.01697401888668537,
0.11867281049489975,
0.11829657107591629,
-0.6220230460166931,
1.1698102951049805,
-0.661973774433136,
-0.04467122629284859,
-0.5318436622619629,
0.5561577081680298,
-0.43823641538619995,
0.577667951583862... |
func (emitter *EventEmitter) PrependListener(eventName string, listener func(...interface{})) *EventEmitter {
return emitter.addListener(eventName, listener, true)
} | [
0.4584607183933258,
-0.3020389974117279,
0.5421606302261353,
-0.26732656359672546,
-0.5398944616317749,
0.969297468662262,
-0.9275482892990112,
0.5416595935821533,
0.42561066150665283,
-0.18912373483181,
0.20934134721755981,
0.13871899247169495,
0.012846086174249649,
0.848486065864563,
-... |
func (emitter *EventEmitter) PrependOnceListener(eventName string, listener func(...interface{})) *EventEmitter {
return emitter
} | [
0.9482588171958923,
-0.914341926574707,
0.4938875138759613,
0.265595018863678,
-0.8010233044624329,
0.8537330031394958,
-0.6473100185394287,
0.8147222399711609,
0.5091888904571533,
-0.042170438915491104,
0.3016342222690582,
0.30182433128356934,
0.13336440920829773,
1.163223147392273,
0.0... |
func (emitter *EventEmitter) RemoveAllListeners(eventNames []string) *EventEmitter {
if len(eventNames) == 0 {
eventNames = getListenerMapKeys(emitter.listenerMap)
}
for _, eventName := range eventNames {
for i := range emitter.listenerMap[eventName] {
emitter.listenerMap[eventName][i] = nil
}
delete(emit... | [
-0.5750383138656616,
-1.352480173110962,
0.8537089228630066,
0.09045536071062088,
-0.4784998297691345,
-0.5615255236625671,
-0.8491132855415344,
1.290792465209961,
0.40431952476501465,
0.32934144139289856,
-0.12895795702934265,
0.0884585976600647,
-1.6456632614135742,
1.0081002712249756,
... |
func (emitter *EventEmitter) RemoveListener(eventName string, listener func(...interface{})) *EventEmitter {
for idx, registredListener := range emitter.listenerMap[eventName] {
registeredFn := getListenerFunc(registredListener)
listenerFn := getListenerFunc(listener)
if registeredFn == nil || listenerFn == nil ... | [
0.21157856285572052,
-0.898490846157074,
0.609035849571228,
-0.3445234000682831,
-0.3672250807285309,
-0.7250332832336426,
0.0009540923056192696,
1.2213815450668335,
0.25094732642173767,
-0.16761483252048492,
-0.023700159043073654,
0.05401207506656647,
-0.6615915894508362,
0.83072769641876... |
func (emitter *EventEmitter) RawListeners(eventName string) {
} | [
-1.0532293319702148,
-0.9349249005317688,
0.5647155046463013,
-0.6465778350830078,
-0.8527948260307312,
0.040080614387989044,
-0.4264417588710785,
0.6649265885353088,
0.4696870744228363,
0.0492946095764637,
-0.8860399127006531,
0.377384752035141,
0.3187236487865448,
-0.05954355373978615,
... |
func (in *K8SClient) GetSecret(namespace, name string) (*core_v1.Secret, error) {
configMap, err := in.k8s.CoreV1().Secrets(namespace).Get(in.ctx, name, emptyGetOptions)
if err != nil {
return &core_v1.Secret{}, err
}
return configMap, nil
} | [
-0.4145769476890564,
0.26541054248809814,
0.5362251996994019,
0.886180579662323,
0.10168508440256119,
-0.8300530910491943,
-1.0165023803710938,
-1.3978865146636963,
0.153860405087471,
0.3048814833164215,
-0.6864644885063171,
1.4539200067520142,
-0.3465626537799835,
0.05304522067308426,
0... |
func ParseRemoteSecretBytes(secretBytes []byte) (*RemoteSecret, error) {
secret := &RemoteSecret{}
err := yaml.Unmarshal(secretBytes, &secret)
if err != nil {
return nil, err
}
return secret, nil
} | [
0.7036853432655334,
-0.826775074005127,
0.2300131618976593,
-0.6807166934013367,
-0.498719722032547,
0.5215196013450623,
-1.0886119604110718,
0.20890504121780396,
0.11924906075000763,
0.34185507893562317,
-2.3455026149749756,
0.08486559987068176,
-0.7470131516456604,
0.4368087351322174,
... |
func NewDate(s string) Date {
t, err := time.Parse("2006-01-02", s)
if err != nil {
panic(`NewDate(string) requires format "2006-01-02"`)
}
return Date(t)
} | [
1.3218992948532104,
-0.41678285598754883,
0.4709804356098175,
1.0652064085006714,
-1.382429838180542,
-0.16513533890247345,
-1.1505775451660156,
-0.4062669575214386,
0.5726420283317566,
-0.2847802937030792,
-0.3756420910358429,
0.2088536024093628,
0.11273718625307083,
-0.41822168231010437,... |
func genASCII(path, s string) {
mustWriteFile(path, []byte(s))
} | [
0.28335708379745483,
-0.8417124152183533,
0.3481508791446686,
0.003992010839283466,
-0.315777987241745,
0.5165368318557739,
0.317632794380188,
0.45874732732772827,
-1.2451629638671875,
0.2336386889219284,
-0.8839995265007019,
0.28822386264801025,
0.8264150023460388,
-0.604255199432373,
-... |
func genUTF8(path, s string) {
mustWriteFile(path, []byte(s))
} | [
-0.21427898108959198,
0.08141493797302246,
0.19376985728740692,
0.24356088042259216,
-0.29443293809890747,
0.4940248429775238,
0.6949870586395264,
1.178177833557129,
-0.29070478677749634,
0.008959859609603882,
-0.02677403762936592,
-0.24485337734222412,
0.6801178455352783,
-0.9584752321243... |
func genUTF16(path, s string, order binary.ByteOrder) {
bs := utf16.Encode([]rune(s))
buf := &bytes.Buffer{}
if err := binary.Write(buf, order, bs); err != nil {
panic(err)
}
mustWriteFile(path, buf.Bytes())
} | [
0.4726674258708954,
0.5157239437103271,
0.4686679244041443,
-0.1096494197845459,
0.3310980498790741,
0.027939552441239357,
0.1395075023174286,
0.25505194067955017,
-0.7128026485443115,
0.06786256283521652,
-0.5936808586120605,
-0.2236161082983017,
0.5778264403343201,
-0.7887311577796936,
... |
func genNullTerm(path, s string) {
mustWriteFile(path, []byte(s+"\x00"))
} | [
0.4330095946788788,
-1.0734443664550781,
0.372852087020874,
-0.27961257100105286,
0.025101477280259132,
-0.14619792997837067,
-0.2861438989639282,
0.8649560213088989,
0.24847930669784546,
0.17493493854999542,
-0.8511010408401489,
0.8122721314430237,
0.4636686146259308,
-0.4489292800426483,... |
func mustWriteFile(path string, data []byte) {
log.Printf("creating %q", path)
if err := ioutil.WriteFile(path, data, 0644); err != nil {
panic(err)
}
} | [
0.545067548751831,
0.08585208654403687,
0.39644867181777954,
0.5038724541664124,
0.8688555359840393,
1.7944897413253784,
-0.9533622860908508,
0.33460694551467896,
-0.6732980608940125,
0.034679267555475235,
-0.08615797758102417,
-0.3138201832771301,
0.13877937197685242,
0.07591784745454788,... |
func (p *Parser) ParseIndirect(line *lexer.Line, mode string) *node.Node {
node := node.NewNode()
node.Instruction = line.Tokens[0].Type
line.ExpectSequence([][]string{
{"left_paren"},
{"dollar"},
{"integer"},
})
integerValue := line.CurrentToken().Value
if mode == "x" {
node.Opcode = getOpcodeForIndir... | [
0.0073310439474880695,
-0.3356204032897949,
0.759734570980072,
-0.9953278303146362,
-0.6977066397666931,
0.013831066899001598,
-0.10394633561372757,
0.11567925661802292,
-0.1551712155342102,
0.13905172049999237,
-0.08560821413993835,
0.699356734752655,
-0.1980234682559967,
-0.3360677659511... |
func ConstructState(store adt.Store, rootKeyAddress addr.Address) (*State, error) {
emptyMapCid, err := adt.StoreEmptyMap(store, builtin.DefaultHamtBitwidth)
if err != nil {
return nil, xerrors.Errorf("failed to create empty map: %w", err)
}
return &State{
RootKey: rootKeyAddress,
Verifiers:... | [
0.17229320108890533,
-0.22082409262657166,
0.31144818663597107,
-0.18718312680721283,
-0.5787062048912048,
-0.3412341773509979,
0.15245823562145233,
0.5652059316635132,
0.6302169561386108,
-0.4646685719490051,
0.43349021673202515,
0.013613729737699032,
-0.3118169605731964,
0.27911981940269... |
func removeDataCapRequestIsValidOrAbort(rt runtime.Runtime, request RemoveDataCapRequest, id RmDcProposalID, toRemove DataCap, client address.Address) {
proposal := RemoveDataCapProposal{
RemovalProposalID: id,
DataCapAmount: toRemove,
VerifiedClient: client,
}
buf := bytes.Buffer{}
buf.WriteString(Sig... | [
-0.10392960906028748,
-0.31538116931915283,
0.6936739087104797,
-0.19710814952850342,
-0.45411813259124756,
-0.28710252046585083,
-0.2192363739013672,
-0.2615198493003845,
1.0563602447509766,
0.6485176682472229,
0.15933869779109955,
0.3619842231273651,
-0.4805355668067932,
0.18419523537158... |
func FastWrite(out io.Writer, x []int16) (int, error) {
const sizeOfScalar = 2
if len(x) == 0 {
return 0, nil
}
numBytes := len(x) * sizeOfScalar
var xb []byte
hx := (*reflect.SliceHeader)(unsafe.Pointer(&xb))
hx.Cap = numBytes
hx.Len = numBytes
hx.Data = uintptr(unsafe.Pointer(&x[0]))
n, err := out.Write(x... | [
0.26147550344467163,
0.7323974967002869,
0.7158190011978149,
0.4908924102783203,
-0.012146458961069584,
-0.9373481273651123,
0.011605074629187584,
-0.43543189764022827,
-0.2641987204551697,
0.012264176271855831,
-0.54114830493927,
0.2949717044830322,
0.1079324334859848,
-0.0432813204824924... |
func (rs *Resolver) Transfer(args *struct{ ToTransfer inputs.TransferInput }) (*types.Transaction, error) {
// get the source id
fid, err := strconv.Atoi(string(args.ToTransfer.FromAccountId))
if err != nil {
// log the error and quit
rs.log.Errorf("GQL->Mutation->Transfer(): Invalid source account ID [%s]. %s",... | [
0.01266250666230917,
0.2531795799732208,
0.755872368812561,
-0.429583340883255,
0.20050083100795746,
-0.6085523366928101,
0.04914817586541176,
-0.7628328800201416,
-0.1704675704240799,
0.38540568947792053,
-0.0632094293832779,
0.5572118759155273,
0.3473987579345703,
-0.33062323927879333,
... |
func (rs *Resolver) Burst(args *struct {
FromAccountId graphql.ID
Amount models.Amount
TargetsCount int32
}) ([]*types.Transaction, error) {
// prep empty result set slice
result := make([]*types.Transaction, 0)
// get the source account id
id, err := strconv.Atoi(string(args.FromAccountId))
if err != ... | [
-0.23456966876983643,
0.8105019927024841,
0.7177664637565613,
-0.17258110642433167,
0.5037760734558105,
-0.3750675320625305,
0.4853292405605316,
-0.5232802033424377,
0.34935930371284485,
0.5066745281219482,
-0.03351724147796631,
0.3898903727531433,
-0.08095640689134598,
0.11486562341451645... |
func (s *Service) CompareInfo(c context.Context, rid int64) (err error) {
var (
games []*model.Game
sysiInfo = &model.SysInfo{}
emailphone = &model.CheckEmailPhone{}
sysRegCheck string
sysUnamesCheck string
sysSafeCheck string
sysCardCheck string
sysPwdsCh... | [
-0.146760955452919,
-0.4339044988155365,
0.9970470666885376,
0.1578410565853119,
0.4865347146987915,
0.175970196723938,
0.7412142753601074,
-0.4250989854335785,
0.11189496517181396,
-0.07054100930690765,
-0.19440338015556335,
-0.19845205545425415,
-0.6622054576873779,
0.5847228765487671,
... |
func lcm(a, b int) int {
return a * b / gcd(a, b)
} | [
0.46472564339637756,
0.0624295212328434,
0.3784724473953247,
-1.7225037813186646,
0.048673756420612335,
0.2686157524585724,
-1.393186330795288,
-0.2944957911968231,
0.2424909770488739,
-0.4416855275630951,
0.6529495716094971,
-0.17876777052879333,
0.011545534245669842,
-0.13891947269439697... |
func KindMap(adapterInfo map[string]*adapter.Info, templateInfo map[string]*template.Info) map[string]proto.Message {
kindMap := make(map[string]proto.Message)
// typed instances
for kind, info := range templateInfo {
kindMap[kind] = info.CtrCfg
log.Debugf("template kind: %s, %v", kind, info.CtrCfg)
}
// typed... | [
-0.2909602224826813,
-0.8512293100357056,
0.6433191895484924,
-0.6806595325469971,
-0.32554391026496887,
0.625328004360199,
0.4261947572231293,
-0.2562588155269623,
-0.5716121792793274,
0.11771009862422943,
-0.06841250509023666,
0.6398317813873291,
-0.46733489632606506,
0.46844691038131714... |
func CriticalKinds() []string {
ck := make([]string, 0, 6)
ck = append(ck, constant.RulesKind)
ck = append(ck, constant.AttributeManifestKind)
ck = append(ck, constant.AdapterKind)
ck = append(ck, constant.TemplateKind)
ck = append(ck, constant.InstanceKind)
ck = append(ck, constant.HandlerKind)
return ck
} | [
0.3985396921634674,
-0.9709632992744446,
0.4715467095375061,
0.06054443120956421,
-0.08509892225265503,
0.3021964728832245,
-0.4970865547657013,
-0.1365106999874115,
0.2687753140926361,
0.23801864683628082,
0.18812333047389984,
0.5210197567939758,
-0.47311708331108093,
0.1459282636642456,
... |
func calculateKPIs(counters map[string]int) map[string]int {
kpi := make(map[string]int)
// 2.1 Accessibility (EUtranCellFDD/TDD)
if counters["pmRrcConnEstabAtt"]-counters["pmRrcConnEstabAttReatt"]-counters["pmRrcConnEstabFailMmeOvlMos"]-counters["pmRrcConnEstabFailMmeOvlMod"] == 0 {
kpi["Acc_RrcConnSetupSuccRate... | [
0.5542892217636108,
-0.36869025230407715,
0.5928556323051453,
0.11050047725439072,
-0.5320762991905212,
0.35162389278411865,
0.14012786746025085,
0.12896747887134552,
-0.23454993963241577,
0.5211608409881592,
0.24853457510471344,
-0.2590150535106659,
0.7668311595916748,
0.02292043343186378... |
func LoadCertsFromEnvVariable(crtEnvVar string, keyEnvVar string) error {
err := createDirectoryIfNotExist(getBasePath())
if err != nil {
return err
}
err = writeFile(GetCertificatePath(), crtEnvVar)
if err != nil {
return err
}
err = writeFile(GetKeyPath(), keyEnvVar)
if err != nil {
return err
}
re... | [
0.23236362636089325,
-0.7688226699829102,
0.6672264933586121,
0.7714881300926208,
0.5682975053787231,
0.21837003529071808,
0.20698970556259155,
-0.2259271889925003,
-0.7973930835723877,
0.9683234691619873,
-0.38975879549980164,
0.034520987421274185,
-0.6499311327934265,
0.21452495455741882... |
func GenerateCertificate(cert x509.Certificate) (string, string, error) {
// priv, err := rsa.GenerateKey(rand.Reader, *rsaBits)
priv, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
if err != nil {
log.Error(err)
return "", "", err
}
derBytes, err := x509.CreateCertificate(rand.Reader, &cert, &cert, p... | [
-0.30172550678253174,
0.1555061936378479,
0.8546555042266846,
-0.07638552039861679,
-0.2953786849975586,
-0.023015199229121208,
-0.7585794925689697,
0.23039907217025757,
0.08156929165124893,
0.5617063045501709,
-0.8373575210571289,
-0.022956479340791702,
-0.3671141266822815,
0.227869808673... |
func Open(dbname string, o *Options) (*DB, error) {
var errStr *C.char
ldbname := C.CString(dbname)
defer C.free(unsafe.Pointer(ldbname))
leveldb := C.leveldb_open(o.Opt, ldbname, &errStr)
if errStr != nil {
gs := C.GoString(errStr)
C.leveldb_free(unsafe.Pointer(errStr))
return nil, DatabaseError(gs)
}
re... | [
-0.17801888287067413,
0.30820751190185547,
0.49510207772254944,
-0.5987493991851807,
-0.7765167355537415,
0.8750957250595093,
0.31344082951545715,
0.3625734746456146,
-0.1227053627371788,
0.13963796198368073,
-0.4099563956260681,
0.4707040786743164,
-1.5100319385528564,
-0.4578065276145935... |
func DestroyDatabase(dbname string, o *Options) error {
var errStr *C.char
ldbname := C.CString(dbname)
defer C.free(unsafe.Pointer(ldbname))
C.leveldb_destroy_db(o.Opt, ldbname, &errStr)
if errStr != nil {
gs := C.GoString(errStr)
C.leveldb_free(unsafe.Pointer(errStr))
return DatabaseError(gs)
}
return n... | [
-0.306179016828537,
0.43571117520332336,
0.5666295289993286,
-0.6736935377120972,
0.5084888935089111,
-0.11657353490591049,
-0.13765665888786316,
-0.12612639367580414,
-0.03640215843915939,
0.36337631940841675,
-0.40644851326942444,
-0.31681177020072937,
-1.5738879442214966,
0.569463849067... |
func RepairDatabase(dbname string, o *Options) error {
var errStr *C.char
ldbname := C.CString(dbname)
defer C.free(unsafe.Pointer(ldbname))
C.leveldb_repair_db(o.Opt, ldbname, &errStr)
if errStr != nil {
gs := C.GoString(errStr)
C.leveldb_free(unsafe.Pointer(errStr))
return DatabaseError(gs)
}
return nil... | [
-0.25393447279930115,
0.35929709672927856,
0.4313923418521881,
-0.8346290588378906,
0.03829072415828705,
-0.2106294333934784,
0.33771389722824097,
0.11004068702459335,
0.12414736300706863,
0.19897781312465668,
-0.37603721022605896,
0.42455583810806274,
-1.649804711341858,
-0.14218290150165... |
func (db *DB) Put(wo *WriteOptions, key, value []byte) error {
if db.closed {
panic(ErrDBClosed)
}
var errStr *C.char
// leveldb_put, _get, and _delete call memcpy() (by way of Memtable::Add)
// when called, so we do not need to worry about these []byte being
// reclaimed by GC.
var k, v *C.char
if len(key) ... | [
-0.3486842215061188,
0.39113861322402954,
0.8026074767112732,
-0.9725183248519897,
0.10267198085784912,
0.275408536195755,
0.13624756038188934,
-0.3659614324569702,
-0.6731389760971069,
0.6988828182220459,
-0.19006499648094177,
0.48510900139808655,
-1.343733310699463,
0.09302514046430588,
... |
func (db *DB) Get(ro *ReadOptions, key []byte) ([]byte, error) {
if db.closed {
panic(ErrDBClosed)
}
var errStr *C.char
var vallen C.size_t
var k *C.char
if len(key) != 0 {
k = (*C.char)(unsafe.Pointer(&key[0]))
}
value := C.leveldb_get(
db.Ldb, ro.Opt, k, C.size_t(len(key)), &vallen, &errStr)
if errS... | [
-0.6549928784370422,
-0.12180566787719727,
0.9437065124511719,
-0.5463029146194458,
0.24608497321605682,
-0.32269129157066345,
-0.8558094501495361,
-0.4113951325416565,
-0.7068185210227966,
0.603818953037262,
0.17494967579841614,
0.33051735162734985,
-1.0892746448516846,
-0.162706375122070... |
func (db *DB) Delete(wo *WriteOptions, key []byte) error {
if db.closed {
panic(ErrDBClosed)
}
var errStr *C.char
var k *C.char
if len(key) != 0 {
k = (*C.char)(unsafe.Pointer(&key[0]))
}
C.leveldb_delete(
db.Ldb, wo.Opt, k, C.size_t(len(key)), &errStr)
if errStr != nil {
gs := C.GoString(errStr)
C... | [
0.06736427545547485,
0.1935223937034607,
0.6886193752288818,
-0.152906134724617,
0.235943004488945,
0.16107343137264252,
-0.09288008511066437,
-0.16882121562957764,
-0.3382112979888916,
1.0537824630737305,
0.037122372537851334,
-0.07689035683870316,
-2.010098695755005,
0.12220273166894913,... |
func (db *DB) Write(wo *WriteOptions, w *WriteBatch) error {
if db.closed {
panic(ErrDBClosed)
}
var errStr *C.char
C.leveldb_write(db.Ldb, wo.Opt, w.wbatch, &errStr)
if errStr != nil {
gs := C.GoString(errStr)
C.leveldb_free(unsafe.Pointer(errStr))
return DatabaseError(gs)
}
return nil
} | [
-0.48708459734916687,
0.143413245677948,
0.40307870507240295,
-0.05318567529320717,
0.8529959321022034,
0.7401164770126343,
-0.04365815222263336,
-0.39474719762802124,
-0.5710120797157288,
0.3914046287536621,
-0.3362846076488495,
0.10265611112117767,
-1.3297446966171265,
0.4072951078414917... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.