text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (p *k8sPlugin) Setup(flagSet *pflag.FlagSet) {
flagSet.StringVar(&p.ETCDTLSConfig.CAFile, "kubernetes-etcd-ca-file", "", "CA certificate used by ETCD")
flagSet.StringVar(&p.ETCDTLSConfig.CertFile, "kubernetes-etcd-cert-file", "", "Public key file used by ETCD")
flagSet.StringVar(&p.ETCDTLSConfig.KeyFile, "kuber... | [
0.02454155869781971,
-0.6185834407806396,
0.665939450263977,
-0.631878137588501,
0.3821137845516205,
0.21244898438453674,
-0.5833222270011902,
0.2190616875886917,
-0.1314822882413864,
0.248104527592659,
0.0014043443370610476,
0.13906651735305786,
-0.3431190550327301,
0.3571406602859497,
... |
func (p *k8sPlugin) Start(config service.ServiceConfig, trigger chan string) error {
if err := util.SetLogLevel(p.LogLevel, config.LogLevel, logName); err != nil {
return maskAny(err)
}
// Setup kubernetes client
p.nodeExporterPort = config.NodeExporterPort
c, err := k8s_http.NewInCluster()
if err != nil {
p.... | [
0.4579388499259949,
-0.12834446132183075,
0.8088010549545288,
-0.6202023029327393,
-0.06585846096277237,
-0.5263760089874268,
0.04456496238708496,
-0.5499961376190186,
0.08052675426006317,
0.17683851718902588,
-0.2135474532842636,
1.7324763536453247,
0.19149309396743774,
-0.019280202686786... |
func (p *k8sUpdate) CreateNodes() ([]service.ScrapeConfig, error) {
// Build scrape config list
scNode := service.StaticConfig{}
scNode.Label("source", "node")
scEtcd := service.StaticConfig{}
scEtcd.Label("source", "etcd")
for _, node := range p.nodes {
for _, addr := range node.Status.Addresses {
if addr.T... | [
-1.1702462434768677,
0.09801387786865234,
0.6382141709327698,
-1.2217206954956055,
0.07504939287900925,
-0.001151339733041823,
-0.8284190893173218,
1.0684493780136108,
-0.2624851167201996,
0.9911848902702332,
0.5288074612617493,
-0.14955268800258636,
0.394795686006546,
0.31511619687080383,... |
func (p *k8sUpdate) CreateRules() ([]string, error) {
// Build URL list
var urls []string
for _, svc := range p.services {
ann, ok := svc.Annotations[metricsAnnotation]
if !ok || ann == "" {
continue
}
var metricsRecords []api.MetricsServiceRecord
if err := json.Unmarshal([]byte(ann), &metricsRecords);... | [
0.5761515498161316,
0.43520647287368774,
0.5550609230995178,
-0.3901767134666443,
0.3269166350364685,
0.4630342721939087,
-0.31769728660583496,
-0.16215796768665314,
-0.7058864831924438,
0.9776932001113892,
1.2068489789962769,
0.19871513545513153,
-0.4380805194377899,
0.8443880081176758,
... |
func NewContext(config *Config) (*Context, error) {
var context Context
var ret C.int32_t
if config != nil {
ret = C.tiledb_ctx_alloc(config.tiledbConfig, &context.tiledbContext)
} else {
ret = C.tiledb_ctx_alloc(nil, &context.tiledbContext)
}
if ret != C.TILEDB_OK {
return nil, fmt.Errorf("error creating t... | [
0.2121318131685257,
0.5941988229751587,
0.6521558165550232,
0.17714034020900726,
-0.46481990814208984,
0.09841294586658478,
0.5815557241439819,
-1.0042554140090942,
0.44838565587997437,
0.8378597497940063,
-0.2301241159439087,
-0.6653549671173096,
-0.7753595113754272,
0.5531732439994812,
... |
func (c *Context) Free() {
if c.tiledbContext != nil {
C.tiledb_ctx_free(&c.tiledbContext)
}
} | [
0.5085741281509399,
0.3407483696937561,
0.3116147816181183,
0.1680922657251358,
-0.5249150991439819,
-0.10709267854690552,
0.9153135418891907,
-1.3318291902542114,
0.24689146876335144,
0.11006945371627808,
-0.09813328832387924,
0.031036756932735443,
-1.1434544324874878,
1.0446237325668335,... |
func (c *Context) Config() (*Config, error) {
config := Config{}
ret := C.tiledb_ctx_get_config(c.tiledbContext, &config.tiledbConfig)
if ret == C.TILEDB_OOM {
return nil, fmt.Errorf("Out of Memory error in GetConfig")
} else if ret != C.TILEDB_OK {
return nil, fmt.Errorf("Unknown error in GetConfig")
}
// ... | [
0.46528124809265137,
0.2034870684146881,
0.7744048833847046,
0.10336810350418091,
-0.4821397662162781,
0.007994325831532478,
0.7778075933456421,
-0.31295710802078247,
0.21054181456565857,
0.5522445440292358,
-0.013612124137580395,
-0.04266948625445366,
-0.5498186349868774,
0.71520775556564... |
func (c *Context) IsSupportedFS(fs FS) (bool, error) {
var isSupported C.int32_t
ret := C.tiledb_ctx_is_supported_fs(c.tiledbContext, C.tiledb_filesystem_t(fs), &isSupported)
if ret != C.TILEDB_OK {
return false, fmt.Errorf("Error in checking FS support")
}
if isSupported == 0 {
return false, nil
}
return... | [
-1.1576812267303467,
0.8603818416595459,
0.732895016670227,
0.44810160994529724,
-0.690022349357605,
-0.3584032952785492,
0.16628621518611908,
0.49635279178619385,
0.8549285531044006,
-0.27571794390678406,
-0.4678493142127991,
-0.4878949224948883,
-0.8069509267807007,
0.04162616655230522,
... |
func (c *Context) SetTag(key string, value string) error {
ckey := C.CString(key)
defer C.free(unsafe.Pointer(ckey))
cvalue := C.CString(value)
defer C.free(unsafe.Pointer(cvalue))
ret := C.tiledb_ctx_set_tag(c.tiledbContext, ckey, cvalue)
if ret != C.TILEDB_OK {
return fmt.Errorf("Error in setting tag")
}
... | [
-0.13430903851985931,
0.011568408459424973,
0.542608380317688,
0.03760436922311783,
0.27194228768348694,
0.30375736951828003,
-0.13525567948818207,
-0.21214532852172852,
-1.0143132209777832,
1.2377172708511353,
-0.5088440179824829,
-0.010401231236755848,
-0.273614764213562,
0.8749082684516... |
func TestBenchmarkCompressed(t *testing.T) {
startFakeBookingApp()
resp := httptest.NewRecorder()
c := NewController(NewRequest(showRequest), NewResponse(resp))
c.SetAction("Hotels", "Show")
Config.SetOption("results.compressed", "true")
result := Hotels{c}.Show(3)
result.Apply(c.Request, c.Response)
if !string... | [
0.8567087054252625,
1.33826744556427,
0.6610098481178284,
0.5468153357505798,
0.6373147368431091,
0.6596782803535461,
0.9829339385032654,
0.022337868809700012,
-0.37404218316078186,
0.10973872244358063,
-0.5174496173858643,
0.3984687030315399,
-0.5599377155303955,
0.6530854105949402,
0.2... |
func convertToNodeAddrs(addrs []string) ([]*kronospb.NodeAddr, error) {
var seedHostsAddrs []*kronospb.NodeAddr
for _, addr := range addrs {
nodeAddr, err := kronosutil.NodeAddr(addr)
if err != nil {
return nil, err
}
seedHostsAddrs = append(seedHostsAddrs, nodeAddr)
}
return seedHostsAddrs, nil
} | [
-1.1804149150848389,
-0.38234207034111023,
0.37637943029403687,
-0.029084566980600357,
-0.022682147100567818,
-0.08614619821310043,
-0.3779493272304535,
-0.24406129121780396,
0.3669358491897583,
1.0476540327072144,
0.7890096306800842,
0.7783785462379456,
-0.1488816738128662,
0.536752164363... |
func NewRaftStateMachine(ctx context.Context, rc *RaftConfig) StateMachine {
var raftStateMachine *RaftStateMachine
proposeC := make(chan string)
getSnapshot := func() ([]byte, error) { return raftStateMachine.GetSnapshot(ctx) }
nodeID := metadata.FetchOrAssignNodeID(ctx, rc.DataDir).String()
commitC, errorC, snap... | [
0.020563390105962753,
0.3930237889289856,
0.7410280704498291,
-0.6483592987060547,
-0.4236491322517395,
-0.5442233681678772,
0.5744299292564392,
-0.622456967830658,
0.32489171624183655,
0.10342860221862793,
-0.3356877267360687,
0.5886862277984619,
-0.18367977440357208,
-0.14361076056957245... |
func (s *RaftStateMachine) Close() {
s.closer()
} | [
0.31318023800849915,
0.6472054719924927,
0.28274422883987427,
-0.4087255299091339,
-0.201889768242836,
1.0628172159194946,
1.2042632102966309,
-1.0842688083648682,
-1.0378330945968628,
-1.1876620054244995,
0.1828942447900772,
0.41911497712135315,
-0.9497524499893188,
1.0235868692398071,
... |
func (s *RaftStateMachine) State(ctx context.Context) *kronospb.OracleState {
return s.stateMachine.State(ctx)
} | [
0.5088929533958435,
0.7787908315658569,
0.12001524120569229,
-0.12664887309074402,
0.4564012587070465,
0.47252699732780457,
0.6037993431091309,
-0.7842062711715698,
0.9329752326011658,
-0.2018657773733139,
0.13133025169372559,
0.7840763926506042,
-0.2071317583322525,
0.807032585144043,
-... |
func (s *RaftStateMachine) SubmitProposal(ctx context.Context, proposal *kronospb.OracleProposal) {
encodedProposal, err := protoutil.Marshal(proposal)
if err != nil {
log.Fatalf(ctx, "Failed to marshal proposal: %v, err: %v", proposal, err)
}
s.proposeC <- string(encodedProposal)
} | [
-0.4048207998275757,
0.5411967635154724,
0.33057940006256104,
-0.47573480010032654,
0.18191957473754883,
0.3884827494621277,
-0.17509333789348602,
-0.5641661882400513,
0.4764053523540497,
0.8467487692832947,
-0.37675753235816956,
0.5262308716773987,
-0.5175621509552002,
0.11059538275003433... |
func (s *RaftStateMachine) readCommits(
ctx context.Context, commitC <-chan string, errorC <-chan error,
) {
for data := range commitC {
switch data {
case replayedWALMsg:
// WAL is replayed synchronously when a server restarts
log.Info(ctx, "Done replaying WAL entries on state machine.")
return
case l... | [
-0.24148258566856384,
0.3287484347820282,
0.6966106295585632,
-0.23620401322841644,
-0.1572146713733673,
-0.19514009356498718,
0.2790885269641876,
-0.8511729836463928,
-0.40874797105789185,
0.633699893951416,
0.6673840284347534,
0.6715992093086243,
-0.07010196149349213,
0.40286126732826233... |
func (s *RaftStateMachine) GetSnapshot(ctx context.Context) ([]byte, error) {
// Block until we get a signal on getSnapshotC
<-s.getSnapshotC
return protoutil.Marshal(s.State(ctx))
} | [
0.6903164982795715,
1.4151883125305176,
0.3263220489025116,
0.48949310183525085,
-0.34830722212791443,
-0.20884130895137787,
-0.037746742367744446,
-0.7584348320960999,
-0.06847263872623444,
-1.0922280550003052,
-0.6891122460365295,
0.631790816783905,
0.11010343581438065,
0.149708107113838... |
func (s *RaftStateMachine) recoverFromSnapshot(ctx context.Context) error {
snapshot, err := s.snapshotter.Load()
if err != nil {
// There must always be snapshot to load whenever we are signaled to
// consume it.
return err
}
log.Infof(
ctx,
"Applying snapshot to state machine, index: %d, term: %d, bytes... | [
-0.01956295594573021,
0.3998042345046997,
0.30931928753852844,
-0.31249484419822693,
-0.6385754346847534,
-0.3556672930717468,
-0.2121797353029251,
0.3392777740955353,
0.7254559993743896,
-0.6461225748062134,
-0.20004414021968842,
-0.6913405656814575,
0.05638948082923889,
-0.18194028735160... |
func GenerateSection(text string) (section Blocks) {
Section := Blocks{Type: "section",
Text: &Text{
Text: text,
Type: "mrkdwn",
},
}
return Section
} | [
0.31446099281311035,
0.14811016619205475,
0.34738025069236755,
0.21437209844589233,
-1.2541470527648926,
0.24060682952404022,
-0.33244016766548157,
-0.5147441625595093,
0.3619701564311981,
0.3167237937450409,
-0.6138424277305603,
-0.31507596373558044,
-0.21125571429729462,
1.07394754886627... |
func GenerateSectionWithImage(text string, imageurl string, alttext string) (section Blocks) {
Section := Blocks{Type: "section",
Text: &Text{
Text: text,
Type: "mrkdwn",
},
Accessory: &Accessory{
Type: "image",
ImageURL: imageurl,
AltText: alttext,
},
}
return Section
} | [
-0.10700439661741257,
-0.22564776241779327,
0.48487865924835205,
0.4010142683982849,
-1.0043659210205078,
-0.023603620007634163,
-0.4368560016155243,
-0.480316698551178,
-0.28100165724754333,
0.603316605091095,
0.07301265001296997,
-0.49970051646232605,
0.6131909489631653,
1.36590445041656... |
func GenerateDivder() (section Blocks) {
Divider := Blocks{Type: "divider"}
return Divider
} | [
-1.0532842874526978,
-0.2912452816963196,
0.45774781703948975,
0.39959391951560974,
-0.017116250470280647,
0.38015902042388916,
-0.3894851803779602,
-0.4637202322483063,
-0.5860428810119629,
-0.030807260423898697,
-0.9788439273834229,
-1.2281495332717896,
-0.003046478610485792,
1.764351844... |
func GenerateContext(text string) (cntext Blocks) {
Cntext := Blocks{Type: "context",
Elements: &[]Elements{
Elements{
Text: text,
Type: "mrkdwn",
},
},
}
return Cntext
} | [
0.23101793229579926,
0.3913637101650238,
0.4083653688430786,
0.7623515725135803,
-1.0624973773956299,
0.2183179259300232,
0.00032913274480961263,
-0.0048342738300561905,
1.3881436586380005,
0.7051306962966919,
-1.132758617401123,
-0.42614853382110596,
-0.7924761772155762,
0.916020512580871... |
func GenerateBlocksString(blocks []Blocks) (blockstr string) {
root := Root{blocks}
prettyJSON, err := json.MarshalIndent(root, "", " ")
if err != nil {
fmt.Println("Failed to generate json", err)
}
return string(prettyJSON)
} | [
-0.26909348368644714,
-0.468473345041275,
0.6501773595809937,
-0.3454687297344208,
-1.3111305236816406,
-0.05027766898274422,
-0.4655728340148926,
-1.0679911375045776,
-0.2577798664569855,
0.9852038025856018,
0.2955840229988098,
0.6108383536338806,
-0.09764672070741653,
0.41582074761390686... |
func GenerateOverFlow(items []string, title string) (options Blocks) {
var o []Options
for i, item := range items {
o = append(o, Options{
Value: fmt.Sprintf("value-%v", i),
OptionsText: OptionsText{
Type: "plain_text",
Text: item,
Emoji: true,
},
},
)
}
Section := Blocks{Type: "sect... | [
-0.08746185898780823,
0.35506099462509155,
0.7638900876045227,
-0.15105938911437988,
-0.10600539296865463,
0.3102153241634369,
-0.30033746361732483,
-0.7438299655914307,
0.3167467415332794,
-0.1027374118566513,
-0.42790985107421875,
-0.4268336296081543,
0.10521575063467026,
0.6308205127716... |
func GenerateMultiSelect(items []string, text string, phtext string) (options Blocks) {
var o []Options
for i, item := range items {
o = append(o, Options{
Value: fmt.Sprintf("value-%v", i),
OptionsText: OptionsText{
Type: "plain_text",
Text: item,
Emoji: true,
},
},
)
}
Section := B... | [
-0.5266252756118774,
0.2528412342071533,
0.7500345706939697,
-0.08193454146385193,
-0.012167590670287609,
0.02968376874923706,
-0.8845900893211365,
-0.12673136591911316,
0.21832868456840515,
0.5208632946014404,
-1.2185041904449463,
-0.2685411870479584,
0.3967837691307068,
0.605286896228790... |
func makeTestNeighborsStore() *NeighborsStore {
be := memory.NewNeighborsBackend()
cfg := &config.Config{
Server: config.ServerConfig{
NeighborsStoreRefreshInterval: 1,
},
Sources: []*config.SourceConfig{
{
ID: "rs1",
Name: "rs1",
},
{
ID: "rs2",
Name: "rs2",
},
},
}
rs1... | [
-0.23333029448986053,
0.10717295855283737,
0.7829951047897339,
-0.5559232234954834,
0.1733648031949997,
0.1408153772354126,
0.3992002308368683,
-0.3184378743171692,
0.1244150847196579,
-0.5542455911636353,
-0.9531216025352478,
0.2715631425380707,
-0.5477426648139954,
-0.06981726735830307,
... |
func (s *smell) String() string {
return fmt.Sprintf("pattern `%s` match found for `%s` starting at line %d in %s",
s.pattern, s.line, s.lineNum, s.fileName)
} | [
0.7275452017784119,
-1.5876456499099731,
0.2381366342306137,
-0.9131886959075928,
0.47262588143348694,
0.429338663816452,
1.3172979354858398,
-0.36904558539390564,
-0.501114010810852,
-0.8653488755226135,
0.5362679362297058,
0.4728313982486725,
0.39649441838264465,
0.07364626973867416,
0... |
func Execute(a *Action) error {
seen := make(map[*Action]error)
return execute(seen, a)
} | [
-0.6373631954193115,
-0.9057783484458923,
0.3221765458583832,
0.6937837600708008,
0.3987821340560913,
-0.565048098564148,
0.10259201377630234,
-0.37971231341362,
0.5170226097106934,
1.1421386003494263,
-0.49159786105155945,
0.22419294714927673,
1.0641148090362549,
-0.0036589603405445814,
... |
func ExecuteConcurrent(a *Action, n int) error {
var mu sync.Mutex // protects seen
seen := make(map[*Action]chan error)
get := func(result chan error) error {
err := <-result
result <- err
return err
}
permits := make(chan bool, n)
for i := 0; i < cap(permits); i++ {
permits <- true
}
// wg tracks a... | [
0.12516245245933533,
-0.13901400566101074,
1.0027977228164673,
0.017827264964580536,
-0.06834255903959274,
-0.5668079853057861,
0.450887531042099,
-0.3531178832054138,
-0.15854120254516602,
0.4419269263744354,
0.3897339701652527,
0.29315561056137085,
0.1955677568912506,
0.44962120056152344... |
func (m *TreeListNodesRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFilterType(formats); err != nil {
res = append(res, err)
}
if err := m.validateNode(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)... | [
-0.7972995042800903,
0.39436498284339905,
0.19333891570568085,
-0.6375113725662231,
0.03479982167482376,
-0.809985339641571,
-0.5440641641616821,
-0.6388027667999268,
-1.065553903579712,
0.20154106616973877,
0.3535171449184418,
0.5240298509597778,
-0.38026341795921326,
1.2718113660812378,
... |
func NewIterator(
reader xio.Reader64,
descr namespace.SchemaDescr,
opts encoding.Options,
) encoding.ReaderIterator {
stream := encoding.NewIStream(reader)
i := &iterator{
opts: opts,
stream: stream,
marshaller: newCustomMarshaller(),
tsIterator: m3tsz.NewTimestampIterator(opts, true),
}
i.re... | [
0.05063893273472786,
-0.30238425731658936,
0.3955048620700836,
-0.004409524146467447,
-1.7049462795257568,
-0.2055194228887558,
-0.6600602269172668,
0.6747890114784241,
0.6753330826759338,
0.5704660415649414,
0.9078503847122192,
0.28291910886764526,
0.01632658578455448,
-0.4418741166591644... |
func (it *iterator) resetSchema(schemaDesc namespace.SchemaDescr) {
if schemaDesc == nil {
it.schemaDesc = nil
it.schema = nil
// Clear but don't set to nil so they don't need to be reallocated
// next time.
customFields := it.customFields
for i := range customFields {
customFields[i] = customFieldStat... | [
0.13990554213523865,
0.21703071892261505,
0.3726408779621124,
-0.37784305214881897,
-0.02285909838974476,
-0.9080538153648376,
0.439532071352005,
1.0071120262145996,
0.1922772079706192,
0.19238059222698212,
-0.12724635004997253,
1.510373592376709,
-0.31964367628097534,
0.04423705115914345,... |
func (it *iterator) updateMarshallerWithCustomValues(arg updateLastIterArg) error {
var (
fieldNum = int32(it.customFields[arg.i].fieldNum)
fieldType = it.customFields[arg.i].fieldType
protoFieldType = it.customFields[arg.i].protoFieldType
)
if protoFieldType == protoFieldTypeNotFound {
// This c... | [
0.2111474871635437,
-0.49164190888404846,
0.6191126108169556,
-0.11639510095119476,
-0.6962955594062805,
-0.26647770404815674,
0.10007750988006592,
0.25560441613197327,
0.1250106692314148,
0.07190865278244019,
0.36086443066596985,
0.22872504591941833,
-0.7593231201171875,
0.720271229743957... |
func (it *iterator) readBitset() error {
it.bitsetValues = it.bitsetValues[:0]
bitsetLengthBits, err := it.readVarInt()
if err != nil {
return err
}
for i := uint64(0); i < bitsetLengthBits; i++ {
bit, err := it.stream.ReadBit()
if err != nil {
return fmt.Errorf("%s error reading bitset: %v", itErrPrefix... | [
-0.46025916934013367,
-0.13856755197048187,
0.47242796421051025,
-0.5683204531669617,
-0.18968507647514343,
-0.4288069009780884,
0.6855296492576599,
-1.0032353401184082,
-0.9205079078674316,
-0.302722692489624,
0.7751115560531616,
1.1591168642044067,
-0.5213710069656372,
0.6125876307487488... |
func (it *iterator) skipToNextByte() error {
remainingBitsInByte := it.stream.RemainingBitsInCurrentByte()
for remainingBitsInByte > 0 {
_, err := it.stream.ReadBit()
if err != nil {
return err
}
remainingBitsInByte--
}
return nil
} | [
-0.32264962792396545,
-0.382207989692688,
0.6309088468551636,
-0.01642928086221218,
-1.074968695640564,
0.9340755343437195,
0.5558732151985168,
-0.6113432049751282,
-0.6464549899101257,
0.17242023348808289,
0.22951799631118774,
-0.09767339378595352,
-1.6893669366836548,
0.5229389667510986,... |
func detectCycle(head *ListNode) *ListNode {
findMeetingPoint := func(head *ListNode) *ListNode {
fast, slow := head, head
for fast.Next != nil && fast.Next.Next != nil {
fast = fast.Next.Next
slow = slow.Next
if fast == slow {
return fast
}
}
return nil
}
if head == nil {
return head
}
... | [
0.4476195275783539,
-0.3388090133666992,
0.7624384760856628,
0.18862424790859222,
-0.1651732325553894,
-0.6715614199638367,
0.63338702917099,
-0.4520898163318634,
0.10093792527914047,
0.2392716407775879,
0.3006724417209625,
0.5710084438323975,
-0.9313897490501404,
1.1773890256881714,
-0.... |
func NewQuerier(k Keeper) sdk.Querier {
return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) {
var (
res []byte
err error
)
switch path[0] {
case client.SubModuleName:
switch path[1] {
case client.QueryAllClients:
res, err = client.QuerierClients(ctx, req, k.Clien... | [
-0.24942392110824585,
-0.7672168612480164,
0.7648633718490601,
0.40103527903556824,
0.2113756537437439,
0.05931739881634712,
-0.11528266966342926,
-0.6810921430587769,
-0.2362208217382431,
-0.46791067719459534,
0.41802650690078735,
0.25769492983818054,
-0.8096985220909119,
0.54055410623550... |
func Transaction(ctx context.Context, driver Driver, opts *TxOptions,
handler func(driver Driver) error) error {
if driver == nil {
return errors.Wrap(ErrInvalidDriver, "makroud: cannot create a transaction")
}
tx, err := driver.Begin(ctx, opts)
if err != nil {
return err
}
err = handler(tx)
if err != ni... | [
0.16435623168945312,
0.6450904607772827,
0.5481496453285217,
0.009198088198900223,
0.43142634630203247,
-0.10356168448925018,
0.6055278778076172,
0.846744954586029,
0.33759811520576477,
0.9920832514762878,
0.030964726582169533,
-0.6540119647979736,
-0.41958630084991455,
-0.1303524225950241... |
func NewImage(img model.Image, cfg *config.Giffy) Image {
if cfg.Meta.IsProdlike() && len(cfg.CloudFrontDNS) > 0 {
return Image{
Image: img,
S3ReadURL: fmt.Sprintf("https://%s/%s", cfg.CloudFrontDNS, img.S3Key),
}
}
return Image{
Image: img,
S3ReadURL: fmt.Sprintf("https://%s.s3.%s.amazonaws.co... | [
-0.34402960538864136,
0.3975512981414795,
0.3120817244052887,
-0.2935052812099457,
-0.1943769007921219,
0.43304643034935,
-0.6844013333320618,
0.3329913020133972,
0.07861212641000748,
0.6168017983436584,
1.030320644378662,
0.6021431088447571,
0.3946211636066437,
0.4792040288448334,
0.210... |
func WrapImages(images []model.Image, cfg *config.Giffy) []Image {
output := make([]Image, len(images))
for x := 0; x < len(images); x++ {
output[x] = NewImage(images[x], cfg)
}
return output
} | [
-1.1356014013290405,
0.10595744103193283,
0.31143441796302795,
0.23376475274562836,
0.28697484731674194,
0.2219490110874176,
-0.3678855001926422,
0.06391851603984833,
-0.21879933774471283,
1.1950609683990479,
0.3068908452987671,
-0.21570037305355072,
-0.27921268343925476,
1.281780242919921... |
func (o *ObjectId) MarshalJSONPB(m *jsonpb.Marshaler) ([]byte, error) {
s, err := m.MarshalToString(&wrappers.StringValue{Value: o.Value})
if err != nil {
return nil, err
}
return []byte(s), nil
} | [
0.5614810585975647,
-0.19544945657253265,
0.7906844615936279,
0.012190505862236023,
-0.662905752658844,
1.0295544862747192,
-1.1314070224761963,
-1.0657835006713867,
0.8390355706214905,
0.9026249647140503,
0.3008803725242615,
0.2707953453063965,
-0.5889489650726318,
0.35308727622032166,
... |
func (o *ObjectId) UnmarshalJSONPB(m *jsonpb.Unmarshaler, data []byte) error {
var id wrappers.StringValue
if err := m.Unmarshal(bytes.NewReader(data), &id); err != nil {
return err
}
o.Value = id.Value
return nil
} | [
0.1990538388490677,
-0.37240761518478394,
0.5368610620498657,
-0.6501002311706543,
-0.6749935150146484,
1.2243684530258179,
-0.4805159270763397,
-0.43823954463005066,
0.36674097180366516,
0.4567289650440216,
0.02723916806280613,
-0.31827324628829956,
-0.8312892913818359,
-0.155381932854652... |
func WithTextOutputRouting(info, err io.Writer) TextLoggerOption {
return func(t *TextLogger) {
t.wOut, t.wErr = info, err
}
} | [
-0.25170186161994934,
-0.41491806507110596,
0.5224301218986511,
-0.8652206063270569,
-0.95143061876297,
-0.7798938751220703,
-0.2553407847881317,
-0.13782618939876556,
-0.5438981652259827,
0.4747196137905121,
0.4207863211631775,
-0.9076054692268372,
1.1490329504013062,
0.20384134352207184,... |
func NewTextLogger(opts ...TextLoggerOption) *TextLogger {
t := &TextLogger{os.Stdout, os.Stderr}
// apply options
for _, opt := range opts {
opt(t)
}
return t
} | [
0.027737174183130264,
-0.30689510703086853,
0.23071616888046265,
-0.5639691948890686,
-1.3394591808319092,
-0.3858129382133484,
-1.7146364450454712,
0.6217043399810791,
-0.15274426341056824,
0.20941413938999176,
-0.07457295060157776,
-0.009351849555969238,
-0.8052811026573181,
1.3452472686... |
func (t *TextLogger) Debug(args ...interface{}) {
t.Debugf("%s", fmt.Sprint(args...))
} | [
0.3930875062942505,
0.03975028917193413,
0.5295155644416809,
-0.2088172882795334,
0.38438430428504944,
0.49692121148109436,
-0.7566753625869751,
0.5795025825500488,
-0.7400841116905212,
-0.1725941002368927,
0.5022551417350769,
0.22548963129520416,
-0.3422420620918274,
1.013355016708374,
... |
func (t *TextLogger) Debugf(format string, args ...interface{}) {
t.writeLine(t.wOut, debugPrefix, fmt.Sprintf(format, args...))
} | [
-0.018990302458405495,
0.20447398722171783,
0.5789526700973511,
-0.7918602824211121,
0.4691050052642822,
-0.549209713935852,
-0.9266476035118103,
0.39376598596572876,
-1.2468072175979614,
-0.3681877851486206,
0.007050746586173773,
0.30761581659317017,
-0.0384010374546051,
1.199169397354126... |
func (t *TextLogger) Info(args ...interface{}) {
t.Infof("%s", fmt.Sprint(args...))
} | [
0.1419697254896164,
-0.33411705493927,
0.5182543396949768,
-0.12698818743228912,
0.3112310469150543,
0.13118329644203186,
-0.5431825518608093,
-0.0025614716578274965,
-1.8999875783920288,
0.356954425573349,
0.06580754369497299,
0.4582740366458893,
0.35302841663360596,
1.2884249687194824,
... |
func (t *TextLogger) Infof(format string, args ...interface{}) {
t.writeLine(t.wOut, infoPrefix, fmt.Sprintf(format, args...))
} | [
0.35973355174064636,
-0.7336733937263489,
0.5984212756156921,
-0.6911827325820923,
0.7457700371742249,
-0.10915098339319229,
-0.2549092173576355,
0.26105213165283203,
-1.0616859197616577,
-0.21522505581378937,
0.19056899845600128,
0.7344948649406433,
0.5422147512435913,
0.8008902668952942,... |
func (t *TextLogger) Warn(args ...interface{}) {
t.Warnf("%s", fmt.Sprint(args...))
} | [
0.1434919387102127,
0.17366184294223785,
0.5516396760940552,
-0.34165897965431213,
-0.15833483636379242,
-0.013454852625727654,
-1.353601098060608,
0.05864476412534714,
-1.1900336742401123,
-0.006806866731494665,
0.2933860421180725,
0.9744307994842529,
0.385799765586853,
0.8309926390647888... |
func (t *TextLogger) Warnf(format string, args ...interface{}) {
t.writeLine(t.wErr, warnPrefix, fmt.Sprintf(format, args...))
} | [
0.14636686444282532,
-0.45052340626716614,
0.43933185935020447,
-0.8937798738479614,
0.4446406364440918,
-0.26003676652908325,
-0.44211649894714355,
0.4225766062736511,
-0.9847638010978699,
0.07403790950775146,
0.3967042863368988,
1.073267936706543,
0.4960864782333374,
0.5912178754806519,
... |
func (t *TextLogger) writeLine(output io.Writer, prefix, msg string) {
fmt.Fprintf(output, "%s %s %s\n", prefix, time.Now().Local().Format("Mon Jan 2 15:04:05 2006"), msg)
} | [
0.035751212388277054,
-1.1569514274597168,
0.6344680190086365,
-0.5980067253112793,
-0.04056895151734352,
-0.43313834071159363,
-0.8423601984977722,
0.6709610223770142,
-0.9976584911346436,
-0.2661733627319336,
-0.1234956607222557,
-0.18426570296287537,
0.050866663455963135,
0.426029890775... |
func (t *TextLogger) Close() error {
return nil
} | [
-0.17526228725910187,
-0.7928116321563721,
0.38981857895851135,
-0.8644549250602722,
-1.259184718132019,
1.0972715616226196,
-0.49783992767333984,
-0.16312488913536072,
-0.9637652635574341,
-0.3821091651916504,
0.24621105194091797,
0.19989342987537384,
-1.1761585474014282,
1.58104789257049... |
func AuthAdminAccess(context *gin.Context, db int, tokenSecret string, needs []string, release bool) {
if !release {
context.Next()
return
}
roles, err := GetRequestTokenRole(context, db, tokenSecret)
if err != nil {
common.ResponseError(context, code.SpawnErrNeedPerm())
log.Debug("authorization role acces... | [
-0.9378371238708496,
-0.5012019276618958,
0.9272822141647339,
-0.7569320201873779,
-0.45526713132858276,
0.012271255254745483,
0.5063377022743225,
-1.277513861656189,
-0.22995159029960632,
0.9197583794593811,
0.9636558294296265,
0.9729477763175964,
0.11357524991035461,
0.456786572933197,
... |
func GetLastDictionaryVersion() *DictionaryVersion {
item := new(DictionaryVersion)
dv := db.C("dictionary_versions")
dv.Find(nil).Sort("-_id").Limit(1).One(&item)
return item
} | [
-0.28249692916870117,
0.05378693714737892,
0.4503411054611206,
-0.9254304766654968,
0.39065614342689514,
-0.15317580103874207,
-0.7423994541168213,
-0.3770444691181183,
-0.4775407612323761,
0.17839203774929047,
-0.12917682528495789,
-0.21768401563167572,
-0.4292526841163635,
0.032857432961... |
func now() time.Duration { return time.Since(startTime) } | [
0.48301962018013,
-0.6860342025756836,
0.3565100133419037,
0.8222745656967163,
-0.9217601418495178,
0.08774290978908539,
0.005168047267943621,
0.43776363134384155,
-1.0762799978256226,
0.11986177414655685,
-0.5767788887023926,
0.7514448761940002,
0.5378636121749878,
0.7387351989746094,
-... |
func assembleService(attrs []syscall.NetlinkRouteAttr) (*Service, error) {
var s Service
var addressBytes []byte
for _, attr := range attrs {
attrType := int(attr.Attr.Type)
switch attrType {
case ipvsSvcAttrAddressFamily:
s.AddressFamily = native.Uint16(attr.Value)
case ipvsSvcAttrProtocol:
s.Prot... | [
-0.4586801826953888,
-0.7460839748382568,
0.7876119613647461,
-0.9588177800178528,
-0.45553046464920044,
-0.17564256489276886,
-0.07101936638355255,
-0.5198339819908142,
0.3959115445613861,
-0.09951622784137726,
0.44634485244750977,
0.11621671915054321,
0.4835933446884155,
0.28172287344932... |
func (i *Handle) parseService(msg []byte) (*Service, error) {
var s *Service
// Remove General header for this message and parse the NetLink message
hdr := deserializeGenlMsg(msg)
NetLinkAttrs, err := nl.ParseRouteAttr(msg[hdr.Len():])
if err != nil {
return nil, err
}
if len(NetLinkAttrs) == 0 {
return nil... | [
0.18483422696590424,
-0.28801900148391724,
0.5485319495201111,
-0.41129326820373535,
-0.1755148470401764,
-0.1998112052679062,
0.790151059627533,
-0.14322929084300995,
0.026230376213788986,
-0.9718347787857056,
0.3061387538909912,
-0.1356683224439621,
-0.8549705147743225,
0.686569750308990... |
func (i *Handle) doGetServicesCmd(svc *Service) ([]*Service, error) {
var res []*Service
msgs, err := i.doCmdwithResponse(svc, nil, ipvsCmdGetService)
if err != nil {
return nil, err
}
for _, msg := range msgs {
srv, err := i.parseService(msg)
if err != nil {
return nil, err
}
res = append(res, srv)... | [
-1.0461915731430054,
0.17603318393230438,
0.8716997504234314,
-0.5083035826683044,
0.537140429019928,
-0.2828431725502014,
0.1390712708234787,
-0.6957734823226929,
0.1509620100259781,
-0.9181010723114014,
0.29958024621009827,
0.25670307874679565,
-1.135148048400879,
1.1610543727874756,
-... |
func (i *Handle) doCmdWithoutAttr(cmd uint8) ([][]byte, error) {
req := newIPVSRequest(cmd)
req.Seq = atomic.AddUint32(&i.seq, 1)
return execute(i.sock, req, 0)
} | [
-1.2212395668029785,
0.12483792752027512,
0.6297040581703186,
-0.6982040405273438,
-0.805984616279602,
0.3196796178817749,
-0.03944987803697586,
-0.5144809484481812,
0.147742360830307,
-0.860849142074585,
0.5357487797737122,
-0.16707682609558105,
-0.6531842350959778,
0.1669020801782608,
... |
func getIPFamily(address []byte) (uint16, error) {
if len(address) == 4 {
return syscall.AF_INET, nil
}
if isZeros(address) {
return 0, errors.New("could not parse IP family from address data")
}
// assume IPv4 if first 4 bytes are non-zero but rest of the data is trailing zeros
if !isZeros(address[:4]) && ... | [
-0.3524636924266815,
0.20667026937007904,
0.627496063709259,
0.5421699285507202,
-0.5499955415725708,
-1.5424519777297974,
0.1502387374639511,
0.45664623379707336,
0.5874803066253662,
-0.3740881383419037,
0.2143186330795288,
-0.6424118876457214,
0.09840512275695801,
0.05039849132299423,
... |
func (i *Handle) parseDestination(msg []byte) (*Destination, error) {
var dst *Destination
// Remove General header for this message
hdr := deserializeGenlMsg(msg)
NetLinkAttrs, err := nl.ParseRouteAttr(msg[hdr.Len():])
if err != nil {
return nil, err
}
if len(NetLinkAttrs) == 0 {
return nil, fmt.Errorf("er... | [
-0.1689394861459732,
-0.28833550214767456,
0.7091830968856812,
-0.6651239991188049,
-0.44872236251831055,
-0.00568615784868598,
0.7541926503181458,
-0.03525792062282562,
0.3801618218421936,
-0.6653168201446533,
0.23157839477062225,
-0.6976920962333679,
-0.22181816399097443,
0.2797068059444... |
func (i *Handle) doGetDestinationsCmd(s *Service, d *Destination) ([]*Destination, error) {
var res []*Destination
msgs, err := i.doCmdwithResponse(s, d, ipvsCmdGetDest)
if err != nil {
return nil, err
}
for _, msg := range msgs {
dest, err := i.parseDestination(msg)
if err != nil {
return res, err
}
... | [
-1.4376119375228882,
0.5897701382637024,
0.988980233669281,
-0.11548097431659698,
1.0936503410339355,
-0.5317413806915283,
-0.2727867662906647,
-0.29393166303634644,
-0.4072459042072296,
-0.2528455853462219,
0.06833481043577194,
0.43706008791923523,
0.04029824957251549,
0.43997272849082947... |
func (i *Handle) parseConfig(msg []byte) (*Config, error) {
var c Config
// Remove General header for this message
hdr := deserializeGenlMsg(msg)
attrs, err := nl.ParseRouteAttr(msg[hdr.Len():])
if err != nil {
return nil, err
}
for _, attr := range attrs {
attrType := int(attr.Attr.Type)
switch attrType... | [
0.2025294303894043,
-0.09726202487945557,
0.5622569918632507,
-0.7981358170509338,
-0.4010550379753113,
-0.05694141983985901,
0.47177383303642273,
0.5516432523727417,
-0.650581419467926,
0.25147464871406555,
-0.1006302759051323,
-0.534719705581665,
-0.41125524044036865,
0.8583472371101379,... |
func (i *Handle) doGetConfigCmd() (*Config, error) {
msg, err := i.doCmdWithoutAttr(ipvsCmdGetConfig)
if err != nil {
return nil, err
}
res, err := i.parseConfig(msg[0])
if err != nil {
return res, err
}
return res, nil
} | [
-1.3233243227005005,
0.6421301364898682,
0.7449550032615662,
-0.08729814738035202,
0.4833942651748657,
-0.3878357708454132,
-0.35147881507873535,
0.019797904416918755,
-0.3534756302833557,
0.15492019057273865,
-0.13726505637168884,
0.4811307191848755,
-0.7432771325111389,
0.695724964141845... |
func (i *Handle) doSetConfigCmd(c *Config) error {
req := newIPVSRequest(ipvsCmdSetConfig)
req.Seq = atomic.AddUint32(&i.seq, 1)
req.AddData(nl.NewRtAttr(ipvsCmdAttrTimeoutTCP, nl.Uint32Attr(uint32(c.TimeoutTCP.Seconds()))))
req.AddData(nl.NewRtAttr(ipvsCmdAttrTimeoutTCPFin, nl.Uint32Attr(uint32(c.TimeoutTCPFin.Se... | [
-1.3214157819747925,
0.5610133409500122,
0.5975728034973145,
-0.8596962690353394,
0.3863764703273773,
0.3194662928581238,
0.1954849660396576,
-0.08763957768678665,
-0.777599573135376,
1.0689421892166138,
-0.013480608351528645,
-0.4124666452407837,
-0.052380919456481934,
0.18773284554481506... |
func volumeStateRefreshFunc(conn *computing.Computing, volumeID string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
resp, err := conn.DescribeVolumes(&computing.DescribeVolumesInput{
VolumeId: []*string{&volumeID},
})
if err != nil {
if ec2err, ok := err.(awserr.Error); ok {
... | [
0.21146997809410095,
-1.1908631324768066,
0.5106770396232605,
-0.6803280711174011,
-0.12656237185001373,
-0.8495012521743774,
-0.43767017126083374,
-0.12969070672988892,
0.3928995728492737,
0.35320645570755005,
0.5395672917366028,
0.39560744166374207,
0.5583157539367676,
-0.366116583347320... |
func runMachineFromVmCode() {
filename := ""
if len(os.Args) == 1 {
filename = "./sample/vm/func.vm"
} else {
filename = os.Args[1]
}
_, err := os.Stat(filename)
if err != nil {
if len(os.Args) == 1 {
fmt.Print("[ERROR] filename is not given")
} else {
fmt.Printf("[ERROR] given filename(%s) is not ... | [
-0.12850038707256317,
-0.12510421872138977,
0.9138379096984863,
0.633905827999115,
-0.08886981010437012,
0.6539599299430847,
0.6677038073539734,
0.28524652123451233,
-0.9813848733901978,
0.4550383985042572,
-0.21761810779571533,
0.8247172236442566,
-0.20518842339515686,
0.28978216648101807... |
func ParseShip(playerID int, tokens []string) (Ship, []string) {
shipID, _ := strconv.Atoi(tokens[0])
shipX, _ := strconv.ParseFloat(tokens[1], 64)
shipY, _ := strconv.ParseFloat(tokens[2], 64)
shipHealth, _ := strconv.ParseFloat(tokens[3], 64)
shipVelX, _ := strconv.ParseFloat(tokens[4], 64)
shipVelY, _ := strco... | [
-0.47036653757095337,
-0.8498583436012268,
0.7116853594779968,
-0.435057669878006,
0.2693502604961395,
-0.3139328360557556,
-0.3122316300868988,
0.1143830195069313,
-0.2827244997024536,
-0.06825614720582962,
-0.09818986803293228,
0.4300162196159363,
0.47558197379112244,
0.4208952784538269,... |
func (ship Ship) Thrust(magnitude float64, angle float64) string {
var boundedAngle int
if angle > 0.0 {
boundedAngle = int(math.Floor(angle + .5))
} else {
boundedAngle = int(math.Ceil(angle - .5))
}
boundedAngle = ((boundedAngle % 360) + 360) % 360
return fmt.Sprintf("t %s %s %s", strconv.Itoa(ship.id), str... | [
0.07168465107679367,
-0.29880356788635254,
0.4358062744140625,
-1.9459400177001953,
0.28089597821235657,
-0.44255661964416504,
-0.33671826124191284,
-0.8296743035316467,
-0.23274311423301697,
0.16653700172901154,
-0.04212801158428192,
0.7458145022392273,
-0.03376958519220352,
-1.0187793970... |
func (ship Ship) Dock(planet Planet) string {
return fmt.Sprintf("d %s %s", strconv.Itoa(ship.id), strconv.Itoa(planet.id))
} | [
-0.8261542320251465,
-0.033281534910202026,
0.5238037109375,
-1.1176962852478027,
0.23334228992462158,
1.1927317380905151,
-0.13970458507537842,
-0.1328175961971283,
-0.5855826735496521,
-0.007104561198502779,
0.8777188062667847,
0.587204098701477,
0.5314761400222778,
0.6663548946380615,
... |
func (ship Ship) Undock() string {
return fmt.Sprintf("u %s", strconv.Itoa(ship.id))
} | [
-0.15809164941310883,
0.46978428959846497,
0.7349212765693665,
-1.0746251344680786,
0.45458707213401794,
0.08575610816478729,
0.8154978156089783,
0.40901342034339905,
0.27482518553733826,
-0.1588016003370285,
0.7665174603462219,
0.5772297978401184,
1.027557373046875,
-0.44911831617355347,
... |
func (ship Ship) NavigateBasic(target twoD.Positioner) string {
distance := ship.CalculateDistanceTo(target)
angle := ship.CalculateAngleTo(target)
speed := 7.0 //TODO: get from environment
speed = math.Min(speed, distance)
return ship.Thrust(speed, angle)
} | [
-0.4770289361476898,
-0.2508509159088135,
0.5719699859619141,
-0.09867455065250397,
0.03584965318441391,
-0.2411402463912964,
-0.34321850538253784,
-1.239422082901001,
-0.6059841513633728,
-0.03446880355477333,
0.22656451165676117,
-0.1097744032740593,
0.6819711327552795,
-1.33207261562347... |
func (ship Ship) CanDock(planet Planet) bool {
owner := planet.Owner()
if owner != 0 && owner != ship.owner {
return false
}
if planet.NumDockedShips == planet.NumDockingSpots {
return false
}
dist := ship.CalculateDistanceTo(planet)
_, _, radius := planet.Circle()
return dist <= (ship.radius + radius + 4)
... | [
-0.47203972935676575,
0.8058751821517944,
0.8255908489227295,
0.7474657893180847,
-0.7348517775535583,
0.7364066243171692,
1.2194457054138184,
0.25097405910491943,
-0.04791300371289253,
-0.19924744963645935,
0.23098565638065338,
0.4515503942966461,
0.23875263333320618,
0.4681587517261505,
... |
func IntToDockingStatus(i int) DockingStatus {
statuses := [4]DockingStatus{UNDOCKED, DOCKING, DOCKED, UNDOCKING}
return statuses[i]
} | [
-0.8760709166526794,
0.5113056302070618,
0.08151579648256302,
-0.9456629753112793,
-0.2207077294588089,
0.5150848031044006,
0.5132097601890564,
-0.0418635793030262,
0.5300758481025696,
0.38527989387512207,
-0.6320469975471497,
0.33434227108955383,
0.4483155608177185,
0.3577772378921509,
... |
func (e *Event) AddHandler(name string, handler EventHandler) {
e.mu.Lock()
defer e.mu.Unlock()
if e.events == nil {
e.events = make(map[string][]EventHandler)
}
handlers, has := e.events[name]
if !has {
handlers = make([]EventHandler, 0, 1)
}
e.events[name] = append(hand... | [
-0.40236252546310425,
0.20990484952926636,
0.549864649772644,
0.2836151123046875,
-0.11275675892829895,
0.3357735574245453,
-0.5977038145065308,
0.6538404822349548,
0.13547363877296448,
-0.36284661293029785,
-0.3843327760696411,
-0.5277050733566284,
-0.2149665355682373,
1.1412633657455444,... |
func (e *Event) AddSyncHandler(name string, handler EventHandler) {
e.mu.Lock()
defer e.mu.Unlock()
if e.syncEvents == nil {
e.syncEvents = make(map[string][]EventHandler)
}
handlers, has := e.syncEvents[name]
if !has {
handlers = make([]EventHandler, 0, 1)
}
e.syncEvents... | [
-0.37738123536109924,
0.3674330711364746,
0.8062896728515625,
0.4985770583152771,
-0.13703621923923492,
-0.24304325878620148,
0.06791576743125916,
0.6915901899337769,
0.45483270287513733,
0.14774268865585327,
-0.9274501204490662,
0.21597330272197723,
-0.10095526278018951,
1.091398000717163... |
func (e *Event) ClearHandlers(name string) {
e.mu.Lock()
defer e.mu.Unlock()
delete(e.events, name)
delete(e.syncEvents, name)
} | [
0.09957126528024673,
-0.2487511783838272,
0.542368471622467,
-0.05058762803673744,
-0.46437206864356995,
0.18086041510105133,
-0.5407220721244812,
-0.3129338324069977,
-0.004528279881924391,
1.2778385877609253,
0.023772014304995537,
0.1947033703327179,
-0.8893993496894836,
-0.4450738430023... |
func (e *Event) ClearAllHandlers() {
e.mu.Lock()
defer e.mu.Unlock()
e.events = make(map[string][]EventHandler)
e.syncEvents = make(map[string][]EventHandler)
} | [
0.2648381292819977,
-0.5306687355041504,
0.6593373417854309,
0.6247850656509399,
-0.24718721210956573,
-0.01703563518822193,
-0.3910383880138397,
-0.03394996374845505,
-0.15850159525871277,
0.4645293056964874,
-0.13446584343910217,
1.237346887588501,
-0.42848965525627136,
0.666150152683258... |
func (e *Event) Trigger(name string, args ...interface{}) {
e.mu.RLock()
defer e.mu.RUnlock()
if handlers, has := e.events[name]; has && len(handlers) > 0 {
for _, handler := range handlers {
go handler(args...)
}
}
if handlers, has := e.syncEvents[name]; has && len(handl... | [
-0.5252717733383179,
0.3328793942928314,
0.5238872170448303,
0.5656688809394836,
0.6543006300926208,
-0.45695868134498596,
0.2919509708881378,
0.7661913633346558,
-0.32705003023147583,
-0.07134775817394257,
-1.0222036838531494,
-0.13865463435649872,
-0.13580742478370667,
0.414048433303833,... |
func NewYamux(conn net.Conn, isClient bool) (Multiplexer, error) {
var session *yamux.Session
var err error
if isClient {
session, err = yamux.Client(conn, nil)
} else {
session, err = yamux.Server(conn, nil)
}
if err != nil {
return nil, err
}
return &Yamux{
session: session,
}, nil
} | [
-0.1358470916748047,
-0.5963394045829773,
0.6596065759658813,
0.49633362889289856,
-0.7057870030403137,
-0.31784868240356445,
-0.36201056838035583,
0.8535295724868774,
0.6162806749343872,
-0.5383138656616211,
-0.5468090176582336,
1.6940995454788208,
-0.2913951575756073,
0.45339465141296387... |
func (s *Yamux) AcceptStream() (net.Conn, error) {
return s.session.AcceptStream()
} | [
-0.1283440887928009,
-0.1758432537317276,
0.5596849918365479,
0.5171194076538086,
-1.3771628141403198,
0.08961990475654602,
0.6334251761436462,
0.7408307194709778,
0.013618022203445435,
-1.3088600635528564,
0.29341644048690796,
0.8341414928436279,
-0.4190075099468231,
0.48051413893699646,
... |
func (s *Yamux) OpenStream() (net.Conn, error) {
return s.session.OpenStream()
} | [
-0.5519979596138,
-0.09732170403003693,
0.5971285104751587,
0.8512867093086243,
-0.9725942015647888,
-0.7569754123687744,
0.6080012321472168,
0.5281878709793091,
0.6831619739532471,
-1.3863056898117065,
-0.05133058875799179,
0.6252676844596863,
-0.29002436995506287,
0.5343397259712219,
0... |
func NewReportingTaskEntity() *ReportingTaskEntity {
this := ReportingTaskEntity{}
return &this
} | [
0.025700975209474564,
0.13914154469966888,
0.15833383798599243,
0.5870051383972168,
0.3342438340187073,
0.19131773710250854,
0.6256089806556702,
0.2908187210559845,
-0.3828102648258209,
-0.5332297086715698,
-0.741184413433075,
-0.30448609590530396,
0.03758320212364197,
0.6438560485839844,
... |
func NewReportingTaskEntityWithDefaults() *ReportingTaskEntity {
this := ReportingTaskEntity{}
return &this
} | [
0.36857882142066956,
0.9447360634803772,
0.18482427299022675,
0.5714145302772522,
1.2372993230819702,
0.12932302057743073,
-0.10592789202928543,
-0.0576467402279377,
-0.44219839572906494,
-0.8710708618164062,
-0.9290910363197327,
-1.319357991218567,
-0.3383095860481262,
0.5296785831451416,... |
func (o *ReportingTaskEntity) GetRevision() RevisionDTO {
if o == nil || o.Revision == nil {
var ret RevisionDTO
return ret
}
return *o.Revision
} | [
1.2937965393066406,
0.5691638588905334,
0.3908887505531311,
1.010835886001587,
0.26898902654647827,
-0.4658746123313904,
1.4021210670471191,
0.5046994686126709,
0.40671849250793457,
-1.1391353607177734,
-0.7732027769088745,
-0.7119817137718201,
-0.09529709815979004,
-0.03543243929743767,
... |
func (o *ReportingTaskEntity) GetRevisionOk() (*RevisionDTO, bool) {
if o == nil || o.Revision == nil {
return nil, false
}
return o.Revision, true
} | [
0.6026829481124878,
0.3475530743598938,
0.5135009288787842,
1.0195749998092651,
-0.10125024616718292,
-0.20171023905277252,
0.9045929908752441,
1.6721127033233643,
-0.024509068578481674,
0.417873740196228,
-0.7157771587371826,
-0.2338656485080719,
0.5016236305236816,
0.10537286102771759,
... |
func (o *ReportingTaskEntity) HasRevision() bool {
if o != nil && o.Revision != nil {
return true
}
return false
} | [
0.8802522420883179,
0.4532349109649658,
0.30361783504486084,
0.41691216826438904,
0.8909969329833984,
-0.6277451515197754,
0.5743017792701721,
1.4408882856369019,
-0.1374640166759491,
-1.068118929862976,
-0.8232582807540894,
-1.0127149820327759,
-0.06380023062229156,
-0.4427676200866699,
... |
func (o *ReportingTaskEntity) SetRevision(v RevisionDTO) {
o.Revision = &v
} | [
1.0002952814102173,
0.4350879490375519,
0.3689345121383667,
0.3124372065067291,
-0.08556380122900009,
0.003745857160538435,
-0.17225924134254456,
-0.16843554377555847,
-0.5570988655090332,
-0.3030065596103668,
-0.2863052785396576,
0.4840388298034668,
0.601336658000946,
-1.0013470649719238,... |
func (o *ReportingTaskEntity) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
} | [
1.3054893016815186,
0.21069344878196716,
0.23436154425144196,
0.7963266372680664,
0.6248162388801575,
0.3374443054199219,
0.8699114918708801,
-0.320149302482605,
1.3968641757965088,
-0.5195293426513672,
0.02996235154569149,
-1.0841281414031982,
-0.568627655506134,
0.9180267453193665,
0.8... |
func (o *ReportingTaskEntity) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
} | [
-0.15810148417949677,
0.8446882367134094,
0.40412646532058716,
1.087978720664978,
0.7168059349060059,
0.2540423572063446,
0.780905544757843,
0.8520035147666931,
0.8311224579811096,
-0.3631003797054291,
-0.8540194034576416,
-0.6602269411087036,
-0.04499838501214981,
0.11590021848678589,
0... |
func (o *ReportingTaskEntity) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
} | [
1.5299668312072754,
0.22873488068580627,
0.3684440851211548,
0.5096620321273804,
0.9665298461914062,
0.7294709086418152,
0.11478493362665176,
0.9011527895927429,
1.045215368270874,
-0.826856255531311,
-0.35964250564575195,
-0.8212867975234985,
-0.379623144865036,
0.3203369379043579,
-0.2... |
func (o *ReportingTaskEntity) SetId(v string) {
o.Id = &v
} | [
0.9613531231880188,
0.07816809415817261,
-0.15670578181743622,
0.044768594205379486,
-0.2802707552909851,
0.7487068176269531,
-0.3792145550251007,
-0.17712362110614777,
0.550504207611084,
0.2042304128408432,
-0.18408198654651642,
0.4550626575946808,
-0.10341821610927582,
-0.092913217842578... |
func (o *ReportingTaskEntity) GetUri() string {
if o == nil || o.Uri == nil {
var ret string
return ret
}
return *o.Uri
} | [
0.09544392675161362,
0.6289735436439514,
0.21830478310585022,
1.1434850692749023,
-0.0792802944779396,
-0.5812525153160095,
0.6131498217582703,
0.3305034935474396,
0.6904693841934204,
-1.2376759052276611,
0.2832542657852173,
-1.2811990976333618,
-0.4724437892436981,
-0.10684625059366226,
... |
func (o *ReportingTaskEntity) GetUriOk() (*string, bool) {
if o == nil || o.Uri == nil {
return nil, false
}
return o.Uri, true
} | [
-0.04400655999779701,
0.3294323682785034,
0.6030643582344055,
0.7985429167747498,
0.1984691619873047,
0.06672962754964828,
0.8959190249443054,
1.4783194065093994,
-0.21038460731506348,
0.11514993011951447,
-0.4484228789806366,
-0.9944829940795898,
0.268462210893631,
-0.1974470019340515,
... |
func (o *ReportingTaskEntity) HasUri() bool {
if o != nil && o.Uri != nil {
return true
}
return false
} | [
0.6130563616752625,
0.5936418175697327,
0.3035879135131836,
0.48736923933029175,
0.8054763674736023,
-0.49718454480171204,
-0.1308690309524536,
1.4206382036209106,
-0.12645548582077026,
-1.1704868078231812,
-0.24594815075397491,
-1.3494571447372437,
-0.22886116802692413,
-0.410941958427429... |
func (o *ReportingTaskEntity) SetUri(v string) {
o.Uri = &v
} | [
0.46943581104278564,
0.2340995818376541,
-0.008046993985772133,
0.18131069839000702,
-0.5685524940490723,
-0.504254162311554,
-0.8510410785675049,
0.45885512232780457,
-0.4479355216026306,
-0.5611308217048645,
-0.26107704639434814,
0.3511963486671448,
-0.2326209992170334,
-0.89642554521560... |
func (o *ReportingTaskEntity) GetPosition() PositionDTO {
if o == nil || o.Position == nil {
var ret PositionDTO
return ret
}
return *o.Position
} | [
0.7250815033912659,
0.477987676858902,
0.20273593068122864,
0.6217126250267029,
0.7007532715797424,
-0.835955023765564,
1.045262098312378,
-0.14175385236740112,
0.7246092557907104,
-0.6011697053909302,
-0.1620258241891861,
-2.202908515930176,
-0.6112446784973145,
0.5028448104858398,
0.52... |
func (o *ReportingTaskEntity) GetPositionOk() (*PositionDTO, bool) {
if o == nil || o.Position == nil {
return nil, false
}
return o.Position, true
} | [
0.35454148054122925,
-0.03666979819536209,
0.5776994824409485,
1.049609661102295,
0.3728982210159302,
-0.01819102093577385,
1.287610650062561,
0.9882925748825073,
-0.1839188039302826,
0.9437037706375122,
-0.5866268873214722,
-1.6682870388031006,
0.06401165574789047,
0.05761401355266571,
... |
func (o *ReportingTaskEntity) HasPosition() bool {
if o != nil && o.Position != nil {
return true
}
return false
} | [
0.5758727192878723,
0.27312272787094116,
0.32104572653770447,
0.16131193935871124,
1.0843828916549683,
-0.6567115187644958,
0.15428420901298523,
0.8552346229553223,
0.13352040946483612,
-0.37927427887916565,
-0.44956085085868835,
-2.2617459297180176,
-0.28326016664505005,
0.127029225230216... |
func (o *ReportingTaskEntity) SetPosition(v PositionDTO) {
o.Position = &v
} | [
0.5198764204978943,
0.3218301236629486,
0.061747100204229355,
-0.06120980530977249,
0.23622901737689972,
-0.14826256036758423,
-0.453502893447876,
-0.4125373065471649,
-0.1541062593460083,
0.07135030627250671,
-0.16416491568088531,
-0.8541480302810669,
0.07852385938167572,
-0.2979268729686... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.