text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (db *PoetDb) UnsubscribeFromProofRef(poetID []byte, roundID string) {
db.mu.Lock()
defer db.mu.Unlock()
delete(db.poetProofRefSubscriptions, makeKey(poetID, roundID))
} | [
0.6336574554443359,
-0.0753977969288826,
0.018763240426778793,
-0.4096529483795166,
-0.9664503931999207,
-0.5429798364639282,
0.5370537042617798,
-0.5561337471008301,
-0.7582603693008423,
0.3973608911037445,
0.590187668800354,
0.8036864399909973,
-1.436952829360962,
0.27906399965286255,
... |
func (db *PoetDb) GetProofMessage(proofRef []byte) ([]byte, error) {
return db.store.Get(proofRef)
} | [
-0.6802164912223816,
1.1516796350479126,
0.14569388329982758,
0.28711411356925964,
-0.06698894500732422,
-0.6698464751243591,
-0.043029557913541794,
-0.7521162033081055,
0.11697373539209366,
-0.054683491587638855,
0.2375643104314804,
0.8264865279197693,
-1.269362211227417,
1.18848228454589... |
func (db *PoetDb) GetMembershipMap(proofRef []byte) (map[types.Hash32]bool, error) {
proofMessageBytes, err := db.GetProofMessage(proofRef)
if err != nil {
return nil, fmt.Errorf("could not fetch poet proof for ref %x: %v", proofRef[:5], err)
}
var proofMessage types.PoetProofMessage
if err := types.BytesToInter... | [
-0.7141909003257751,
0.13605386018753052,
0.625705897808075,
-0.29187342524528503,
-0.42861852049827576,
0.16956782341003418,
0.16554883122444153,
-0.034002307802438736,
0.24795779585838318,
0.29039666056632996,
0.23943212628364563,
-0.22484420239925385,
-0.8388705253601074,
0.751015841960... |
func New() plugin.Plugin {
return &cronPlugin{}
} | [
0.7122017741203308,
-1.5079573392868042,
0.08462636172771454,
0.644652783870697,
0.06035532429814339,
-0.40422430634498596,
0.11949129402637482,
0.19587412476539612,
-0.21535860002040863,
-0.7226676344871521,
-0.9832738637924194,
0.9354515075683594,
0.14653049409389496,
0.16204451024532318... |
func NewLoggingService(logger log.Logger, s Service) Service {
return &loggingService{logger: logger, service: s}
} | [
-0.541900634765625,
-0.3392072021961212,
0.06800639629364014,
-0.13120821118354797,
-0.8306237459182739,
-0.7190864682197571,
-1.5759024620056152,
-0.6655580401420593,
0.1650429219007492,
-0.10995696485042572,
-0.36706647276878357,
0.7400038242340088,
-0.826998233795166,
0.0020269278902560... |
func NewbieResources(prefix string) bot.Handler {
return bot.HandlerFunc(func(ctx context.Context, m bot.Message, r bot.Responder) {
if !strings.HasPrefix(m.TrimmedText, prefix) {
return
}
msg := "Here are some resources you should check out if you are learning / new to Go:"
if strings.Contains(m.TrimmedTe... | [
-0.014716270379722118,
-0.6350165009498596,
0.4664665162563324,
-0.15605305135250092,
-0.5827407240867615,
-0.030725518241524696,
0.08574344962835312,
-0.4761761724948883,
0.7328445911407471,
0.1654483824968338,
-0.05156012997031212,
0.15836367011070251,
-0.4077981114387512,
0.627382159233... |
func (in *KeycloakOperator) DeepCopyInto(out *KeycloakOperator) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
return
} | [
0.08637768030166626,
0.2925935983657837,
0.6526734828948975,
0.16029344499111176,
-1.4877196550369263,
0.09762164205312729,
0.0955309197306633,
0.5583528876304626,
-0.9992944598197937,
-0.09625349938869476,
-0.7281848788261414,
1.2303491830825806,
0.1930008828639984,
-0.15976859629154205,
... |
func (in *KeycloakOperator) DeepCopy() *KeycloakOperator {
if in == nil {
return nil
}
out := new(KeycloakOperator)
in.DeepCopyInto(out)
return out
} | [
-0.4664287567138672,
1.1005468368530273,
0.5387425422668457,
0.6652055382728577,
-1.8331149816513062,
-0.20501375198364258,
0.15120606124401093,
-0.2733785808086395,
-0.04345301166176796,
0.4526752829551697,
-0.3579208254814148,
-0.40228044986724854,
-0.6699816584587097,
-0.331991761922836... |
func (in *KeycloakOperator) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.29364481568336487,
0.5728227496147156,
0.6718594431877136,
0.46899718046188354,
-1.2012629508972168,
0.18642668426036835,
0.9595810770988464,
-0.024565258994698524,
-0.6387741565704346,
-0.485163152217865,
-0.37502720952033997,
-0.15001694858074188,
-0.02295379899442196,
-0.166583031415... |
func (in *KeycloakOperatorList) DeepCopyInto(out *KeycloakOperatorList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]KeycloakOperator, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
-0.31157419085502625,
0.7972421050071716,
0.6220859289169312,
0.3282380700111389,
-0.9739757180213928,
-0.13169646263122559,
-0.06292099505662918,
0.8230698108673096,
-0.6984427571296692,
0.49580061435699463,
-0.8637900352478027,
0.3713708519935608,
-0.6030092239379883,
0.14995723962783813... |
func (in *KeycloakOperatorList) DeepCopy() *KeycloakOperatorList {
if in == nil {
return nil
}
out := new(KeycloakOperatorList)
in.DeepCopyInto(out)
return out
} | [
-0.3809983730316162,
0.8391270637512207,
0.47444212436676025,
0.7239921689033508,
-1.0324864387512207,
0.2003098428249359,
-0.03860149905085564,
0.5595431327819824,
0.0931420847773552,
0.6258788108825684,
-0.7887413501739502,
-0.7536734342575073,
-0.7239326238632202,
-0.15704959630966187,
... |
func (in *KeycloakOperatorList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.695482075214386,
0.6498612761497498,
0.5731094479560852,
0.3874300420284271,
-0.8207384943962097,
0.16127246618270874,
0.7183527946472168,
0.20512372255325317,
-0.4951225221157074,
-0.20610259473323822,
-0.7652550935745239,
-0.487053781747818,
-0.3997262418270111,
0.2082158923149109,
... |
func (in *KeycloakOperatorSpec) DeepCopyInto(out *KeycloakOperatorSpec) {
*out = *in
return
} | [
0.5083617568016052,
0.8990206718444824,
0.5400093793869019,
-0.0399848148226738,
-1.550917625427246,
0.2555762231349945,
0.22273975610733032,
0.9216524958610535,
-1.1448489427566528,
0.10247764736413956,
0.009541108272969723,
0.9559608101844788,
-0.3178585171699524,
-0.4840744137763977,
... |
func (in *KeycloakOperatorSpec) DeepCopy() *KeycloakOperatorSpec {
if in == nil {
return nil
}
out := new(KeycloakOperatorSpec)
in.DeepCopyInto(out)
return out
} | [
-0.08523458242416382,
0.8434603810310364,
0.5788825750350952,
-0.08386275917291641,
-1.5619795322418213,
0.2825133502483368,
0.20922207832336426,
0.2907189428806305,
-0.4292553961277008,
0.6527275443077087,
0.312531977891922,
-0.18813443183898926,
-0.31369879841804504,
-0.638394832611084,
... |
func (in *KeycloakOperatorStatus) DeepCopyInto(out *KeycloakOperatorStatus) {
*out = *in
return
} | [
0.2463301718235016,
0.5170255899429321,
0.43909162282943726,
-0.085516057908535,
-1.6567453145980835,
0.272377610206604,
-0.26289793848991394,
1.0534400939941406,
-0.767917275428772,
0.05848567932844162,
-0.5579421520233154,
0.8657631874084473,
-0.2649725675582886,
-0.3763047158718109,
0... |
func (in *KeycloakOperatorStatus) DeepCopy() *KeycloakOperatorStatus {
if in == nil {
return nil
}
out := new(KeycloakOperatorStatus)
in.DeepCopyInto(out)
return out
} | [
-0.4879487454891205,
0.3748612701892853,
0.3748835027217865,
-0.14819318056106567,
-1.5734421014785767,
0.16302481293678284,
-0.22835685312747955,
0.32709184288978577,
0.141050323843956,
0.642789900302887,
-0.6927576661109924,
-0.07163890451192856,
-0.3298388123512268,
-0.2694731652736664,... |
func Paxos(kv *KVPaxos, seq int, op Op) Op{
kv.px.Start(seq, op)
to := 10 * time.Millisecond
for{
status, val := kv.px.Status(seq)
if status == paxos.Decided{
return val.(Op)
}
time.Sleep(to)
if to < 10 * time.Second{
to *= 2
}
}
} | [
0.35074517130851746,
0.4328451454639435,
0.49714258313179016,
0.08417754620313644,
-1.0608341693878174,
-0.21792832016944885,
-1.0676910877227783,
0.32415515184402466,
0.615049421787262,
0.07748638093471527,
0.08068020641803741,
-0.1079716607928276,
0.5935714840888977,
-0.6879702806472778,... |
func (kv *KVPaxos) kill() {
DPrintf("Kill(%d): die\n", kv.me)
atomic.StoreInt32(&kv.dead, 1)
kv.l.Close()
kv.px.Kill()
} | [
-0.46587082743644714,
-0.3639848232269287,
0.4262492060661316,
1.0294032096862793,
-0.31138181686401367,
1.2623776197433472,
-0.975724995136261,
0.018194083124399185,
-0.6151988506317139,
0.3894650638103485,
0.06065870821475983,
-0.39415815472602844,
0.5018172264099121,
-0.4084042906761169... |
func (kv *KVPaxos) isdead() bool {
return atomic.LoadInt32(&kv.dead) != 0
} | [
-0.6940794587135315,
-0.04782944917678833,
0.6944431066513062,
0.7391359210014343,
-0.0882643312215805,
1.118445873260498,
-1.2030903100967407,
-0.3220237195491791,
0.37953120470046997,
-0.406384140253067,
0.02076779119670391,
0.12201714515686035,
-0.4196578562259674,
-0.24042628705501556,... |
func (kv *KVPaxos) setunreliable(what bool) {
if what {
atomic.StoreInt32(&kv.unreliable, 1)
} else {
atomic.StoreInt32(&kv.unreliable, 0)
}
} | [
-0.8268908858299255,
0.6454170942306519,
0.783753514289856,
-0.7275485992431641,
0.22610895335674286,
-0.04737759381532669,
-0.39828550815582275,
0.05856803059577942,
-1.5435386896133423,
-0.2313249707221985,
-1.0670603513717651,
-0.1794985681772232,
-0.7968015670776367,
-0.513333201408386... |
func StartServer(servers []string, me int) *KVPaxos {
// call gob.Register on structures you want
// Go's RPC library to marshall/unmarshall.
gob.Register(Op{})
kv := new(KVPaxos)
kv.me = me
// Your initialization code here.
kv.keyVal = make(map[string]string)
kv.requests = make(map[int64]string)
kv.seqCount... | [
-0.29694679379463196,
-0.217714324593544,
1.0344914197921753,
0.8085675835609436,
0.0697835385799408,
0.21795840561389923,
-0.8194901347160339,
0.3087717890739441,
-0.042344652116298676,
-0.49612340331077576,
0.026488834992051125,
0.3730729818344116,
-0.7237868309020996,
0.1411593109369278... |
func VerifyRequest(r *http.Request) (err error) {
certURL := r.Header.Get("SignatureCertChainUrl")
// Verify certificate URL
if !verifyCertURL(certURL) {
return ErrInvalidCertificateURL
}
// Fetch certificate data
cert, err := http.Get(certURL)
if err != nil {
return fmt.Errorf("could not fetch Amazon cert... | [
-0.19161050021648407,
-0.017884358763694763,
0.8039351105690002,
1.0344325304031372,
-0.16394716501235962,
0.5117394924163818,
-0.7117097973823547,
-0.14640115201473236,
0.10230762511491776,
0.5077782869338989,
-0.4626902639865875,
0.40494751930236816,
0.3845851719379425,
0.575395822525024... |
func IsCIDR(str string) bool {
_, _, err := net.ParseCIDR(str)
return err == nil
} | [
0.34199875593185425,
-0.7719390392303467,
0.39527130126953125,
-0.08348832279443741,
-0.45891639590263367,
0.292676717042923,
-0.8010125756263733,
0.6747096180915833,
0.27157872915267944,
0.5287478566169739,
-0.4181855022907257,
-1.0021326541900635,
-1.3672685623168945,
0.16085106134414673... |
func IsIP(str string) bool {
return net.ParseIP(str) != nil
} | [
-0.6985553503036499,
-0.5026510953903198,
0.35605868697166443,
1.1570073366165161,
-0.9581553339958191,
0.10324160009622574,
-0.980872392654419,
0.7954193949699402,
0.5888790488243103,
0.5601856112480164,
-0.1135677620768547,
-1.059966802597046,
-0.43497228622436523,
-1.5472298860549927,
... |
func IsDNS(str string) bool {
if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 {
// constraints already violated
return false
}
return !IsIP(str) && rxDNSName.MatchString(str)
} | [
-0.8729555010795593,
0.17666079103946686,
0.4828498065471649,
0.7961243391036987,
-1.009242296218872,
-0.5644134879112244,
-0.5484977960586548,
-1.0269358158111572,
1.8614298105239868,
-0.4271845519542694,
-0.21558047831058502,
0.24501711130142212,
-0.7385682463645935,
-0.534580647945404,
... |
func copyDir(src string, dst string) error {
var err error
var fds []os.FileInfo
var srcinfo os.FileInfo
if srcinfo, err = os.Stat(src); err != nil {
return err
}
if err = os.MkdirAll(dst, srcinfo.Mode()); err != nil {
return err
}
if fds, err = ioutil.ReadDir(src); er... | [
-0.03423185274004936,
0.40962859988212585,
0.6134599447250366,
0.5274840593338013,
-0.7388632893562317,
0.6134408712387085,
0.8591490983963013,
0.08922205865383148,
-0.14443635940551758,
-0.45779818296432495,
0.12949202954769135,
0.04335067793726921,
0.8061333894729614,
1.087167501449585,
... |
func (c *Client) DescribeEnvironmentManagedActionHistory(ctx context.Context, params *DescribeEnvironmentManagedActionHistoryInput, optFns ...func(*Options)) (*DescribeEnvironmentManagedActionHistoryOutput, error) {
if params == nil {
params = &DescribeEnvironmentManagedActionHistoryInput{}
}
result, metadata, er... | [
-0.0822705328464508,
0.5822650194168091,
0.9904352426528931,
-0.3560659885406494,
0.31919941306114197,
-0.31413325667381287,
0.32545870542526245,
-0.7276309728622437,
0.15742804110050201,
0.03588337451219559,
0.33172446489334106,
1.6468781232833862,
-0.22990825772285461,
0.3001675009727478... |
func (d *Directory) Entry(name string) *DirectoryEntry {
for _, e := range d.Entries {
if e.Path == name {
return e
}
}
return nil
} | [
0.24716565012931824,
-0.3466922342777252,
0.1406439244747162,
-0.2772897779941559,
0.29539644718170166,
-0.49197396636009216,
0.8730489611625671,
-0.2048865556716919,
0.9515327215194702,
0.061667561531066895,
0.5147839784622192,
0.5858615040779114,
0.14077728986740112,
0.034686680883169174... |
func (d *Directory) Remove(name string) (*DirectoryEntry, int) {
for i, e := range d.Entries {
if e.Path == name {
d.Entries = append(d.Entries[:i], d.Entries[i+1:]...)
return e, i
}
}
return nil, -1
} | [
-1.3809996843338013,
-0.07303772866725922,
0.6984044909477234,
-0.5889260172843933,
-0.843059241771698,
-1.2524977922439575,
1.1466811895370483,
0.8854976892471313,
0.41605961322784424,
0.39264294505119324,
-1.058698296546936,
-0.1600111573934555,
-0.7088012099266052,
0.26382073760032654,
... |
func (d *Directory) SyncEntries() error {
d.Emit("sync", &DirectorySyncEvent{
UUID: d.UUID,
})
unmatchedEntries := make([]*DirectoryEntry, len(d.Entries))
copy(unmatchedEntries, d.Entries)
var errors []error
var walk func(local, name string)
walk = func(local, name string) {
entries, err := os.ReadDir(name)
... | [
0.08184845745563507,
-0.5819352269172668,
0.7170296907424927,
-0.24672168493270874,
0.4297632873058319,
-0.7762292623519897,
1.0159505605697632,
0.37560102343559265,
0.24609602987766266,
0.26642903685569763,
-0.19623231887817383,
0.3471738398075104,
0.42727890610694885,
1.0661062002182007,... |
func (r *Request) Context() context.Context {
return r.ctx
} | [
-0.36733806133270264,
-0.6030570268630981,
0.0931243747472763,
0.10311079025268555,
-0.10834307968616486,
0.5723239183425903,
0.038397908210754395,
-0.9960371255874634,
1.1270525455474854,
-1.257535457611084,
0.5001596212387085,
0.7909834384918213,
-0.006698730867356062,
-0.410688966512680... |
func (mt MessageType) MetricLabel() string {
switch mt {
case None:
return "none"
case IfId:
return "ifid_push"
case Ack:
return "ack_push"
case HPSegReg:
return "hp_seg_reg_push"
case HPSegRequest:
return "hp_seg_req"
case HPSegReply:
return "hp_seg_push"
case HPCfgRequest:
return "hp_cfg_req"
c... | [
0.02540201134979725,
0.13365134596824646,
0.5250723361968994,
-0.5946845412254333,
0.9381160140037537,
1.1918755769729614,
0.4764256179332733,
-0.669529378414154,
-0.7693533301353455,
1.1201589107513428,
1.024812936782837,
-0.04813872277736664,
-0.4523846209049225,
-0.11455754935741425,
... |
func NewResourceAwareHandler(handler Handler, resources ...ResourceHealth) Handler {
return HandlerFunc(func(r *Request) *HandlerResult {
ctx := r.Context()
for _, resource := range resources {
if !resource.IsHealthy() {
logger := log.FromCtx(ctx)
rwriter, ok := ResponseWriterFromContext(ctx)
if !ok... | [
0.13296166062355042,
-0.7518411874771118,
0.5321828126907349,
-0.12670288980007172,
-0.42209672927856445,
0.7375379800796509,
0.8926553726196289,
-0.6578545570373535,
-0.22929859161376953,
0.05452929437160492,
1.0432409048080444,
-0.7388723492622375,
-0.21437238156795502,
0.837808072566986... |
func Trace(ctx context.Context, msg string) {
sp := opentracing.SpanFromContext(ctx)
if sp != nil {
sp.LogEvent(msg)
}
} | [
1.6551192998886108,
0.3137705326080322,
0.6891337633132935,
0.12773485481739044,
0.0391661711037159,
0.2659458816051483,
0.49508440494537354,
-0.7202646732330322,
1.5460822582244873,
-0.6150105595588684,
0.05726192146539688,
0.3621455430984497,
-0.3799993395805359,
0.02512003481388092,
-... |
func (c BuildTxHandler) Handler(ctx context.Context, request *commonProtoc.BuildTxRequest) (
*commonProtoc.BuildTxResponse, error) {
buildTxVO := c.buildRequest(request)
resVO, err := buildTxService.BuildTx(buildTxVO)
if err.IsNotNull() {
return nil, BuildException(err)
}
return c.buildResponse(resVO), nil
} | [
-0.741078794002533,
-0.636284351348877,
0.48126617074012756,
-0.07192125171422958,
-0.03993415832519531,
0.4096912443637848,
0.7197064757347107,
-0.0862581729888916,
0.5368396043777466,
-0.570503294467926,
-0.5086331963539124,
-0.17278724908828735,
-0.24375051259994507,
-0.4434491097927093... |
func (*TriggersListRequest) Descriptor() ([]byte, []int) {
return file_triggers_list_proto_rawDescGZIP(), []int{0}
} | [
-0.8062981367111206,
-0.38930168747901917,
0.3450528681278229,
-0.12832020223140717,
-0.026434022933244705,
-1.3545466661453247,
0.32481998205184937,
0.5414408445358276,
0.222545325756073,
-0.8244627118110657,
-1.0639289617538452,
0.13291825354099274,
-0.05211423337459564,
0.73094874620437... |
func (*TriggersListResponse) Descriptor() ([]byte, []int) {
return file_triggers_list_proto_rawDescGZIP(), []int{1}
} | [
-0.04314327612519264,
-0.41918063163757324,
-0.09905274212360382,
-0.17729486525058746,
0.4666506350040436,
-1.7757750749588013,
0.6955046653747559,
0.6019221544265747,
0.44579795002937317,
-0.6081070303916931,
-1.7264965772628784,
-1.0792484283447266,
-0.4686073958873749,
0.10280586779117... |
func StopKubeTest2(clusterName string) error {
args := []string{"kind", "--down", "--cluster-name",
clusterName}
println("Down(): stopin kind cluster...\n")
// we want to see the output so use process.ExecJUnit
return process.ExecJUnit("kubetest2", args, os.Environ())
} | [
-0.530116081237793,
-1.234932541847229,
0.6074413657188416,
-0.14690907299518585,
-0.06120116263628006,
0.6351943612098694,
0.12468928843736649,
-0.6177465915679932,
-0.9259198307991028,
-0.31315675377845764,
0.8328225016593933,
1.5675709247589111,
-1.4183663129806519,
0.4326701760292053,
... |
func StartKubeTest2(clusterName string) error {
args := []string{
"kind", "--up", "--cluster-name", clusterName, "--loglevel", "10",
}
println("Up(): startin kind cluster...\n")
// we want to see the output so use process.ExecJUnit
return process.ExecJUnit("kubetest2", args, os.Environ())
} | [
-0.1636611372232437,
-0.9915894269943237,
0.825067937374115,
0.3236391544342041,
-0.17510707676410675,
0.0720275342464447,
0.11464444547891617,
-0.5687180757522583,
-0.40513598918914795,
-0.23290279507637024,
0.6606327295303345,
1.918570876121521,
-0.4783400893211365,
0.4965411126613617,
... |
func ValidateSlice(target []string, valid []string) (bool, error) {
for _, item := range target {
found, _ := ValidateString(item, valid)
if !found {
return false, fmt.Errorf("'%s' is not in the allowed list: %s", item, strings.Join(valid, ", "))
}
}
return true, nil
} | [
-0.614001989364624,
-0.3861386477947235,
0.6855852603912354,
0.19863609969615936,
-0.40400463342666626,
-0.19175314903259277,
-0.9271041750907898,
0.2163933962583542,
-0.6241028308868408,
0.5152125954627991,
0.8669549822807312,
-0.026775281876325607,
-0.2726137042045593,
0.0408378839492797... |
func ValidateString(target string, valid []string) (bool, error) {
found := false
for _, e := range valid {
if e == target {
found = true
}
}
if !found {
return false, fmt.Errorf("'%s' is not in the allowed list: %s", target, strings.Join(valid, ", "))
}
return true, nil
} | [
-0.7072012424468994,
-0.04734471067786217,
0.6980845928192139,
-0.1466488391160965,
-0.2777688801288605,
0.26228153705596924,
-0.8457661271095276,
0.17034772038459778,
-0.15869154036045074,
0.3228892982006073,
0.7272287011146545,
0.497827410697937,
-0.11864446103572845,
-0.2948397994041443... |
func ValidateStructField(value reflect.Value, tag string) (bool, error) {
re := regexp.MustCompile(`^enum=(.+,*?)+$`)
parts := re.FindStringSubmatch(tag)
if len(parts) != 2 {
return false, fmt.Errorf("invalid tag '%s', must be enum=v1,v2,v3", tag)
}
evs := strings.Split(parts[1], ",")
switch value.Kind() {
... | [
-0.7453436255455017,
-0.20395489037036896,
0.6690691709518433,
-0.8207585215568542,
-0.5454277396202087,
0.25458449125289917,
0.36092641949653625,
-0.6749030351638794,
-0.15329402685165405,
0.38220691680908203,
-0.4719618856906891,
-0.16924452781677246,
-0.5663037300109863,
0.3362759649753... |
func (g *NBAGame) gameDate() string {
easternTime, err := time.LoadLocation("America/New_York")
if err != nil {
panic("getting game date")
}
return g.StartTime.In(easternTime).Format("20060102")
} | [
0.7483069896697998,
-0.6906499266624451,
0.42231035232543945,
0.4368934631347656,
-0.2767733633518219,
1.1191810369491577,
-1.2852849960327148,
-0.2931552231311798,
0.06168327480554581,
1.6525661945343018,
0.6873637437820435,
-0.3569064736366272,
-0.302494615316391,
0.845035195350647,
-0... |
func remove_meta_fields (body string) (string){
regex, _ := regexp.Compile("<meta .*?>")
result := regex.ReplaceAllString(body, "")
return result
} | [
-0.16500324010849,
0.30212268233299255,
0.6799550652503967,
-0.15201731026172638,
-0.6432759165763855,
-0.09615297615528107,
-0.16445523500442505,
0.9865742325782776,
0.05860699713230133,
0.9250638484954834,
-1.116348385810852,
0.06547603756189346,
-1.2737432718276978,
-1.1202366352081299,... |
func Tags(ctx context.Context, repo Repository) ([]string, error) {
var res []string
if err := repo.Tags(ctx, func(tags []string) error {
res = append(res, tags...)
return nil
}); err != nil {
return nil, err
}
return res, nil
} | [
-0.03596615791320801,
0.7457600831985474,
0.08937709778547287,
0.060895103961229324,
1.0862380266189575,
0.029226776212453842,
-1.502358078956604,
-0.48538097739219666,
0.07615300267934799,
0.6614812612533569,
-0.6828448176383972,
0.2220907211303711,
-0.11212246119976044,
0.961896479129791... |
func (repository *CategoryRepositoryMock) FindById(id string) *entity.Category {
// bikin program untuk si mock nya
// panggil Mocknya dan masukkan parameter sesuai dengan parameter yang ada di function yang dibuatkan mock
// balikannya adalah argument
arguments := repository.Mock.Called(id)
// karena balikannya... | [
-0.04978383705019951,
0.5077097415924072,
0.6868161559104919,
-0.3767396807670593,
0.10431230813264847,
-0.0031139214988797903,
0.7879156470298767,
-0.6563280820846558,
-0.08345577120780945,
-0.24611784517765045,
0.15689852833747864,
-0.15536129474639893,
-0.6011108160018921,
1.59830224514... |
func (h *nsqHandler) HandleMessage(message *nsq.Message) error {
data, err := Processor.Unmarshal(message.Body)
if err != nil {
log.Error("handler msg error:%s", err.Error())
return nil
}
msg, ok := data.(*S2S_NsqMsg)
if !ok {
log.Debug("Unmarshal error ")
return nil
}
log.Debug("Cluster IN ==== %s, SrcS... | [
-0.6141193509101868,
0.25480177998542786,
0.7065590620040894,
0.039264876395463943,
0.07625244557857513,
-0.15527260303497314,
-0.12475385516881943,
-0.595314085483551,
0.4982793927192688,
-0.20085887610912323,
0.6035735607147217,
0.38551101088523865,
-0.9515694975852966,
1.557414412498474... |
func NewApp() *App {
return &App{}
} | [
0.6250669956207275,
-0.9710949659347534,
-0.1336790919303894,
1.309737205505371,
-1.323516607284546,
0.7980983257293701,
-0.06805431097745895,
-0.6395260691642761,
0.6977555155754089,
-0.5551883578300476,
-0.004219735041260719,
0.36590859293937683,
-0.06261633336544037,
-0.7694455981254578... |
func (a *App) NewTrigger(trg trigger.Trigger, settings map[string]interface{}) *Trigger {
value := reflect.ValueOf(trg)
value = value.Elem()
ref := value.Type().PkgPath()
newTrg := &Trigger{ref: ref, settings: settings}
a.triggers = append(a.triggers, newTrg)
return newTrg
} | [
-0.2626052498817444,
0.2733565866947174,
0.25363439321517944,
0.07940628379583359,
-0.039486609399318695,
-0.37685999274253845,
-0.770396888256073,
-0.45022839307785034,
0.3998125195503235,
0.014582684263586998,
0.10643899440765381,
0.11885455250740051,
-0.19951342046260834,
0.436447560787... |
func (a *App) AddProperty(name string, dataType data.Type, value interface{}) error {
property, err := data.NewAttribute(name, dataType, value)
if err != nil {
return err
}
a.properties = append(a.properties, property)
return nil
} | [
0.01571863330900669,
-0.39825135469436646,
0.6684486269950867,
0.216481015086174,
0.1926661729812622,
0.7217100262641907,
-0.9485464096069336,
0.47752606868743896,
0.5984470844268799,
-0.058046843856573105,
0.4141003489494324,
-0.1740293800830841,
-0.4574734568595886,
0.7535985112190247,
... |
func (a *App) AddResource(id string, data json.RawMessage) {
res := &resource.Config{ID: id, Data: data}
a.resources = append(a.resources, res)
} | [
-0.4741189181804657,
0.023183396086096764,
0.19422022998332977,
-0.25239965319633484,
0.24996112287044525,
0.39974722266197205,
-1.2583420276641846,
0.45745566487312317,
0.6195598244667053,
0.21383510529994965,
-0.04838138073682785,
-0.5325082540512085,
-0.5516775846481323,
1.0815285444259... |
func (a *App) Properties() []*data.Attribute {
return a.properties
} | [
-0.3877078890800476,
-0.9157313108444214,
0.1721944957971573,
0.2608656585216522,
-0.09172012656927109,
0.45832404494285583,
-0.41126495599746704,
0.40229806303977966,
0.8155398964881897,
-0.5377925038337708,
0.7707803249359131,
0.5888388752937317,
0.554980456829071,
0.5137231349945068,
... |
func (a *App) Triggers() []*Trigger {
return a.triggers
} | [
0.3475719392299652,
-0.39141082763671875,
0.1693682223558426,
0.9395508170127869,
0.363051176071167,
0.3926188051700592,
-0.07804352045059204,
0.12112362682819366,
1.1547043323516846,
-0.9268024563789368,
-0.5603873133659363,
0.5160359144210815,
0.07369168847799301,
0.2328445166349411,
-... |
func (t *Trigger) Settings() map[string]interface{} {
return t.settings
} | [
-0.7065623998641968,
-0.44031864404678345,
0.3257853388786316,
-0.18486277759075165,
0.04318136349320412,
-0.6473419666290283,
-0.03725782781839371,
-0.46128034591674805,
-0.15543119609355927,
0.26239195466041565,
-1.4016567468643188,
-0.7419813275337219,
0.5239559412002563,
0.263705104589... |
func (t *Trigger) NewHandler(settings map[string]interface{}) *Handler {
newHandler := &Handler{settings: settings}
t.handlers = append(t.handlers, newHandler)
return newHandler
} | [
0.26997190713882446,
-0.35430583357810974,
0.10243191570043564,
0.5306485891342163,
-0.09406422823667526,
0.23780196905136108,
-0.5005396008491516,
-0.2802526354789734,
0.3114880919456482,
-0.7469996213912964,
-0.26421985030174255,
-0.16704759001731873,
-0.2940271198749542,
-0.324173301458... |
func (t *Trigger) NewFuncHandler(settings map[string]interface{}, handlerFunc HandlerFunc) *Handler {
newHandler := &Handler{settings: settings}
newAct := &Action{act: NewProxyAction(handlerFunc)}
newHandler.actions = append(newHandler.actions, newAct)
t.handlers = append(t.handlers, newHandler)
return newHandl... | [
0.40719252824783325,
-0.5298609733581543,
0.3081613779067993,
0.23298095166683197,
-0.6328549385070801,
-0.8442683815956116,
0.34412628412246704,
0.025031400844454765,
0.04307549074292183,
-0.6104106903076172,
-0.5497862100601196,
0.38069450855255127,
-0.008164454251527786,
0.4389937520027... |
func (t *Trigger) Handlers() []*Handler {
return t.handlers
} | [
-0.05113615840673447,
-0.574310302734375,
-0.04680433124303818,
0.5498567819595337,
0.09956754744052887,
0.5398910641670227,
-0.08100900053977966,
0.24413827061653137,
0.251586377620697,
-1.1736299991607666,
-0.9470111131668091,
0.5177738666534424,
-0.02789275348186493,
-0.4048019051551819... |
func (h *Handler) Settings() map[string]interface{} {
return h.settings
} | [
-1.0513814687728882,
-0.2276124805212021,
0.421413391828537,
-0.08409176766872406,
0.17943689227104187,
0.14203330874443054,
0.052280083298683167,
-0.199908047914505,
-0.49613243341445923,
0.03917418047785759,
-1.02334725856781,
-0.6095685362815857,
0.1953279972076416,
1.064936637878418,
... |
func (h *Handler) NewAction(act action.Action, settings map[string]interface{}) *Action {
value := reflect.ValueOf(act)
value = value.Elem()
ref := value.Type().PkgPath()
newAct := &Action{ref: ref, settings: settings}
h.actions = append(h.actions, newAct)
return newAct
} | [
-0.1880837082862854,
-0.7867600321769714,
0.4359756410121918,
0.33545875549316406,
0.239125594496727,
0.07669099420309067,
0.6913164854049683,
-0.6694450378417969,
0.8564150333404541,
0.24986830353736877,
0.17117568850517273,
0.47585079073905945,
0.28355827927589417,
0.595305860042572,
0... |
func (h *Handler) Actions() []*Action {
return h.actions
} | [
-0.4828108847141266,
-0.444472998380661,
0.07416025549173355,
0.708961009979248,
0.8001915812492371,
0.4197481572628021,
0.1352238655090332,
-0.018838251009583473,
0.46638280153274536,
-1.236006259918213,
-0.6427510380744934,
0.791047990322113,
-0.023165231570601463,
0.7185074687004089,
... |
func (a *Action) Settings() map[string]interface{} {
return a.settings
} | [
-1.2178847789764404,
-0.5117338299751282,
0.34148263931274414,
0.32969269156455994,
0.3912125825881958,
-0.5397804379463196,
0.3683188557624817,
-0.4810176193714142,
0.3874051570892334,
0.9198756217956543,
-0.31802046298980713,
0.05226357281208038,
0.2741177976131439,
0.9099361896514893,
... |
func (a *Action) SetInputMappings(mappings ...string) {
a.inputMappings = mappings
} | [
-1.6366961002349854,
-0.547122597694397,
0.3547380566596985,
0.7624838948249817,
-0.6689497232437134,
0.5378625392913818,
0.5929135084152222,
0.1698775589466095,
1.0184147357940674,
-0.30058053135871887,
-1.0113236904144287,
-0.01864536851644516,
-1.0230755805969238,
-0.18246948719024658,
... |
func (a *Action) SetOutputMappings(mappings ...string) {
a.outputMappings = mappings
} | [
-1.7956541776657104,
-0.9970116019248962,
0.3887077569961548,
0.650978684425354,
-0.6916424632072449,
-0.18621119856834412,
0.6129785776138306,
-0.34148111939430237,
0.45830070972442627,
0.14246046543121338,
-0.26820966601371765,
-0.661232590675354,
-0.07043423503637314,
-0.420499145984649... |
func (a *Action) InputMappings() []string {
return a.inputMappings
} | [
-1.0539413690567017,
-0.33320724964141846,
0.5341307520866394,
1.0462324619293213,
-0.7548376321792603,
0.6367565989494324,
0.27085772156715393,
0.16953155398368835,
1.5992523431777954,
-0.2351389229297638,
-0.30498749017715454,
0.014368722215294838,
-0.6154415607452393,
-0.162098377943038... |
func (a *Action) OutputMappings() []string {
return a.outputMappings
} | [
-1.556298017501831,
-0.6296722888946533,
0.6372011303901672,
0.8869514465332031,
-0.7720361351966858,
0.08266280591487885,
0.3494293987751007,
-0.31738966703414917,
0.9430046081542969,
0.4335263669490814,
0.2562512755393982,
-0.3555588722229004,
-0.011662406846880913,
-0.3955199420452118,
... |
func NewEngine(a *App) (engine.Engine, error) {
appConfig := toAppConfig(a)
return engine.New(appConfig)
} | [
0.7226483225822449,
-0.40412387251853943,
0.028400229290127754,
0.9525279402732849,
-0.6991719603538513,
-0.051084380596876144,
-0.5903598666191101,
0.18835143744945526,
0.0867743268609047,
0.6645965576171875,
0.17314539849758148,
0.36179885268211365,
0.20910608768463135,
0.263477504253387... |
func TestClient_ReplicaID(t *testing.T) {
c := NewClient(1000)
defer c.Close()
if replicaID := c.ReplicaID(); replicaID != 1000 {
t.Fatalf("unexpected replica id: %d", replicaID)
}
} | [
0.7446218132972717,
0.31479138135910034,
0.07813002169132233,
-0.39541125297546387,
-0.43094077706336975,
0.541370689868927,
0.0493427999317646,
0.20429757237434387,
0.4889104664325714,
0.30756378173828125,
-0.42015695571899414,
0.7937036156654358,
0.0019039071630686522,
-0.266727060079574... |
func TestClient_Open(t *testing.T) {
c := NewClient(1000)
defer c.Close()
// Create replica on broker.
c.Server.Handler.Broker().CreateReplica(1000, &url.URL{Host: "localhost"})
// Open client to broker.
f := NewTempFile()
defer os.Remove(f)
u, _ := url.Parse(c.Server.URL)
if err := c.Open(f, []*url.URL{u});... | [
0.26785027980804443,
0.5343932509422302,
0.5647019743919373,
-0.6116284132003784,
-0.16083750128746033,
0.21561431884765625,
1.3205424547195435,
0.6080736517906189,
-0.4791867434978485,
-0.479111909866333,
-0.7768523097038269,
0.36178648471832275,
-0.5829150676727295,
0.07335983961820602,
... |
func TestClient_Open_ErrClientOpen(t *testing.T) {
c := NewClient(1000)
defer c.Close()
// Open client to broker.
f := NewTempFile()
defer os.Remove(f)
u, _ := url.Parse(c.Server.URL)
c.Open(f, []*url.URL{u})
if err := c.Open(f, []*url.URL{u}); err != messaging.ErrClientOpen {
t.Fatalf("unexpected error: %s"... | [
-0.11481635272502899,
0.020830819383263588,
0.3578771650791168,
-0.3294059932231903,
-0.3080468475818634,
0.6962926983833313,
1.1025639772415161,
0.6420585513114929,
-0.42932188510894775,
-0.6864426732063293,
-0.5815074443817139,
0.06085394695401192,
-0.4033685028553009,
0.0354393012821674... |
func TestClient_Open_ErrBrokerURLRequired(t *testing.T) {
t.Skip()
c := NewClient(1000)
defer c.Close()
f := NewTempFile()
defer os.Remove(f)
if err := c.Open(f, []*url.URL{}); err != messaging.ErrBrokerURLRequired {
t.Fatalf("unexpected error: %s", err)
}
} | [
-0.3764461576938629,
0.02757297269999981,
0.409534215927124,
0.02747601643204689,
0.18851257860660553,
0.763562798500061,
0.7230709195137024,
0.6167923212051392,
-0.7960753440856934,
-0.48165521025657654,
-0.48380666971206665,
0.08707103878259659,
-0.5504648089408875,
0.6919474601745605,
... |
func TestClient_Close(t *testing.T) {
c := NewClient(1000)
defer c.Close()
// Create replica on broker.
c.Server.Handler.Broker().CreateReplica(1000, &url.URL{Host: "localhost"})
// Open client to broker.
f := NewTempFile()
defer os.Remove(f)
u, _ := url.Parse(c.Server.URL)
if err := c.Open(f, []*url.URL{u})... | [
0.39060014486312866,
0.272481232881546,
0.5646353363990784,
-0.26944756507873535,
-0.28591015934944153,
0.3756429851055145,
1.2882105112075806,
0.5728335380554199,
-0.6294450759887695,
-0.48765531182289124,
-0.5659980177879333,
-0.25439420342445374,
-0.5434507727622986,
0.2143128365278244,... |
func TestClient_SetLeaderURL(t *testing.T) {
c := messaging.NewClient(100)
// Nil shouldn't blow up.
var u *url.URL
c.SetLeaderURL(u)
tests := []struct {
leader string
expected string
}{
{
leader: "http://localhost",
expected: "http://localhost",
},
{
leader: "https://localhost",
exp... | [
-0.22514818608760834,
0.12426519393920898,
0.4154033362865448,
-0.5951727628707886,
0.0600457489490509,
0.46930304169654846,
-0.0323336087167263,
-0.3801923394203186,
-0.0086069880053401,
0.01068064197897911,
-0.9506969451904297,
0.6843440532684326,
-0.47151491045951843,
0.3699566423892975... |
func TestClient_Publish(t *testing.T) {
c := OpenClient(1000)
defer c.Close()
// Publish message to the broker.
if index, err := c.Publish(&messaging.Message{Type: 100, TopicID: messaging.BroadcastTopicID, Data: []byte{0}}); err != nil {
t.Fatalf("unexpected error: %v", err)
} else if index != 3 {
t.Fatalf("u... | [
0.482310026884079,
0.9543274641036987,
0.3783832788467407,
0.008190935477614403,
0.5304224491119385,
-0.052459605038166046,
1.0248785018920898,
-0.007535967975854874,
-0.07691402733325958,
-0.13277478516101837,
0.2878558039665222,
0.5325872898101807,
-1.4256536960601807,
0.0855903029441833... |
func TestClient_Publish_ErrConnectionRefused(t *testing.T) {
c := OpenClient(1000)
c.Server.Close()
defer c.Close()
// Publish message to the broker.
if _, err := c.Publish(&messaging.Message{Type: 100, TopicID: 0, Data: []byte{0}}); err == nil || !strings.Contains(err.Error(), "connection refused") {
t.Fatalf(... | [
0.5834718346595764,
0.5654454827308655,
0.33493125438690186,
0.06663405895233154,
0.572503924369812,
0.10708631575107574,
0.02442414127290249,
0.6581791043281555,
-0.2971256375312805,
-0.3631591796875,
0.056332796812057495,
0.3052211403846741,
-1.3734946250915527,
0.5104691386222839,
0.6... |
func TestClient_Publish_ErrLogClosed(t *testing.T) {
c := OpenClient(1000)
c.Server.Handler.Broker().Close()
defer c.Close()
// Publish message to the broker.
if _, err := c.Publish(&messaging.Message{Type: 100, TopicID: 0, Data: []byte{0}}); err == nil || err.Error() != "log closed" {
t.Fatalf("unexpected erro... | [
0.3983672857284546,
0.23863539099693298,
0.4891970157623291,
0.3561655580997467,
-0.31001901626586914,
0.6880719065666199,
0.3608819842338562,
-0.05938739329576492,
-0.3891409933567047,
-0.09607120603322983,
0.07099694013595581,
0.49850109219551086,
-0.8125740885734558,
0.3712672293186188,... |
func TestClient_CreateReplica(t *testing.T) {
c := OpenClient(0)
defer c.Close()
// Create replica through client.
if err := c.CreateReplica(123, &url.URL{Host: "localhost"}); err != nil {
t.Fatalf("unexpected error: %v", err)
}
// Verify replica was created.
if r := c.Server.Handler.Broker().Replica(123); r... | [
0.4932093322277069,
0.787911593914032,
0.2704782485961914,
-0.19024419784545898,
0.20124632120132446,
0.5327178239822388,
0.9349046945571899,
0.08079426735639572,
-0.2529091238975525,
0.02566400170326233,
-0.8228933215141296,
-0.022077055647969246,
-0.201852947473526,
-0.29097652435302734,... |
func TestClient_CreateReplica_Err(t *testing.T) {
c := OpenClient(0)
defer c.Close()
c.Server.Handler.Broker().CreateReplica(123, &url.URL{Host: "localhost"})
if err := c.CreateReplica(123, &url.URL{Host: "localhost"}); err == nil || err.Error() != `replica already exists` {
t.Fatalf("unexpected error: %v", err)
... | [
0.041905250400304794,
0.4427628517150879,
0.2920754551887512,
0.0030277534388005733,
0.42214736342430115,
0.2723787724971771,
0.47627896070480347,
0.35323333740234375,
0.02501300722360611,
0.04833786562085152,
-0.6728030443191528,
0.18892864882946014,
-0.5702435374259949,
-0.25535836815834... |
func TestClient_DeleteReplica(t *testing.T) {
c := OpenClient(0)
defer c.Close()
c.Server.Handler.Broker().CreateReplica(123, &url.URL{Host: "localhost"})
// Delete replica through client.
if err := c.DeleteReplica(123); err != nil {
t.Fatalf("unexpected error: %v", err)
}
// Verify replica was deleted.
if ... | [
0.45255187153816223,
0.7141345143318176,
0.32963302731513977,
-0.0933491438627243,
-0.27890244126319885,
-0.05283381789922714,
0.835638701915741,
0.6803084015846252,
0.18980766832828522,
0.05852459743618965,
-0.5443557500839233,
0.5782871842384338,
-0.527165949344635,
-0.47812530398368835,... |
func TestClient_Subscribe(t *testing.T) {
c := OpenClient(0)
defer c.Close()
c.Server.Broker().CreateReplica(100, &url.URL{Host: "localhost"})
// Create subscription through client.
if err := c.Subscribe(100, 200); err != nil {
t.Fatalf("unexpected error: %v", err)
}
// Verify subscription was created.
if a... | [
1.0477633476257324,
0.5534136295318604,
0.3615776598453522,
0.025926245376467705,
-0.018001390621066093,
0.1733575314283371,
0.4799766540527344,
-0.3890887498855591,
-0.24538621306419373,
-0.4240623712539673,
-1.052180290222168,
0.1465781033039093,
-0.2797102928161621,
-0.16169729828834534... |
func TestClient_Subscribe_Err(t *testing.T) {
c := OpenClient(0)
defer c.Close()
if err := c.Subscribe(123, 100); err == nil || err.Error() != `replica not found` {
t.Fatalf("unexpected error: %v", err)
}
} | [
0.7058656215667725,
0.5733754634857178,
0.34399494528770447,
-0.15382270514965057,
-0.16721533238887787,
0.20826509594917297,
-0.484649658203125,
0.22690626978874207,
0.14922864735126495,
-0.5421169996261597,
-0.1809697151184082,
0.8319754004478455,
-0.4282498359680176,
-0.5824463963508606... |
func TestClient_Unsubscribe(t *testing.T) {
c := OpenClient(0)
defer c.Close()
c.Server.Broker().CreateReplica(100, &url.URL{Host: "localhost"})
c.Server.Broker().Subscribe(100, 200)
// Remove subscription through client.
if err := c.Unsubscribe(100, 200); err != nil {
t.Fatalf("unexpected error: %v", err)
}
... | [
0.873878538608551,
0.4466954171657562,
0.3687463700771332,
-0.10099105536937714,
-0.6862022280693054,
-0.41077059507369995,
0.7820687890052795,
0.27435195446014404,
-0.2905940115451813,
-0.18544191122055054,
-0.7250352501869202,
0.05327989533543587,
-0.4729517102241516,
-0.1950872391462326... |
func TestClient_Unsubscribe_Err(t *testing.T) {
c := OpenClient(0)
defer c.Close()
if err := c.Unsubscribe(123, 100); err == nil || err.Error() != `replica not found` {
t.Fatalf("unexpected error: %v", err)
}
} | [
0.6609813570976257,
0.5485697388648987,
0.29924196004867554,
-0.06265817582607269,
-0.627182126045227,
-0.14885613322257996,
-0.03025660663843155,
1.0060162544250488,
-0.12848439812660217,
-0.2838640809059143,
0.27215254306793213,
0.5808241963386536,
-0.21389180421829224,
-0.60392463207244... |
func NewClient(replicaID uint64) *Client {
return &Client{
clientConfig: "", // Not all tests with NewClient require automatic temp file creation.
Client: messaging.NewClient(replicaID),
Server: NewServer(),
}
} | [
0.4525631070137024,
-0.038375742733478546,
0.046648137271404266,
-0.08814000338315964,
-0.9071890115737915,
0.06883498281240463,
1.208605408668518,
-0.6393328309059143,
0.025141239166259766,
-0.12172423303127289,
-0.5343395471572876,
0.8264257311820984,
-0.40199732780456543,
0.187534570693... |
func OpenClient(replicaID uint64) *Client {
c := NewClient(replicaID)
c.Server.Handler.Broker().CreateReplica(replicaID, &url.URL{Host: "localhost"})
// Open client to broker.
c.clientConfig = NewTempFile()
u, _ := url.Parse(c.Server.URL)
if err := c.Open(c.clientConfig, []*url.URL{u}); err != nil {
panic(err)... | [
-0.11488279700279236,
0.11006712913513184,
0.328300803899765,
-0.5761479139328003,
-1.0671838521957397,
0.13493511080741882,
1.1615968942642212,
0.9033874273300171,
-0.06486190855503082,
-0.37852081656455994,
-0.8555571436882019,
0.7243634462356567,
-0.42443132400512695,
-0.457939296960830... |
func (c *Client) Close() {
c.Client.Close()
if c.clientConfig != "" {
os.Remove(c.clientConfig)
}
c.Server.Close()
} | [
0.2191598117351532,
-0.6712053418159485,
0.28301188349723816,
-0.6260395646095276,
-0.2657550275325775,
0.881010115146637,
0.9477397203445435,
-0.2619985044002533,
-1.0938833951950073,
-0.1215180978178978,
-0.5081779360771179,
0.4395226836204529,
-0.9362714886665344,
1.3134396076202393,
... |
func NewTempFile() string {
f, err := ioutil.TempFile("", "influxdb-client-test")
if err != nil {
panic(err)
}
defer f.Close()
return f.Name()
} | [
1.4627065658569336,
-0.4660030007362366,
0.19530341029167175,
-0.3421227037906647,
0.2939845621585846,
0.988582193851471,
0.2476525753736496,
-0.23003296554088593,
-1.201477289199829,
0.21890228986740112,
-0.17852671444416046,
-0.6979050636291504,
-0.44189226627349854,
-0.47280314564704895... |
func (*SearchMovieRequest) Descriptor() ([]byte, []int) {
return file_src_search_proto_rawDescGZIP(), []int{0}
} | [
-1.390511155128479,
0.28719374537467957,
0.6544361114501953,
-0.01603466086089611,
0.15314076840877533,
-0.0979568362236023,
-0.3096790313720703,
-0.031653836369514465,
-0.33412495255470276,
0.12320952862501144,
-0.486107736825943,
0.31610292196273804,
-0.038952670991420746,
1.397819757461... |
func (*Search) Descriptor() ([]byte, []int) {
return file_src_search_proto_rawDescGZIP(), []int{1}
} | [
-1.1974879503250122,
0.8504356145858765,
0.46945539116859436,
0.004846953321248293,
0.04496588557958603,
0.055778030306100845,
0.6985978484153748,
-0.06534475833177567,
-0.29165005683898926,
-0.3302512764930725,
-0.44806772470474243,
-0.2174706757068634,
-0.5748803615570068,
0.760363936424... |
func (*SearchMovieResponse) Descriptor() ([]byte, []int) {
return file_src_search_proto_rawDescGZIP(), []int{2}
} | [
-0.9452627301216125,
-0.23894003033638,
0.3262409269809723,
-0.16251403093338013,
0.05953359976410866,
-0.6510943174362183,
0.0008012285688892007,
-0.13070961833000183,
-0.5092044472694397,
0.01049331109970808,
-1.200853943824768,
-0.5602607131004333,
-0.7690415382385254,
0.531809210777282... |
func (*DetailMovieRequest) Descriptor() ([]byte, []int) {
return file_src_search_proto_rawDescGZIP(), []int{3}
} | [
-0.794369637966156,
0.51667320728302,
0.7310878038406372,
0.051532428711652756,
0.3925892412662506,
-0.2909672260284424,
0.7663898468017578,
0.3836100697517395,
0.25566715002059937,
-0.4158388376235962,
-1.031483769416809,
1.0723954439163208,
0.3256566524505615,
1.5443499088287354,
0.323... |
func (*DetailMovieResponse) Descriptor() ([]byte, []int) {
return file_src_search_proto_rawDescGZIP(), []int{4}
} | [
-0.36150357127189636,
0.019924018532037735,
0.4621415436267853,
-0.08237183094024658,
0.4616098999977112,
-0.6582068204879761,
0.9263919591903687,
0.39467138051986694,
0.21201901137828827,
-0.42657479643821716,
-1.8250786066055298,
-0.07380487769842148,
-0.3952655792236328,
0.6341753005981... |
func (*Rating) Descriptor() ([]byte, []int) {
return file_src_search_proto_rawDescGZIP(), []int{5}
} | [
-1.041674017906189,
0.951763927936554,
0.4343828856945038,
-0.3410930037498474,
-0.3131978213787079,
0.13968531787395477,
0.24284209311008453,
-0.027766171842813492,
-0.8616975545883179,
0.30782991647720337,
-0.4799593389034271,
-0.2025192230939865,
0.13315945863723755,
0.3309427797794342,... |
func (*HealthCheckResponse) Descriptor() ([]byte, []int) {
return file_src_search_proto_rawDescGZIP(), []int{6}
} | [
0.09182971715927124,
0.39337852597236633,
0.08266416192054749,
-0.027214426547288895,
1.309054970741272,
-0.9916245937347412,
0.9896660447120667,
-0.44010287523269653,
0.04889450967311859,
-0.19007104635238647,
-0.11623777449131012,
-0.6836773157119751,
-0.5196765065193176,
0.0094508007168... |
func sliceAtoi(sa []string) ([]int, error) {
si := make([]int, 0, len(sa))
for _, a := range sa {
i, err := strconv.Atoi(a)
if err != nil {
return si, err
}
si = append(si, i)
}
return si, nil
} | [
-0.6017898917198181,
-0.8773722648620605,
0.48127585649490356,
-0.06253856420516968,
-0.026840316131711006,
-0.9063850045204163,
-0.09308498352766037,
0.315828800201416,
-0.1293804794549942,
1.48358952999115,
-0.001164983375929296,
-0.4088427722454071,
0.4732988774776459,
-0.03317823633551... |
func MaxIntSlice(v []int) (m int) {
if len(v) > 0 {
m = v[0]
}
for i := 1; i < len(v); i++ {
if v[i] > m {
m = v[i]
}
}
return
} | [
-0.7859163284301758,
-0.6786956787109375,
0.49374788999557495,
0.17751021683216095,
-0.6022664904594421,
-0.8171473741531372,
-0.7515870928764343,
-0.17192202806472778,
0.022625969722867012,
0.5167381167411804,
0.051356591284275055,
-0.4424670934677124,
-0.5475938320159912,
0.6891078352928... |
func EntityContestToRpcContest(contest *entity.Contest) *problempb.Contest {
if contest == nil {
return &problempb.Contest{}
}
startTime, _ := ptypes.TimestampProto(contest.StartTime)
endTime, _ := ptypes.TimestampProto(contest.EndTime)
problemIds := make([]uint64, len(contest.ProblemIds))
for i, p := range con... | [
-0.38913974165916443,
-0.7959741353988647,
0.5579424500465393,
-0.9421239495277405,
0.0295834019780159,
0.2143431305885315,
-0.16221748292446136,
-0.17371870577335358,
0.1570136845111847,
0.8537048101425171,
0.59001624584198,
0.05544732138514519,
-0.11375439167022705,
-0.46581995487213135,... |
func StartPinglistServer(config PinglistConfig) {
// Create the host registry that will keep track of the hosts
// that we're pinging.
var hostRegistry *HostRegistry = NewHostRegistry(config.hostDbFile)
// Results channel receives Host structs once a host has been
// pinged so result can be stored.
results := ma... | [
-0.49792537093162537,
0.19211481511592865,
0.2796536982059479,
0.5586931109428406,
0.6464882493019104,
0.5520271062850952,
0.301429808139801,
1.0835899114608765,
-0.0747997984290123,
-0.5115087628364563,
-1.51859450340271,
0.6651138663291931,
-0.2452860325574875,
1.0058802366256714,
-0.7... |
func pingLoop(results chan Host, hostRegistry *HostRegistry, interval time.Duration, timeout time.Duration) {
for {
hostAddresses := hostRegistry.GetHostAddresses()
log.Info("Pinging these addresses: %q\n", hostAddresses)
for _, address := range hostAddresses {
log.Debug("Pinging: %v\n", address)
host, ... | [
-0.035409413278102875,
0.21324165165424347,
0.5435791611671448,
0.30679836869239807,
0.5316820740699768,
0.5613214373588562,
0.15532423555850983,
0.33668243885040283,
-0.4361877143383026,
0.2990211546421051,
0.007024227175861597,
0.7244231700897217,
-0.3010736107826233,
0.691694438457489,
... |
func storePingResults(results chan Host, hostRegistry *HostRegistry) {
for {
host := <-results
log.Info("Storing results for host: %q\n", host)
hostRegistry.UpdateHost(host)
}
} | [
-0.769711971282959,
0.6942517757415771,
0.27566108107566833,
-0.3511907756328583,
0.7573603987693787,
0.9541712999343872,
-0.040899112820625305,
-0.3339972496032715,
-0.26016339659690857,
-0.7759092450141907,
-1.0175029039382935,
0.2400428056716919,
-0.6948422789573669,
0.5838103294372559,... |
func pingAddress(results chan Host, oldHost Host, timeout time.Duration) {
isUp, rtt, err := pingWithFastping(oldHost.Address, timeout)
if err != nil {
log.Error(err.Error())
}
newHost := Host{}
newHost.Address = oldHost.Address
newHost.Description = oldHost.Description
if isUp {
newHost.Status = Online
... | [
-0.513163685798645,
-0.6987630724906921,
0.6485884785652161,
0.217781662940979,
-0.053023647516965866,
0.18025276064872742,
-0.5298302173614502,
0.6550117135047913,
0.4797070026397705,
0.9262895584106445,
-0.24601253867149353,
1.6524516344070435,
0.15613485872745514,
0.775937557220459,
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.