text
stringlengths
11
6.3k
embedding
listlengths
768
768
func IsClosed() bool { return server.IsClosed() }
[ -0.5264789462089539, -0.7544020414352417, 0.4467731714248657, 0.5000079870223999, -0.1845400035381317, 0.632003664970398, -0.543828547000885, 0.09423976391553879, 0.5790397524833679, -0.5197533965110779, -0.44342634081840515, 0.7958064079284668, -1.013866901397705, 0.20282675325870514, 0...
func Close() error { return server.Close() }
[ -0.4045495390892029, -0.21332138776779175, 0.07870518416166306, 0.26753342151641846, -0.42932838201522827, 0.9989600777626038, -0.16407005488872528, -0.48903602361679077, -0.4278124272823334, -0.46253037452697754, 0.2810957133769989, 0.4801187515258789, -1.5103946924209595, 0.5553320646286...
func Wait(timeout time.Duration) error { return server.Wait(timeout) }
[ -0.5863645076751709, 0.45365285873413086, 0.1329292207956314, 0.2182708978652954, 0.007104734890162945, 0.9408050179481506, -0.591763436794281, 0.08405546844005585, -0.7368900775909424, 0.2230079621076584, -0.7780183553695679, 0.7435497045516968, 0.1348947435617447, 0.43266674876213074, ...
func New(server *http.Server) (*Server, error) { listener, err := zerodown.Listen("tcp", server.Addr) if err != nil { return nil, err } return &Server{ server: server, listener: listener, }, nil }
[ -0.027882855385541916, -1.4450467824935913, 0.34303155541419983, -0.7638870477676392, -0.25338372588157654, 0.6347073316574097, 0.10178522020578384, -0.33351701498031616, 0.10034725815057755, -0.3915923833847046, 0.3617314398288727, 0.36176544427871704, 0.010751313529908657, 1.176707625389...
func FromFd(fd int, server *http.Server) (*Server, error) { listener, err := zerodown.FdListen(fd) if err != nil { return nil, err } return &Server{ server: server, listener: listener, }, nil }
[ 0.37767598032951355, -1.0008809566497803, 0.6068722009658813, -0.4906034469604492, -0.6717541813850403, 0.52904212474823, -0.20522411167621613, -0.17640474438667297, 0.4839257299900055, -0.8159564137458801, 0.47215643525123596, 0.38432806730270386, -0.45082229375839233, 0.7230756878852844,...
func (s *Server) ListenAndServe() error { return s.server.Serve(s.listener) }
[ 0.46245723962783813, -1.508669137954712, 0.1775059551000595, -0.38995829224586487, 0.21566343307495117, 0.04124275967478752, -1.1284879446029663, 0.7143509387969971, -0.15467874705791473, -0.32956454157829285, -0.3328269422054291, -0.24734030663967133, -0.4085340201854706, 0.95193493366241...
func (s *Server) ListenAndServeTLS(certFile, keyFile string) error { config := &tls.Config{} if s.server.TLSConfig != nil { *config = *s.server.TLSConfig } if config.NextProtos == nil { config.NextProtos = []string{"http/1.1"} } var err error config.Certificates = make([]tls.Certificate, 1) config.Certific...
[ 0.4977681040763855, -0.46471136808395386, 0.631852924823761, 0.10276679694652557, -0.8172246217727661, 0.541641891002655, -0.16519604623317719, 0.6234039068222046, -0.45100295543670654, 1.1137475967407227, -0.6731980443000793, -0.17389844357967377, -0.16158966720104218, 0.964381992816925, ...
func (s *Server) DupFd() (int, error) { return s.listener.DupFd() }
[ 0.1364648938179016, 0.14117619395256042, 0.6509829163551331, -0.17014451324939728, -0.2110641747713089, 0.0317346416413784, 0.5494346022605896, -0.3782009184360504, 0.3912903666496277, -0.46151089668273926, -0.3235034942626953, 0.5972888469696045, -0.21486279368400574, 1.5255956649780273, ...
func (s *Server) IsClosed() bool { return s.listener.IsClosed() }
[ -0.06421664357185364, -0.8867889642715454, 0.5992749333381653, 0.1402347832918167, 0.32230105996131897, 0.4681662619113922, -0.3723122775554657, -0.13594666123390198, 0.7838890552520752, -0.47505486011505127, -0.18073955178260803, 0.8853397965431213, -0.7688705325126648, 0.4708323180675506...
func (s *Server) Close() error { return s.listener.Close() }
[ -0.046360310167074203, -0.8188306093215942, 0.36908990144729614, -0.2789137065410614, -0.33950015902519226, 0.8928006887435913, -0.2342207133769989, -0.4449292719364166, -0.2989274561405182, -0.3806252181529999, 0.4535336494445801, 0.4881190359592438, -1.1121855974197388, 1.150528907775879...
func (s *Server) Wait(timeout time.Duration) error { return s.listener.Wait(timeout) }
[ -0.22924086451530457, -0.13093315064907074, 0.18389937281608582, -0.4375770092010498, 0.3489753305912018, 0.9215009212493896, -0.4403117299079895, -0.0759851261973381, -0.519432008266449, 0.14620450139045715, -0.3827334940433502, 0.5087421536445618, 0.257171094417572, 0.5627937316894531, ...
func shutdownServer() { shutdownDelay := time.NewTimer(SHUTDOWN_DELAY) <-shutdownDelay.C srv.Shutdown(context.Background()) }
[ -1.024470567703247, -0.5136752724647522, 0.5167200565338135, 0.13993950188159943, 0.2976795732975006, 0.04580262303352356, 0.6967464089393616, 0.43103691935539246, -0.1462080329656601, -0.49980029463768005, 0.07736524194478989, 0.2917502224445343, -1.0353142023086548, 0.5253821611404419, ...
func checkShutdownState(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if shutDown { http.Error(w, "Server Shutting Down", http.StatusServiceUnavailable) return } processes++ next.ServeHTTP(w, r) processes-- if shutDown && processes == 0 { ...
[ -0.6348565816879272, -0.021856922656297684, 0.39476239681243896, 0.30777183175086975, -0.6081623435020447, 0.01214949693530798, -0.15967272222042084, -0.42231032252311707, 0.5721898674964905, 0.25627660751342773, 0.23820056021213531, -0.3302878737449646, -0.2077222317457199, 0.233699396252...
func (c *customerio) From(name, from string) Mailer { c.from = address{Name: name, Email: from} return c }
[ 0.9459418058395386, -0.7273141741752625, 0.388287216424942, -0.12377768754959106, -1.118837833404541, 0.17902220785617828, -0.46525147557258606, 0.14539934694766998, -0.23259291052818298, -0.5068145990371704, -0.7077109217643738, 1.4367862939834595, 0.6034478545188904, -0.41693606972694397...
func (c *customerio) To(name, to string) Mailer { c.toList = append(c.toList, address{Name: name, Email: to}) return c }
[ -0.45257875323295593, 0.05616988241672516, 0.3958966135978699, -1.2711706161499023, -0.058657996356487274, -0.38210296630859375, -0.8215449452400208, 0.46574127674102783, -0.5697362422943115, 0.010706423781812191, -1.3276193141937256, 1.285902976989746, 0.34782227873802185, -0.453664839267...
func (c *customerio) Cc(name, to string) Mailer { c.ccList = append(c.ccList, address{Name: name, Email: to}) return c }
[ 0.5654721856117249, -0.2687818706035614, 0.5307225584983826, 0.2763293385505676, -0.6416078805923462, 0.7604422569274902, -0.8272130489349365, 0.4993787109851837, -0.15896013379096985, 0.18601259589195251, -0.7188236117362976, 0.6524912118911743, 0.900532066822052, -0.3078922629356384, -...
func (c *customerio) Bcc(name, to string) Mailer { c.bccList = append(c.bccList, address{Name: name, Email: to}) return c }
[ 0.8535845279693604, -0.412734717130661, 0.44700130820274353, -0.565472424030304, 0.40384575724601746, -0.4080135226249695, -0.6284400224685669, 0.555720865726471, -0.13954871892929077, -0.3517451286315918, -1.1144447326660156, 0.9652117490768433, 0.29804426431655884, -0.49065980315208435, ...
func (c *customerio) ReplyTo(name, email string) Mailer { c.replyTo = address{Name: name, Email: email} return c }
[ 0.8263599276542664, -0.10853984206914902, 0.5785015225410461, -1.0309209823608398, -0.08601603657007217, -0.27685877680778503, -0.3197721540927887, -0.012341003865003586, -0.6386405229568481, -0.3864651024341583, -1.558719277381897, 1.3360841274261475, -0.07367867231369019, -0.449894279241...
func (c *customerio) Subject(subject string) Mailer { c.subject = subject return c }
[ 0.9547462463378906, -0.19329488277435303, 0.18704502284526825, -0.08378708362579346, -0.9122267961502075, 0.7147692441940308, 0.31348559260368347, -0.23318085074424744, -0.6028401851654053, -0.7822882533073425, -1.0205738544464111, 1.2270338535308838, 0.446397602558136, 0.5480664968490601,...
func (c *customerio) BodyHTML(body string) Mailer { c.bodyHTML = body return c }
[ 0.7262234091758728, 0.5833800435066223, 0.33298763632774353, 0.7812948822975159, -0.5890772938728333, 0.3934914469718933, 0.01720339059829712, 0.04814508184790611, 0.061103273183107376, 0.3002215623855591, -1.3574652671813965, 0.8362821340560913, -0.49743929505348206, 0.6495915651321411, ...
func (c *customerio) BodyText(body string) Mailer { c.bodyText = body return c }
[ 0.7704405188560486, -0.35480955243110657, 0.3892606794834137, 0.095878466963768, -0.6243100762367249, 0.6087241768836975, -0.21022659540176392, -0.30992391705513, 0.9594788551330566, 0.028312282636761665, -2.0998125076293945, 0.5251076817512512, -0.5274611711502075, 0.2511337697505951, -...
func (c *customerio) AttachmentFile(file string) Mailer { c.attachmentFiles = append(c.attachmentFiles, file) return c }
[ 0.915842592716217, -0.3835752010345459, 0.5228238701820374, 0.011100232601165771, -0.5607552528381348, 0.9289697408676147, 0.400189071893692, 0.22340397536754608, -0.2235860377550125, -0.6239588856697083, -0.5323638916015625, 0.020788172259926796, -0.32507067918777466, 0.33612656593322754,...
func (c *customerio) AttachmentInlineFile(file string) Mailer { c.attachmentInlineFiles = append(c.attachmentInlineFiles, file) return c }
[ 1.0579967498779297, -1.0617679357528687, 0.6392831206321716, -0.49182936549186707, -1.031029462814331, 1.1212871074676514, 0.47567152976989746, 0.6147224307060242, -0.6593712568283081, -0.7843911051750183, -0.859331488609314, 0.3566015660762787, -0.4134969413280487, -0.20313310623168945, ...
func (c *customerio) AttachmentReader(file string, r io.Reader) Mailer { c.attachmentReaders = make(map[string]readerInfo) c.attachmentReaders[file] = readerInfo{r: r} return c }
[ 0.07776857167482376, -1.2962088584899902, 0.4345186650753021, -0.6146020293235779, -1.4534255266189575, 0.32236447930336, 0.17153286933898926, 0.05712173134088516, -0.16234681010246277, -0.7076728940010071, 0.19669121503829956, 0.24066539108753204, 0.1470973789691925, 0.07333634048700333, ...
func (c *customerio) AttachmentInlineReader(file string, r io.Reader) Mailer { c.attachmentInlineReaders = make(map[string]readerInfo) c.attachmentInlineReaders[file] = readerInfo{r: r} return c }
[ 0.5052407383918762, -1.8362252712249756, 0.48638856410980225, -1.0126265287399292, -1.342706322669983, 0.2779235243797302, 0.06951990723609924, -0.0032894171308726072, -0.47020575404167175, -0.962701678276062, -0.2691871225833893, 0.5752590894699097, -0.0504542700946331, -0.551965951919555...
func (c *customerio) Send() error { // verify params for sending email c.verifyParams() //check the total file size and path var totalSize int64 for _, f := range c.attachmentFiles { fi, e := os.Stat(f) if e != nil { return e } // get the size totalSize += fi.Size() } if totalSize > customerioMaxF...
[ 0.08855661004781723, -0.16090364754199982, 0.8468591570854187, 0.16704188287258148, 0.3709110617637634, 0.07049544155597687, 0.5162410736083984, 0.21784891188144684, -0.9716082811355591, 0.051508545875549316, -0.6592823266983032, 0.3577207028865814, -0.11096464097499847, 0.0452852807939052...
func (c customerio) verifyParams() { if c.from.Email == "" { panic("gomailer: you must provide from") } if len(c.toList) <= 0 { panic("gomailer: you must provide at least one receipent") } if len(c.toList)+len(c.ccList)+len(c.bccList) > customerioMaxReceipents { panic(fmt.Sprintf("mailer: total number of rec...
[ 0.7578880190849304, 0.5686946511268616, 0.4380885362625122, 0.001049091457389295, 0.351725697517395, 0.34578102827072144, 0.11428087949752808, 0.28949493169784546, -0.787538468837738, -0.10938390344381332, -0.7205361127853394, 0.5642870664596558, -0.5128458738327026, 0.8090587854385376, ...
func NewActivity(metadata *activity.Metadata) activity.Activity { return &MyActivity{metadata: metadata} }
[ 0.5254675149917603, -1.2250394821166992, 0.07614469528198242, 0.38101768493652344, -0.5346868634223938, -0.05096015706658363, -0.028699614107608795, -0.4048473834991455, -0.09228713810443878, -0.7047272324562073, 0.9237696528434753, 0.4914596676826477, -0.19386348128318787, -0.948610663414...
func New(url string, log kite.Logger) *Docker { // the error is returned only when the passed URL is not parsable via // url.Parse, so we can safely neglect it client, _ := dockerclient.NewClient(url) return &Docker{ client: client, log: log, } }
[ 0.10961266607046127, -0.20209842920303345, 0.2788657546043396, 0.1464124619960785, -0.824221670627594, -0.8437882661819458, -0.650626003742218, 0.837354302406311, -0.8490045666694641, -0.8781589269638062, -0.09639139473438263, 0.5072023868560791, 0.7642427682876587, 1.1613831520080566, 0...
func (d *Docker) Create(r *kite.Request) (interface{}, error) { var params struct { // Custom Container name Name string // Image name Image string } if err := r.Args.One().Unmarshal(&params); err != nil { return nil, err } if params.Image == "" { return nil, errors.New("missing arg: image is empty"...
[ -0.9421259760856628, 0.2973186671733856, 0.898956298828125, 0.45171788334846497, -0.4615761339664459, -0.3479144871234894, 0.0795227512717247, -0.7335031032562256, -0.6199469566345215, 0.7483422756195068, 0.7112236022949219, -0.5045453310012817, -0.177244633436203, 1.2847366333007812, 0....
func (d *Docker) Connect(r *kite.Request) (interface{}, error) { var params struct { // The ID of the container. This needs to be created and started before // we can use Connect. ID string // Cmd contains the command which is executed and passed to the docker // exec api. If empty "bash" is used. Cmd str...
[ -0.4671318829059601, -0.5357282757759094, 0.9831008315086365, 0.5788122415542603, 0.11004117131233215, -0.3309740424156189, -0.2060832679271698, -0.7192457914352417, -0.8605273365974426, -0.030302172526717186, 0.555515706539154, 0.2068275660276413, 0.3940015733242035, 0.9845733642578125, ...
func (d *Docker) Stop(r *kite.Request) (interface{}, error) { var params struct { // The ID of the container. ID string } if err := r.Args.One().Unmarshal(&params); err != nil { return nil, err } if params.ID == "" { return nil, errors.New("missing arg: container is is empty") } if err := d.client.Sto...
[ -1.916182279586792, 0.4948646128177643, 0.7866238355636597, 0.20640124380588531, 0.6506890058517456, -0.09058990329504013, 0.014300080016255379, -0.26096591353416443, -0.5478388071060181, 0.5049950480461121, -0.28271064162254333, -0.4587799906730652, -0.8210901618003845, 0.3924104273319244...
func (d *Docker) Start(r *kite.Request) (interface{}, error) { var params struct { // The ID of the container. ID string } if err := r.Args.One().Unmarshal(&params); err != nil { return nil, err } if params.ID == "" { return nil, errors.New("missing arg: container is is empty") } if err := d.client.St...
[ -0.8044795393943787, 0.4806513488292694, 0.6515470147132874, 0.5689195394515991, 0.4964793026447296, -0.31237584352493286, 0.4250943064689636, 0.23703661561012268, -0.5082495212554932, 0.3081207871437073, -0.16861531138420105, 0.3899467885494232, -0.344436913728714, 0.9342565536499023, -...
func (d *Docker) RemoveContainer(r *kite.Request) (interface{}, error) { var params struct { // The ID of the container. ID string // A flag that indicates whether Docker should remove the volumes // associated to the container. RemoveVolumes bool // A flag that indicates whether Docker should remove the...
[ -1.2850544452667236, 0.3191731572151184, 0.8605540990829468, 0.15835055708885193, 0.746873140335083, -0.5395370125770569, 0.4301801323890686, 0.008578482083976269, -0.1930217742919922, -0.12030147761106491, 0.39718878269195557, -0.5402640104293823, -0.7134900093078613, 0.9300862550735474, ...
func (d *Docker) List(r *kite.Request) (interface{}, error) { filter := dockerclient.ListContainersOptions{ All: true, } return d.client.ListContainers(filter) }
[ -0.6970791220664978, -0.30018100142478943, 0.655671238899231, 0.3464876711368561, 0.6643171906471252, -1.241274118423462, -0.3546251058578491, -0.5846489667892456, 0.516932487487793, 0.42984893918037415, -0.031582240015268326, 0.22807975113391876, 0.35335105657577515, 1.4764548540115356, ...
func CheckItemWithStringKeys(item types.Item, stringKeys []string) bool { for _, sK := range stringKeys { keyExist := false for _, sKV := range item.Strings { if sK == sKV.Key { keyExist = true } } if !keyExist { return false } } return true }
[ -0.8474690914154053, -1.3143761157989502, 0.34066832065582275, 0.6742520332336426, -0.042483534663915634, 0.04262181743979454, -1.4146604537963867, -0.1488974392414093, -0.8421758413314819, 1.528668761253357, 0.08216336369514465, 0.24264712631702423, -0.9803752303123474, 0.2030754536390304...
func CheckItemWithStringValues(item types.Item, stringValues map[string]string) bool { for sK, sV := range stringValues { keyExist := false for _, sKV := range item.Strings { if sK == sKV.Key && sV == sKV.Value { keyExist = true } } if !keyExist { return false } } return true }
[ -0.3388998508453369, -1.4200807809829712, 0.5343043208122253, 0.35433271527290344, -0.22792796790599823, 0.7010451555252075, -1.0738105773925781, 0.09104093909263611, -1.000245451927185, 0.695972204208374, 0.1994340717792511, 0.1541917324066162, -0.23627851903438568, 0.5978924036026001, ...
func CheckItemWithDblKeys(item types.Item, dblKeys []string) bool { for _, sK := range dblKeys { keyExist := false for _, sKV := range item.Doubles { if sK == sKV.Key { keyExist = true } } if !keyExist { return false } } return true }
[ -0.7453949451446533, 0.17018845677375793, 0.596298098564148, 1.1707879304885864, -0.15567149221897125, 0.4303600788116455, -0.45442771911621094, -0.8967800736427307, -0.7557973861694336, 1.336162805557251, -0.31770557165145874, -0.2240438312292099, -0.776174008846283, 0.4901100695133209, ...
func CheckItemWithDblValues(item types.Item, dblValues map[string]sdk.Dec) bool { for sK, sV := range dblValues { keyExist := false for _, sKV := range item.Doubles { if sK == sKV.Key && sV.Equal(sKV.Value) { keyExist = true } } if !keyExist { return false } } return true }
[ -0.6313217282295227, 0.17624817788600922, 0.7511006593704224, 1.0505492687225342, 0.06928063929080963, 1.0126034021377563, -0.27752357721328735, -0.6836493015289307, -0.9979044198989868, 0.663195788860321, -0.25056004524230957, -0.1433711051940918, -0.3758096992969513, 0.5112609267234802, ...
func CheckItemWithLongKeys(item types.Item, longKeys []string) bool { for _, sK := range longKeys { keyExist := false for _, sKV := range item.Longs { if sK == sKV.Key { keyExist = true } } if !keyExist { return false } } return true }
[ -0.7819347381591797, -0.6296041011810303, 0.5212541222572327, 0.8315904140472412, -0.17217324674129486, 0.29873111844062805, -1.4158860445022583, -0.038701947778463364, -0.8856236934661865, 1.2642673254013062, -0.7732616066932678, -0.23079754412174225, -0.3443904221057892, 0.50013732910156...
func CheckItemWithLongValues(item types.Item, longValues map[string]int64) bool { for sK, sV := range longValues { keyExist := false for _, sKV := range item.Longs { if sK == sKV.Key && sV == sKV.Value { keyExist = true } } if !keyExist { return false } } return true }
[ -0.3492434620857239, -0.6693496108055115, 0.6134498119354248, 0.6567497253417969, -0.16560706496238708, 0.796768069267273, -1.1702606678009033, 0.11537870764732361, -0.8765082359313965, 0.4907335042953491, -0.5683712363243103, -0.2412475049495697, 0.12208056449890137, 1.0082918405532837, ...
func CheckItemWithTransferFee(item types.Item, transferFee string, t *testing.T) bool { if len(transferFee) > 0 { n, err := strconv.Atoi(transferFee) if err != nil { return false } return int64(n) == item.TransferFee } return true }
[ 0.4945044219493866, -0.23639880120754242, 0.3529776334762573, 0.7789743542671204, 0.4044007956981659, -0.14877603948116302, -0.7619133591651917, -0.16145049035549164, 0.08342991769313812, 0.4834786653518677, 0.0007690204656682909, -0.09722146391868591, -0.6362472176551819, 0.06772054731845...
func PropertyExistCheck(step FixtureStep, t *testing.T) { for _, pCheck := range step.Output.Property { shouldNotExist := pCheck.ShouldNotExist var pOwnerAddr string if len(pCheck.Owner) == 0 { pOwnerAddr = "" } else { pOwnerAddr = GetAccountAddressFromTempName(pCheck.Owner, t) } if len(pCheck.Cookbo...
[ -0.04281146824359894, -0.7431012392044067, 0.8934399485588074, 0.6566342115402222, 1.1167316436767578, 0.650100827217102, 0.9285590052604675, 0.9576871395111084, -0.6430619955062866, 0.36291834712028503, 0.7010951042175293, -0.9702576994895935, -0.20601654052734375, 0.6269770264625549, -...
func ProcessSingleFixtureQueueItem(file string, idx int, fixtureSteps []FixtureStep, lv1t *testing.T) { step := fixtureSteps[idx] lv1t.Run(strconv.Itoa(idx)+"_"+step.ID, func(t *testing.T) { if FixtureTestOpts.IsParallel { t.Parallel() } if step.RunAfter.BlockWait > 0 { err := inttest.WaitForBlockInterval...
[ -0.28198012709617615, -0.8083812594413757, 0.50022953748703, 0.2841029167175293, 0.4330732524394989, 0.4486358165740967, 0.6753224730491638, 0.0452432818710804, -0.03442405164241791, 0.12856584787368774, -0.3957068622112274, -0.20316775143146515, 0.26248446106910706, 0.48863041400909424, ...
func RunRegisterWorkQueuesForSingleFixture(file string, t *testing.T) { var fixtureSteps []FixtureStep byteValue := ReadFile(file, t) err := json.Unmarshal([]byte(byteValue), &fixtureSteps) t.WithFields(testing.Fields{ "raw_json": string(byteValue), }).MustNil(err, "error decoding fixture steps") CheckSteps(f...
[ -0.6620809435844421, -0.05724036693572998, 0.409408837556839, 0.07820364832878113, 0.9170587658882141, 0.16820110380649567, 0.48058369755744934, 0.5139765739440918, -0.60025954246521, 0.02672918699681759, -0.8153148293495178, -0.20388029515743256, -0.16992492973804474, 1.0862866640090942, ...
func RunSingleFixtureTest(file string, t *testing.T) { var fixtureSteps []FixtureStep byteValue := ReadFile(file, t) err := json.Unmarshal([]byte(byteValue), &fixtureSteps) t.WithFields(testing.Fields{ "raw_json": string(byteValue), }).MustNil(err, "error decoding fixture steps") t.Run(file, func(t *testing.T...
[ -0.3208063840866089, -0.1689346879720688, 0.47473010420799255, -0.18005506694316864, 0.1475711613893509, 0.14911691844463348, 1.0750194787979126, 0.7702605128288269, -0.2203780859708786, -0.04868408292531967, -0.6318072080612183, -0.23066346347332, -0.35935065150260925, 0.7641997933387756,...
func RunTestScenarios(scenarioDir string, scenarioFileNames []string, t *originT.T) { newT := testing.NewT(t) // Register default accounts configured into runtime key mapping RegisterDefaultAccountKeys() var files []string scenarioDirectory := path.Join(FixtureTestOpts.BaseDirectory, scenarioDir) err := filepa...
[ -0.5102847218513489, -0.6105565428733826, 0.8434750437736511, 0.780695915222168, 0.6406009793281555, -0.09662038087844849, 1.2461715936660767, -0.08147846907377243, 0.018825529143214226, -0.03321925550699234, -0.3649640679359436, -0.47993868589401245, -0.034138016402721405, 0.7820217609405...
func runUntaggedExample(session client.Session, schema *desc.MessageDescriptor) { log.Printf("------ run untagged example ------") var ( untaggedSeriesID = ident.StringID("untagged_seriesID") m = newTestValue(schema) ) marshaled, err := m.Marshal() if err != nil { log.Fatalf("error marshaling ...
[ -0.12478087842464447, -0.4075562357902527, 0.779854416847229, -0.7777355909347534, 0.481914758682251, 0.21239057183265686, 0.3710404336452484, -0.6471273899078369, -0.3716154396533966, -0.22042156755924225, 0.030800096690654755, 1.2881900072097778, -0.48503991961479187, 0.37542426586151123...
func runTaggedExample(session client.Session, schema *desc.MessageDescriptor) { log.Printf("------ run tagged example ------") var ( seriesID = ident.StringID("vehicle_id_1") tags = []ident.Tag{ {Name: ident.StringID("type"), Value: ident.StringID("sedan")}, {Name: ident.StringID("city"), Value: ident.S...
[ -0.10727774351835251, -0.27204495668411255, 0.7850988507270813, -0.7216340899467468, 0.4714089632034302, -0.05764221400022507, -0.10194975137710571, -0.7626292109489441, -0.5493454933166504, -0.10752339661121368, -0.19329987466335297, 0.957949697971344, -0.3756962716579437, 0.2833946347236...
func Setup() { var err error DB, err = gorm.Open(config.DatabaseConfig.Type, fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8&parseTime=True&loc=Local", config.DatabaseConfig.User, config.DatabaseConfig.Password, config.DatabaseConfig.Host, config.DatabaseConfig.Name)) if err != nil { log.Fatalf("models.Setup e...
[ -0.14570364356040955, 0.900885283946991, 0.6952128410339355, 0.5159238576889038, 0.892566442489624, 0.6930074095726013, 0.30787375569343567, 1.0724817514419556, -0.5530714988708496, 1.2829455137252808, -0.5694056153297424, -0.014165205880999565, -0.12569695711135864, 0.5597584247589111, ...
func NewHeap[T any](direction func(a, b T) bool) *Heap[T] { if direction == nil { return nil } return &Heap[T]{ direction: direction, datas: make([]T, 0, 256), } }
[ -0.158046692609787, 0.2878027856349945, 0.28703203797340393, 0.24396738409996033, -0.3227073848247528, -0.11685623228549957, -0.2599429190158844, -0.19393891096115112, 0.9879249930381775, 0.1283096820116043, -0.15249165892601013, 0.9647225141525269, 0.7296390533447266, -0.43104809522628784...
func (this *Heap[T]) GetRoot() (data T, ok bool) { if len(this.datas) > 0 { return this.datas[0], true } return }
[ -0.05793239176273346, 0.5809658765792847, 0.8344683647155762, 0.38055548071861267, 0.026876484975218773, -0.03129758685827255, -1.2916405200958252, -0.556790292263031, 0.46403607726097107, 0.44442424178123474, -0.70574951171875, 0.6875680685043335, -0.5706313252449036, -0.09618914127349854...
func (*Entry) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Entry_OneofMarshaler, _Entry_OneofUnmarshaler, _Entry_OneofSizer, []interface{}{ (*Entry_EntryType)(nil), }...
[ -0.1529121696949005, 0.4331958293914795, 0.40470945835113525, -0.6233096122741699, 0.700144350528717, -0.8904464840888977, 0.6915878057479858, -0.8823579549789429, 0.6779590249061584, -0.4167921543121338, -0.28165385127067566, 0.2417711466550827, -0.14944575726985931, 1.0301724672317505, ...
func (*Header) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Header_OneofMarshaler, _Header_OneofUnmarshaler, _Header_OneofSizer, []interface{}{ (*Header_Version)(nil),...
[ -0.7171004414558411, 0.4124506413936615, 0.5622032880783081, -0.3954165279865265, 0.21013197302818298, -0.7344762682914734, 0.43131381273269653, -0.8546844124794006, 0.24814267456531525, -0.6157196760177612, -0.741484522819519, 0.02636256441473961, -0.48084279894828796, 0.5729708075523376,...
func (*Column) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Column_OneofMarshaler, _Column_OneofUnmarshaler, _Column_OneofSizer, []interface{}{ (*Column_IsNull)(nil), ...
[ -0.21172237396240234, 0.46073421835899353, 0.5781568884849548, -0.4414564073085785, 0.8627718091011047, -1.1434656381607056, 0.6438148021697998, -1.1530377864837646, -0.047593411058187485, -0.37720316648483276, -0.7307068109512329, 0.20116202533245087, -0.0011429195292294025, 0.90151780843...
func (*RowChange) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _RowChange_OneofMarshaler, _RowChange_OneofUnmarshaler, _RowChange_OneofSizer, []interface{}{ (*RowChange...
[ -0.688568115234375, 1.0282970666885376, 0.4846881926059723, -0.23720984160900116, 0.2841780185699463, -0.9692472815513611, 0.44233784079551697, -0.6119228005409241, 0.4250044524669647, -0.2514124810695648, -0.29569417238235474, 0.14397169649600983, 0.2493571937084198, 1.5320740938186646, ...
func (*Node) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Node_UserAgentVersion)(nil), (*Node_UserAgentBuildVersion)(nil), } }
[ -1.4939656257629395, -0.16219423711299896, 0.22099697589874268, 0.12379194051027298, 0.8376733660697937, 0.4305998980998993, -0.011797758750617504, -0.2567939758300781, 1.1836693286895752, 0.3992714583873749, -0.23639850318431854, 0.3294936716556549, -0.02527789957821369, 0.714541018009185...
func (*DataSource) XXX_OneofWrappers() []interface{} { return []interface{}{ (*DataSource_Filename)(nil), (*DataSource_InlineBytes)(nil), (*DataSource_InlineString)(nil), } }
[ -1.4217342138290405, 0.29764631390571594, 0.11201823502779007, -0.9710648059844971, 0.4243241250514984, -0.9243290424346924, -0.17193388938903809, 0.40287667512893677, 1.1679996252059937, -0.21840451657772064, -1.2611846923828125, 0.1222744733095169, 0.33097824454307556, 0.4869544506072998...
func (*AsyncDataSource) XXX_OneofWrappers() []interface{} { return []interface{}{ (*AsyncDataSource_Local)(nil), (*AsyncDataSource_Remote)(nil), } }
[ -1.631833553314209, 0.44168612360954285, 0.07726877927780151, -0.7755699753761292, 0.4800785779953003, -0.547293484210968, -0.3543420433998108, 0.25132015347480774, 0.9606451988220215, 0.06028987839818001, -0.5081912875175476, 0.12349461764097214, 0.3716648519039154, 0.44174015522003174, ...
func (*TransportSocket) XXX_OneofWrappers() []interface{} { return []interface{}{ (*TransportSocket_TypedConfig)(nil), } }
[ -1.6119645833969116, 0.8896868824958801, 0.49588915705680847, -0.6280378103256226, 0.7017924785614014, 0.031772639602422714, 0.16701094806194305, -0.6046667695045471, 1.0566201210021973, 0.29428017139434814, -0.40853655338287354, 0.5471838712692261, -0.47907695174217224, 0.4742463529109955...
func (f *Flag) Get() bool { return atomic.LoadInt32(&f.flag) > 0 }
[ -0.4827558100223541, 0.9247926473617554, 0.19332869350910187, 0.12586387991905212, 0.6575588583946228, 0.34640225768089294, -0.7907623648643494, 0.07503122091293335, -1.8330860137939453, -0.7004337906837463, -0.6061199307441711, 0.039150334894657135, -0.6297321319580078, -0.180044129490852...
func (f *Flag) Set() { atomic.StoreInt32(&f.flag, 1) }
[ -0.14610622823238373, 1.5341225862503052, 0.0013091468717902899, 0.07077592611312866, 0.8738068342208862, 0.7803508043289185, 0.576282799243927, 0.00271746632643044, -1.9788466691970825, -0.6444834470748901, -1.1724843978881836, -0.04237576574087143, -0.8351996541023254, 0.7564404010772705...
func resolveSourceFileOrNull(sourceFile string, roots []string) (string, os.FileInfo, error) { if filepath.IsAbs(sourceFile) { cleanPath := filepath.Clean(sourceFile) fileInfo, err := os.Stat(cleanPath) if err == nil { return cleanPath, fileInfo, nil } return "", nil, errors.WithStack(err) } for _, roo...
[ 0.659835159778595, -0.6360753178596497, 0.7514349222183228, -0.02946392260491848, 0.600648045539856, 0.03979087620973587, 0.47014284133911133, -0.12441878020763397, -0.5916749238967896, 0.2868594527244568, 0.15181894600391388, -1.4001511335372925, 0.24676965177059174, 0.7981129288673401, ...
func (b *Buffer) DrawLine(x0, y0, x1, y1 int, color *RGBA) { steep := false // if the line is steep, we swap the coords // and we'll swap them back again right before rendering if abs(x0-x1) < abs(y0-y1) { steep = true x0, y0 = y0, x0 x1, y1 = y1, x1 } // sort the points, left to right if x0 > x1 { x0,...
[ 0.0949852392077446, 0.32798734307289124, 0.6383054852485657, 0.07173547893762589, 0.8533759713172913, 0.10448610782623291, -0.23520691692829132, -0.05508973076939583, -0.21995946764945984, -0.7223876714706421, -0.3791149854660034, 0.5160927772521973, -0.2009417861700058, 0.5978520512580872...
func TestClient_Int_PubSub(t *testing.T) { asyncErrs := make(chan error, 8) c, err := NewClient(ClientConfig{ Addr: pulsarAddr(t), Errs: asyncErrs, }) if err != nil { t.Fatal(err) } go func() { for err := range asyncErrs { t.Log(err) } }() // context for remainder of test ctx, cancel := context.W...
[ 0.31912338733673096, 0.7082594037055969, 0.9691460728645325, -0.4707174599170685, 0.4020675718784332, -0.08516229689121246, 0.5611505508422852, -0.8975347876548767, -0.12607036530971527, -0.1959482580423355, 0.4032622277736664, -0.13937151432037354, -0.28219032287597656, -0.166687786579132...
func TestClient_Int_ServerInitiatedTopicClose(t *testing.T) { addr := pulsarAddr(t) asyncErrs := make(chan error, 8) c, err := NewClient(ClientConfig{ Addr: addr, Errs: asyncErrs, }) if err != nil { t.Fatal(err) } go func() { for err := range asyncErrs { t.Log(err) } }() // context for remainder...
[ 0.45620670914649963, 0.03537333756685257, 1.0088815689086914, -0.3453919291496277, 0.2898046374320984, 0.7175202369689941, 0.5749816298484802, -0.43837928771972656, -0.2415073961019516, -0.2780994176864624, 0.2396310716867447, 0.1895601451396942, -0.5328753590583801, -0.22151274979114532, ...
func TestClient_Int_Unsubscribe(t *testing.T) { asyncErrs := make(chan error, 8) go func() { for err := range asyncErrs { t.Log(err) } }() N := 4 t.Run("group", func(t *testing.T) { for i := 0; i < N; i++ { t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { t.Parallel() c, err := NewClient(Cl...
[ 0.6493475437164307, 0.4901953935623169, 0.8276274800300598, -0.9096295833587646, -0.2229730188846588, 0.242545947432518, 0.3892322778701782, -0.8747482895851135, -0.37051910161972046, -0.3454563617706299, 0.45828741788864136, -0.015474398620426655, -0.030947694554924965, -0.477329999208450...
func TestClient_Int_RedeliverOverflow(t *testing.T) { asyncErrs := make(chan error, 8) c, err := NewClient(ClientConfig{ Addr: pulsarAddr(t), Errs: asyncErrs, }) if err != nil { t.Fatal(err) } go func() { for err := range asyncErrs { t.Log(err) } }() // context for remainder of test ctx, cancel :...
[ 0.33073145151138306, 0.9351714253425598, 1.0132664442062378, -0.5216147303581238, 0.38096126914024353, 0.10657918453216553, 0.5217939019203186, -1.022489070892334, 0.3414965569972992, -0.35331663489341736, 0.27077025175094604, -0.004190437495708466, -0.19710814952850342, 0.3158178925514221...
func TestClient_Int_RedeliverAll(t *testing.T) { asyncErrs := make(chan error, 8) c, err := NewClient(ClientConfig{ Addr: pulsarAddr(t), Errs: asyncErrs, }) if err != nil { t.Fatal(err) } go func() { for err := range asyncErrs { t.Log(err) } }() // context for remainder of test ctx, cancel := con...
[ 0.4388742744922638, 0.687667965888977, 0.9900781512260437, -0.5284200310707092, 0.39077651500701904, 0.02232763171195984, 0.37523752450942993, -0.7944944500923157, 0.09569784998893738, 0.0020531276240944862, 0.1322605311870575, 0.01082327775657177, -0.0923519879579544, 0.22974778711795807,...
func (m *ChampionMastery) Validate(formats strfmt.Registry) error { return nil }
[ 0.21318957209587097, -0.7701168656349182, 0.21251735091209412, -0.2757684290409088, 0.2982877194881439, -0.12921831011772156, -0.1229168102145195, -0.0974888950586319, -0.6312144994735718, -0.9055083990097046, -0.25328898429870605, 0.14388376474380493, -0.9527912735939026, 0.54873174428939...
func init() { if err := json.Unmarshal([]byte(oembedProviders), &prov); err != nil { log.Fatal(err) } for _, p := range prov { p.regProviderURL = regexp.MustCompile(p.ProviderURL + ".*") for _, e := range p.Endpoints { e.regSchemes = make([]*regexp.Regexp, len(e.Schemes)) for i, s := range e.Schemes { ...
[ -0.88010174036026, 0.0429883748292923, 0.6088989973068237, -0.8147066831588745, 0.10243063420057297, 0.13341043889522552, 0.3122885823249817, 0.0044690752401947975, -0.12509919703006744, 0.8282679319381714, -0.4695459008216858, 0.7895900011062622, 0.08523078262805939, -0.18740521371364594,...
func EachIOLine(f io.ReadCloser, handler func(line string, num int) error) error { defer Fclose(f) r := bufio.NewReader(f) var err error for i := 0; err == nil; i++ { var line string line, err = r.ReadString('\n') if err != nil && line == "" { break } line = strings.Trim(line, "\n\r") errr := handler...
[ 0.04222144931554794, -1.1279182434082031, 0.6503065228462219, 0.2957143783569336, 0.028568372130393982, 0.37031227350234985, 0.09470249712467194, -0.0951809287071228, -0.8105905652046204, -0.42219534516334534, 0.059405192732810974, -0.5408222079277039, 0.18228013813495636, 0.02904615737497...
func EachLine(path string, handler func(line string, num int) error) error { f, err := os.Open(path) if err != nil { return err } return EachIOLine(f, handler) }
[ 0.04272301122546196, -0.7516737580299377, 0.5028809309005737, 0.548389732837677, -0.21337111294269562, 0.5687836408615112, 0.5111499428749084, 0.2221752256155014, -0.6910547614097595, -0.7659990191459656, 0.2915056347846985, -0.08162765204906464, 0.6536200642585754, 0.2918000817298889, 0...
func HasString(s []string, val string) bool { return FindString(s, val) != -1 }
[ 0.38272812962532043, -0.35619837045669556, 0.33564937114715576, 0.6972899436950684, -0.39700716733932495, -0.0232013538479805, -0.45389223098754883, -0.687207043170929, 0.005408411845564842, 0.24961590766906738, 0.23543678224086761, -0.27559414505958557, 0.3916893005371094, -0.086626775562...
func FindString(s []string, val string) int { for i, v := range s { if v == val { return i } } return -1 }
[ -0.36363500356674194, -0.5036972761154175, 0.594912052154541, 0.3942781090736389, -0.5718569755554199, -0.37052446603775024, 0.503158688545227, -0.620536208152771, -0.45195603370666504, 0.7624887824058533, 0.6954130530357361, -0.06929898262023926, -0.345703125, -0.045153532177209854, -0....
func EachFiles(dir string, handler func(dir os.FileInfo) error) error { dirs, err := ioutil.ReadDir(dir) if err != nil { return err } for _, i := range dirs { if err := handler(i); err != nil { return err } } return nil }
[ -0.07089130580425262, 0.1750006228685379, 0.5628337264060974, 0.3868619203567505, 0.16265524923801422, 0.9734392762184143, 0.8165981769561768, 0.6847417950630188, -1.047716498374939, -0.5237094759941101, 0.49539250135421753, 0.07137482613325119, -0.411647766828537, 0.6153305768966675, -0...
func IsFile(path string) bool { fs, err := os.Stat(path) if err != nil { return false } return !fs.IsDir() }
[ -0.4733557105064392, 0.462035596370697, 0.2768136262893677, 0.7596128582954407, 0.23618485033512115, 0.628790557384491, 0.6532859802246094, -0.35044199228286743, 0.5217258334159851, -1.270137071609497, 0.020088938996195793, -0.5055701732635498, -0.646194577217102, 0.2754822075366974, -1....
func IsDir(path string) bool { fs, err := os.Stat(path) if err != nil { return false } return fs.IsDir() }
[ -0.03455237299203873, -0.1531844437122345, 0.5546033978462219, 0.5333824157714844, -0.6380544304847717, 0.825298547744751, 0.36062830686569214, 0.15646892786026, 0.506101131439209, -1.5159169435501099, 0.2969374358654022, -0.1329493671655655, -0.020817378535866737, 0.5274618268013, -0.62...
func Fclose(f io.Closer) { if err := f.Close(); err != nil { log.Println(err) } }
[ 0.6583501100540161, -0.09080696851015091, 0.5787782073020935, 0.5531310439109802, -0.38454362750053406, 0.5722317695617676, 0.3358408510684967, -0.9625350832939148, -1.0424282550811768, -0.6215910315513611, 0.9495760202407837, -0.23106050491333008, 0.04782232642173767, 0.8741016387939453, ...
func MakeThumbnail(encoded []byte, suffix, thumbnailSize string) []byte { size := strings.Split(thumbnailSize, "x") if len(size) != 2 { return nil } x, err1 := strconv.Atoi(size[0]) y, err2 := strconv.Atoi(size[1]) if err1 != nil || err2 != nil { log.Println(thumbnailSize, "is illegal format") return nil }...
[ 0.5383718609809875, 0.1359759271144867, 0.6061144471168518, 0.08807219564914703, -1.0165889263153076, -0.18715913593769073, -0.04088020697236061, 0.27822113037109375, 0.42165467143058777, -0.011925254948437214, -0.9154970049858093, 0.3876720070838928, 0.15652820467948914, -0.46920350193977...
func ToSJIS(b string) string { return convertSJIS(b, true) }
[ -0.05398034304380417, 0.014036932028830051, 0.4089844524860382, 0.277747243642807, -1.2540302276611328, -1.0612645149230957, -0.11538165807723999, 0.12391118705272675, 0.6868002414703369, 0.7141087055206299, -1.0578776597976685, 0.4890567660331726, -0.5119496583938599, -0.6145881414413452,...
func convertSJIS(b string, toSJIS bool) string { var t transform.Transformer t = japanese.ShiftJIS.NewDecoder() if toSJIS { tt := japanese.ShiftJIS.NewEncoder() t = encoding.ReplaceUnsupported(tt) } r, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader([]byte(b)), t)) if err != nil { log.Println(err)...
[ -0.48385733366012573, -0.31678760051727295, 0.546649158000946, -0.06017492711544037, -1.2802900075912476, -0.7853356599807739, -0.7440786361694336, 0.2399805635213852, 0.4798787534236908, 0.8300626277923584, -0.3135959208011627, 0.5135793089866638, 0.06025240942835808, -0.21587786078453064...
func FromSJIS(b string) string { return convertSJIS(b, false) }
[ 0.5041362643241882, -0.5044282674789429, 0.19140534102916718, 0.4256432354450226, -2.0615921020507812, -0.7399356961250305, -0.14652933180332184, 0.16907720267772675, 1.0320297479629517, 0.6500993371009827, -0.5794734358787537, 0.17120198905467987, 0.7736698985099792, -0.5794671773910522, ...
func miscURL(url string) string { reg1 := regexp.MustCompile("http://www.nicovideo.jp/watch/([a-z0-9]+)") id := reg1.FindStringSubmatch(url) if len(id) > 1 { return ` <script type="text/javascript" src="http://ext.nicovideo.jp/thumb_watch/` + id[1] + `"></script>` } reg2 := regexp.MustCompile("https?://github.c...
[ -0.10394157469272614, 0.3800775706768036, 0.8118426203727722, -0.00004324130713939667, -0.16904650628566742, -0.6431223154067993, 0.061854295432567596, 0.13513121008872986, 0.4885333776473999, 0.21007448434829712, -0.023477761074900627, 0.08127251267433167, 0.5672988891601562, 0.7108373641...
func oEmbedURL(url string) string { for _, p := range prov { match := false if p.regProviderURL != nil { match = p.regProviderURL.MatchString(url) } for _, e := range p.Endpoints { for _, s := range e.regSchemes { if s == nil { continue } match = match || s.MatchString(url) } if !m...
[ -0.38184183835983276, 0.10366024076938629, 1.009260892868042, 0.5084750056266785, -0.05128062888979912, 0.3319369852542877, 0.11983288079500198, -0.10130204260349274, 0.7388096451759338, 1.0383306741714478, 0.3516685962677002, 0.1488940268754959, -0.3965362310409546, -0.04789947718381882, ...
func EmbedURL(url string) string { if e := miscURL(url); e != "" { return e } return oEmbedURL(url) }
[ 0.1734146624803543, 0.7584747672080994, 0.5000826716423035, 1.1896625757217407, -0.17539162933826447, 0.6644788980484009, -0.14075814187526703, 0.4534299373626709, 1.4967575073242188, 0.522256076335907, 0.19340239465236664, -0.21448376774787903, -0.40124350786209106, 0.003679050365462899, ...
func HasExt(fname, suffix string) bool { return strings.HasSuffix(fname, "."+suffix) && (!strings.HasPrefix(fname, ".") || strings.HasPrefix(fname, "_")) }
[ 0.5370028614997864, 0.2697647213935852, 0.4811844527721405, -0.47984638810157776, -0.7126102447509766, -0.17984722554683685, -1.1666804552078247, 0.7250707149505615, -0.45406514406204224, 0.18661369383335114, -0.617007315158844, 0.24474850296974182, 1.0680713653564453, 0.6173104047775269, ...
func Emoji(str string) string { for _, v := range emojis { match := false if str == v.Shortname { match = true } for _, alias := range v.AliasesASCII { if str == alias { match = true } } if match { return `<img height="25" src="http://cdn.jsdelivr.net/emojione/assets/png/` + v.Unicode + `.p...
[ -0.08931130170822144, -0.022482311353087425, 0.375185489654541, 0.42524299025535583, -1.351969599723816, 0.11077314615249634, -0.1932816356420517, 0.6663639545440674, -0.9223793745040894, 0.8340830206871033, -0.0857066884636879, -0.28766873478889465, 0.7390000820159912, 0.3664321303367615,...
func TestOperatorHive(t *testing.T) { defer goleak.VerifyNone(t, // Ignore all the currently running goroutines spawned // by prior tests or by package init() functions (like the // client-go logger). goleak.IgnoreCurrent(), ) err := hive.New(Operator).Populate() assert.NoError(t, err, "Populate()") }
[ 0.12043683230876923, 1.200019359588623, 0.5861579179763794, 0.5494932532310486, 1.1955512762069702, 0.5632733702659607, 0.3403988778591156, -0.13780425488948822, -0.015801172703504562, -0.2581790089607239, -0.6766021251678467, -0.6098747849464417, -0.34667834639549255, 0.24514707922935486,...
func Configure(opts Options) { if opts.Logger == nil { opts.Logger = logrus.StandardLogger() } opts.Logger.SetReportCaller(true) opts.Logger.AddHook(utcHook{}) opts.Logger.AddHook(newFilenameHook()) opts.Logger.SetFormatter(&logrus.TextFormatter{ FullTimestamp: true, TimestampFormat: "...
[ -0.023816946893930435, 0.3523084819316864, 0.9051535129547119, -0.21876409649848938, 1.016611099243164, -0.7079623341560364, -0.5000965595245361, 0.5902225375175476, 0.17595802247524261, -0.8086852431297302, -0.12545831501483917, 0.4557039737701416, -0.20446084439754486, 0.9092133641242981...
func (m *Import) namespace(req *sdk.GetReq) Namespace { if global, ok := m.Root.(Namespace); ok { return global } // Look for it in the cache of executions m.namespaceLock.RLock() ns, ok := m.namespaceMap[req.ExecId] m.namespaceLock.RUnlock() if ok { return ns } nsFunc, ok := m.Root.(NamespaceCreator) i...
[ -0.19490249454975128, 0.26084908843040466, 0.6304937601089478, 0.8093855381011963, -0.12772391736507416, -0.4083409309387207, -0.05218210443854332, -0.8476302623748779, 1.0432320833206177, -0.5925613045692444, 1.1416120529174805, 0.9205747842788696, -0.9461731910705566, 0.8613975644111633,...
func (m *Import) call(f interface{}, args []interface{}) (interface{}, error) { // If a function call isn't supported for this key, then it is an error if f == nil { return nil, fmt.Errorf("function call unsupported") } // Reflect on the function and verify it is a function funcVal := reflect.ValueOf(f) if fun...
[ -1.0216401815414429, 0.3137904405593872, 1.0006868839263916, 0.054289016872644424, -0.1668556183576584, -0.45545968413352966, -0.7089026570320129, 0.050750818103551865, -0.7088643312454224, 0.5424506068229675, 0.4668104946613312, 0.4197789430618286, -0.4040396809577942, 0.01056664250791072...
func ToTime(v interface{}) (time.Time, error) { if v == nil { if ZeroMode { return zeroTime, nil } return zeroTime, ErrorNilToTime } vTyp := reflect.ValueOf(v).Type() if vTyp == TypeTime { // same type, just cast it return v.(time.Time), nil } v, e := ToInt(v) if e != nil { return zeroTime, error...
[ -0.22374607622623444, 0.036505311727523804, 1.1583534479141235, 0.1500711292028427, -0.01361626386642456, -0.9820395112037659, 0.4566054344177246, -0.4679524004459381, 0.8785805702209473, 1.2164007425308228, -0.4812730848789215, -0.2415088564157486, -0.47977685928344727, 0.8123921155929565...
func Convert(v interface{}, t reflect.Type) (interface{}, error) { if t == nil { return v, nil } // if v == nil { // return nil, errors.New("cannot convert: nil to " + t.String()) // } switch t.Kind() { case reflect.Bool: return ToBool(v) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflec...
[ -0.6651899218559265, -0.8649626970291138, 0.6715072989463806, -0.6851803064346313, -0.24109603464603424, -0.4326818585395813, 0.05343158543109894, -0.601742148399353, 0.3509357273578644, 0.87507563829422, -0.37627437710762024, 0.7696080803871155, -0.27753132581710815, 0.5041646361351013, ...
func (s Selector) String() string { buf := bytes.Buffer{} for i, sc := range s { if i > 0 { buf.WriteRune(' ') } buf.WriteString(sc.String()) } return buf.String() }
[ -0.439633309841156, -0.9550674557685852, -0.018984882161021233, -0.6037473082542419, 0.25981852412223816, -0.03948495164513588, 0.24691200256347656, -1.078100323677063, -0.015817081555724144, -0.26224252581596375, -0.28888100385665894, 0.5082459449768066, -0.21428677439689636, -0.016793103...
func (sc selectCriterion) String() string { buf := bytes.Buffer{} if sc.negated { buf.WriteRune('!') } if sc.tagged { buf.WriteRune('.') } buf.WriteString(sc.name) return buf.String() }
[ 0.7316644191741943, -0.9315289258956909, 0.3138200044631958, -0.20924927294254303, -0.4496109187602997, 0.8523964881896973, -0.4909670650959015, -0.9255198240280151, -0.31204983592033386, 0.5223556756973267, -0.05736805126070976, 1.1576259136199951, 0.29281091690063477, -0.2933825850486755...
func (sc selectCriterion) Validate() error { if sc.name == "" { return fmt.Errorf("name is empty") } if i := strings.IndexAny(sc.name, InvalidCriterionRunes); i == 0 { return fmt.Errorf("name starts with invalid character '%v'", sc.name[i]) } if sc.name == SelectAll { if sc.tagged { return fmt.Errorf("can...
[ 0.40875694155693054, -0.18610697984695435, 0.5833113193511963, 0.2679823338985443, -0.461974561214447, -0.1755189746618271, -0.7595745921134949, -0.10237955302000046, -0.3900848627090454, 0.37592604756355286, 0.32851237058639526, 0.9597046375274658, 0.3471478223800659, 0.7750024795532227, ...
func ParseSelector(s string) Selector { var criteria []selectCriterion // read the white-space delimited criteria critStrings := strings.Fields(s) for _, c := range critStrings { criteria = append(criteria, stringToCriterion(c)) } return criteria }
[ 0.04001199081540108, -1.0270631313323975, 0.21921393275260925, -0.7935075759887695, -0.3822089433670044, -0.8347227573394775, -0.5097443461418152, 0.29373857378959656, 0.5649189352989197, -0.7130952477455139, 0.46374407410621643, 0.8854039311408997, 0.06943629682064056, -0.1443985849618911...
func stringToCriterion(s string) selectCriterion { sc := selectCriterion{} if len(s) > 0 && s[0] == '!' { // negation sc.negated = true s = s[1:] } if len(s) > 0 && s[0] == '.' { // tags sc.tagged = true s = s[1:] } sc.name = s return sc }
[ 0.5488344430923462, -1.2995890378952026, 0.5781952738761902, -0.5905503034591675, -0.3839024603366852, -0.48913517594337463, -0.024273423478007317, 0.00965652521699667, 0.5099005103111267, 0.4205540418624878, -0.4203178584575653, 1.3643652200698853, 0.4999309778213501, -0.7449976205825806,...
func NewParserTaskSelectorEvaluator(tasks []parserTask) *taskSelectorEvaluator { // cache everything byName := map[string]*ProjectTask{} byTag := map[string][]*ProjectTask{} ts := []ProjectTask{} for _, t := range tasks { info := ProjectTask{ Name: t.Name, Tags: t.Tags, } ts = append(ts, info) byName...
[ -0.44970595836639404, -0.8153128027915955, 0.161134734749794, -0.7288430333137512, -1.1746174097061157, -0.08827804028987885, -0.30868786573410034, 0.040999747812747955, -0.8712145090103149, -0.5479292869567871, -0.882849395275116, 0.13918061554431915, 0.5804815888404846, 0.495559006929397...