text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func NewMockOrganizationDescriber(ctrl *gomock.Controller) *MockOrganizationDescriber {
mock := &MockOrganizationDescriber{ctrl: ctrl}
mock.recorder = &MockOrganizationDescriberMockRecorder{mock}
return mock
} | [
0.23311421275138855,
0.20499806106090546,
0.037983715534210205,
0.3505792021751404,
-0.02406766265630722,
0.3334570527076721,
0.1634083241224289,
0.05965718626976013,
-0.3591647148132324,
-0.1967126429080963,
0.011010163463652134,
0.14640527963638306,
0.3295283615589142,
2.0281338691711426... |
func (m *MockOrganizationDescriber) EXPECT() *MockOrganizationDescriberMockRecorder {
return m.recorder
} | [
0.2908948063850403,
0.17848210036754608,
0.4282078146934509,
-0.09921610355377197,
0.6091648936271667,
0.4534561336040497,
0.31976446509361267,
0.22261714935302734,
-0.03497987985610962,
-0.24436256289482117,
0.9382163286209106,
1.2022476196289062,
-0.7423050999641418,
0.8008257746696472,
... |
func (m *MockOrganizationDescriber) Organization(arg0 string) (*mongodbatlas.Organization, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Organization", arg0)
ret0, _ := ret[0].(*mongodbatlas.Organization)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-1.025422215461731,
0.138974130153656,
0.10088377445936203,
0.7804532051086426,
1.1403322219848633,
0.38003939390182495,
1.4630848169326782,
-0.33072808384895325,
-0.8355100750923157,
0.3938579857349396,
-0.4239955544471741,
-0.6350703239440918,
0.10306484997272491,
1.3602051734924316,
0... |
func (mr *MockOrganizationDescriberMockRecorder) Organization(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Organization", reflect.TypeOf((*MockOrganizationDescriber)(nil).Organization), arg0)
} | [
-0.4633243680000305,
0.7353687882423401,
-0.001091551035642624,
0.6305626630783081,
0.39742153882980347,
0.23650065064430237,
0.09214313328266144,
-0.8697403073310852,
0.5719373822212219,
0.8836522698402405,
0.7087213397026062,
0.48090100288391113,
-0.16426123678684235,
1.974848985671997,
... |
func (*Request) Descriptor() ([]byte, []int) {
return file_core_core_proto_rawDescGZIP(), []int{0}
} | [
-1.6595730781555176,
0.7052083611488342,
0.571902334690094,
0.14350639283657074,
0.3132276237010956,
-0.13699810206890106,
0.1397019475698471,
0.17996610701084137,
-0.08809489011764526,
-1.154237985610962,
-0.22865502536296844,
0.29358264803886414,
0.12056747078895569,
0.5447571277618408,
... |
func (*Response) Descriptor() ([]byte, []int) {
return file_core_core_proto_rawDescGZIP(), []int{1}
} | [
-0.44587549567222595,
0.387484073638916,
0.3061760365962982,
0.251203328371048,
-0.060318417847156525,
-0.12803776562213898,
1.0841232538223267,
0.10027379542589188,
0.46371105313301086,
-0.9881837368011475,
-1.1328810453414917,
-0.4674060344696045,
-0.044127050787210464,
0.353856414556503... |
func (c *ColorFlag) String() string {
return fmt.Sprintf("0x%x", *c)
} | [
0.1521380990743637,
-0.03234740346670151,
0.21231487393379211,
-0.6437596082687378,
0.0983700081706047,
1.3604729175567627,
-0.2930944561958313,
-0.7588461637496948,
-1.0903186798095703,
-0.7217772006988525,
-0.7023119330406189,
0.2172621488571167,
-0.6513108611106873,
0.09071925282478333,... |
func (c *ColorFlag) Set(v string) error {
col, err := strconv.ParseInt(v, 0, 64)
if err != nil {
return err
}
if col < ColorLimit {
*c = ColorFlag(col)
return nil
}
return errors.New("Not a color in RGB palette")
} | [
-0.025985002517700195,
0.5603747367858887,
0.4845159351825714,
-0.6479927897453308,
-0.011333867907524109,
0.7684361934661865,
-0.1251864731311798,
-0.4131338894367218,
-0.5199570655822754,
0.11116275191307068,
-1.0789165496826172,
0.4026675224304199,
-0.22373127937316895,
0.04727267101407... |
func (u *NonNegativeFlag) String() string {
return fmt.Sprint(*u)
} | [
-0.13495659828186035,
-0.005152521189302206,
0.21599510312080383,
0.7636867761611938,
0.08030684292316437,
1.8130863904953003,
-0.50095134973526,
-0.7886609435081482,
-1.2106465101242065,
-0.12425560504198074,
0.07299602031707764,
0.21013356745243073,
-0.6742578744888306,
1.002774834632873... |
func (u *NonNegativeFlag) Set(v string) error {
x, err := strconv.ParseInt(v, 0, strconv.IntSize)
if x < 0 {
return errors.New("Non-negative number required")
}
if err == nil {
*u = NonNegativeFlag(x)
}
return err
} | [
-0.5018394589424133,
0.027488693594932556,
0.5251877307891846,
-0.28287866711616516,
-0.20050932466983795,
1.1215014457702637,
-0.5648667216300964,
0.32437318563461304,
-0.8180685043334961,
0.31550100445747375,
-0.4846709966659546,
0.014009497128427029,
-0.23084688186645508,
0.946570336818... |
func (s *StringsFlag) String() string {
return fmt.Sprint(s.Value)
} | [
0.5584566593170166,
-0.6589904427528381,
0.017882097512483597,
-0.6928474307060242,
0.22254210710525513,
1.1086093187332153,
0.5773923397064209,
-0.7809247970581055,
-0.6989743113517761,
-0.6801231503486633,
0.1040225699543953,
1.145822525024414,
-0.2526000142097473,
0.5659084320068359,
... |
func (s *StringsFlag) Set(v string) error {
s.Value = append(s.Value, v)
return nil
} | [
0.2960995137691498,
-0.047472916543483734,
0.0026703134644776583,
-1.4259661436080933,
0.48166537284851074,
0.7189024686813354,
-0.053687456995248795,
0.27230599522590637,
-0.6389254927635193,
-0.044489845633506775,
-0.8217766880989075,
0.8781877756118774,
-0.2379572093486786,
0.6482214927... |
func ParseArgs() {
flag.Var(&color, "color", "Background and border color")
flag.Var(&paddingTop, "padding-top", "Value of top padding")
flag.Var(&paddingBottom, "padding-bottom", "Value of bottom padding")
flag.Var(&borderWidth, "border-width", "Border width of focused window")
flag.Var(&nameLimit, "name-limit", ... | [
0.311005175113678,
-0.11589595675468445,
0.5223473906517029,
-0.7403210997581482,
-0.0877746045589447,
0.006686802953481674,
-0.2686207592487335,
-0.7751150727272034,
-0.6941892504692078,
-0.046406712383031845,
-0.026981549337506294,
0.8306767344474792,
-0.35711294412612915,
1.051671266555... |
func (h *Handler) SendCertificate(transaction *entityApi.Transaction) (*entityApi.TransactionStatus, error) {
data, err := json.Marshal(transaction)
if err != nil {
return nil, err
}
return h.SendTransaction(certificateCertifyRoute, data)
} | [
-0.06044384464621544,
0.3144587576389313,
0.6384559273719788,
0.43528395891189575,
0.019549978896975517,
-0.5292898416519165,
-0.7371503710746765,
0.1838427484035492,
-0.4131815433502197,
0.8139166235923767,
-1.137202501296997,
-0.33231011033058167,
-0.25171709060668945,
0.7953959107398987... |
func (h *Handler) SendSecret(
transaction *entityApi.Transaction,
companyChainID string,
certificateUuid string,
) (*entityApi.TransactionStatus, error) {
data, err := json.Marshal(transaction)
if err != nil {
return nil, err
}
return h.SendTransaction(fmt.Sprintf(secretCertifyRout... | [
-0.10210695117712021,
0.7409418821334839,
0.756322979927063,
0.38457417488098145,
0.364186555147171,
-0.8398665189743042,
-1.1565992832183838,
-0.22044433653354645,
-0.3898060917854309,
0.6211591362953186,
-1.617509126663208,
0.403621107339859,
-0.08782818913459778,
-0.5043498277664185,
... |
func (h *Handler) RetrieveCertificate(companyChainID string, uuid string) (*entityApi.TransactionWrapper, error) {
apiResponse, err := h.apiClient.Get(fmt.Sprintf(certificateRoute, companyChainID, uuid), nil)
if err != nil {
return nil, err
}
var transactionWrapper entityApi.TransactionWrapper
... | [
0.09204568713903427,
0.1585785448551178,
0.4248989224433899,
-0.09885434061288834,
0.5942742228507996,
-1.9443113803863525,
-0.7705046534538269,
0.40688061714172363,
-0.10233329236507416,
-0.15900549292564392,
-0.02602142095565796,
-0.23502038419246674,
-1.3257627487182617,
-0.957134485244... |
func (h *Handler) RetrieveSecrets(
companyChainID string,
certificateUuid string,
) (*entityApi.TransactionWrappers, error) {
apiResponse, err := h.apiClient.Get(fmt.Sprintf(secretsRoute, companyChainID, certificateUuid), nil)
if err != nil {
return nil, err
}
var transactionWrappers en... | [
-0.06618401408195496,
0.5995622873306274,
0.12903445959091187,
0.13760215044021606,
1.0500928163528442,
-1.1420825719833374,
-1.013004183769226,
-0.6385859847068787,
0.1505604088306427,
-0.3573969006538391,
-0.8811125159263611,
0.18749995529651642,
-1.1864416599273682,
-0.4358144998550415,... |
func (h *Handler) SendTransaction(
route string,
transaction []byte,
) (*entityApi.TransactionStatus, error) {
apiResponse, err := h.apiClient.Post(route, nil, transaction)
if err != nil {
return nil, err
}
var transactionStatus entityApi.TransactionStatus
if err := unmarshalApiResp... | [
-0.8147499561309814,
0.2732788324356079,
0.7289689183235168,
-0.8904343247413635,
0.17810383439064026,
-0.5100215077400208,
-0.4671723246574402,
0.07668792456388474,
0.4153140187263489,
1.1750844717025757,
-1.4948729276657104,
-0.3169597089290619,
-0.7429985404014587,
-0.09048362076282501,... |
func unmarshalApiResponse(apiResponse *RawResponse, dest interface{}) error {
if apiResponse.StatusCode == fasthttp.StatusOK || apiResponse.StatusCode == fasthttp.StatusAccepted {
if err := json.Unmarshal(apiResponse.Body, dest); err != nil {
return err
}
return nil
} else {
... | [
-0.5760151147842407,
-0.6803353428840637,
0.8607115149497986,
-0.9517470598220825,
-1.184987187385559,
-0.3096122741699219,
-0.6598434448242188,
0.7386947274208069,
0.4292586147785187,
0.37397027015686035,
0.3491373360157013,
-0.3936764895915985,
-0.05281958729028702,
-0.7422155141830444,
... |
func Insert(ctx context.Context, req *proto.CreateRequest) error {
log.Printf("Inside Insert()\n")
txn, err := GetDbConn().Begin()
if err != nil {
log.Fatal(err)
}
defer txn.Rollback()
log.Printf("Transaction started \n")
fmt.Printf("Creating prepared statement\n")
stmtStr, err := txn.Prepare("INSERT INTO ... | [
-0.3281479775905609,
0.11048763245344162,
1.1719967126846313,
0.7292792797088623,
0.7013123035430908,
0.08260593563318253,
0.6411325931549072,
-0.12701332569122314,
-0.8021407127380371,
0.11483334749937057,
-0.1736854463815689,
-0.19295702874660492,
-1.3745079040527344,
0.15289893746376038... |
func findLatestTimestamp(db *mdb.Database) (int64, *router.Error) {
// Sort by timestamp in decsending order, and limit to one result
findopts := []findopt.Find{
findopt.Sort(bson.NewDocument(bson.EC.Int64("ts", -1))),
findopt.Projection(bson.NewDocument(bson.EC.Int64("ts", 1))),
findopt.Limit(1)}
tracks := m... | [
-0.3108770251274109,
0.8158252835273743,
0.8944233655929565,
-0.15278948843479156,
0.3634291887283325,
-0.10301545262336731,
0.03338691592216492,
-0.7052947878837585,
-0.5477516055107117,
0.7029899954795837,
0.4009571969509125,
-0.8017319440841675,
-0.5258833169937134,
0.7442956566810608,
... |
func New(storage Storage) Server {
s := &server{
storage: storage,
r: chi.NewMux(),
}
s.routes()
return s
} | [
-0.5424106121063232,
-0.8356533646583557,
0.2349262535572052,
0.5413914918899536,
0.07925684750080109,
-0.15934549272060394,
-0.28030410408973694,
0.32829374074935913,
-0.08650238066911697,
-0.013997316360473633,
-0.6542031168937683,
0.6141065955162048,
0.5384178161621094,
0.65004974603652... |
func Account(client *ticketmatic.Client) (*ticketmatic.AccountInfo, error) {
r := client.NewRequest("GET", "/{accountname}/tools/account", "json")
var obj *ticketmatic.AccountInfo
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
} | [
-0.009849045425653458,
-0.22952760756015778,
0.3504248857498169,
0.3485972583293915,
0.10069943219423294,
0.11724607646465302,
1.2671520709991455,
-0.8500853776931763,
-0.6649771928787231,
-0.3197035789489746,
-0.09565653651952744,
1.0613700151443481,
-0.09164506942033768,
-0.3959825634956... |
func Accounts(client *ticketmatic.Client) ([]*ticketmatic.AccountInfo, error) {
r := client.NewRequest("GET", "/_/tools/accounts", "json")
var obj []*ticketmatic.AccountInfo
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
} | [
-0.34562528133392334,
-0.2539810836315155,
0.3360392451286316,
-0.09124290198087692,
0.1750628799200058,
0.2024165838956833,
0.2153579145669937,
-1.1641850471496582,
-0.496317595243454,
-0.5046440362930298,
-0.03952253609895706,
0.5005993843078613,
-0.28643593192100525,
-0.3419264853000641... |
func Queries(client *ticketmatic.Client, data *ticketmatic.QueryRequest) (*ticketmatic.QueryResult, error) {
r := client.NewRequest("POST", "/{accountname}/tools/queries", "json")
r.Body(data, "json")
var obj *ticketmatic.QueryResult
err := r.Run(&obj)
if err != nil {
return nil, err
}
return obj, nil
} | [
-0.009805903770029545,
0.5280239582061768,
0.49089938402175903,
-0.2152652144432068,
0.004726360086351633,
-0.5933493375778198,
-0.06346677243709564,
-1.8401470184326172,
-0.5817044377326965,
-0.6988540887832642,
0.18926338851451874,
0.5323536992073059,
-0.8955768346786499,
-1.274736642837... |
func Export(client *ticketmatic.Client, data *ticketmatic.QueryRequest) (*QueryStream, error) {
r := client.NewRequest("POST", "/{accountname}/tools/queries/export", "json")
r.Body(data, "json")
stream, err := r.Stream()
if err != nil {
return nil, err
}
return &QueryStream{stream}, nil
} | [
0.7534319758415222,
0.6172675490379333,
0.46494340896606445,
0.4367218315601349,
-1.324540615081787,
-0.5030878186225891,
0.13399820029735565,
-1.2209389209747314,
0.12328249961137772,
0.14939631521701813,
-0.48892316222190857,
1.2676761150360107,
-1.053127646446228,
0.17227999866008759,
... |
func Ticketsprocessedstatistics(client *ticketmatic.Client, params *ticketmatic.TicketsprocessedRequest) ([]*ticketmatic.TicketsprocessedStatistics, error) {
r := client.NewRequest("GET", "/{accountname}/tools/ticketsprocessedstatistics", "json")
if params != nil {
r.AddParameter("endts", params.Endts)
r.AddParam... | [
-0.39567628502845764,
0.34054332971572876,
0.35694190859794617,
-0.19020327925682068,
0.06934287399053574,
0.28307145833969116,
0.20715875923633575,
-0.5763198733329773,
-0.8942894339561462,
-0.3297664523124695,
-0.07363810390233994,
0.5357950329780579,
-0.29766976833343506,
-0.36773994565... |
func (rmd ResourceMetaData) SetID(formatter resourceids.Id) {
rmd.ResourceData.SetId(formatter.ID())
} | [
0.11871758848428726,
-1.7064321041107178,
0.2367539256811142,
-0.21621845662593842,
-0.14512276649475098,
1.193629503250122,
-0.5709128975868225,
0.26214799284935,
0.6117666363716125,
-0.30047857761383057,
0.2206360548734665,
0.7425795197486877,
0.2668493688106537,
1.694843053817749,
-0.... |
func (la Launch) execute(l *Lobby) {
l.started = true
la.Event = "launch"
l.send <- la
} | [
0.7567456960678101,
-0.3271782398223877,
0.5996832847595215,
0.12560805678367615,
0.45507413148880005,
1.3712148666381836,
-1.0206875801086426,
0.711808443069458,
0.43561694025993347,
0.5161411762237549,
-1.2202389240264893,
-0.10002388060092926,
-0.09141989052295685,
0.6261464953422546,
... |
func (m MsgPlayer) process(u *User) {
(*u.socket).Emit("msgplayer", m.Msg)
} | [
-0.06422156095504761,
0.16393564641475677,
0.47427812218666077,
0.051666904240846634,
-0.3991089463233948,
0.47991660237312317,
0.5243059992790222,
-0.26879167556762695,
0.2691517472267151,
0.2220817357301712,
-0.4659183621406555,
1.3358573913574219,
-0.8012067675590515,
1.2768824100494385... |
func (m MsgAll) process(u *User) {
(*u.socket).Emit("msgall", m.Msg)
(*u.socket).BroadcastTo(m.Room, "msgall", m.Msg)
} | [
0.3692863881587982,
0.1891842484474182,
0.514790952205658,
0.20166590809822083,
0.1417786031961441,
0.8276545405387878,
0.7378197908401489,
-0.24182726442813873,
0.2507930397987366,
0.3737409710884094,
0.0022579331416636705,
1.7782251834869385,
-0.4554625153541565,
1.2106263637542725,
0.... |
func getNumberTransformer(value *interface{}) *numberTransformer {
valueType := GetValueType(value)
for _, transformer := range numberTransformers {
if valueType == transformer.name {
return &transformer
}
}
fmt.Println("[WARN] getNumberTransformer() no transformer for valueType -> ", valueType)
return nil... | [
-0.7879974246025085,
-0.05713436380028725,
0.6108496785163879,
-0.7719253897666931,
0.053338464349508286,
-0.8538371324539185,
-0.36770614981651306,
-0.6384999752044678,
0.5291761159896851,
-1.0684236288070679,
-0.9426971077919006,
-0.04134971648454666,
-0.43426525592803955,
1.129433512687... |
func (r *Robot) Run() {
gbot := gobot.NewGobot()
// Set up the adapter.
sa := sphero.NewSpheroAdaptor(r.Name, r.Port)
// New sphero driver.
sd := sphero.NewSpheroDriver(sa, r.Name)
sd.SetStabilization(true)
sd.ConfigureCollisionDetection(r.CC)
// Channel to talk to the device.
talk := make(chan string)
//... | [
-0.4562779664993286,
0.17097435891628265,
0.882278561592102,
0.07655445486307144,
0.49701204895973206,
0.22608156502246857,
-0.022532258182764053,
-0.1345066875219345,
0.4980236291885376,
0.20824666321277618,
-0.3358291685581207,
0.4949779510498047,
-0.5303857326507568,
0.18769454956054688... |
func ParseObj(data []byte) (*models.TaskConfig, error) {
run := models.TaskConfig{}
log.Println(string(data))
err := yaml.Unmarshal(data, &run)
if err != nil {
return nil, err
}
return &run, nil
} | [
0.3493954539299011,
-0.20614032447338104,
0.5133697390556335,
0.04409606754779816,
-1.325158953666687,
0.5250418782234192,
0.7065343260765076,
0.6171628832817078,
-0.41120174527168274,
0.06455392390489578,
-0.8515577912330627,
-0.2527318298816681,
0.4403974413871765,
0.28321558237075806,
... |
func TestLoadFile(filepath string) ([]byte, error) {
file, err := ioutil.ReadFile(filepath)
if err != nil {
return nil, err
}
return file, nil
} | [
0.6021364331245422,
0.17286232113838196,
0.34110119938850403,
-0.8557037711143494,
0.2867441773414612,
0.3927130699157715,
0.26740705966949463,
-0.928328275680542,
0.11418725550174713,
-0.4651303291320801,
-0.46269741654396057,
0.0950101688504219,
-0.911085307598114,
-0.3776569068431854,
... |
func (c *config) UnmarshalJSON(data []byte) error {
type Alias config
aux := &struct {
Z string `json:"z"`
X string `json:"x"`
*Alias
}{
Alias: (*Alias)(c),
}
if err := json.Unmarshal(data, &aux); err != nil {
return err
}
if aux.Data != nil {
err := checkData(aux.Data)
if err != nil {
return e... | [
-0.4504060447216034,
0.5464431047439575,
0.5542248487472534,
-1.2110258340835571,
-0.69056236743927,
0.12947803735733032,
0.41478773951530457,
0.8979465961456299,
-0.05797301605343819,
0.954306423664093,
-1.161420226097107,
0.38141709566116333,
0.6240837574005127,
0.9699447751045227,
1.3... |
func (c config) MarshalJSON() ([]byte, error) {
type Alias config
return json.Marshal(&struct {
*Alias
Z string `json:"z"`
X string `json:"x"`
}{
Alias: (*Alias)(&c),
Z: c.Z.String(),
})
} | [
-0.17259366810321808,
-0.11094366014003754,
0.13044564425945282,
-0.6137472987174988,
-0.4366435110569,
0.04467259719967842,
0.312374472618103,
0.8995898962020874,
0.42205771803855896,
0.47036635875701904,
-1.1970268487930298,
0.8076364994049072,
0.7958909869194031,
0.8405747413635254,
1... |
func (v ZoneZoneStatus) Ptr() *ZoneZoneStatus {
return &v
} | [
1.2553743124008179,
-0.6385263204574585,
-0.42748990654945374,
0.2429477423429489,
-0.839217483997345,
0.9662521481513977,
0.3049544394016266,
-0.7178547978401184,
0.43646717071533203,
0.2667425870895386,
0.6296903491020203,
-0.02644745260477066,
-0.5021178126335144,
-0.11296096444129944,
... |
func getTokenHeader(c *gin.Context) (string, error) {
tokenString := c.GetHeader("Authorization")
if strings.Index(tokenString, "Bearer ") != 0 {
return "", errors.Unauthorized
}
return tokenString[7:], nil
} | [
-0.049253690987825394,
0.05224229395389557,
0.5472657084465027,
0.7468140125274658,
0.07039567828178406,
-0.4734811782836914,
-0.4095264673233032,
-0.618025004863739,
0.31170013546943665,
0.024430707097053528,
0.1562192291021347,
0.5061629414558411,
0.22839941084384918,
-0.2372626811265945... |
func (c *Client) CreatePartnerEventSource(ctx context.Context, params *CreatePartnerEventSourceInput, optFns ...func(*Options)) (*CreatePartnerEventSourceOutput, error) {
if params == nil {
params = &CreatePartnerEventSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreatePartnerEventSource", para... | [
-0.7257182598114014,
1.0688152313232422,
0.7280303835868835,
0.3947773873806,
0.07612261921167374,
-0.4231862425804138,
0.5788613557815552,
-0.2842092514038086,
0.18624435365200043,
-0.36591097712516785,
-1.0471688508987427,
0.4515256881713867,
-0.9003810882568359,
-0.794392466545105,
-0... |
func UnmarshalDeployableArtifacts(deployableArtifactsFilePath, projectConfigPath string, lateDeploy bool) (*Result, error) {
modulesMap, err := unmarshalDeployableArtifactsJson(deployableArtifactsFilePath)
if err != nil {
return nil, err
}
url, repo, err := getDeployerUrlAndRepo(modulesMap, projectConfigPath)
if... | [
-0.35982540249824524,
-0.4081762731075287,
0.742315948009491,
-1.0427453517913818,
0.06383533775806427,
0.2068168669939041,
0.9734672904014587,
0.2724905014038086,
-0.10789754241704941,
0.06897938996553421,
-0.3921961784362793,
-0.8462367057800293,
-0.475827157497406,
-0.31336942315101624,... |
func getDeployerUrlAndRepo(modulesMap *map[string][]clientutils.DeployableArtifactDetails, configPath string) (string, string, error) {
repo := getTargetRepoFromMap(modulesMap)
vConfig, err := utils.ReadConfigFile(configPath, utils.YAML)
if err != nil {
return "", "", err
}
// The relevant deployment repository ... | [
-0.18979890644550323,
-0.8013821244239807,
0.5380896925926208,
-0.8871546387672424,
-0.10813236981630325,
0.28036221861839294,
0.8262208700180054,
0.900085985660553,
-0.32955414056777954,
0.3515097498893738,
-0.008009468205273151,
0.1313423067331314,
0.18093904852867126,
0.1248898357152938... |
func Compose(apis ...API) http.Handler {
autoConfigureMetricsIfNecessary()
r := mux.NewRouter()
m := middleware{inner: r}
for _, a := range apis {
switch a := a.(type) {
case pseudoAPI:
a.configure(&m)
default:
a.AddTo(r)
}
}
//TODO add a /healthcheck "ok" API that does SkipRequestLog()
h := htt... | [
-0.7941046357154846,
-0.11475242674350739,
0.3915873169898987,
0.8662373423576355,
-0.0003658690256997943,
0.2869189381599426,
0.10260401666164398,
-0.22247669100761414,
-0.23475103080272675,
-0.13644875586032867,
0.5806998014450073,
-0.8026306629180908,
-0.5065868496894836,
0.559260666370... |
func SkipRequestLog(r *http.Request) {
fn, ok := r.Context().Value(oobFunctionKey).(func(oobMessage))
if !ok {
panic("httpapi.SkipRequestLog called from request handler outside of httpapi.Compose()!")
}
fn(oobMessage{
SkipLog: true,
})
} | [
-0.8345210552215576,
0.045695122331380844,
0.5152878761291504,
0.7464953064918518,
-0.5132873058319092,
1.1527286767959595,
0.6228416562080383,
-1.2726428508758545,
-0.11435212939977646,
-0.018503693863749504,
0.5147267580032349,
-0.008496468886733055,
0.2143402248620987,
-0.43482401967048... |
func IdentifyEndpoint(r *http.Request, endpoint string) {
fn, ok := r.Context().Value(oobFunctionKey).(func(oobMessage))
if !ok {
panic("httpapi.IdentifyEndpoint called from request handler outside of httpapi.Compose()!")
}
fn(oobMessage{
EndpointID: endpoint,
})
} | [
-0.5711036920547485,
-0.5109571814537048,
0.3497639000415802,
1.274343490600586,
1.034877061843872,
0.05834618955850601,
0.19673217833042145,
-0.6636757850646973,
0.7451825141906738,
0.528407871723175,
0.020943649113178253,
0.05321819707751274,
-0.23062056303024292,
0.3285906910896301,
0... |
func NewCacheMutationDetector(name string) MutationDetector {
if !mutationDetectionEnabled {
return dummyMutationDetector{}
}
klog.Warningln("Mutation detector is enabled, this will result in memory leakage.")
return &defaultCacheMutationDetector{name: name, period: 1 * time.Second, retainDuration: 2 * time.Minut... | [
-0.6415433287620544,
0.15724456310272217,
0.4589582681655884,
0.8895573616027832,
-1.475724697113037,
-0.7351810932159424,
-0.5978365540504456,
-0.35120755434036255,
1.7578439712524414,
-0.22817249596118927,
-0.9342845678329468,
0.06781551241874695,
-0.5623304843902588,
0.918527364730835,
... |
func (d *defaultCacheMutationDetector) AddObject(obj interface{}) {
if _, ok := obj.(DeletedFinalStateUnknown); ok {
return
}
if obj, ok := obj.(runtime.Object); ok {
copiedObj := obj.DeepCopyObject()
d.addedObjsLock.Lock()
defer d.addedObjsLock.Unlock()
d.addedObjs = append(d.addedObjs, cacheObj{cached: ... | [
-0.6834234595298767,
-0.09294325858354568,
0.6691392660140991,
0.6392185688018799,
-0.47151902318000793,
0.6406247019767761,
0.4352220594882965,
-0.08278220146894455,
1.1449955701828003,
-0.721322238445282,
-0.4540574550628662,
0.004572249948978424,
0.21103891730308533,
0.369695782661438,
... |
func (resource *ConceptMap) MarshalJSON() ([]byte, error) {
resource.ResourceType = "ConceptMap"
// Dereferencing the pointer to avoid infinite recursion.
// Passing in plain old x (a pointer to ConceptMap), would cause this same
// MarshallJSON function to be called again
return json.Marshal(*resource)
} | [
-0.2571370005607605,
-0.5251094698905945,
0.040736351162195206,
-0.3925325274467468,
-0.10850121825933456,
-0.04435182362794876,
0.8288840651512146,
0.2723228633403778,
1.4553871154785156,
-0.7666884064674377,
-0.06616867333650589,
0.44993171095848083,
-0.26136326789855957,
0.9033078551292... |
func LevelStart(prevScene string, data interface{}) {
levelName := levels[currentLevel]
l := levelStore[levelName]
l.Place()
// This is the 'reset level' binding.
event.GlobalBind(func(int, interface{}) int {
ok, d := oak.IsHeld("R")
if ok && d > time.Millisecond*1500 {
currentLevel--
levelComplete = tru... | [
0.5156012773513794,
-0.38738417625427246,
0.41554898023605347,
0.2477995753288269,
-0.0027666818350553513,
-0.2224537581205368,
0.5706810355186462,
-0.11225742101669312,
-0.003418657463043928,
1.076280951499939,
-0.7381323575973511,
0.5482763051986694,
-0.8442370891571045,
0.40797621011734... |
func LevelLoop() bool {
return !levelComplete
} | [
0.014079918153584003,
-0.8526209592819214,
0.37741291522979736,
0.7373684048652649,
-0.4777633547782898,
1.3876101970672607,
0.14562590420246124,
-0.5579916834831238,
-1.2541838884353638,
0.9437935948371887,
-0.5506020188331604,
-1.0922304391860962,
-1.1171973943710327,
0.45511072874069214... |
func LevelEnd() (string, *oak.SceneResult) {
levelInit = false
levelComplete = false
currentLevel = (currentLevel + 1) % len(levels)
res := &oak.SceneResult{
Transition: oak.TransitionFade(.1, 50),
}
return "level", res
} | [
-0.5566559433937073,
-0.1932263821363449,
0.4403076171875,
-0.12474182993173599,
-0.34629929065704346,
0.28122153878211975,
-0.23117688298225403,
-0.27906689047813416,
-1.1404402256011963,
1.2192007303237915,
-0.8100928664207458,
-0.22047126293182373,
-1.132541298866272,
1.4242734909057617... |
func CgoIcrs2g(dr, dd float64) (dl, db float64) {
var cDl, cDb C.double
C.iauIcrs2g(C.double(dr), C.double(dd),
&cDl, &cDb)
return float64(cDl), float64(cDb)
} | [
-0.5065763592720032,
0.09787354618310928,
0.3909270465373993,
-1.2320266962051392,
-0.6836702227592468,
0.2038951814174652,
-0.015772301703691483,
-0.13399305939674377,
-0.89898681640625,
0.5198479294776917,
0.2551455795764923,
0.19630728662014008,
0.045718129724264145,
0.44396737217903137... |
func GoIcrs2g(dr, dd float64) (dl, db float64) {
var v1, v2 [3]float64
//
// L2,B2 system of galactic coordinates in the form presented
// in the Hipparcos Catalogue. In degrees:
//
// P = 192.85948 right ascension of the Galactic north pole
// in ICRS Q = 27.12825 declination of the Galactic north
... | [
-0.1949538290500641,
-0.39263179898262024,
0.8247320055961609,
-1.5929869413375854,
-0.30600234866142273,
-0.19428850710391998,
-0.4459931552410126,
-0.24309614300727844,
-1.4158614873886108,
0.6423124074935913,
-0.2129964977502823,
0.8972560167312622,
-0.06041988357901573,
0.2303256690502... |
func (mq *SqlMQ) NotifyConsumeAt(at time.Time, event interface{}) {
mq.sleep.AwakeAtEalier(at, event)
} | [
-0.05894017219543457,
-0.9441636800765991,
0.49751338362693787,
0.3272356688976288,
-0.31048139929771423,
-0.3107908070087433,
-0.9276942610740662,
-0.5458812713623047,
-0.15837912261486053,
1.1705358028411865,
-0.9741937518119812,
0.44045254588127136,
0.6789333820343018,
0.683282017707824... |
func (mq *SqlMQ) Produce(tx *sql.Tx, msg Message) error {
if _, err := mq.handlerOf(msg); err != nil {
return err
}
var db DBOrTx = mq.DB
if tx != nil {
db = tx
}
if err := mq.Table.ProduceMessage(db, msg); err != nil {
return err
}
mq.NotifyConsumeAt(msg.ConsumeAt(), "produce")
return nil
} | [
0.396809846162796,
1.178244709968567,
0.5962538719177246,
0.02928026206791401,
-0.15105320513248444,
-0.17520874738693237,
-0.02133624441921711,
-0.45122817158699036,
-0.5410742163658142,
0.18618835508823395,
0.32327890396118164,
-0.060555629432201385,
-0.14672401547431946,
0.4705383777618... |
func SetBaseDirectory(dir string) error {
if len(dir) == 0 {
usr, err := user.Current()
if err != nil {
fmt.Println(err)
}
dir = usr.HomeDir
}
dir, err := filepath.Abs(dir)
if err != nil {
fmt.Println("Could not calculate absolute path", err)
return err
}
base = dir
return nil
} | [
-0.804419994354248,
-0.6209093928337097,
0.9172693490982056,
0.9929688572883606,
0.3428308963775635,
0.2046184092760086,
0.6977820992469788,
0.042351480573415756,
-0.06489108502864838,
-0.4152073264122009,
0.1582687348127365,
1.3001176118850708,
-0.5771022439002991,
1.2388036251068115,
0... |
func Run() {
if Log == nil {
InitLogger("debug")
}
if base == "" {
SetBaseDirectory("") // Default to usr.homedir.
}
thrustExecPath := GetExecutablePath()
if len(thrustExecPath) > 0 {
if provisioner == nil {
SetProvisioner(NewThrustProvisioner())
}
if err := provisioner.Provision(); err != nil {
... | [
0.0253079105168581,
-0.4357794523239136,
1.2069346904754639,
0.3602050244808197,
0.7353270053863525,
-0.07923193275928497,
0.857469379901886,
0.542771577835083,
-0.5818929672241211,
0.14971166849136353,
-0.10445722937583923,
0.5760715007781982,
-0.8810820579528809,
0.77055823802948,
1.11... |
func (o *GetHostdbActiveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetHostdbActiveOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil... | [
0.16543997824192047,
-0.9720454216003418,
0.8455140590667725,
0.9591071009635925,
0.00031907338416203856,
-0.48133543133735657,
0.5299685001373291,
-0.02771354839205742,
-0.40156227350234985,
0.497883677482605,
0.32640066742897034,
-0.5941244959831238,
-1.278066635131836,
-0.29598748683929... |
func NewGetHostdbActiveOK() *GetHostdbActiveOK {
return &GetHostdbActiveOK{}
} | [
0.36446407437324524,
-1.538744568824768,
0.3235018849372864,
1.6292469501495361,
-0.313110888004303,
0.36652541160583496,
0.5690096616744995,
2.0497958660125732,
-1.8964259624481201,
0.06312201917171478,
-0.7756865620613098,
-1.2622877359390259,
-0.39251402020454407,
-0.6232832074165344,
... |
func NewGetHostdbActiveDefault(code int) *GetHostdbActiveDefault {
return &GetHostdbActiveDefault{
_statusCode: code,
}
} | [
0.7585172057151794,
-0.7261765599250793,
0.08872459083795547,
1.4359861612319946,
0.5502548217773438,
0.38353824615478516,
0.10909845679998398,
1.7124568223953247,
-1.0127683877944946,
0.14859789609909058,
-1.356332778930664,
-0.42370232939720154,
-0.9580415487289429,
-0.6486815810203552,
... |
func (o *GetHostdbActiveDefault) Code() int {
return o._statusCode
} | [
0.3861132562160492,
-0.02950037643313408,
0.2995385229587555,
1.5019632577896118,
0.5863205790519714,
0.5920753479003906,
0.4401260018348694,
1.2659200429916382,
-1.171382188796997,
0.0027630834374576807,
-0.3567085862159729,
-0.2998827397823334,
-0.7769903540611267,
-0.05826080963015556,
... |
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&EtcdBackup{},
&EtcdBackupList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
} | [
-0.34717926383018494,
0.6548567414283752,
0.26583364605903625,
0.4096287786960602,
0.3869471848011017,
0.04846927151083946,
0.4657880663871765,
0.22981759905815125,
-0.0013289126800373197,
0.7165796756744385,
-0.8388730883598328,
-0.5153771042823792,
0.46048083901405334,
0.9832508563995361... |
func (adsb adsbFormatReferenceDefinition) GetTypeCode() byte {
return adsb.typeCode
} | [
0.4888153076171875,
-0.46259695291519165,
0.5082045793533325,
-0.07437501102685928,
0.6774076223373413,
-0.1284874975681305,
0.11530491709709167,
-0.2984826862812042,
0.6872757077217102,
-0.10059989988803864,
0.6730777025222778,
1.673888087272644,
-0.9274917840957642,
1.0539312362670898,
... |
func (adsb adsbFormatReferenceDefinition) GetRegister() bds.Register {
return adsb.register
} | [
0.5755305290222168,
-0.013405468314886093,
0.3837476670742035,
-0.08653825521469116,
0.7337643504142761,
-0.25065213441848755,
-0.42218971252441406,
-0.4161812663078308,
0.31706929206848145,
-0.9440172910690308,
1.0025131702423096,
1.4593396186828613,
-0.3324131667613983,
1.225031852722168... |
func (adsb adsbFormatReferenceDefinition) ToString() string {
return fmt.Sprintf("%v - %v (%v)",
adsb.typeCode,
adsb.register.GetDescription(),
adsb.register.GetId())
} | [
0.277110755443573,
-0.5606529712677002,
0.3836720585823059,
-0.8043979406356812,
1.0169390439987183,
0.14430706202983856,
-0.36203792691230774,
-0.4792375862598419,
-0.03828348591923714,
0.47573330998420715,
0.5400494933128357,
1.6165318489074707,
-0.5600111484527588,
0.48744726181030273,
... |
func BenchmarkEncodingBinary(b *testing.B) {
var s1, s2 test.Stat
analysis.RandomizeValue(&s1)
size := encbin.Size(&s1)
b.ResetTimer()
for n := 0; n < b.N; n++ {
buf := bytes.NewBuffer(make([]byte, size))
buf.Reset()
if err := encbin.Write(buf, hostarch.ByteOrder, &s1); err != nil {
b.Error("Write:", e... | [
0.21697929501533508,
0.3722734749317169,
0.6224868893623352,
0.2813739478588104,
0.5238192677497864,
-0.1506192833185196,
0.49881014227867126,
-0.505778968334198,
-0.283951997756958,
0.13211415708065033,
0.015314074233174324,
0.6499878168106079,
-0.4931913912296295,
0.11326508224010468,
... |
func BenchmarkBinary(b *testing.B) {
var s1, s2 test.Stat
analysis.RandomizeValue(&s1)
size := binary.Size(s1)
b.ResetTimer()
for n := 0; n < b.N; n++ {
buf := make([]byte, 0, size)
buf = binary.Marshal(buf, hostarch.ByteOrder, &s1)
binary.Unmarshal(buf, hostarch.ByteOrder, &s2)
}
b.StopTimer()
// Sa... | [
0.7733616828918457,
0.7054114937782288,
0.5944746136665344,
0.002533131744712591,
0.8968513607978821,
-0.193410724401474,
0.3644492030143738,
-0.5881913304328918,
-0.35458388924598694,
-0.3653097152709961,
-0.057016946375370026,
0.7414987087249756,
-0.06243240460753441,
0.4110298454761505,... |
func BenchmarkMarshalManual(b *testing.B) {
var s1, s2 test.Stat
analysis.RandomizeValue(&s1)
b.ResetTimer()
for n := 0; n < b.N; n++ {
buf := make([]byte, 0, s1.SizeBytes())
// Marshal
buf = binary.AppendUint64(buf, hostarch.ByteOrder, s1.Dev)
buf = binary.AppendUint64(buf, hostarch.ByteOrder, s1.Ino)
... | [
0.5411972403526306,
0.22442474961280823,
0.8661379218101501,
-0.05999535322189331,
-0.015680404379963875,
0.18802572786808014,
0.11444833129644394,
0.11955755949020386,
0.005061556585133076,
-0.34966689348220825,
-0.021413713693618774,
0.7675415277481079,
-0.10339900106191635,
0.7178158164... |
func BenchmarkGoMarshalSafe(b *testing.B) {
var s1, s2 test.Stat
analysis.RandomizeValue(&s1)
b.ResetTimer()
for n := 0; n < b.N; n++ {
buf := make([]byte, s1.SizeBytes())
s1.MarshalBytes(buf)
s2.UnmarshalBytes(buf)
}
b.StopTimer()
// Sanity check, make sure the values were preserved.
if !reflect.Deep... | [
1.0383741855621338,
1.0833487510681152,
0.5550200343132019,
-0.2642521858215332,
0.4507847726345062,
-0.0674717128276825,
0.4159177839756012,
-0.49873390793800354,
-0.05428920313715935,
-0.07078548520803452,
0.42403608560562134,
0.9397854804992676,
-0.19782915711402893,
-0.1851362586021423... |
func BenchmarkGoMarshalUnsafe(b *testing.B) {
var s1, s2 test.Stat
analysis.RandomizeValue(&s1)
b.ResetTimer()
for n := 0; n < b.N; n++ {
buf := make([]byte, s1.SizeBytes())
s1.MarshalUnsafe(buf)
s2.UnmarshalUnsafe(buf)
}
b.StopTimer()
// Sanity check, make sure the values were preserved.
if !reflect.... | [
0.7799441814422607,
1.0572401285171509,
0.5905117988586426,
-0.17211541533470154,
0.5006547570228577,
0.14346157014369965,
0.23774011433124542,
-0.2839808762073517,
0.15450870990753174,
-0.0839770957827568,
0.1883230060338974,
0.9711332321166992,
-0.07834021747112274,
-0.14867833256721497,... |
func (b *BuiltinFn) Call(ec *EvalCtx, args []Value) {
b.Impl(ec, args)
} | [
-0.5976213216781616,
0.19305548071861267,
0.22255218029022217,
-0.16249549388885498,
0.6628762483596802,
0.5448383688926697,
-0.22731879353523254,
0.6381131410598755,
-0.9081389904022217,
0.2343202382326126,
-0.4256303012371063,
0.17549027502536774,
0.3135119378566742,
-0.1123879924416542,... |
func wrapFn(inner interface{}) func(*EvalCtx, []Value) {
type_ := reflect.TypeOf(inner)
if type_.In(0) != evalCtxType {
panic("bad func")
}
requiredArgs := type_.NumIn() - 1
isVariadic := type_.IsVariadic()
var variadicType reflect.Type
if isVariadic {
requiredArgs--
variadicType = type_.In(type_.NumIn() ... | [
-1.2813419103622437,
-0.3696829676628113,
0.7959486246109009,
-0.41198644042015076,
-0.4639173448085785,
-0.17653781175613403,
-0.20018893480300903,
0.15431736409664154,
-0.35312220454216003,
0.24657320976257324,
-0.007256641052663326,
0.28765204548835754,
0.389017790555954,
0.312664240598... |
func unpack(ec *EvalCtx) {
in := ec.ports[0].Chan
out := ec.ports[1].Chan
for v := range in {
elemser, ok := v.(Elemser)
if !ok {
throw(ErrInput)
}
for e := range elemser.Elems() {
out <- e
}
}
} | [
0.10370419919490814,
0.3396623730659485,
0.341377317905426,
-0.7077770233154297,
0.22174473106861115,
0.17163145542144775,
0.6076552867889404,
0.14697004854679108,
-0.35254284739494324,
-0.1103440448641777,
0.2830464541912079,
0.2630908787250519,
0.7673214077949524,
0.2782387435436249,
0... |
func fromJSON(ec *EvalCtx) {
in := ec.ports[0].File
out := ec.ports[1].Chan
dec := json.NewDecoder(in)
var v interface{}
for {
err := dec.Decode(&v)
if err != nil {
if err == io.EOF {
return
}
throw(err)
}
out <- FromJSONInterface(v)
}
} | [
1.0125644207000732,
-0.3581461012363434,
0.39003658294677734,
-1.2629806995391846,
-0.09360980987548828,
0.18099908530712128,
0.20846326649188995,
-0.34649136662483215,
-0.710708737373352,
0.48711347579956055,
-0.2747475802898407,
0.8332840204238892,
0.8482711315155029,
0.4328925609588623,... |
func each(ec *EvalCtx, f FnValue) {
in := ec.ports[0].Chan
in:
for v := range in {
// NOTE We don't have the position range of the closure in the source.
// Ideally, it should be kept in the Closure itself.
newec := ec.fork("closure of each")
ex := newec.PCall(f, []Value{v})
ClosePorts(newec.ports)
switc... | [
-0.46275049448013306,
-0.07817380875349045,
0.3845553696155548,
-0.11060480028390884,
0.30956295132637024,
0.35240060091018677,
0.6767235994338989,
-0.2564311921596527,
-0.8510177731513977,
-0.1075589507818222,
0.7305963039398193,
0.18712888658046722,
0.23141993582248688,
0.489491134881973... |
func eawk(ec *EvalCtx, f FnValue) {
in := bufio.NewReader(ec.ports[0].File)
in:
for {
line, err := in.ReadString('\n')
if err == io.EOF {
break
} else if err != nil {
throw(err)
}
line = line[:len(line)-1]
args := []Value{String(line)}
for _, field := range eawkWordSep.Split(strings.Trim(line, " ... | [
0.7188220620155334,
0.34900325536727905,
0.7689467668533325,
-0.5204198360443115,
-0.3304484784603119,
0.2236323207616806,
0.6973508596420288,
0.3755427896976471,
-1.0618759393692017,
-0.11397599428892136,
0.6465068459510803,
0.0818624496459961,
0.9555912017822266,
0.651576578617096,
-0.... |
func (kh *KeyHandler) Sign(buf []byte) ([]byte, cop.Error) {
return make([]byte, 0), nil
} | [
-0.4643711745738983,
-0.5752505660057068,
0.5014633536338806,
-0.11442943662405014,
-0.19158372282981873,
0.5725051164627075,
-0.07877130806446075,
0.14692537486553192,
-0.15104073286056519,
-0.6604438424110413,
-1.3684228658676147,
-0.24284087121486664,
-1.3300693035125732,
0.394863545894... |
func mainLoop() {
openPorts()
defer closePorts()
log.Println("Waiting for configuration IP...")
var options *bonjour.ServiceEntry
for {
ip, err := inPort.RecvMessageBytes(0)
if err != nil {
log.Println("Error receiving IP:", err.Error())
continue
}
if !runtime.IsValidIP(ip) || !runtime.IsPacket(ip) ... | [
-0.06464328616857529,
0.3321128487586975,
0.8610036373138428,
0.03390171378850937,
0.1540505439043045,
0.005605289246886969,
0.30239182710647583,
-0.08078207820653915,
-0.3780977725982666,
-0.20290686190128326,
0.21889235079288483,
-0.3627539873123169,
-0.6778585314750671,
0.09798194468021... |
func validateArgs() {
if *inputEndpoint == "" {
flag.Usage()
os.Exit(1)
}
} | [
0.19708964228630066,
0.52179354429245,
0.21611419320106506,
0.8488721251487732,
1.0422048568725586,
0.5919802784919739,
0.6282848119735718,
-0.6104987263679504,
-0.7457438707351685,
0.4352039396762848,
0.9350690841674805,
-0.2731114625930786,
-1.3354272842407227,
0.6176348328590393,
0.13... |
func openPorts() {
inPort, err = utils.CreateInputPort("bonjour/discover.options", *inputEndpoint, nil)
utils.AssertError(err)
} | [
0.3204626739025116,
0.9037547707557678,
0.5183990597724915,
-0.5552902221679688,
0.6302249431610107,
0.5605298280715942,
0.7070332169532776,
-0.4762536883354187,
0.5479729175567627,
-0.8412176966667175,
-0.18677565455436707,
-0.13808615505695343,
-1.0399526357650757,
-0.6718814969062805,
... |
func closePorts() {
log.Println("Closing ports...")
inPort.Close()
zmq.Term()
} | [
1.1028621196746826,
-0.7721677422523499,
0.39804884791374207,
-0.6815536618232727,
-0.1373850554227829,
0.9356076717376709,
0.5566885471343994,
-0.24558737874031067,
-0.25005409121513367,
-0.3810151219367981,
0.12882155179977417,
0.29402822256088257,
-0.9870010614395142,
0.3094710111618042... |
func Kmp(word, text string, patternTable []int) []int {
if len(word) > len(text) {
return nil
}
var (
i, j int
matches []int
)
for i+j < len(text) {
if word[j] == text[i+j] {
j++
if j == len(word) {
matches = append(matches, i)
i = i + j
j = 0
}
} else {
i = i + j - patternT... | [
0.9303127527236938,
0.10496389120817184,
0.6324431896209717,
0.5189518332481384,
-0.7466446757316589,
-0.5401861071586609,
0.646348237991333,
-0.10918314009904861,
0.5564029216766357,
1.4236979484558105,
-0.10847954452037811,
0.04953005164861679,
-1.367169737815857,
-0.7171497941017151,
... |
func table(w string) []int {
var (
t []int = []int{-1}
k int
)
for j := 1; j < len(w); j++ {
k = j - 1
for w[0:k] != w[j-k:j] && k > 0 {
k--
}
t = append(t, k)
}
return t
} | [
-0.18863241374492645,
-0.37972721457481384,
0.9172443747520447,
0.32869952917099,
-0.4826222062110901,
-0.23250813782215118,
0.7666188478469849,
-0.15337888896465302,
-0.46263423562049866,
1.0040863752365112,
-0.6272234916687012,
-0.1866234689950943,
-0.36733561754226685,
0.269229352474212... |
func (ri *RateIterator) Tick(f func() error) error {
// wait until we have a positive rate before doing anything
if ri.rate <= 0.0 {
return nil
}
// next tick becomes this tick
ri.nextOccurrence -= 1.0
// choose events can call function until event occurs in next tick
for ri.nextOccurrence < 1.0 {
err := f... | [
0.3982307016849518,
0.537266194820404,
0.7510526776313782,
-0.06588447093963623,
0.015019594691693783,
0.1977723240852356,
0.833138108253479,
-0.20326894521713257,
-0.7633882761001587,
0.129018172621727,
0.6103482842445374,
0.09581402689218521,
-0.05330822989344597,
-0.11965663731098175,
... |
func (ri *RateIterator) TickWithRate(rate float64, f func() error) error {
// recompute next occurrence if rate has changed
if ri.rate != rate && rate > 0.0 {
ri.nextOccurrence = 1.0 + poissonDelay(ri.rnd.Float64(), rate)
}
ri.rate = rate
return ri.Tick(f)
} | [
0.2200009822845459,
0.00571328354999423,
0.49642011523246765,
-0.1550666242837906,
-0.23512409627437592,
-0.2564752697944641,
0.5582864880561829,
-0.31220588088035583,
-0.6999809741973877,
0.20526006817817688,
0.818832516670227,
-0.051569048315286636,
0.02423853985965252,
-0.26489785313606... |
func poissonDelay(uniformRnd float64, rate float64) float64 {
return -math.Log(1.0-uniformRnd) / rate
} | [
0.5437042713165283,
-0.43064558506011963,
0.25695979595184326,
-1.0560091733932495,
-0.8009262084960938,
0.5151312351226807,
-0.5184995532035828,
0.2678205370903015,
0.14332512021064758,
-0.23888294398784637,
0.1137666329741478,
0.2737080454826355,
-0.37996456027030945,
-0.3307092487812042... |
func WinCount(minerPower abi.StoragePower, totalPower abi.StoragePower, random float64) uint64 {
E := big2.NewRat(5, 1)
lambdaR := new(big2.Rat)
lambdaR.SetFrac(minerPower.Int, totalPower.Int)
lambdaR.Mul(lambdaR, E)
lambda, _ := lambdaR.Float64()
rhs := 1 - poissonPMF(lambda, 0)
winCount := uint64(0)
for rhs... | [
0.3169611394405365,
-0.1779630482196808,
0.5014352202415466,
-0.3390437066555023,
0.02663823775947094,
-0.021537963300943375,
0.8690358400344849,
1.2200164794921875,
-0.5331158638000488,
-0.21548953652381897,
-0.14009082317352295,
0.5324532985687256,
-0.2567995488643646,
0.0863064453005790... |
func PopRandom(list []uint64, rnd *rand.Rand) (uint64, []uint64) {
idx := rnd.Int63n(int64(len(list)))
result := list[idx]
list[idx] = list[len(list)-1]
return result, list[:len(list)-1]
} | [
-1.373408317565918,
0.21306563913822174,
0.5696918964385986,
-0.06548203527927399,
-0.13790687918663025,
0.09712402522563934,
-0.1181250512599945,
0.9726810455322266,
1.1593575477600098,
1.0409505367279053,
-0.8155853748321533,
-0.12407627701759338,
-0.4993918538093567,
0.6010683178901672,... |
func (Tag) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
field.Bool("is_available").Default(true),
}
} | [
-0.7259044647216797,
-0.12310720235109329,
0.2001827508211136,
-1.017890214920044,
0.8417514562606812,
0.6884397268295288,
-1.5639289617538452,
0.20581237971782684,
-0.10181590914726257,
0.42187491059303284,
-1.1154921054840088,
-0.695354700088501,
0.4694162905216217,
0.1266733855009079,
... |
func (Tag) Edges() []ent.Edge {
return []ent.Edge{
edge.From("articles", Article.Type).Ref("tags"),
}
} | [
-0.24477189779281616,
-0.1405680775642395,
0.13790367543697357,
-0.5134713649749756,
0.9582964181900024,
0.23006562888622284,
-1.4713114500045776,
0.19838009774684906,
-0.18809552490711212,
0.164336159825325,
0.3208470344543457,
0.4356842041015625,
0.2803109586238861,
0.5318466424942017,
... |
func (Tag) Mixin() []ent.Mixin {
return []ent.Mixin{
mixin.Time{},
// Or, mixin.CreateTime only for create_time
// and mixin.UpdateTime only for update_time.
CommonFieldMixin{},
}
} | [
-1.260251760482788,
-0.784022331237793,
0.4319835603237152,
0.5239996314048767,
0.39508292078971863,
0.8168839812278748,
-0.532088577747345,
0.3942175805568695,
0.7099825739860535,
-0.30133017897605896,
-1.0422027111053467,
0.14274241030216217,
0.2125764638185501,
1.321107029914856,
-0.4... |
func GetDoctorCount(db *gorm.DB) (int, error) {
count := 0
countDB := db.Model(&doctorTable{}).Count(&count)
if countDB.Error != nil {
return 0, countDB.Error
}
return count, nil
} | [
-0.04639106243848801,
0.6987073421478271,
0.7290607690811157,
0.5791088938713074,
0.3638414144515991,
-0.44781213998794556,
0.5919992923736572,
0.8216027617454529,
-0.7489670515060425,
-0.2011268138885498,
-0.00383237493224442,
0.22184905409812927,
-0.11358720809221268,
1.3383188247680664,... |
func (m Dense) MarshalBinary() ([]byte, error) {
bufLen := int64(m.mat.Rows)*int64(m.mat.Cols)*int64(sizeFloat64) + 2*int64(sizeInt64)
if bufLen <= 0 {
// bufLen is too big and has wrapped around.
return nil, errTooBig
}
p := 0
buf := make([]byte, bufLen)
binary.LittleEndian.PutUint64(buf[p:p+sizeInt64], uin... | [
0.7672234177589417,
0.14438392221927643,
0.8681264519691467,
0.33591699600219727,
0.6889710426330566,
-0.16144873201847076,
-0.10284354537725449,
-0.9738934636116028,
0.10611420124769211,
0.053112566471099854,
-0.17396798729896545,
0.24150899052619934,
-0.46589985489845276,
0.4521146714687... |
func (m Dense) MarshalBinaryTo(w io.Writer) (int, error) {
var n int
var buf [8]byte
binary.LittleEndian.PutUint64(buf[:], uint64(m.mat.Rows))
nn, err := w.Write(buf[:])
n += nn
if err != nil {
return n, err
}
binary.LittleEndian.PutUint64(buf[:], uint64(m.mat.Cols))
nn, err = w.Write(buf[:])
n += nn
if er... | [
0.46049821376800537,
0.3177879750728607,
0.960504412651062,
-0.6631428003311157,
0.505226731300354,
-0.22828030586242676,
0.7410485148429871,
-0.5200164318084717,
-0.8339756727218628,
-0.021693876013159752,
-1.0131436586380005,
0.7709053158760071,
-0.44755488634109497,
0.3686731457710266,
... |
func (m *Dense) UnmarshalBinary(data []byte) error {
if !m.isZero() {
panic("mat64: unmarshal into non-zero matrix")
}
if len(data) < 2*sizeInt64 {
return errTooSmall
}
p := 0
rows := int64(binary.LittleEndian.Uint64(data[p : p+sizeInt64]))
p += sizeInt64
cols := int64(binary.LittleEndian.Uint64(data[p : ... | [
0.6232516169548035,
-0.022542675957083702,
1.2270417213439941,
-0.5854349732398987,
0.20699577033519745,
-0.6676448583602905,
0.342515766620636,
-0.7793133854866028,
0.22174657881259918,
0.09939766675233841,
0.4855283498764038,
0.3541044294834137,
-0.6233442425727844,
0.5168573260307312,
... |
func (m *Dense) UnmarshalBinaryFrom(r io.Reader) (int, error) {
if !m.isZero() {
panic("mat64: unmarshal into non-zero matrix")
}
var (
n int
buf [8]byte
)
nn, err := readFull(r, buf[:])
n += nn
if err != nil {
return n, err
}
rows := int64(binary.LittleEndian.Uint64(buf[:]))
nn, err = readFull(r,... | [
0.43975314497947693,
-0.2724746763706207,
1.153328537940979,
-0.5880281925201416,
-0.42874500155448914,
-0.6496229767799377,
0.6663619875907898,
-0.31959325075149536,
-0.043317146599292755,
-0.06604653596878052,
0.3268209397792816,
-0.11415447294712067,
-0.22111062705516815,
0.663806676864... |
func (v Vector) MarshalBinary() ([]byte, error) {
bufLen := int64(sizeInt64) + int64(v.n)*int64(sizeFloat64)
if bufLen <= 0 {
// bufLen is too big and has wrapped around.
return nil, errTooBig
}
p := 0
buf := make([]byte, bufLen)
binary.LittleEndian.PutUint64(buf[p:p+sizeInt64], uint64(v.n))
p += sizeInt64
... | [
0.49486440420150757,
0.26927450299263,
0.6227092742919922,
0.26388704776763916,
1.0739960670471191,
-0.36785560846328735,
-0.3082268536090851,
-1.1256201267242432,
0.2442585676908493,
-0.03519238904118538,
-0.4468814730644226,
0.29858994483947754,
-0.3133661448955536,
0.6717072129249573,
... |
func (v Vector) MarshalBinaryTo(w io.Writer) (int, error) {
var (
n int
buf [8]byte
)
binary.LittleEndian.PutUint64(buf[:], uint64(v.n))
nn, err := w.Write(buf[:])
n += nn
if err != nil {
return n, err
}
for i := 0; i < v.n; i++ {
binary.LittleEndian.PutUint64(buf[:], math.Float64bits(v.at(i)))
nn... | [
0.38167890906333923,
0.49724262952804565,
0.6890356540679932,
-0.7026084661483765,
0.8659844398498535,
-0.2990751266479492,
0.43230101466178894,
-0.40455809235572815,
-0.7727575302124023,
-0.08159518241882324,
-1.3686726093292236,
1.0185027122497559,
-0.29706525802612305,
0.585267782211303... |
func (v *Vector) UnmarshalBinary(data []byte) error {
if !v.isZero() {
panic("mat64: unmarshal into non-zero vector")
}
p := 0
n := int64(binary.LittleEndian.Uint64(data[p : p+sizeInt64]))
p += sizeInt64
if n < 0 {
return errBadSize
}
if n > maxLen {
return errTooBig
}
if len(data) != int(n)*sizeFloat6... | [
0.5954297780990601,
-0.07248526066541672,
1.0230839252471924,
-0.48559924960136414,
0.3112828731536865,
-0.6099811792373657,
0.3379476070404053,
-0.6240463256835938,
0.10426171869039536,
0.22273528575897217,
0.3469565212726593,
0.42856183648109436,
-0.3840029239654541,
0.546195924282074,
... |
func (v *Vector) UnmarshalBinaryFrom(r io.Reader) (int, error) {
if !v.isZero() {
panic("mat64: unmarshal into non-zero vector")
}
var (
n int
buf [8]byte
)
nn, err := readFull(r, buf[:])
n += nn
if err != nil {
return n, err
}
sz := int64(binary.LittleEndian.Uint64(buf[:]))
if sz < 0 {
return n,... | [
0.48995450139045715,
-0.09015589952468872,
0.9358974099159241,
-0.44647759199142456,
-0.4568634033203125,
-0.5376649498939514,
0.8237401247024536,
-0.33477532863616943,
0.14527437090873718,
-0.110024593770504,
0.3107285797595978,
-0.10214338451623917,
-0.15340712666511536,
0.56558686494827... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.