text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (e *ExpectedBegin) WillDelayFor(duration time.Duration) *ExpectedBegin {
e.delay = duration
return e
} | [
0.1829773485660553,
-0.0052722543478012085,
0.4123997986316681,
-0.07574261724948883,
-0.6363227963447571,
1.5284830331802368,
0.685012936592102,
0.8594022393226624,
0.37875738739967346,
-1.7447689771652222,
-0.32381969690322876,
0.6159646511077881,
0.9533284306526184,
1.1888384819030762,
... |
func (e *ExpectedCommit) String() string {
msg := "ExpectedCommit => expecting transaction Commit"
if e.err != nil {
msg += fmt.Sprintf(", which should return error: %s", e.err)
}
return msg
} | [
0.5967938899993896,
-0.6054688096046448,
0.5467408895492554,
-0.7884517312049866,
-0.037469532340765,
0.06678296625614166,
0.19947314262390137,
-0.3834477365016937,
-0.3642973303794861,
1.1172666549682617,
1.2222648859024048,
0.28363037109375,
-0.6413034200668335,
-0.37130987644195557,
0... |
func (e *ExpectedRollback) String() string {
msg := "ExpectedRollback => expecting transaction Rollback"
if e.err != nil {
msg += fmt.Sprintf(", which should return error: %s", e.err)
}
return msg
} | [
0.3881404995918274,
-0.2496993988752365,
0.5943673849105835,
-0.6194853186607361,
-0.1555401086807251,
0.19151417911052704,
0.30317673087120056,
0.1406029313802719,
0.4210790991783142,
1.0023505687713623,
0.98748779296875,
0.7668988108634949,
-0.7181278467178345,
-0.6596329212188721,
0.3... |
func (e *ExpectedQuery) WithArgs(args ...driver.Value) *ExpectedQuery {
e.args = args
return e
} | [
-0.15848444402217865,
0.062348753213882446,
-0.09373757988214493,
-0.9077743291854858,
0.48744264245033264,
0.09721112251281738,
-0.2051081359386444,
0.34377026557922363,
0.03688521310687065,
-0.22563990950584412,
1.037428855895996,
-0.16273029148578644,
-0.037314265966415405,
0.9100919365... |
func (e *ExpectedQuery) RowsWillBeClosed() *ExpectedQuery {
e.rowsMustBeClosed = true
return e
} | [
0.49544939398765564,
0.19491985440254211,
0.4039006531238556,
-0.6418499946594238,
0.1756822168827057,
0.7574049234390259,
0.2834903299808502,
0.8050034642219543,
1.4125514030456543,
-0.5276269316673279,
0.2516815662384033,
0.4798908829689026,
0.23099090158939362,
1.6351280212402344,
-1.... |
func (e *ExpectedQuery) WillDelayFor(duration time.Duration) *ExpectedQuery {
e.delay = duration
return e
} | [
0.17080630362033844,
0.1320466548204422,
0.25240883231163025,
-0.25721192359924316,
-0.37597164511680603,
1.2917851209640503,
0.41369888186454773,
0.43470054864883423,
0.28557267785072327,
-1.612504005432129,
-0.058267150074243546,
0.09931564331054688,
1.1620497703552246,
1.313981771469116... |
func (e *ExpectedQuery) String() string {
msg := "ExpectedQuery => expecting Query, QueryContext or QueryRow which:"
msg += "\n - matches sql: '" + e.expectSQL + "'"
if len(e.args) == 0 {
msg += "\n - is without arguments"
} else {
msg += "\n - is with arguments:\n"
for i, arg := range e.args {
msg += ... | [
0.011371213011443615,
-0.7488988637924194,
0.48562243580818176,
-1.0120694637298584,
-0.2629334032535553,
0.1806051880121231,
-0.06904475390911102,
-0.6566721200942993,
-0.12839126586914062,
0.30701112747192383,
1.0639997720718384,
0.9168941378593445,
-0.3074321746826172,
0.705236196517944... |
func (e *ExpectedExec) WithArgs(args ...driver.Value) *ExpectedExec {
e.args = args
return e
} | [
-0.24356812238693237,
0.3952649235725403,
0.09205992519855499,
-0.2782415449619293,
0.7892765998840332,
-0.02715240977704525,
0.10863649845123291,
0.497297465801239,
-0.23167899250984192,
-0.0935383141040802,
0.7188544273376465,
0.11649719625711441,
0.18594993650913239,
0.7551390528678894,... |
func (e *ExpectedExec) WillDelayFor(duration time.Duration) *ExpectedExec {
e.delay = duration
return e
} | [
0.21095755696296692,
0.23360782861709595,
0.35274025797843933,
0.06513793766498566,
0.02744547463953495,
1.040930151939392,
0.5427811145782471,
0.6318484544754028,
0.1607058346271515,
-1.6903563737869263,
-0.11858998239040375,
0.4933086633682251,
1.30856192111969,
1.3263540267944336,
-0.... |
func (e *ExpectedExec) String() string {
msg := "ExpectedExec => expecting Exec or ExecContext which:"
msg += "\n - matches sql: '" + e.expectSQL + "'"
if len(e.args) == 0 {
msg += "\n - is without arguments"
} else {
msg += "\n - is with arguments:\n"
var margs []string
for i, arg := range e.args {
... | [
-0.16086891293525696,
-0.5777721405029297,
0.7899967432022095,
-0.6995463371276855,
-0.03452936187386513,
-0.29830482602119446,
0.29066702723503113,
-0.5534239411354065,
-0.224139004945755,
0.266247034072876,
0.761954128742218,
0.636738657951355,
-0.5434080362319946,
0.40349388122558594,
... |
func (e *ExpectedPrepare) WillDelayFor(duration time.Duration) *ExpectedPrepare {
e.delay = duration
return e
} | [
-0.02687353827059269,
0.3162645399570465,
0.5205020308494568,
-0.3717562258243561,
-0.37345054745674133,
1.0793719291687012,
0.25428885221481323,
0.5691132545471191,
0.45442357659339905,
-1.635076642036438,
-0.5930052399635315,
-0.07554491609334946,
1.3389739990234375,
1.3648681640625,
-... |
func (e *ExpectedPrepare) WillBeClosed() *ExpectedPrepare {
e.mustBeClosed = true
return e
} | [
0.19102512300014496,
0.1028127446770668,
0.36352336406707764,
-0.06157369539141655,
0.5771520733833313,
1.2218842506408691,
-0.06831859052181244,
0.5047328472137451,
0.8076764941215515,
-0.9581829905509949,
-0.43856021761894226,
0.41970425844192505,
-0.18047839403152466,
1.1457159519195557... |
func (e *ExpectedPrepare) ExpectQuery() *ExpectedQuery {
eq := &ExpectedQuery{}
eq.expectSQL = e.expectSQL
eq.converter = e.mock.converter
e.mock.expected = append(e.mock.expected, eq)
return eq
} | [
-0.6076286435127258,
-0.28569719195365906,
0.47461560368537903,
-0.2893899083137512,
0.3404625654220581,
-0.18136781454086304,
-0.1686161905527115,
0.4230499863624573,
0.7799811959266663,
-0.33312949538230896,
0.3504427969455719,
0.2839127779006958,
0.1316845566034317,
1.13557767868042,
... |
func (e *ExpectedPrepare) ExpectExec() *ExpectedExec {
eq := &ExpectedExec{}
eq.expectSQL = e.expectSQL
eq.converter = e.mock.converter
e.mock.expected = append(e.mock.expected, eq)
return eq
} | [
-0.6426231265068054,
-0.09418952465057373,
0.6194601058959961,
0.5044144988059998,
0.2354339063167572,
0.0773753896355629,
0.03819064050912857,
0.1130315512418747,
0.26746103167533875,
0.311567485332489,
-0.03048054873943329,
-0.15254591405391693,
0.3636505901813507,
0.6956396698951721,
... |
func (e *ExpectedPrepare) String() string {
msg := "ExpectedPrepare => expecting Prepare statement which:"
msg += "\n - matches sql: '" + e.expectSQL + "'"
if e.err != nil {
msg += fmt.Sprintf("\n - should return error: %s", e.err)
}
if e.closeErr != nil {
msg += fmt.Sprintf("\n - should return error on C... | [
-0.13078874349594116,
-0.919823169708252,
0.7407467365264893,
-0.7440884113311768,
-0.6791982054710388,
0.3354717195034027,
-0.09678035229444504,
-0.47481125593185425,
0.16595278680324554,
0.7482807040214539,
0.5508030652999878,
0.4584343135356903,
-0.3490234315395355,
0.04811633378267288,... |
func (e *ExpectedPing) WillDelayFor(duration time.Duration) *ExpectedPing {
e.delay = duration
return e
} | [
-0.002844786737114191,
0.3321603834629059,
0.40782296657562256,
0.023831281810998917,
-0.39040300250053406,
1.8146328926086426,
0.28760772943496704,
0.5886956453323364,
0.5710108876228333,
-1.4798672199249268,
-0.26930975914001465,
0.08881513774394989,
1.132790207862854,
0.7977259755134583... |
func (e *ExpectedPing) String() string {
msg := "ExpectedPing => expecting database Ping"
if e.err != nil {
msg += fmt.Sprintf(", which should return error: %s", e.err)
}
return msg
} | [
-0.07801572233438492,
-0.07770682126283646,
0.3065444529056549,
-0.34969067573547363,
-0.013170192018151283,
1.140114426612854,
0.28938934206962585,
-0.13486802577972412,
0.37892964482307434,
1.0362995862960815,
0.8054506182670593,
0.5547226667404175,
-0.7040166258811951,
0.061486996710300... |
func Collatz(n int, concurrent bool) (int, time.Duration) {
if n < 1 {
return -1, 0
}
/* if true {
time.Sleep(1000 * time.Millisecond)
return 1, 0
} */
sw := stopwatch.Start(0)
numSlice := []int{}
const partitionSize = 10000
if concurrent {
values := make(chan int, 1000)
chunkCalls := 0
for i := ... | [
0.42584753036499023,
0.22958138585090637,
0.8094883561134338,
0.3249433934688568,
-0.37194231152534485,
-0.8411211371421814,
0.9796370267868042,
0.2797267735004425,
-0.035703323781490326,
0.17715410888195038,
-0.39461076259613037,
0.17057226598262787,
-0.26172295212745667,
1.38089454174041... |
func (*BuildResponse) Descriptor() ([]byte, []int) {
return file_pkg_flow_grpc_build_proto_rawDescGZIP(), []int{0}
} | [
-0.6667641401290894,
-0.21117562055587769,
0.375778466463089,
0.44221681356430054,
0.7116307020187378,
-0.31472522020339966,
0.7967310547828674,
0.694118857383728,
-0.2812870740890503,
-0.22820919752120972,
-1.119587779045105,
-0.16838663816452026,
-0.742171585559845,
-0.2715625762939453,
... |
func (dst *WordsName) Scan(src interface{}) error {
if src == nil {
*dst = WordsName{Status: pgtype.Null}
return nil
}
switch src := src.(type) {
case string:
return dst.DecodeText(nil, []byte(src))
case []byte:
srcCopy := make([]byte, len(src))
copy(srcCopy, src)
return dst.DecodeText(nil, srcCopy)
... | [
-0.7952526807785034,
0.9041483402252197,
0.5911509394645691,
-0.31755033135414124,
-2.0120248794555664,
-0.2918983995914459,
-0.4285885691642761,
-0.42509526014328003,
0.011249194853007793,
0.29399967193603516,
-0.16604335606098175,
1.252769947052002,
-0.4322631061077118,
0.653293907642364... |
func (src *WordsName) Value() (driver.Value, error) {
switch src.Status {
case pgtype.Present:
return src.String, nil
case pgtype.Null:
return nil, nil
default:
return nil, errUndefined
}
} | [
-0.03258628398180008,
-0.12942840158939362,
0.4582027792930603,
-0.4970345199108124,
0.3769190311431885,
-0.03461622819304466,
-0.7850437760353088,
-0.4636574387550354,
-0.01988789439201355,
1.4551836252212524,
0.5860707759857178,
0.7654039263725281,
-0.4450201690196991,
0.9481447339057922... |
func (root *Node) Find(v int) *Node {
if root == nil {
return root
}
if root.Val == v {
return root
}
q := Queue{}
root.Visit()
q.Enqueue(root)
for !q.IsEmpty() {
r := q.Dequeue()
r.Visit()
for _, n := range r.Children {
if n.IsVisited() {
if n.Val == v {
return n
}
n.Visi... | [
0.3596772849559784,
0.24519559741020203,
0.787992000579834,
-0.327554315328598,
-0.6299359798431396,
-0.683535635471344,
0.8359312415122986,
-1.2634941339492798,
-0.05771569907665253,
0.6935393214225769,
0.2528845965862274,
0.28991925716400146,
-0.6794278025627136,
1.471961498260498,
-0.... |
func (r *DeliveryStream_SplunkDestinationConfiguration) AWSCloudFormationType() string {
return "AWS::KinesisFirehose::DeliveryStream.SplunkDestinationConfiguration"
} | [
0.4465312957763672,
0.44446659088134766,
0.3489893972873688,
0.5404064655303955,
0.034118663519620895,
0.12933123111724854,
0.045957889407873154,
0.572181224822998,
0.1650414913892746,
0.06711725145578384,
-0.1467726081609726,
0.3872334361076355,
0.6387368440628052,
1.0628548860549927,
0... |
func renameServiceAccount(w io.Writer, email, newDisplayName string) (*iam.ServiceAccount, error) {
ctx := context.Background()
service, err := iam.NewService(ctx)
if err != nil {
return nil, fmt.Errorf("iam.NewService: %w", err)
}
// First, get a ServiceAccount using List() or Get().
resource := "projects/-/s... | [
0.46875664591789246,
-0.5780954360961914,
0.4694976210594177,
0.11975403875112534,
-1.355547547340393,
-0.09151080250740051,
1.0920954942703247,
-0.4815291464328766,
0.19068415462970734,
0.313088595867157,
0.17415444552898407,
1.3686084747314453,
-0.1613667756319046,
-0.20109739899635315,
... |
func New(githubServer string,
clientID string,
clientSecret string,
cookieSecret string,
requiredOrg string,
loginURL string) Auth {
fatalError := false
if clientID == "" {
logger.Error("Authentication ClientId missing")
fatalError = true
}
if clientSecret == "" {
logger.Error("Authentication ClientSecr... | [
-0.5742542147636414,
-0.8439892530441284,
0.5239261984825134,
0.12503066658973694,
-1.1048972606658936,
0.10857928544282913,
-0.21943308413028717,
0.26301801204681396,
-0.08074567466974258,
0.3612153232097626,
0.6809801459312439,
0.9231433272361755,
-0.21758365631103516,
0.1686483174562454... |
func (a *GithubAuth) AuthorizeOrRedirect(h http.Handler) http.Handler {
// Always use context.ClearHandler as the base middleware or you'll leak memory (unless you're using gorilla as your server)
fn := func(w http.ResponseWriter, r *http.Request) {
user := a.User(r)
if user == nil {
http.Redirect(w, r, a.Logi... | [
-0.6013279557228088,
-0.379911333322525,
0.5568874478340149,
0.6263713240623474,
-0.7559506893157959,
0.11146080493927002,
0.6972211599349976,
-0.05895450711250305,
0.830723762512207,
-0.03439785912632942,
0.7787676453590393,
0.6808598637580872,
0.004396248143166304,
0.10280357301235199,
... |
func (a *GithubAuth) AuthorizeOrForbid(h http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
user := a.User(r)
if user == nil || user.IsMemberOfOrg == false {
http.Error(w, "Please authenticate", http.StatusForbidden)
return
}
h.ServeHTTP(w, r)
}
return http.HandlerFunc(f... | [
-0.07964228838682175,
0.02941492572426796,
0.4361504912376404,
0.826529860496521,
-0.510823130607605,
0.05148133635520935,
0.5469495058059692,
-0.4826149046421051,
-0.27087464928627014,
0.5191448330879211,
1.0765234231948853,
0.2154601514339447,
-0.47723957896232605,
0.2645842730998993,
... |
func (a *GithubAuth) User(r *http.Request) *User {
session, _ := a.CookieStore.Get(r, cookieName)
loginTime, present := session.Values["login-time"]
if !present {
logger.Warn("No login-time value in cookie")
return nil
} else if time.Unix(loginTime.(int64), 0).Add(a.LoginTTL).Before(time.Now()) {
logger.Warn... | [
-0.5033271312713623,
-0.9347029328346252,
0.6814886331558228,
0.0019167244900017977,
-0.3479689359664917,
-0.5585074424743652,
-0.13904337584972382,
-0.577324390411377,
0.6751717329025269,
-0.10674110800027847,
0.2115568220615387,
0.6576692461967468,
-0.25024136900901794,
-0.22853565216064... |
func (info *AwsUserInfo) ToString() string {
return fmt.Sprintf("Information for %s:\n======================\nPolicies:\n=============\n%v\nAccess keys:\n======================\n%v\n",
info.Username, info.Policies, info.AccessKeys)
} | [
0.45646902918815613,
-0.4649360179901123,
0.33779555559158325,
-0.6641274690628052,
-0.3282906413078308,
0.9743712544441223,
-0.41548147797584534,
-0.44368278980255127,
-0.6885330677032471,
0.1593087911605835,
-0.09392153471708298,
0.5985777378082275,
0.14254119992256165,
-0.79060000181198... |
func (mg *LBListener) ResolveReferences(ctx context.Context, c client.Reader) error {
r := reference.NewAPIResolver(c, mg)
var rsp reference.ResolutionResponse
var err error
for i3 := 0; i3 < len(mg.Spec.ForProvider.DefaultAction); i3++ {
for i4 := 0; i4 < len(mg.Spec.ForProvider.DefaultAction[i3].Forward); i4+... | [
-0.8235976696014404,
-0.5911217927932739,
0.602029025554657,
-0.7166578769683838,
1.5129165649414062,
-0.5234858989715576,
0.3512110412120819,
-0.2967569828033447,
-0.7614603042602539,
0.11912377178668976,
0.3515489399433136,
0.21698753535747528,
-0.4105864465236664,
0.49916964769363403,
... |
func (mg *LBTargetGroup) ResolveReferences(ctx context.Context, c client.Reader) error {
r := reference.NewAPIResolver(c, mg)
var rsp reference.ResolutionResponse
var err error
rsp, err = r.Resolve(ctx, reference.ResolutionRequest{
CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VpcID),
Extract: ... | [
-0.8157159090042114,
-0.2881903052330017,
0.2857411801815033,
-1.7894057035446167,
0.7991311550140381,
-0.29281485080718994,
-0.6419576406478882,
-0.41080203652381897,
-0.8835446834564209,
0.08084243535995483,
0.6626383066177368,
0.8984266519546509,
-0.7057593464851379,
-0.2865715324878692... |
func (mg *LBTargetGroupAttachment) ResolveReferences(ctx context.Context, c client.Reader) error {
r := reference.NewAPIResolver(c, mg)
var rsp reference.ResolutionResponse
var err error
rsp, err = r.Resolve(ctx, reference.ResolutionRequest{
CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.TargetGroupAr... | [
-1.1307440996170044,
-0.4919396638870239,
0.33233579993247986,
-1.0441222190856934,
0.34132710099220276,
-0.24839544296264648,
-0.2101902812719345,
-0.3830139935016632,
-0.3907736837863922,
-0.2544311285018921,
0.6878326535224915,
1.1124886274337769,
-0.043273162096738815,
-0.2836252748966... |
func (mg *LoadBalancer) ResolveReferences(ctx context.Context, c client.Reader) error {
r := reference.NewAPIResolver(c, mg)
var rsp reference.ResolutionResponse
var mrsp reference.MultiResolutionResponse
var err error
for i3 := 0; i3 < len(mg.Spec.ForProvider.AccessLogs); i3++ {
rsp, err = r.Resolve(ctx, refe... | [
-0.26688045263290405,
-0.12971508502960205,
0.6319687962532043,
-0.8440929055213928,
0.5316529273986816,
0.11687271296977997,
-0.41882944107055664,
-0.4732678532600403,
-0.43500301241874695,
0.4027775526046753,
0.46508511900901794,
0.3760091960430145,
-0.644306480884552,
0.5764650106430054... |
func New(brokerCfg broker.Configuration, storage storage.Storage) (*KafkaConsumer, error) {
return NewWithSaramaConfig(brokerCfg, storage, DefaultSaramaConfig)
} | [
1.0096821784973145,
-0.7314131259918213,
0.44479939341545105,
1.6523343324661255,
-1.1336743831634521,
-0.6951372623443604,
-0.08021672070026398,
0.8193528652191162,
-0.18669657409191132,
0.7730697393417358,
-0.6700578331947327,
-0.2147161364555359,
0.4547663629055023,
0.653988778591156,
... |
func NewWithSaramaConfig(
brokerCfg broker.Configuration,
storage storage.Storage,
saramaConfig *sarama.Config,
) (*KafkaConsumer, error) {
var err error
if saramaConfig == nil {
saramaConfig, err = broker.SaramaConfigFromBrokerConfig(brokerCfg)
if err != nil {
log.Error().Err(err).Msg("unable to create sa... | [
0.05910509079694748,
-0.9159620404243469,
0.8508388996124268,
1.1566840410232544,
-0.9400197267532349,
-0.9869011044502258,
0.5121413469314575,
-0.2937345802783966,
-0.022483455017209053,
1.0339909791946411,
-0.40809980034828186,
-0.048872560262680054,
-0.3525586426258087,
0.65345597267150... |
func (consumer *KafkaConsumer) Serve() {
ctx, cancel := context.WithCancel(context.Background())
consumer.cancel = cancel
go func() {
for {
// `Consume` should be called inside an infinite loop, when a
// server-side rebalance happens, the consumer session will need to be
// recreated to get the new clai... | [
0.6905014514923096,
-0.48953256011009216,
0.6246963739395142,
0.4415571391582489,
0.4141537547111511,
-0.7031143307685852,
-0.12570929527282715,
-0.1970067322254181,
-0.5696607232093811,
1.1384865045547485,
-0.012201354838907719,
0.6211978197097778,
-0.19135653972625732,
0.0513746440410614... |
func (consumer *KafkaConsumer) Setup(sarama.ConsumerGroupSession) error {
log.Info().Msg("new session has been setup")
// Mark the consumer as ready
close(consumer.ready)
return nil
} | [
-0.006668012589216232,
-0.7068924903869629,
0.42823895812034607,
0.4473804533481598,
-0.07272092252969742,
-0.9890913963317871,
0.6898131370544434,
-0.33375728130340576,
0.37762439250946045,
1.3260449171066284,
-0.10364596545696259,
0.05541062355041504,
-0.3692178428173065,
0.3601849377155... |
func (consumer *KafkaConsumer) Cleanup(sarama.ConsumerGroupSession) error {
log.Info().Msg("new session has been finished")
return nil
} | [
0.5390075445175171,
-1.1528148651123047,
0.33990928530693054,
0.5683135390281677,
-0.8011369705200195,
-0.933143138885498,
0.6745928525924683,
-0.7174983024597168,
0.5547654032707214,
0.4155464768409729,
-0.27673569321632385,
-0.06977825611829758,
-0.41950953006744385,
0.480765163898468,
... |
func (consumer *KafkaConsumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error {
log.Info().
Int64(offsetKey, claim.InitialOffset()).
Msg("starting messages loop")
latestMessageOffset, err := consumer.Storage.GetLatestKafkaOffset()
if err != nil {
log.Error().Msg("unab... | [
0.4096926152706146,
-1.2260903120040894,
0.8774943947792053,
-0.405517041683197,
0.44448360800743103,
-0.06883050501346588,
0.2586839199066162,
-0.19895674288272858,
-0.32701700925827026,
0.6469419598579407,
0.7316848635673523,
0.11366402357816696,
-0.1805254966020584,
0.5577616095542908,
... |
func (consumer *KafkaConsumer) Close() error {
if consumer.cancel != nil {
consumer.cancel()
}
if consumer.ConsumerGroup != nil {
if err := consumer.ConsumerGroup.Close(); err != nil {
log.Error().Err(err).Msg("unable to close consumer group")
}
}
if consumer.payloadTrackerProducer != nil {
if err := ... | [
-0.09233511239290237,
-0.6291059851646423,
0.7351154685020447,
1.3472956418991089,
-0.4738721251487732,
0.02664031833410263,
0.3738238215446472,
-0.6149943470954895,
-0.6817995309829712,
0.6963077187538147,
0.8651258945465088,
-0.23640885949134827,
-0.9035219550132751,
0.7012441158294678,
... |
func (consumer *KafkaConsumer) GetNumberOfSuccessfullyConsumedMessages() uint64 {
return consumer.numberOfSuccessfullyConsumedMessages
} | [
0.46444714069366455,
0.010128650814294815,
0.2842022478580475,
0.59808748960495,
-0.0659610703587532,
-0.3930155038833618,
0.3464500308036804,
-0.29072603583335876,
-0.6738752126693726,
0.22390688955783844,
-0.8372882604598999,
-0.4950796365737915,
-0.012589761056005955,
0.2384751439094543... |
func (v HireManager) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonAf94a8adEncodeGithubComGoParkMailRu20192ComandusInternalModel(&w, v)
return w.Buffer.BuildBytes(), w.Error
} | [
-0.17180036008358002,
-0.24439668655395508,
0.3931978642940521,
-0.29210394620895386,
-0.36499395966529846,
-0.7643224596977234,
0.17757569253444672,
0.6651622653007507,
-0.13497161865234375,
-0.5636920928955078,
-0.604095458984375,
0.8867185711860657,
-0.03694620728492737,
1.0038939714431... |
func (v HireManager) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonAf94a8adEncodeGithubComGoParkMailRu20192ComandusInternalModel(w, v)
} | [
-0.12156215310096741,
-0.2997640371322632,
0.4070001244544983,
-0.8359577655792236,
-0.30493417382240295,
-1.033969521522522,
-0.12101485580205917,
-0.08394952118396759,
0.12205085158348083,
-0.5636441707611084,
-0.8078576326370239,
0.7075768709182739,
0.2862647473812103,
1.438602328300476... |
func (v *HireManager) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonAf94a8adDecodeGithubComGoParkMailRu20192ComandusInternalModel(&r, v)
return r.Error()
} | [
0.09239823371171951,
-0.10604532063007355,
0.39039361476898193,
-1.3069028854370117,
-0.6547853350639343,
-0.4269559979438782,
-0.4056916832923889,
0.5430456399917603,
-0.3666386902332306,
-0.7073818445205688,
-0.2945098876953125,
0.5104658007621765,
-0.36705702543258667,
1.235495328903198... |
func (v *HireManager) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonAf94a8adDecodeGithubComGoParkMailRu20192ComandusInternalModel(l, v)
} | [
0.34807443618774414,
-0.22021794319152832,
0.4159615635871887,
-1.238635778427124,
-0.28577515482902527,
-1.2108945846557617,
-0.1601615995168686,
0.6105916500091553,
-0.16704782843589783,
-0.6918075680732727,
-0.7308293581008911,
0.4200052320957184,
-0.007934240624308586,
1.29329061508178... |
func CreateConfig() *Config {
return &Config{
Whitelist: []string{},
}
} | [
0.5591399669647217,
0.1680949330329895,
0.3506200611591339,
-0.4041895270347595,
0.44349750876426697,
0.22132283449172974,
-0.6437807679176331,
0.5844547152519226,
-0.2143172174692154,
0.6482808589935303,
0.12627176940441132,
0.22661355137825012,
-0.48413676023483276,
1.145638346672058,
... |
func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {
whitelist := map[string]bool{}
for _, country := range config.Whitelist {
whitelist[country] = true
}
return &IP2Country{whitelist: whitelist, next: next}, nil
} | [
-0.9231873750686646,
-0.17476995289325714,
0.23239766061306,
-0.6167203187942505,
-1.4659279584884644,
0.1651114672422409,
-0.1606636792421341,
0.06662503629922867,
-1.0297420024871826,
0.10529825836420059,
-0.28231140971183777,
0.8111604452133179,
0.7270292639732361,
0.30977049469947815,
... |
func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router) {
r.HandleFunc("/billboard/advertisement", listAdvertisementHandler(cliCtx, "billboard")).Methods("GET")
r.HandleFunc("/billboard/advertisement/{key}", getAdvertisementHandler(cliCtx, "billboard")).Methods("GET")
} | [
-0.39194533228874207,
0.632597029209137,
0.2596062421798706,
0.35061779618263245,
0.7832618951797485,
0.3351350724697113,
0.5585480332374573,
0.632444441318512,
-0.14463354647159576,
0.1670585572719574,
-0.08366860449314117,
0.24022722244262695,
-0.19712185859680176,
0.44322508573532104,
... |
func TestCompletePackUnpack(t *testing.T) {
if testing.Short() {
t.Skip("skipping testing in short mode")
}
maxCategory := categoryBitMask >> 24
maxLocation := locationBitMask >> 15
maxResult := resultBitMask
for c := 0; c < maxCategory; c++ {
for l := 0; l < maxLocation; l++ {
for r := 0; r < maxResult... | [
-0.09377225488424301,
0.4560263454914093,
0.7034080028533936,
0.05754585936665535,
0.42396456003189087,
-0.24493511021137238,
1.4165140390396118,
0.2216234654188156,
0.5048068165779114,
-0.7718322277069092,
-0.8545417785644531,
-1.0501331090927124,
-0.052101340144872665,
0.2972440123558044... |
func dashboard(query_string string, only_new bool) () {
change_list, err := gerrit.FetchChangeList(query_string)
if err != nil {
return
}
num_changes := len(change_list)
fmt.Printf("%sTotal %d changes%s\n", theme.Title, num_changes, theme.Reset)
if num_changes == 0 {
return
... | [
0.26675641536712646,
0.04594593122601509,
0.9955355525016785,
-0.03879520297050476,
-0.22394542396068573,
0.2479633241891861,
0.5030311346054077,
0.10405129194259644,
-0.5110172629356384,
0.34840235114097595,
0.2930484712123871,
0.8597113490104675,
0.2599238157272339,
0.8223298192024231,
... |
func (p *Parser) Default() *Env {
context := defaultContext.Copy()
context.appID = p.App.ID()
context.defaultAppID = p.App.ID()
return context
} | [
0.5449787974357605,
-0.933627724647522,
0.3215823769569397,
0.4958043694496155,
0.8375895023345947,
0.8717041015625,
-0.5137845873832703,
0.14633944630622864,
0.3530344069004059,
-0.30598175525665283,
0.3745354413986206,
0.4986039102077484,
-0.16690391302108765,
0.5395972728729248,
-0.93... |
func (p *Parser) FromRequest(r *http.Request) (*Env, error) {
e := p.Default()
if appid, err := strconv.ParseUint(r.FormValue("appid"), 10, 64); err == nil {
e.appID = appid
}
if appid, err := strconv.ParseUint(r.FormValue("client_id"), 10, 64); err == nil {
e.appID = appid
}
if level := r.FormValue("level")... | [
-0.11421795934438705,
-0.7376413941383362,
0.7840388417243958,
0.16405953466892242,
-0.5788842439651489,
0.007325396873056889,
-0.24895626306533813,
-0.5436456203460693,
-0.505914568901062,
-0.2801611125469208,
0.3975628614425659,
0.22175368666648865,
0.2948233485221863,
1.1082907915115356... |
func (c *Env) Copy() *Env {
context := *c
return &context
} | [
-0.20368973910808563,
-0.8515539169311523,
0.3009563982486725,
-0.02737255021929741,
-1.1394679546356201,
1.755857229232788,
0.5993936657905579,
-0.6214523315429688,
0.6278011798858643,
0.5316678881645203,
0.5661675930023193,
0.5561668872833252,
-0.32265377044677734,
-0.04659080132842064,
... |
func (c *Env) SdkURL() string {
server := "connect.facebook.net"
if c.Env != "" {
server = fburl.Hostname("static", c.Env) + "/assets.php"
}
return fmt.Sprintf("%s://%s/%s/%s.js", c.Scheme, server, c.locale, c.Module)
} | [
-0.3725912272930145,
-0.21134813129901886,
0.7682803869247437,
0.45017680525779724,
-0.12135586142539978,
0.37959542870521545,
0.2830120325088501,
-0.3952687382698059,
-0.5945852398872375,
0.22049278020858765,
0.5213812589645386,
0.06776626408100128,
0.7593312859535217,
0.5471240878105164,... |
func (c *Env) PageTabURL(name string) string {
values := url.Values{}
values.Set("sk", fmt.Sprintf("app_%d", c.appID))
values.Set("app_data", appdata.Encode(c.URL(name)))
url := fburl.URL{
Scheme: c.Scheme,
SubDomain: fburl.DWww,
Env: c.Env,
Path: "/pages/Rell-Page-for-Tabs/141929622497380",
... | [
0.5140702724456787,
-0.39114442467689514,
0.554636538028717,
0.04485686123371124,
-0.08460595458745956,
0.9754056334495544,
-0.5389225482940674,
-0.5162594318389893,
-0.4522899389266968,
0.7675981521606445,
0.19094066321849823,
-0.2036108672618866,
0.7387250065803528,
0.0512268990278244,
... |
func (c *Env) CanvasURL(name string) string {
var base = "/" + c.appNamespace + "/"
if name == "" || name == "/" {
name = base
} else {
name = path.Join(base, name)
}
url := fburl.URL{
Scheme: "https",
SubDomain: fburl.DApps,
Env: c.Env,
Path: name,
Values: c.Values(),
}
return ur... | [
0.4172658324241638,
0.47899284958839417,
0.6861178874969482,
0.7445055246353149,
-0.9140913486480713,
0.731043815612793,
-0.02009573020040989,
-1.1478794813156128,
-0.12565933167934418,
0.3598613739013672,
-0.39181724190711975,
-0.10937868058681488,
0.5948309898376465,
0.8641947507858276,
... |
func (c *Env) Values() url.Values {
values := url.Values{}
if c.appID != c.defaultAppID {
values.Set("appid", strconv.FormatUint(c.appID, 10))
}
if c.Env != defaultContext.Env {
values.Set("server", c.Env)
}
if c.locale != defaultContext.locale {
values.Set("locale", c.locale)
}
if c.Module != defaultCont... | [
-0.7862496972084045,
-0.2858084440231323,
0.4091063141822815,
-0.5653418302536011,
1.0929745435714722,
0.08947771787643433,
-0.5642240047454834,
-0.19507060945034027,
-0.09641532599925995,
-0.24415180087089539,
-0.12586936354637146,
0.1634557545185089,
-0.03895944729447365,
1.3220671415328... |
func (c *Env) URL(path string) *url.URL {
return &url.URL{
Path: path,
RawQuery: c.Values().Encode(),
}
} | [
0.12269438803195953,
-0.2619979679584503,
-0.0029009042773395777,
0.050328951328992844,
-0.4091756343841553,
1.0284433364868164,
-0.3223866820335388,
0.3768382668495178,
-0.04108720272779465,
-0.5202828049659729,
-0.1917315572500229,
0.6954655051231384,
0.2967824935913086,
0.04654406383633... |
func (c *Env) AbsoluteURL(path string) *url.URL {
u := c.URL(path)
u.Host = c.Host
u.Scheme = c.Scheme
return u
} | [
0.8139157891273499,
-0.4349505305290222,
0.4819272756576538,
0.4601629376411438,
-0.36134251952171326,
1.141777515411377,
-0.48411160707473755,
0.346589058637619,
-0.620943546295166,
0.2644393742084503,
0.07691103965044022,
0.33509305119514465,
0.8705719113349915,
-0.3178790807723999,
-0... |
func (c *Env) ViewURL(path string) string {
switch c.ViewMode {
case Canvas:
return c.CanvasURL(path)
case PageTab:
return c.PageTabURL(path)
default:
return c.AbsoluteURL(path).String()
}
} | [
-0.23732751607894897,
-0.6439510583877563,
0.4850043058395386,
0.34299778938293457,
-0.4426248371601105,
0.747205376625061,
0.1723288744688034,
-0.32847440242767334,
-0.12286660075187683,
-0.1557304710149765,
0.3920053541660309,
-0.06603437662124634,
0.7896764874458313,
0.08679031580686569... |
func (c *Env) MarshalJSON() ([]byte, error) {
data := map[string]interface{}{
"appID": strconv.FormatUint(c.appID, 10),
"level": c.level,
"status": c.Status,
"frictionlessRequests": c.FrictionlessRequests,
"signedRequest": c.SignedRequest,
"viewMode": ... | [
-0.4928008019924164,
-0.5586233735084534,
0.4356139302253723,
0.017617888748645782,
0.15584956109523773,
0.3422994017601013,
0.20678314566612244,
0.5259760618209839,
0.1305171251296997,
0.278378427028656,
-0.3152042329311371,
0.9710725545883179,
-0.18734216690063477,
1.5459445714950562,
... |
func FromContext(ctx context.Context) (*Env, error) {
if e, ok := ctx.Value(contextEnvKey).(*Env); ok {
return e, nil
}
return nil, ctxerr.Wrap(ctx, errEnvNotFound)
} | [
-0.11817033588886261,
-0.09827665984630585,
0.11976908147335052,
0.25612717866897583,
-0.5432419776916504,
0.15482157468795776,
-0.6229124665260315,
-0.4050804674625397,
1.0779335498809814,
0.3120080232620239,
0.1192493811249733,
0.7272002696990967,
-0.17901475727558136,
0.0168075840920209... |
func WithEnv(ctx context.Context, env *Env) context.Context {
return context.WithValue(ctx, contextEnvKey, env)
} | [
-0.2907750606536865,
-0.16377663612365723,
0.5368925333023071,
0.2248540222644806,
-0.30572617053985596,
0.4251442849636078,
-0.20761121809482574,
-0.15259116888046265,
0.2798924744129181,
0.2992663085460663,
0.0838341936469078,
0.2855467200279236,
0.3739059567451477,
-0.8634342551231384,
... |
func IsEmployee(ctx context.Context) bool {
if ctx, err := FromContext(ctx); err == nil {
return ctx.isEmployee
}
return false
} | [
-0.3708513379096985,
-0.27803802490234375,
0.5774075984954834,
0.446845144033432,
-0.018802840262651443,
0.7497806549072266,
-0.35110318660736084,
0.39652329683303833,
0.7647966742515564,
0.1309671401977539,
-0.41790488362312317,
-0.35527464747428894,
-1.1119848489761353,
0.339779704809188... |
func FbApp(ctx context.Context) fbapp.App {
// TODO: secret?
if ctx, err := FromContext(ctx); err == nil {
return fbapp.New(ctx.appID, "", ctx.appNamespace)
}
return defaultFbApp
} | [
0.8970903754234314,
-0.673270046710968,
0.4524660110473633,
1.4224461317062378,
0.14535173773765564,
0.3918440043926239,
-0.48500195145606995,
-1.2261158227920532,
1.5761958360671997,
-0.08611536026000977,
-0.35249361395835876,
-0.13308420777320862,
-0.26395145058631897,
0.1539305895566940... |
func NewTaskList() TaskList {
return TaskList{}
} | [
-0.09927602112293243,
-0.5552105903625488,
0.20512676239013672,
0.8694310188293457,
-0.9490773677825928,
0.31646203994750977,
0.07509472966194153,
0.08004748821258545,
-0.23929056525230408,
0.1491844803094864,
-1.7481961250305176,
0.025287248194217682,
0.7410217523574829,
0.314116358757019... |
func (tasklist TaskList) String() string {
var sb strings.Builder
for _, task := range tasklist {
sb.WriteString(task.String())
sb.WriteString(ys.NewLine)
}
return sb.String()
} | [
-0.021853873506188393,
-0.6747614741325378,
0.09876005351543427,
0.16563734412193298,
-0.3888481855392456,
0.453354150056839,
0.897142231464386,
-0.7089988589286804,
-0.48488694429397583,
-0.0943511500954628,
-0.5885294675827026,
0.3049251437187195,
0.5806350111961365,
0.8571071028709412,
... |
func (tasklist *TaskList) AddTask(task *Task) {
task.ID = 0
for _, t := range *tasklist {
if t.ID > task.ID {
task.ID = t.ID
}
}
task.ID++
*tasklist = append(*tasklist, *task)
} | [
-1.2202472686767578,
0.6388171315193176,
0.4015727639198303,
1.4568378925323486,
0.6610615849494934,
0.8521246314048767,
0.024478420615196228,
0.30958473682403564,
0.2487632781267166,
-0.305332213640213,
-1.5543303489685059,
0.0709100291132927,
0.3098211884498596,
1.4408670663833618,
-0.... |
func (tasklist *TaskList) GetTask(id int) (*Task, error) {
for i := range *tasklist {
if ([]Task(*tasklist))[i].ID == id {
return &([]Task(*tasklist))[i], nil
}
}
return nil, errors.New("task not found")
} | [
-0.48348113894462585,
0.3013310134410858,
0.2676149010658264,
1.2986516952514648,
0.30055487155914307,
-0.35368824005126953,
0.2681919038295746,
-0.3807327449321747,
0.3281727135181427,
0.5600515604019165,
-0.6844605803489685,
0.7905252575874329,
0.13842512667179108,
0.6074014902114868,
... |
func (tasklist *TaskList) RemoveTaskByID(id int) error {
var newList TaskList
found := false
for _, t := range *tasklist {
if t.ID != id {
newList = append(newList, t)
} else {
found = true
}
}
if !found {
return errors.New("task not found")
}
*tasklist = newList
return nil
} | [
-0.7679125666618347,
-0.14863087236881256,
0.4214024245738983,
0.7270257472991943,
-0.2961234450340271,
-0.023457365110516548,
0.41293609142303467,
0.3244490325450897,
0.11973436176776886,
1.0396283864974976,
-1.8446599245071411,
-0.5316106677055359,
-0.38410958647727966,
1.205913782119751... |
func (tasklist *TaskList) RemoveTask(task Task) error {
var newList TaskList
found := false
for _, t := range *tasklist {
if t.String() != task.String() {
newList = append(newList, t)
} else {
found = true
}
}
if !found {
return errors.New("task not found")
}
*tasklist = newList
return nil
} | [
-0.5960171818733215,
-0.17421101033687592,
0.4035142958164215,
0.8442588448524475,
-0.16953809559345245,
0.18108996748924255,
0.11968592554330826,
0.8627802133560181,
0.2957780361175537,
0.9542464017868042,
-1.1282823085784912,
0.050600867718458176,
0.0009728387231007218,
1.022839784622192... |
func (tasklist *TaskList) LoadFromFile(file *os.File) error {
*tasklist = []Task{} // Empty task list
taskID := 1
scanner := bufio.NewScanner(file)
for scanner.Scan() {
text := strings.Trim(scanner.Text(), whitespaces) // Read line
// Ignore blank or comment lines
if isEmpty(text) || (IgnoreComments && stri... | [
0.25026118755340576,
0.15278609097003937,
0.6511349081993103,
-0.024824174121022224,
-0.38279470801353455,
0.9449492692947388,
0.2523134648799896,
0.5300764441490173,
-0.6048690676689148,
0.049375418573617935,
-0.8663074374198914,
-0.8389070630073547,
-0.12605024874210358,
0.95848321914672... |
func (tasklist *TaskList) WriteToFile(file *os.File) error {
writer := bufio.NewWriter(file)
if _, err := writer.WriteString(tasklist.String()); err != nil {
return err
}
return writer.Flush()
} | [
-0.24344153702259064,
0.2195597141981125,
0.5406707525253296,
0.15849988162517548,
0.6747972965240479,
0.6007571816444397,
0.7488256096839905,
0.5898064970970154,
-0.9499435424804688,
0.9093140959739685,
-0.6945044994354248,
-0.5408291816711426,
-0.17194236814975739,
-0.06677158176898956,
... |
func (tasklist *TaskList) LoadFromPath(filename string) error {
file, err := os.Open(filename)
if err != nil {
return err
}
defer file.Close()
return tasklist.LoadFromFile(file)
} | [
0.46261849999427795,
-0.04126830771565437,
0.46795031428337097,
-0.20895978808403015,
-0.7083367109298706,
0.9677225351333618,
-0.13355711102485657,
-0.07487563788890839,
-0.34021541476249695,
0.7443205714225769,
-0.8048294186592102,
-0.7354953289031982,
-0.5540252923965454,
0.207221433520... |
func (tasklist *TaskList) WriteToPath(filename string) error {
return ioutil.WriteFile(filename, []byte(tasklist.String()), 0640)
} | [
-0.3192840814590454,
-0.18551409244537354,
0.2612495422363281,
0.36112070083618164,
0.5731582641601562,
0.7425560355186462,
1.1581186056137085,
0.7396822571754456,
-0.33426040410995483,
0.6902416944503784,
-1.375188946723938,
-0.6269948482513428,
-0.12411238998174667,
0.1726064383983612,
... |
func LoadFromFile(file *os.File) (TaskList, error) {
tasklist := TaskList{}
if err := tasklist.LoadFromFile(file); err != nil {
return nil, err
}
return tasklist, nil
} | [
0.18299588561058044,
0.308452308177948,
0.2751360535621643,
0.5436975359916687,
-0.7493094801902771,
0.6704848408699036,
0.5208536386489868,
0.12206676602363586,
-0.33089572191238403,
0.36204928159713745,
-1.1978774070739746,
-0.43733856081962585,
-0.2677059769630432,
0.7671250700950623,
... |
func WriteToFile(tasklist *TaskList, file *os.File) error {
return tasklist.WriteToFile(file)
} | [
-0.3376758098602295,
-0.03960640728473663,
0.3445862829685211,
1.0254963636398315,
0.877925455570221,
0.9180215001106262,
0.8116887807846069,
1.07512366771698,
-1.092441201210022,
0.7891057729721069,
-0.8841062188148499,
-0.3476555645465851,
0.2524011731147766,
0.5239525437355042,
-1.028... |
func LoadFromPath(filename string) (TaskList, error) {
tasklist := TaskList{}
if err := tasklist.LoadFromPath(filename); err != nil {
return nil, err
}
return tasklist, nil
} | [
0.23785394430160522,
-0.0875229686498642,
0.3917654752731323,
0.4724503755569458,
-0.8356409668922424,
0.5369608402252197,
0.14098253846168518,
-0.2744101881980896,
0.0542246550321579,
0.49998486042022705,
-1.0659763813018799,
-0.5566505789756775,
-0.5756397247314453,
0.35638609528541565,
... |
func WriteToPath(tasklist *TaskList, filename string) error {
return tasklist.WriteToPath(filename)
} | [
-0.8558622598648071,
-0.376010000705719,
0.1719008982181549,
1.131899356842041,
0.5760617852210999,
0.9454255700111389,
1.5392085313796997,
1.031153678894043,
-0.6329657435417175,
0.6705739498138428,
-0.9929037690162659,
-0.42853569984436035,
-0.0372437983751297,
0.4890054762363434,
-0.5... |
func Execute() {
if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
} | [
0.8741579055786133,
-0.631639301776886,
0.8534528017044067,
1.2026909589767456,
0.42606523633003235,
0.8930875062942505,
-0.11484168469905853,
0.11600733548402786,
-0.7203778028488159,
-0.3646620810031891,
0.6552295088768005,
0.16867855191230774,
-0.38348233699798584,
0.8589836955070496,
... |
func Route(root string, router *tp.Router) {
// root router group
group := router.SubRoute(root)
// custom router
customRoute(group.ToRouter())
// automatically generated router
// PULL APIs...
group.RoutePullFunc(Home)
group.RoutePull(new(Math))
// PUSH APIs...
group.RoutePushFunc(Stat)
} | [
0.18067297339439392,
0.6809406280517578,
0.2246050387620926,
0.43791452050209045,
-0.21079795062541962,
-0.17921419441699982,
0.17266856133937836,
-0.11394695192575455,
-0.6269547939300537,
-0.0242500901222229,
0.28530633449554443,
0.3795258402824402,
0.38152390718460083,
0.447388947010040... |
func (m *peerMap) nodeCount() int {
return len(m.byNodeKey)
} | [
-0.6736130714416504,
0.1957629770040512,
0.43020525574684143,
-0.8454192876815796,
0.33502867817878723,
0.25343477725982666,
0.26646164059638977,
0.8557520508766174,
-0.9187661409378052,
0.8521418571472168,
-0.04898781329393387,
-0.11677920818328857,
0.09590194374322891,
0.2613492608070373... |
func (m *peerMap) anyEndpointForDiscoKey(dk key.DiscoPublic) bool {
return len(m.nodesOfDisco[dk]) > 0
} | [
-1.5033543109893799,
0.8015188574790955,
0.301254540681839,
-0.15038250386714935,
0.31896185874938965,
-0.779008150100708,
-0.04731784760951996,
0.5395538806915283,
-1.1511845588684082,
0.36501234769821167,
0.22343555092811584,
-1.0837846994400024,
0.2005912959575653,
1.097740650177002,
... |
func (m *peerMap) endpointForNodeKey(nk key.NodePublic) (ep *endpoint, ok bool) {
if nk.IsZero() {
return nil, false
}
if info, ok := m.byNodeKey[nk]; ok {
return info.ep, true
}
return nil, false
} | [
-1.283875823020935,
0.27158817648887634,
0.34362784028053284,
-0.4336417019367218,
0.13793005049228668,
-0.4002446234226227,
-0.5518462061882019,
-0.6675958037376404,
-0.5354047417640686,
1.0606720447540283,
0.7786355018615723,
-0.9312987923622131,
-0.2218763381242752,
0.9277468323707581,
... |
func (m *peerMap) endpointForIPPort(ipp netip.AddrPort) (ep *endpoint, ok bool) {
if info, ok := m.byIPPort[ipp]; ok {
return info.ep, true
}
return nil, false
} | [
-1.2692757844924927,
-0.14117825031280518,
0.38686665892601013,
-0.4830029308795929,
-0.017012910917401314,
-0.1751025915145874,
0.10522731393575668,
-0.32386070489883423,
-0.22416065633296967,
0.6070637106895447,
0.25835803151130676,
-1.5654221773147583,
-0.8058388829231262,
-0.8077045679... |
func (m *peerMap) forEachEndpoint(f func(ep *endpoint)) {
for _, pi := range m.byNodeKey {
f(pi.ep)
}
} | [
-0.8735510110855103,
0.20730344951152802,
0.25854337215423584,
0.06536135822534561,
0.645936906337738,
-0.473574697971344,
0.34330105781555176,
-0.05566103756427765,
-1.3748246431350708,
1.0171648263931274,
0.37403222918510437,
-0.16889648139476776,
0.2956949770450592,
0.09940540790557861,... |
func (m *peerMap) forEachEndpointWithDiscoKey(dk key.DiscoPublic, f func(*endpoint) (keepGoing bool)) {
for nk := range m.nodesOfDisco[dk] {
pi, ok := m.byNodeKey[nk]
if !ok {
// Unexpected. Data structures would have to
// be out of sync. But we don't have a logger
// here to log [unexpected], so just s... | [
-0.897249162197113,
0.9023607969284058,
0.5688179731369019,
0.8583751916885376,
-0.077337346971035,
-0.645386278629303,
0.23472420871257782,
-0.25492504239082336,
-1.1065829992294312,
0.5841301679611206,
0.3845633864402771,
-0.7548367381095886,
0.39261096715927124,
0.0975780114531517,
-0... |
func (m *peerMap) upsertEndpoint(ep *endpoint, oldDiscoKey key.DiscoPublic) {
if m.byNodeKey[ep.publicKey] == nil {
m.byNodeKey[ep.publicKey] = newPeerInfo(ep)
}
epDisco := ep.disco.Load()
if epDisco == nil || oldDiscoKey != epDisco.key {
delete(m.nodesOfDisco[oldDiscoKey], ep.publicKey)
}
if ep.isWireguardOn... | [
-1.209080696105957,
0.6042579412460327,
0.7410829663276672,
-0.12645405530929565,
0.7302134037017822,
-0.17300203442573547,
0.05506252497434616,
0.4530981779098511,
-0.45360636711120605,
1.0761183500289917,
-0.060383766889572144,
-0.5685544610023499,
-0.20936594903469086,
0.516908109188079... |
func (m *peerMap) setNodeKeyForIPPort(ipp netip.AddrPort, nk key.NodePublic) {
if pi := m.byIPPort[ipp]; pi != nil {
delete(pi.ipPorts, ipp)
delete(m.byIPPort, ipp)
}
if pi, ok := m.byNodeKey[nk]; ok {
pi.ipPorts[ipp] = true
m.byIPPort[ipp] = pi
}
} | [
-1.0070842504501343,
0.10292552411556244,
0.4106816053390503,
-0.8927944898605347,
0.026082105934619904,
0.22324928641319275,
0.08270972222089767,
-0.5337356925010681,
-0.9277231097221375,
0.6268401145935059,
-0.08697400987148285,
-0.19950123131275177,
-0.1443197876214981,
-0.3674195706844... |
func (m *peerMap) deleteEndpoint(ep *endpoint) {
if ep == nil {
return
}
ep.stopAndReset()
epDisco := ep.disco.Load()
pi := m.byNodeKey[ep.publicKey]
if epDisco != nil {
delete(m.nodesOfDisco[epDisco.key], ep.publicKey)
}
delete(m.byNodeKey, ep.publicKey)
if pi == nil {
// Kneejerk paranoia from earlie... | [
-0.6404833793640137,
-0.2030566930770874,
0.35751205682754517,
0.03317679464817047,
0.4922773540019989,
-0.3624361753463745,
0.3493228852748871,
0.6862552762031555,
0.30564388632774353,
0.1570158749818802,
0.08066701143980026,
-0.7967743873596191,
-0.3393479287624359,
0.41003069281578064,
... |
func NewRequiredService(serviceId string) *RequiredService {
req := new(RequiredService)
req.ServiceId = serviceId
return req
} | [
-0.5875532627105713,
-0.61783367395401,
-0.24344350397586823,
0.2857750952243805,
-0.7722191214561462,
0.047476641833782196,
-0.9215996265411377,
-0.8025621175765991,
0.4648422300815582,
-0.8861832618713379,
0.04087529331445694,
1.1865848302841187,
-1.006368637084961,
1.703391432762146,
... |
func NewRequiredComponent(componentId string) *RequiredComponent {
req := new(RequiredComponent)
req.ComponentId = componentId
return req
} | [
-0.23986002802848816,
-0.9875067472457886,
-0.1977526694536209,
-0.5500606894493103,
-0.687240719795227,
-0.028919564560055733,
-0.16254915297031403,
-0.10080000013113022,
0.6937144994735718,
-0.8429696559906006,
-0.4888227581977844,
0.8093056082725525,
-0.32168084383010864,
0.961222648620... |
func (r Report) Filter(paths ...string) (result Report) {
if len(paths) == 0 {
return r
}
return r.filter(func(filterPath *ytbx.Path) bool {
for _, pathString := range paths {
path, err := ytbx.ParsePathStringUnsafe(pathString)
if err == nil && filterPath != nil && path.String() == filterPath.String() {
... | [
0.8881898522377014,
0.39773157238960266,
0.4465707242488861,
0.8827728629112244,
-0.04039153829216957,
-0.014396434649825096,
0.38175538182258606,
-0.0022757775150239468,
-0.791717529296875,
-0.6853640079498291,
0.5213069319725037,
-0.48783546686172485,
-0.7436789870262146,
0.0984547212719... |
func (r Report) Exclude(paths ...string) (result Report) {
if len(paths) == 0 {
return r
}
return r.filter(func(filterPath *ytbx.Path) bool {
for _, pathString := range paths {
path, err := ytbx.ParsePathStringUnsafe(pathString)
if err == nil && filterPath != nil && path.String() == filterPath.String() {
... | [
0.6702789068222046,
0.4449874460697174,
0.6950311660766602,
0.886465847492218,
-0.3792601227760315,
0.17221297323703766,
0.6283817887306213,
0.03498870134353638,
-0.4261382818222046,
-0.7055726647377014,
0.3617403507232666,
-0.9406917095184326,
-1.1756963729858398,
-0.06177467480301857,
... |
func (r Report) FilterRegexp(pattern ...string) (result Report) {
if len(pattern) == 0 {
return r
}
regexps := make([]*regexp.Regexp, len(pattern))
for i := range pattern {
regexps[i] = regexp.MustCompile(pattern[i])
}
return r.filter(func(filterPath *ytbx.Path) bool {
for _, regexp := range regexps {
... | [
0.5829486846923828,
-0.011784846894443035,
0.7963863611221313,
0.4839242696762085,
0.013159789144992828,
0.18315786123275757,
1.025504231452942,
0.7567319273948669,
-0.3159550130367279,
0.16883952915668488,
0.2262430489063263,
-0.18168863654136658,
-0.9533103108406067,
-0.6849590539932251,... |
func (r Report) ExcludeRegexp(pattern ...string) (result Report) {
if len(pattern) == 0 {
return r
}
regexps := make([]*regexp.Regexp, len(pattern))
for i := range pattern {
regexps[i] = regexp.MustCompile(pattern[i])
}
return r.filter(func(filterPath *ytbx.Path) bool {
for _, regexp := range regexps {
... | [
0.15526318550109863,
0.17427343130111694,
1.079210638999939,
0.4633994698524475,
-0.3328077495098114,
0.672370195388794,
1.2560724020004272,
0.5752007365226746,
0.19189614057540894,
0.06976441293954849,
-0.14068716764450073,
-0.5369491577148438,
-1.4047080278396606,
-0.7069358229637146,
... |
func ReOrientJpeg(file []byte, orient Orientation) ([]byte, error) {
if len(file) == 0 {
return nil, EmptyInputError
}
// Init a transform
tjHandle := C.tjInitTransform()
if tjHandle == nil {
return nil, fmt.Errorf("could not init libjpeg-turbo: %v", C.GoString(C.tjGetErrorStr2(tjHandle)))
}
defer C.tjDestro... | [
-0.6343448758125305,
-0.07764014601707458,
0.8917005062103271,
-0.6658211946487427,
-0.9621739387512207,
-0.5444350838661194,
0.9131165742874146,
-0.4402816891670227,
-0.47771114110946655,
1.1218911409378052,
-0.7689985036849976,
-0.002071993425488472,
-0.6745366454124451,
-0.3000085651874... |
func TransformJpeg(data []byte, grayscale bool, scale ScaleFunc) (out image.Image, width, height int, scaleFactor float64, err error) {
if len(data) == 0 {
return nil, 0, 0, -1, EmptyInputError
}
// Init Turbo-JPEG Decompression
tjHandle := C.tjInitDecompress()
if tjHandle == nil {
return nil, 0, 0, -1, fmt.E... | [
-0.37765073776245117,
0.058419812470674515,
0.7806488871574402,
-0.6133760809898376,
-0.7617098093032837,
-1.0058386325836182,
0.2704264521598816,
-0.02054193802177906,
-0.9018174409866333,
1.0412474870681763,
-0.3980970084667206,
-0.10133356600999832,
0.09724823385477066,
0.57592093944549... |
func (*GatewayMiningFuelChange) Descriptor() ([]byte, []int) {
return file_wallet_proto_rawDescGZIP(), []int{0}
} | [
-1.0703197717666626,
0.13977311551570892,
0.08158107846975327,
-0.033448658883571625,
0.3712831735610962,
-0.48742929100990295,
-1.0915411710739136,
-0.1459966003894806,
-1.369069218635559,
0.030208751559257507,
0.05399539694190025,
0.3485792577266693,
-0.9546218514442444,
1.76136624813079... |
func (*TopUpGatewayMiningFuelRequest) Descriptor() ([]byte, []int) {
return file_wallet_proto_rawDescGZIP(), []int{1}
} | [
-1.809840440750122,
-0.22222362458705902,
0.5451653003692627,
-0.11043906956911087,
0.01378387026488781,
-0.8524155616760254,
-0.5426459908485413,
0.4880799651145935,
-0.893541157245636,
-0.5657315254211426,
0.6604499816894531,
0.00985699612647295,
-0.5511394143104553,
0.6515066623687744,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.